github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/csbs/v1/resource/GetResRestorationCapabilities.go (about) 1 package resource 2 3 import golangsdk "github.com/opentelekomcloud/gophertelekomcloud" 4 5 type GetRestorationOpts struct { 6 // ID of the backup used to restore data 7 CheckpointItemId string `json:"checkpoint_item_id" required:"true"` 8 // Restoration target 9 Target RestorableTarget `json:"target" required:"true"` 10 } 11 12 type RestorableTarget struct { 13 // ID of the resource to which the backup is restored 14 ResourceId string `json:"resource_id" required:"true"` 15 // Type of the target to which the backup is restored, for example, OS::Nova::Server for an ECS 16 ResourceType string `json:"resource_type" required:"true"` 17 // Disk mapping list for restoring an ECS. Enter the mapping between disks and backups based on the actual situation. 18 Volumes []RestoreVolumeMapping `json:"volumes" required:"true"` 19 } 20 21 type RestoreVolumeMapping struct { 22 // Disk backup ID. Use the API in 2.3.3 Querying a Single Backup to obtain the disk backup ID. 23 BackupId string `json:"backup_id" required:"true"` 24 // ID of the destination EVS disk for the restoration 25 VolumeId string `json:"volume_id" required:"true"` 26 } 27 28 // GetResRestorationCapabilities check whether target resources can be restored. 29 func GetResRestorationCapabilities(client *golangsdk.ServiceClient, opts []GetRestorationOpts) ([]ResourceCapability, error) { 30 return doAction(client, opts, "check_restorable", "restorable") 31 }