@@ -58,6 +58,46 @@ const (
5858 ImageStatusError ImageStatus = "Error"
5959)
6060
61+ type VolumeType string
62+
63+ const (
64+ VolumeTypeSYSTEM VolumeType = "System"
65+ VolumeTypeEPHEMERAL VolumeType = "Ephemeral"
66+ VolumeTypeCDS VolumeType = "Cds"
67+ )
68+
69+ type StorageType string
70+
71+ const (
72+ StorageTypeStd1 StorageType = "std1"
73+ StorageTypeHP1 StorageType = "hp1"
74+ StorageTypeCloudHP1 StorageType = "cloud_hp1"
75+ StorageTypeLocal StorageType = "local"
76+ StorageTypeSATA StorageType = "sata"
77+ StorageTypeSSD StorageType = "ssd"
78+ StorageTypeHDDThroughput StorageType = "HDD_Throughput"
79+ StorageTypeHdd StorageType = "hdd"
80+ )
81+
82+ type VolumeStatus string
83+
84+ const (
85+ VolumeStatusAVAILABLE VolumeStatus = "Available"
86+ VolumeStatusINUSE VolumeStatus = "InUse"
87+ VolumeStatusSNAPSHOTPROCESSING VolumeStatus = "SnapshotProcessing"
88+ VolumeStatusRECHARGING VolumeStatus = "Recharging"
89+ VolumeStatusDETACHING VolumeStatus = "Detaching"
90+ VolumeStatusDELETING VolumeStatus = "Deleting"
91+ VolumeStatusEXPIRED VolumeStatus = "Expired"
92+ VolumeStatusNOTAVAILABLE VolumeStatus = "NotAvailable"
93+ VolumeStatusDELETED VolumeStatus = "Deleted"
94+ VolumeStatusSCALING VolumeStatus = "Scaling"
95+ VolumeStatusIMAGEPROCESSING VolumeStatus = "ImageProcessing"
96+ VolumeStatusCREATING VolumeStatus = "Creating"
97+ VolumeStatusATTACHING VolumeStatus = "Attaching"
98+ VolumeStatusERROR VolumeStatus = "Error"
99+ )
100+
61101type CreateInstanceArgs struct {
62102 FlavorId string `json:"flavorId"`
63103 ImageId string `json:"imageId"`
@@ -671,3 +711,61 @@ type SharedUser struct {
671711 AccountId string `json:"accountId,omitempty"`
672712 Account string `json:"account,omitempty"`
673713}
714+
715+ type ListCDSVolumeArgs struct {
716+ MaxKeys int
717+ InstanceId string
718+ ZoneName string
719+ Marker string
720+ }
721+
722+ type ListCDSVolumeResult struct {
723+ Marker string `json:"marker"`
724+ IsTruncated bool `json:"isTruncated"`
725+ NextMarker string `json:"nextMarker"`
726+ MaxKeys int `json:"maxKeys"`
727+ Volumes []VolumeModel `json:"volumes"`
728+ }
729+
730+ type VolumeModel struct {
731+ Type VolumeType `json:"type"`
732+ StorageType StorageType `json:"storageType"`
733+ Id string `json:"id"`
734+ Name string `json:"name"`
735+ DiskSizeInGB int `json:"diskSizeInGB"`
736+ PaymentTiming string `json:"paymentTiming"`
737+ ExpireTime string `json:"expireTime"`
738+ Status VolumeStatus `json:"status"`
739+ Desc string `json:"desc"`
740+ Attachments []VolumeAttachmentModel `json:"attachments"`
741+ ZoneName string `json:"zoneName"`
742+ AutoSnapshotPolicy * AutoSnapshotPolicyModel `json:"autoSnapshotPolicy"`
743+ CreateTime string `json:"createTime"`
744+ IsSystemVolume bool `json:"isSystemVolume"`
745+ RegionId string `json:"regionId"`
746+ SourceSnapshotId string `json:"sourceSnapshotId"`
747+ SnapshotNum string `json:"snapshotNum"`
748+ Tags []model.TagModel `json:"tags"`
749+ Encrypted bool `json:"encrypted"`
750+ }
751+
752+ type VolumeAttachmentModel struct {
753+ VolumeId string `json:"volumeId"`
754+ InstanceId string `json:"instanceId"`
755+ Device string `json:"device"`
756+ Serial string `json:"serial"`
757+ }
758+
759+ type AutoSnapshotPolicyModel struct {
760+ CreatedTime string `json:"createdTime"`
761+ Id string `json:"id"`
762+ Status string `json:"status"`
763+ RetentionDays int `json:"retentionDays"`
764+ UpdatedTime string `json:"updatedTime"`
765+ DeletedTime string `json:"deletedTime"`
766+ LastExecuteTime string `json:"lastExecuteTime"`
767+ VolumeCount int `json:"volumeCount"`
768+ Name string `json:"name"`
769+ TimePoints []int `json:"timePoints"`
770+ RepeatWeekdays []int `json:"repeatWeekdays"`
771+ }
0 commit comments