Help us shape the future of Go! Take the 2026 Go Developer Survey

replications

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *golangsdk.ServiceClient, ops ListOptsBuilder) pagination.Pager

List all the replications

Types

type CreateOps

type CreateOps struct {
	// The name of the EVS replication pair.
	// The name can contain a maximum of 255 bytes.
	Name string `json:"name,omitempty"`

	// The description of the EVS replication pair.
	// The description can contain a maximum of 255 bytes.
	Description string `json:"description,omitempty"`

	// The IDs of the EVS disks used to create the EVS replication pair.
	VolumeIDs []string `json:"volume_ids" required:"true"`

	// The primary AZ of the EVS replication pair.
	// That is the AZ where the production disk belongs.
	PriorityStation string `json:"priority_station" required:"true"`

	// The type of the EVS replication pair.
	// Currently only type hypermetro is supported.
	ReplicationModel string `json:"replication_model" required:"true"`
}

CreateOps is a struct that contains all the parameters.

func (CreateOps) ToReplicationCreateMap

func (ops CreateOps) ToReplicationCreateMap() (map[string]interface{}, error)

ToReplicationCreateMap is used for type convert

type CreateOpsBuilder

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

CreateOpsBuilder is used for creating replication parameters. any struct providing the parameters should implement this interface

type CreateResult

type CreateResult struct {
	golangsdk.Result
}

CreateResult is a struct that contains all the return parameters of creation

func Create

func Create(client *golangsdk.ServiceClient, ops CreateOpsBuilder) (r CreateResult)

Create a replication with given parameters.

func (CreateResult) Extract

func (r CreateResult) Extract() (*ReplicationCreate, error)

Extract from CreateResult

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult is a struct which contains the result of deletion

func Delete

func Delete(client *golangsdk.ServiceClient, id string) (r DeleteResult)

Delete a replication by id

type GetResult

type GetResult struct {
	golangsdk.Result
}

GetResult contains the body of getting detailed

func Get

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

Get a replication with detailed information by id

func (GetResult) Extract

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

Extract from GetResult

type ListOpts

type ListOpts struct {
	Marker                        string `q:"marker"`
	Limit                         int    `q:"limit"`
	SortKey                       string `q:"sort_key"`
	SortDir                       string `q:"sort_dir"`
	Offset                        int    `q:"offset"`
	ChangesSince                  string `q:"changes-since"`
	Name                          string `q:"name"`
	Status                        string `q:"status"`
	ReplicationConsistencyGroupID string `q:"replication_consistency_group_id"`
	VolumeIDs                     string `q:"volume_ids"`
	VolumeID                      string `q:"volume_id"`
	PriorityStation               string `q:"priority_station"`
}

ListOpts is a struct that contains all the parameters.

func (ListOpts) ToReplicationListQuery

func (opts ListOpts) ToReplicationListQuery() (string, error)

ToReplicationListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToReplicationListQuery() (string, error)
}

ListOptsBuilder is an interface by which can be able to build the query string of the list function

type Replication

type Replication struct {
	ID                            string `json:"id"`
	Name                          string `json:"name"`
	Description                   string `json:"description"`
	Status                        string `json:"status"`
	ReplicationConsistencyGroupID string `json:"replication_consistency_group_id"`
	VolumeIDs                     string `json:"volume_ids"`
	PriorityStation               string `json:"priority_station"`
	CreatedAt                     string `json:"created_at"`
	UpdatedAt                     string `json:"updated_at"`
	ReplicationModel              string `json:"replication_model"`
	ReplicationStatus             string `json:"replication_status"`
	Progress                      string `json:"progress"`
	FailureDetail                 string `json:"failure_detail"`
	// RecordMetadata includes volume_type and multiattach currently.
	RecordMetadata json.RawMessage `json:"record_metadata"`
	FaultLevel     string          `json:"fault_level"`
}

Replication response

func ExtractReplications

func ExtractReplications(r pagination.Page) ([]Replication, error)

ExtractReplications from List

type ReplicationCreate

type ReplicationCreate struct {
	ID                            string `json:"id"`
	Name                          string `json:"name"`
	Description                   string `json:"description"`
	Status                        string `json:"status"`
	ReplicationConsistencyGroupID string `json:"replication_consistency_group_id"`
	VolumeIDs                     string `json:"volume_ids"`
	PriorityStation               string `json:"priority_station"`
	CreatedAt                     string `json:"created_at"`
	UpdatedAt                     string `json:"updated_at"`
}

ReplicationCreate response

type ReplicationPage

type ReplicationPage struct {
	pagination.SinglePageBase
}

ReplicationPage may be embedded in a Page that contains all of the results from an operation at once.

func (ReplicationPage) IsEmpty

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

IsEmpty returns true if a ListResult contains no replications.

Jump to

Keyboard shortcuts

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