images

package
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDataImage

func CreateDataImage(client *golangsdk.ServiceClient, opts CreateDataImageOpts) (*string, error)

CreateDataImage This API is used to create a data disk image from a data disk image file uploaded to the OBS bucket. The API is an asynchronous one. If it is successfully called, the cloud service system receives the request. However, you need to use the asynchronous job query API to query the image creation status. For details, see Asynchronous Job Query.

func CreateWholeImageFromCBRorCSBS

func CreateWholeImageFromCBRorCSBS(client *golangsdk.ServiceClient, opts CreateWholeImageFromCBRorCSBSOpts) (*string, error)

func CreateWholeImageFromECS

func CreateWholeImageFromECS(client *golangsdk.ServiceClient, opts CreateWholeImageFromECSOpts) (*string, error)

func ExportImage

func ExportImage(client *golangsdk.ServiceClient, opts ExportImageOpts) (*string, error)

func RegisterImage

func RegisterImage(client *golangsdk.ServiceClient, opts RegisterImageOpts) (*string, error)

Types

type CreateDataImageOpts

type CreateDataImageOpts struct {
	// Specifies the image name.
	Name string `json:"name" required:"true"`
	// Provides supplementary information about the image. For detailed description, see Image Attributes. The value contains a maximum of 1024 characters and consists of only letters and digits. Carriage returns and angle brackets (< >) are not allowed. This parameter is left blank by default.
	Description string `json:"description,omitempty"`
	// Specifies the OS type.
	//
	// It can only be Windows or Linux. The default is Linux.
	OsType string `json:"os_type,omitempty"`
	// Specifies the URL of the external image file in the OBS bucket.
	//
	// The format is OBS bucket name:Image file name.
	//
	// NOTE:
	// The storage class of the OBS bucket must be Standard.
	ImageUrl string `json:"image_url" required:"true"`
	// Specifies the minimum size of the data disk.
	// Value range: 40 GB to 2048 GB
	MinDisk int `json:"min_disk" required:"true"`
	// Specifies the master key used for encrypting an image. For its value, see the Key Management Service User Guide.
	CmkId string `json:"cmk_id,omitempty"`
	// Specifies image tags. This parameter is left blank by default.
	//
	// For detailed parameter description, see Image Tag Data Formats.
	//
	// Use either tags or image_tags.
	Tags []string `json:"tags,omitempty"`
	// Lists the image tags. This parameter is left blank by default.
	//
	// Use either tags or image_tags.
	ImageTags []tags.ResourceTag `json:"image_tags,omitempty"`
}

type CreateWholeImageFromCBRorCSBSOpts

type CreateWholeImageFromCBRorCSBSOpts struct {
	// Specifies the image name. For detailed description, see Image Attributes.
	Name string `json:"name" required:"true"`
	// Provides supplementary information about the image. For detailed description, see Image Attributes.
	Description string `json:"description,omitempty"`
	// Lists the image tags. The value is left blank by default.
	//
	// Use either tags or image_tags.
	Tags []string `json:"tags,omitempty"`
	// Lists the image tags. The value is left blank by default.
	//
	// Use either tags or image_tags.
	ImageTags []tags.ResourceTag `json:"image_tags,omitempty"`
	// Specifies the CSBS backup ID or CBR backup ID.
	//
	// To obtain the CSBS backup ID, perform the following operations:
	//
	// Log in to the management console.
	//
	// Under Storage, click Cloud Server Backup Service.
	//
	// In the backup list, expand details of the backup to obtain its ID.
	//
	// To obtain the CBR backup ID, perform the following operations:
	//
	// Log in to the management console.
	//
	// Under Storage, click Cloud Backup and Recovery.
	//
	// On the displayed Cloud Server Backup page, click the Backups tab and obtain the backup ID from the backup list.
	BackupId string `json:"backup_id" required:"true"`
	// Specifies the maximum memory of the image in the unit of MB. This parameter is not configured by default.
	MaxRam int `json:"max_ram,omitempty"`
	// Specifies the minimum memory of the image in the unit of MB. The default value is 0, indicating that the memory is not restricted.
	MinRam int `json:"min_ram,omitempty"`
	// Specifies the method of creating a full-ECS image.
	//
	// 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.
	//
	// 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.
	//
	// If you do not specify this parameter, value CSBS is used by default.
	WholeImageType string `json:"whole_image_type,omitempty"`
}

