api

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RetCodeOK = 0
)

Variables

This section is empty.

Functions

func CloneVolume added in v1.2.0

func CloneVolume(confFile, sourcePoolName, sourceVolumeName, snapshotName, targetVolumeName, targetPoolName string) error

func CreateSnapshot added in v1.2.0

func CreateSnapshot(confFile, poolName, volumeName, snapshotName string) error

func CreateVolume

func CreateVolume(confFile, volumeName string, size int64, parameters map[string]string) error

func DeleteSnapshot added in v1.2.0

func DeleteSnapshot(confFile, poolName, volumeName, snapshotName string) error

func DeleteVolume

func DeleteVolume(confFile, poolName, volumeName string) error

func DetachCloneRelationship added in v1.2.0

func DetachCloneRelationship(confFile, sourcePoolName, sourceVolumeName, targetPoolName, targetVolumeName string) error

func ResizeVolume

func ResizeVolume(confFile, poolName, volumeName string, size int64) error

Types

type CloneInfo added in v1.2.0

type CloneInfo struct {
	Id         int       `json:"id"`
	SourceVol  string    `json:"source_vol"`
	TargetVol  string    `json:"target_vol"`
	CreateTime time.Time `json:"create_time" format:"ISO 8601"`
	Status     string    `json:"status"`
	StatusTime time.Time `json:"status_time" format:"ISO 8601"`
}

func ListClone added in v1.2.0

func ListClone(confFile, sourcePoolName, sourceVolumeName, targetPoolName, targeVolumeName string) (*CloneInfo, error)

func ListClone220 added in v1.2.0

func ListClone220(confFile, sourcePoolName, sourceVolumeName, targetPoolName, targetVolumeName string) (*CloneInfo, error)

type CloneRelation added in v1.2.0

type CloneRelation struct {
	SourceVol int `json:"SourceVol"`
	TargetVol int `json:"TargetVol"`
}

type CloneVolumeRequest added in v1.2.0

type CloneVolumeRequest struct {
	Op           string `json:"op"`
	SourcePool   string `json:"source_pool"`
	SourceVol    string `json:"source_vol"`
	SnapshotName string `json:"snapshot_name"`
	TargetPool   string `json:"target_pool"`
	TargetVol    string `json:"target_vol"`
	Size         int64  `json:"size"`
}

type CloneVolumeResponse added in v1.2.0

type CloneVolumeResponse struct {
	ResponseHeader
	Id        string `json:"id"`
	QueueName string `json:"queue_name"`
}

type CreateSnapshotRequest added in v1.2.0

type CreateSnapshotRequest struct {
	Op           string `json:"op"`
	PoolName     string `json:"pool_name"`
	VolumeName   string `json:"volume_name"`
	SnapshotName string `json:"snapshot_name"`
}

type CreateSnapshotResponse added in v1.2.0

type CreateSnapshotResponse struct {
	ResponseHeader
}

type CreateVolumeRequest

type CreateVolumeRequest struct {
	Op         string            `json:"op"`
	Name       string            `json:"name"`
	Size       int64             `json:"size"`
	Parameters map[string]string `json:"parameters"`
}

type CreateVolumeResponse

type CreateVolumeResponse struct {
	ResponseHeader
	Id   int `json:"id"`
	Size int `json:"size"`
}

type DeleteSnapshotRequest added in v1.2.0

type DeleteSnapshotRequest struct {
	Op           string `json:"op"`
	PoolName     string `json:"pool_name"`
	VolumeName   string `json:"volume_name"`
	SnapshotName string `json:"snapshot_name"`
}

type DeleteSnapshotResponse added in v1.2.0

type DeleteSnapshotResponse struct {
	ResponseHeader
	Id int `json:"id"`
}

type DeleteVolumeRequest

type DeleteVolumeRequest struct {
	Op       string `json:"op"`
	PoolName string `json:"pool_name"`
	Name     string `json:"name"`
}

type DeleteVolumeResponse

type DeleteVolumeResponse struct {
	ResponseHeader
	Id int `json:"id"`
}

type DetachCloneRelationshipRequest added in v1.2.0

type DetachCloneRelationshipRequest struct {
	Op        string `json:"op"`
	SourceVol string `json:"source_vol"`
	TargetVol string `json:"target_vol"`
}

type DetachCloneRelationshipResponse added in v1.2.0

type DetachCloneRelationshipResponse struct {
	ResponseHeader
	CloneRelations []CloneRelation `json:"CloneRelations"`
}

type GetVolumeForCloneRequest added in v1.2.0

type GetVolumeForCloneRequest struct {
	Op       string `json:"op"`
	Name     string `json:"name"`
	PoolName string `json:"pool_name"`
}

