Documentation ¶
Index ¶
- func Contains(arr []string, val string) bool
- func Filter(list []string, check func(string) bool) []string
- func IsHeadDisk(diskName string) bool
- func TrimSnapshotName(diskName string) string
- func TrimSnapshotNamesOfSlice(diskNames []string) []string
- type Collection
- type Condition
- type ControllerClient
- func (c *ControllerClient) Do(method, path string, req, resp interface{}) error
- func (c *ControllerClient) Get(path string, obj interface{}) error
- func (c *ControllerClient) GetVolumeStats(address string, api string, obj interface{}) (int, error)
- func (c *ControllerClient) ListReplicas(path string) ([]Replica, error)
- func (c *ControllerClient) Post(path string, req, resp interface{}) error
- type DiskInfo
- type InfoReplica
- type MarkDiskAsRemovedInput
- type Pagination
- type Replica
- type ReplicaClient
- func (c *ReplicaClient) Get(url string, obj interface{}) error
- func (c *ReplicaClient) GetReplica() (InfoReplica, error)
- func (c *ReplicaClient) GetVolumeStats(address string, obj interface{}) (int, error)
- func (c *ReplicaClient) MarkDiskAsRemoved(disk string) error
- func (c *ReplicaClient) Post(path string, req, resp interface{}) error
- type ReplicaCollection
- type Resource
- type RevertInput
- type SnapshotInput
- type SnapshotOutput
- type Sort
- type VolumeCollection
- type Volumes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TrimSnapshotName ¶
TrimSnapshotName trims the snapshot name from diskName string
func TrimSnapshotNamesOfSlice ¶
TrimSnapshotNamesOfSlice trims the each snapshot name in diskNames Slice
Types ¶
type Collection ¶
type Collection struct { Type string `json:"type,omitempty"` ResourceType string `json:"resourceType,omitempty"` Links map[string]string `json:"links,omitempty"` CreateTypes map[string]string `json:"createTypes,omitempty"` Actions map[string]string `json:"actions,omitempty"` SortLinks map[string]string `json:"sortLinks,omitempty"` Pagination *Pagination `json:"pagination,omitempty"` Sort *Sort `json:"sort,omitempty"` Filters map[string][]Condition `json:"filters,omitempty"` }
type Condition ¶
type Condition struct { Modifier string `json:"modifier,omitempty"` Value interface{} `json:"value,omitempty"` }
type ControllerClient ¶
type ControllerClient struct { Address string Host string // contains filtered or unexported fields }
func NewControllerClient ¶
func NewControllerClient(address string) (*ControllerClient, error)
NewControllerClient create the new controller client
func (*ControllerClient) Do ¶
func (c *ControllerClient) Do(method, path string, req, resp interface{}) error
Do sends a request to the specified path and it stores JSON-decoded body from the response into the value pointed to by resp.
func (*ControllerClient) Get ¶
func (c *ControllerClient) Get(path string, obj interface{}) error
Get sends a request to the specified path and stores body in the value pointed to by obj.
func (*ControllerClient) GetVolumeStats ¶
func (c *ControllerClient) GetVolumeStats(address string, api string, obj interface{}) (int, error)
GetVolumeStats is used to get the status of volume controller.It is used to get the response in json format and then the response is then decoded to the desired structure.
func (*ControllerClient) ListReplicas ¶
func (c *ControllerClient) ListReplicas(path string) ([]Replica, error)
ListReplicas to get the details of all the existing replicas which contains address and mode of those replicas (RW/R/W) as well as resource information.
func (*ControllerClient) Post ¶
func (c *ControllerClient) Post(path string, req, resp interface{}) error
Post sends a POST request to the specified path and stores body in the value pointed to by resp.
type InfoReplica ¶
type InfoReplica struct { Resource Dirty bool `json:"dirty"` Rebuilding bool `json:"rebuilding"` Head string `json:"head"` Parent string `json:"parent"` Size string `json:"size"` SectorSize int64 `json:"sectorSize"` State string `json:"state"` Chain []string `json:"chain"` Disks map[string]DiskInfo `json:"disks"` RemainSnapshots int `json:"remainsnapshots"` RevisionCounter string `json:"revisioncounter"` }
type MarkDiskAsRemovedInput ¶
type Pagination ¶
type Pagination struct { Marker string `json:"marker,omitempty"` First string `json:"first,omitempty"` Previous string `json:"previous,omitempty"` Next string `json:"next,omitempty"` Limit *int64 `json:"limit,omitempty"` Total *int64 `json:"total,omitempty"` Partial bool `json:"partial,omitempty"` }
type ReplicaClient ¶
type ReplicaClient struct { Address string SyncAgent string Host string // contains filtered or unexported fields }
ReplicaClient is Client structure
func NewReplicaClient ¶
func NewReplicaClient(address string) (*ReplicaClient, error)
NewReplicaClient create the new replica client
func (*ReplicaClient) Get ¶
func (c *ReplicaClient) Get(url string, obj interface{}) error
Get obj from a specific url
func (*ReplicaClient) GetReplica ¶
func (c *ReplicaClient) GetReplica() (InfoReplica, error)
GetReplica will return the InfoReplica struct which contains info related to specific replica
func (*ReplicaClient) GetVolumeStats ¶
func (c *ReplicaClient) GetVolumeStats(address string, obj interface{}) (int, error)
GetVolumeStats is the helper function for mayactl.It is used to get the response of the replica created in json format and then the response is then decoded to the desired structure.
func (*ReplicaClient) MarkDiskAsRemoved ¶
func (c *ReplicaClient) MarkDiskAsRemoved(disk string) error
MarkDiskAsRemoved is the helper function to mark the disks as removed
func (*ReplicaClient) Post ¶
func (c *ReplicaClient) Post(path string, req, resp interface{}) error
Post to a specific path
type ReplicaCollection ¶
type ReplicaCollection struct { Collection Data []Replica `json:"data"` }
type RevertInput ¶
type SnapshotInput ¶
type SnapshotInput struct { Resource Name string `json:"name"` UserCreated bool `json:"usercreated"` Created string `json:"created"` Labels map[string]string `json:"labels"` }
SnapshotInput is Input struct to create snapshot
type SnapshotOutput ¶
type SnapshotOutput struct {
Resource
}
type VolumeCollection ¶
type VolumeCollection struct { Collection Data []Volumes `json:"data"` }