CreateWholeImageFromCBRorCSBSOpts Parameters in the request body when a CSBS backup or CBR backup is used to create a full-ECS image

type CreateWholeImageFromECSOpts

type CreateWholeImageFromECSOpts struct {
	// Specifies the image name. For detailed description, see Image Attributes.
	Name string `json:"name" required:"true"`
	// Provides supplementary information about the image. For detailed description, see Image Attributes.
	Description string `json:"description,omitempty"`
	// Lists the image tags. The value is left blank by default.
	// Use either tags or image_tags.
	Tags []string `json:"tags,omitempty"`
	// Lists the image tags. The value is left blank by default.
	// Use either tags or image_tags.
	ImageTags []tags.ResourceTag `json:"image_tags,omitempty"`
	// Specifies the ECS ID. This parameter is required when an ECS is used to create a full-ECS image.
	//
	// To obtain the ECS ID, perform the following operations:
	//
	// Log in to management console.
	//
	// Under Computing, click Elastic Cloud Server.
	//
	// In the ECS list, click the name of the ECS and view its ID.
	InstanceId string `json:"instance_id" required:"true"`
	// Specifies the maximum memory of the image in the unit of MB. This parameter is not configured by default.
	MaxRam int `json:"max_ram,omitempty"`
	// Specifies the minimum memory of the image in the unit of MB. The default value is 0.
	MinRam int `json:"min_ram,omitempty"`
	// Specifies the ID of the vault to which an ECS is to be added or has been added.
	//
	// To create a full-ECS image from an ECS, create a backup from the ECS and then use the backup to create a full-ECS image. If a CBR backup is created, vault_id is mandatory. If a CSBS backup is created, vault_id is optional.
	//
	// You can obtain the vault ID from the CBR console or section "Querying the Vault List" in Cloud Backup and Recovery API Reference.
	VaultId string `json:"vault_id,omitempty"`
}

CreateWholeImageFromECSOpts Parameters for creating a full-ECS image using an ECS

type ExportImageOpts

type ExportImageOpts struct {
	// Specifies the image ID.
	ImageId string `json:"-" required:"true"`
	// Specifies the URL of the image file in the format of Bucket name:File name.
	//
	// Note
	//
	// The storage class of the OBS bucket must be Standard.
	BucketUrl string `json:"bucket_url" required:"true"`
	// Specifies the file format. The value can be qcow2, vhd, zvhd, or vmdk.
	FileFormat string `json:"file_format" required:"true"`
	// Whether to enable fast export. The value can be true or false.
	//
	// Note
	//
	// If fast export is enabled, file_format cannot be specified.
	IsQuickExport *bool `json:"is_quick_export,omitempty"`
}

type RegisterImageOpts

type RegisterImageOpts struct {
	// Specifies the image ID.
	//
	// image_id is the ID of the image you created by invoking the API for creating image metadata. Registration may fail if you use other image IDs.
	//
	// After this API is invoked, you can check the image status with the image ID. When the image status changes to active, the image file is successfully registered. For details, see Querying Image Details (Native OpenStack API).
	ImageId string `json:"-" required:"true"`
	// Specifies the URL of the image file in the format of Bucket name:File name.
	//
	// Image files in the bucket can be in ZVHD, QCOW2, VHD, RAW, VHDX, QED, VDI, QCOW, ZVHD2, or VMDK format.
	//
	// Note
	//
	// The storage class of the OBS bucket must be Standard.
	ImageUrl string `json:"image_url" required:"true"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL