github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/ims/v1/images/CreateWholeImageFromCBRorCSBS.go (about) 1 package images 2 3 import ( 4 golangsdk "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/build" 6 "github.com/opentelekomcloud/gophertelekomcloud/openstack/common/tags" 7 ) 8 9 // CreateWholeImageFromCBRorCSBSOpts Parameters in the request body when a CSBS backup or CBR backup is used to create a full-ECS image 10 type CreateWholeImageFromCBRorCSBSOpts struct { 11 // Specifies the image name. For detailed description, see Image Attributes. 12 Name string `json:"name" required:"true"` 13 // Provides supplementary information about the image. For detailed description, see Image Attributes. 14 Description string `json:"description,omitempty"` 15 // Lists the image tags. The value is left blank by default. 16 // 17 // Use either tags or image_tags. 18 Tags []string `json:"tags,omitempty"` 19 // Lists the image tags. The value is left blank by default. 20 // 21 // Use either tags or image_tags. 22 ImageTags []tags.ResourceTag `json:"image_tags,omitempty"` 23 // Specifies the CSBS backup ID or CBR backup ID. 24 // 25 // To obtain the CSBS backup ID, perform the following operations: 26 // 27 // Log in to the management console. 28 // 29 // Under Storage, click Cloud Server Backup Service. 30 // 31 // In the backup list, expand details of the backup to obtain its ID. 32 // 33 // To obtain the CBR backup ID, perform the following operations: 34 // 35 // Log in to the management console. 36 // 37 // Under Storage, click Cloud Backup and Recovery. 38 // 39 // On the displayed Cloud Server Backup page, click the Backups tab and obtain the backup ID from the backup list. 40 BackupId string `json:"backup_id" required:"true"` 41 // Specifies the maximum memory of the image in the unit of MB. This parameter is not configured by default. 42 MaxRam int `json:"max_ram,omitempty"` 43 // Specifies the minimum memory of the image in the unit of MB. The default value is 0, indicating that the memory is not restricted. 44 MinRam int `json:"min_ram,omitempty"` 45 // Specifies the method of creating a full-ECS image. 46 // 47 // If the value is CBR, a CBR backup is used to create a full-ECS image. In this case, backup_id is the CBR backup ID. 48 // 49 // If the value is CSBS, a CSBS backup is used to create a full-ECS image. In this case, backup_id is the CSBS backup ID. 50 // 51 // If you do not specify this parameter, value CSBS is used by default. 52 WholeImageType string `json:"whole_image_type,omitempty"` 53 } 54 55 func CreateWholeImageFromCBRorCSBS(client *golangsdk.ServiceClient, opts CreateWholeImageFromCBRorCSBSOpts) (*string, error) { 56 b, err := build.RequestBody(opts, "") 57 if err != nil { 58 return nil, err 59 } 60 61 return wholeImages(client, b) 62 }