type GetVolumeForCloneResponse added in v1.2.0

type GetVolumeForCloneResponse struct {
	ResponseHeader
	VolumeInfo VolumeForClone `json:"VolumeInfo"`
}

type ListCloneRequest added in v1.2.0

type ListCloneRequest struct {
	Op           string `json:"op"`
	SvolFullname string `json:"svol_fullname"`
}

type ListCloneRequest220 added in v1.2.0

type ListCloneRequest220 struct {
	Op        string `json:"op"`
	SourceVol string `json:"source_vol"`
	TargetVol string `json:"target_vol"`
}

type ListCloneResponse added in v1.2.0

type ListCloneResponse struct {
	ResponseHeader
	CloneVolumes []CloneInfo `json:"CloneVolumes"`
}

type ListSnapshotRequest added in v1.2.0

type ListSnapshotRequest struct {
	Op           string `json:"op"`
	PoolName     string `json:"pool_name"`
	VolumeName   string `json:"volume_name"`
	SnapshotName string `json:"snapshot_name"` //Optional
}

type ListSnapshotResponse added in v1.2.0

type ListSnapshotResponse struct {
	ResponseHeader
	VolumeId      int            `json:"volume_id"`
	SnapshotCount int            `json:"snapshot_count"`
	Snapshots     []SnapshotInfo `json:"snapshots"`
}

type ListVolumeRequest

type ListVolumeRequest struct {
	Op       string `json:"op"`
	PoolName string `json:"pool_name"`
	Name     string `json:"name"`
}

type ListVolumeResponse

type ListVolumeResponse struct {
	ResponseHeader
	Count   int      `json:"count"`
	Volumes []Volume `json:"volumes"`
}

type ResizeVolumeRequest

type ResizeVolumeRequest struct {
	Op       string `json:"op"`
	PoolName string `json:"pool_name"`
	Name     string `json:"name"`
	Size     int64  `json:"size"`
}

type ResizeVolumeResponse

type ResizeVolumeResponse struct {
	ResponseHeader
	Id   int `json:"id"`
	Size int `json:"size"`
}

type Response

type Response interface {
	Header() *ResponseHeader
}

type ResponseHeader

type ResponseHeader struct {
	Op      string `json:"op"`
	RetCode int    `json:"ret_code"`
	Reason  string `json:"reason"`
}

func (*ResponseHeader) Header

func (r *ResponseHeader) Header() *ResponseHeader

type SnapshotInfo added in v1.2.0

type SnapshotInfo struct {
	SnapshotId   int       `json:"snapshot_id"`
	SnapshotName string    `json:"snapshot_name"`
	SnapshotSize int64     `json:"snapshot_size"`
	Status       string    `json:"status"`
	CreateTime   time.Time `json:"create_time" format:"ISO 8601"`
}

func ListSnapshot added in v1.2.0

func ListSnapshot(confFile, poolName, volumeName, snapshotName string) (*SnapshotInfo, error)

type Volume

type Volume struct {
	Id                  int       `json:"id"`
	Name                string    `json:"name"`
	PoolName            string    `json:"pool_name"`
	Size                int       `json:"size"`
	ReplicationCount    int       `json:"replication_count"`
	Status              string    `json:"status"`
	MinReplicationCount int       `json:"min_replication_count"`
	Role                string    `json:"role"`
	Policy              string    `json:"policy"`
	CreateTime          time.Time `json:"create_time" format:"ISO 8601"`
	StatusTime          time.Time `json:"status_time" format:"ISO 8601"`
	MetroReplica        string    `json:"metro_replica"`
	ProvisionType       string    `json:"provision_type"` // thin or thick
	MaxBs               int       `json:"max_bs"`
	VolumeAllocated     int       `json:"volume_allocated"`
	RgName              string    `json:"rg_name"`
	Encrypted           string    `json:"encrypted"`
}

func ListVolume

func ListVolume(confFile, poolName, volumeName string) (*Volume, error)

type VolumeForClone added in v1.2.0

type VolumeForClone struct {
	ID                  int    `json:"id"`
	Size                int    `json:"size"`
	ReplicationCount    int    `json:"replication_count"`
	MinReplicationCount int    `json:"min_replication_count"`
	Role                string `json:"role"`
	MaxBs               int    `json:"max_bs"`
	Encrypte            string `json:"encrypte"`
	KeyName             string `json:"key_name"`
	Rg                  string `json:"rg"`
}

func GetVolumeForClone added in v1.2.0

func GetVolumeForClone(confFile, poolName, volumeName string) (*VolumeForClone, error)

Jump to

Keyboard shortcuts

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