github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/dws/v1/snapshot/ListSnapshotDetails.go (about) 1 package snapshot 2 3 import ( 4 golangsdk "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" 6 "github.com/opentelekomcloud/gophertelekomcloud/openstack" 7 ) 8 9 func ListSnapshotDetails(client *golangsdk.ServiceClient, snapshotId string) (*SnapshotDetail, error) { 10 // GET /v1.0/{project_id}/snapshots/{snapshot_id} 11 raw, err := client.Get(client.ServiceURL("snapshots", snapshotId), nil, openstack.StdRequestOpts()) 12 if err != nil { 13 return nil, err 14 } 15 16 var res SnapshotDetail 17 err = extract.IntoStructPtr(raw.Body, &res, "snapshot") 18 return &res, err 19 } 20 21 type SnapshotDetail struct { 22 // Snapshot ID 23 Id string `json:"id"` 24 // Snapshot name 25 Name string `json:"name"` 26 // Snapshot description 27 Description string `json:"description"` 28 // Time when a snapshot starts to be created. Format: ISO8601: YYYY-MM-DDThh:mm:ssZ 29 Started string `json:"started"` 30 // Time when a snapshot is complete. Format: ISO8601: YYYY-MM-DDThh:mm:ssZ 31 Finished string `json:"finished"` 32 // Snapshot size, in GB 33 Size float64 `json:"size"` 34 // Snapshot status: 35 // CREATING 36 // AVAILABLE 37 // UNAVAILABLE 38 Status string `json:"status"` 39 // Snapshot type. It can be: 40 // MANUAL 41 // AUTOMATED 42 Type string `json:"type"` 43 // ID of the cluster for which snapshots are created For details about how to obtain the ID, see 7.6 Obtaining the Cluster ID. 44 ClusterId string `json:"cluster_id"` 45 }