From cb3b522a5eda07600ac6071eb33884dd217d1174 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Fri, 28 Oct 2022 14:26:45 +0200 Subject: [PATCH] ListVolumes --- openstack/evs/v2/disk/ListVolumes.go | 146 +++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 openstack/evs/v2/disk/ListVolumes.go diff --git a/openstack/evs/v2/disk/ListVolumes.go b/openstack/evs/v2/disk/ListVolumes.go new file mode 100644 index 000000000..bf3513e23 --- /dev/null +++ b/openstack/evs/v2/disk/ListVolumes.go @@ -0,0 +1,146 @@ +package disk + +type ListVolumesRequest struct { + // + Marker string `q:"marker,omitempty"` + // + Name string `q:"name,omitempty"` + // + Limit int32 `q:"limit,omitempty"` + // + SortKey string `q:"sort_key,omitempty"` + // + Offset int32 `q:"offset,omitempty"` + // + SortDir string `q:"sort_dir,omitempty"` + // + Status string `q:"status,omitempty"` + // + Metadata string `q:"metadata,omitempty"` + // + AvailabilityZone string `q:"availability_zone,omitempty"` + // + Multiattach bool `q:"multiattach,omitempty"` + // + ServiceType string `q:"service_type,omitempty"` + // + DedicatedStorageId string `q:"dedicated_storage_id,omitempty"` + // + DedicatedStorageName string `q:"dedicated_storage_name,omitempty"` + // + VolumeTypeId string `q:"volume_type_id,omitempty"` + // + Id string `q:"id,omitempty"` + // + Ids string `q:"ids,omitempty"` + // + EnterpriseProjectId string `q:"enterprise_project_id,omitempty"` + // + ServerId string `q:"server_id,omitempty"` +} + +// GET /v2/{project_id}/cloudvolumes/detail + +type ListVolumesResponse struct { + // + Count int32 `json:"count,omitempty"` + // + VolumesLinks []Link `json:"volumes_links,omitempty"` + // + Volumes []VolumeDetail `json:"volumes,omitempty"` +} + +type Link struct { + // + Href string `json:"href,omitempty"` + // + Rel string `json:"rel,omitempty"` +} + +type VolumeDetail struct { + // + Id string `json:"id"` + // + Links []Link `json:"links"` + // + Name string `json:"name"` + // + Status string `json:"status"` + // + Attachments []Attachment `json:"attachments"` + // + AvailabilityZone string `json:"availability_zone"` + // + OsVolHostAttrhost string `json:"os-vol-host-attr:host"` + // + SourceVolid string `json:"source_volid,omitempty"` + // + SnapshotId string `json:"snapshot_id"` + // + Description string `json:"description"` + // + CreatedAt string `json:"created_at"` + // + OsVolTenantAttrtenantId string `json:"os-vol-tenant-attr:tenant_id"` + // + VolumeImageMetadata map[string]interface{} `json:"volume_image_metadata"` + // + VolumeType string `json:"volume_type"` + // + Size int32 `json:"size"` + // + ConsistencygroupId string `json:"consistencygroup_id,omitempty"` + // + Bootable string `json:"bootable"` + // + Metadata map[string]interface{} `json:"metadata"` + // + UpdatedAt string `json:"updated_at"` + // + Encrypted bool `json:"encrypted,omitempty"` + // + ReplicationStatus string `json:"replication_status"` + // + OsVolumeReplicationextendedStatus string `json:"os-volume-replication:extended_status"` + // + OsVolMigStatusAttrmigstat string `json:"os-vol-mig-status-attr:migstat"` + // + OsVolMigStatusAttrnameId string `json:"os-vol-mig-status-attr:name_id"` + // + Shareable string `json:"shareable"` + // + UserId string `json:"user_id"` + // + ServiceType string `json:"service_type"` + // + Multiattach bool `json:"multiattach"` + // + DedicatedStorageId string `json:"dedicated_storage_id,omitempty"` + // + DedicatedStorageName string `json:"dedicated_storage_name,omitempty"` + // + Tags map[string]string `json:"tags"` + // + Wwn string `json:"wwn,omitempty"` + // + EnterpriseProjectId string `json:"enterprise_project_id,omitempty"` + // + SerialNumber string `json:"serial_number,omitempty"` +} + +type Attachment struct { + // + AttachedAt string `json:"attached_at"` + // + AttachmentId string `json:"attachment_id"` + // + Device string `json:"device"` + // + HostName string `json:"host_name"` + // + Id string `json:"id"` + // + ServerId string `json:"server_id"` + // + VolumeId string `json:"volume_id"` +}