replications

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 3 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 {
	// Device Name
	Device string `json:"device"`
	// Protected Instance ID
	ProtectedInstance string `json:"protected_instance"`
}

type CreateOpts

type CreateOpts struct {
	// Protection Group ID
	GroupID string `json:"server_group_id" required:"true"`
	// Volume ID
	VolumeID string `json:"volume_id" required:"true"`
	// Replication Name
	Name string `json:"name" required:"true"`
	// Replication Description
	Description string `json:"description,omitempty"`
}

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

func (CreateOpts) ToReplicationCreateMap

func (opts CreateOpts) ToReplicationCreateMap() (map[string]interface{}, error)

ToReplicationCreateMap builds a create request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToReplicationCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type DeleteOpts

type DeleteOpts struct {
	// Group ID
	GroupID string `json:"server_group_id,omitempty"`
	// Delete Target Volume
	DeleteVolume bool `json:"delete_target_volume,omitempty"`
}

DeleteOpts contains all the values needed to delete a Replication.

func (DeleteOpts) ToReplicationDeleteMap

func (opts DeleteOpts) ToReplicationDeleteMap() (map[string]interface{}, error)

ToReplicationDeleteMap builds a update request body from DeleteOpts.

type DeleteOptsBuilder

type DeleteOptsBuilder interface {
	ToReplicationDeleteMap() (map[string]interface{}, error)
}

DeleteOptsBuilder allows extensions to add additional parameters to the Delete request.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult represents the result of a get operation. Call its Extract method to interpret it as a Replication.

func Get

func Get(c *golangsdk.ServiceClient, id string) (r GetResult)

Get retrieves a particular Replication based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Replication, error)

Extract is a function that accepts a result and extracts a replication.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

type JobResponse

type JobResponse struct {
	JobID string `json:"job_id"`
}

type JobResult

type JobResult struct {
	golangsdk.Result
}

func Create

func Create(c *golangsdk.ServiceClient, opts CreateOptsBuilder) (r JobResult)

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

func Delete

func Delete(c *golangsdk.ServiceClient, id string, opts DeleteOptsBuilder) (r JobResult)

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

func (JobResult) ExtractJobResponse

func (r JobResult) ExtractJobResponse() (*JobResponse, error)

func (JobResult) ExtractJobStatus

func (r JobResult) ExtractJobStatus() (*JobStatus, error)

type JobStatus

type JobStatus struct {
	Status     string            `json:"status"`
	Entities   map[string]string `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"`
}

type RecordMetadata

type RecordMetadata struct {
	// Whether Multiattach
	Multiattach bool `json:"multiattach"`
	// Whether Bootable
	Bootable bool `json:"bootable"`
	// Volume Size
	VolumeSize int `json:"volume_size"`
	// Volume Type
	VolumeType string `json:"volume_type"`
}

type Replication

type Replication struct {
	// Replication ID
	Id string `json:"id"`
	// Replication Name
	Name string `json:"name"`
	// Replication Description
	Description string `json:"description"`
	// Replication Model
	ReplicaModel string `json:"replication_model"`
	// Replication Status
	Status string `json:"status"`
	// Replication Attachment
	Attachment []Attachment `json:"attachment"`
	// Replication Group ID
	GroupID string `json:"server_group_id"`
	// Replication Volume IDs
	VolumeIDs string `json:"volume_ids"`
	// Replication Priority Station
	PriorityStation string `json:"priority_station"`
	// Replication Fault Level
	FaultLevel string `json:"fault_level"`
	// Replication Record Metadata
	RecordMetadata RecordMetadata `json:"record_metadata"`
}

type UpdateOpts

type UpdateOpts struct {
	// Replication name
	Name string `json:"name" required:"true"`
}

UpdateOpts contains all the values needed to update a Replication.

func (UpdateOpts) ToReplicationUpdateMap

func (opts UpdateOpts) ToReplicationUpdateMap() (map[string]interface{}, error)

ToReplicationUpdateMap builds a update request body from UpdateOpts.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToReplicationUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

UpdateResult represents the result of a update operation. Call its Extract method to interpret it as a Replication.

func Update

func Update(c *golangsdk.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)

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

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Replication, error)

Extract is a function that accepts a result and extracts a replication.

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

Jump to

Keyboard shortcuts

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