protectedinstances

package
v0.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2025 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJobEntity

func GetJobEntity(client *golangsdk.ServiceClient, jobID string, label string) (interface{}, error)

func WaitForJobSuccess

func WaitForJobSuccess(client *golangsdk.ServiceClient, secs int, jobID string) error

Types

type Attachment

type Attachment struct {
	// Replication ID
	Replication string `json:"replication"`
	// Device Name
	Device string `json:"device"`
}

type CreateOpts

type CreateOpts struct {
	// Group ID
	GroupID string `json:"server_group_id" required:"true"`
	// Server ID
	ServerID string `json:"server_id" required:"true"`
	// Instance Name
	Name string `json:"name" required:"true"`
	// Instance Description
	Description string `json:"description,omitempty"`
	// Subnet ID
	SubnetID string `json:"primary_subnet_id,omitempty"`
	// IP Address
	IpAddress string `json:"primary_ip_address,omitempty"`
	// Flavor ID of the DR site server
	Flavor string `json:"flavorRef,omitempty"`
}

CreateOpts contains all the values needed to create a new instance.

type CreateProtectedInstanceResponse added in v0.9.4

type CreateProtectedInstanceResponse struct {
	// 	Specifies the job ID. For details about the task execution result, see the description in Querying the Job Status at:
	// https://docs-beta.sc.otc.t-systems.com/storage-disaster-recovery-service/api-ref/sdrs_apis/job/querying_the_job_status.html
	JobID string `json:"job_id"`
}

func Create

Create will create a new Instance based on the values in CreateOpts.

type DeleteOpts

type DeleteOpts struct {
	// Delete Target Server
	DeleteTargetServer *bool `json:"delete_target_server,omitempty"`
	// Delete Target Eip
	DeleteTargetEip *bool `json:"delete_target_eip,omitempty"`
}

DeleteOpts contains all the values needed to delete an Instance.

type DeleteProtectedInstanceResponse added in v0.9.4

type DeleteProtectedInstanceResponse struct {
	// 	Specifies the job ID. For details about the task execution result, see the description in Querying the Job Status at:
	// https://docs-beta.sc.otc.t-systems.com/storage-disaster-recovery-service/api-ref/sdrs_apis/job/querying_the_job_status.html
	JobID string `json:"job_id"`
}

func Delete

func Delete(client *golangsdk.ServiceClient, instanceId string, opts DeleteOpts) (*DeleteProtectedInstanceResponse, error)

Delete will permanently delete a particular Instance based on its unique ID.

type GetResponse added in v0.9.4

type GetResponse struct {
	// Specifies the details about a protected instance.
	ProtectedInstance Instance `json:"protected_instance"`
}

type Instance

type Instance struct {
	// Instance ID
	ID string `json:"id"`
	// Instance Name
	Name string `json:"name"`
	// Instance Description
	Description string `json:"description"`
	// Protection Group ID
	GroupID string `json:"server_group_id"`
	// Instance Status
	Status string `json:"status"`
	// Instance Progress
	Progress int `json:"progress"`
	// Source Server
	SourceServer string `json:"source_server"`
	// Target Server
	TargetServer string `json:"target_server"`
	// Instance CreatedAt time
	CreatedAt string `json:"created_at"`
	// Instance UpdatedAt time
	UpdatedAt string `json:"updated_at"`
	// Production site AZ of the protection group containing the protected instance.
	PriorityStation string `json:"priority_station"`
	// Attachment
	Attachment []Attachment `json:"attachment"`
	// Tags list
	Tags []Tags `json:"tags"`
	// Metadata
	Metadata map[string]string `json:"metadata"`
}

func ExtractProtectedInstances added in v0.9.4

func ExtractProtectedInstances(r pagination.NewPage) ([]Instance, error)

func Get

func Get(client *golangsdk.ServiceClient, instanceId string) (*Instance, error)

Get retrieves a particular Instance based on its unique ID.

func List added in v0.3.1

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]Instance, error)

func Update

func Update(client *golangsdk.ServiceClient, instanceId string, opts UpdateOpts) (*Instance, error)

Update accepts a UpdateOpts struct and uses the values to update an Instance.The response code from api is 200

type InstancePage added in v0.3.1

type InstancePage struct {
	pagination.NewSinglePageBase
}

InstancePage is a struct which can do the page function

func (InstancePage) IsEmpty added in v0.3.1

func (r InstancePage) IsEmpty() (bool, error)

IsEmpty determines whether or not a InstancePage is empty.

type JobEntity

type JobEntity struct {
	InstanceID string   `json:"protected_instance_id"`
	SubJobs    []SubJob `json:"sub_jobs"`
}

type JobStatus

type JobStatus struct {
	Status     string    `json:"status"`
	Entities   JobEntity `json:"entities"`
	JobID      string    `json:"job_id"`
	JobType    string    `json:"job_type"`
	BeginTime  string    `json:"begin_time"`
	EndTime    string    `json:"end_time"`
	ErrorCode  string    `json:"error_code"`
	FailReason string    `json:"fail_reason"`
	Message    string    `json:"message"`
	Code       string    `json:"code"`
}

type ListOpts added in v0.3.1

type ListOpts struct {
	ServerGroupID        string   `q:"server_group_id"`
	ServerGroupIDs       []string `q:"server_group_ids"`
	ProtectedInstanceIDs []string `q:"protected_instance_ids"`
	Limit                int      `q:"limit"`
	Offset               int      `q:"offset"`
	Status               string   `q:"status"`
	Name                 string   `q:"name"`
	QueryType            string   `q:"query_type"`
	AvailabilityZone     string   `q:"availability_zone"`
}

type ListResponse added in v0.9.4

type ListResponse struct {
	// Specifies the information about protected instances.
	ProtectedInstances []Instance `json:"protected_instances"`
	// Specifies the number of protected instances.
	Count int `json:"count"`
}

type SubJob added in v0.3.1

type SubJob struct {
	// Specifies the task ID.
	ID string `json:"job_id"`
	// Task type.
	Type string `json:"job_type"`
	// Specifies the task status.
	Status string `json:"status"`
	// Specifies the time when the task started.
	BeginTime string `json:"begin_time"`
	// Specifies the time when the task finished.
	EndTime string `json:"end_time"`
	// Specifies the returned error code when the task execution fails.
	ErrorCode string `json:"error_code"`
	// Specifies the cause of the task execution failure.
	FailReason string `json:"fail_reason"`
	// Specifies the object of the task.
	Entities map[string]string `json:"entities"`
}

type Tags added in v0.3.1

type Tags struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

type UpdateOpts

type UpdateOpts struct {
	// Instance name. Specifies the name of a protected instance.
	// The name can contain a maximum of 64 bytes.
	// The value can contain only letters (a to z and A to Z), digits (0 to 9), decimal points (.), underscores (_), and hyphens (-).
	Name string `json:"name" required:"true"`
}

UpdateOpts contains all the values needed to update an Instance.

type UpdateResponse added in v0.9.4

type UpdateResponse struct {
	// Specifies the details about a protected instance.
	ProtectedInstance Instance `json:"protected_instance"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL