Documentation ¶
Index ¶
- func CreateImageFromDisk(client *golangsdk.ServiceClient, opts CreateImageFromDiskOpts) (*string, error)
- func CreateImageFromECS(client *golangsdk.ServiceClient, opts CreateImageFromECSOpts) (*string, error)
- func CreateImageFromOBS(client *golangsdk.ServiceClient, opts CreateImageFromOBSOpts) (*string, error)
- func ImportImageQuick(client *golangsdk.ServiceClient, opts ImportImageQuickOpts) (*string, error)
- type CreateImageFromDiskOpts
- type CreateImageFromECSOpts
- type CreateImageFromOBSOpts
- type ECSDataImage
- type ImageInfo
- type ImportImageQuickOpts
- type ListImagesOpts
- type OBSDataImage
- type UpdateImageOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateImageFromDisk ¶
func CreateImageFromDisk(client *golangsdk.ServiceClient, opts CreateImageFromDiskOpts) (*string, error)
CreateImageFromDisk Constraints (Creating a System Disk Image Using a Data Disk) Before using a data disk to create a system disk image, ensure that an OS has been installed on the data disk and has been optimized. For details about the optimization, see "Optimizing a Windows Private Image" and "Optimizing a Linux Private Image" in the Image Management Service User Guide. The system cannot verify that an OS has been installed on the data disk. Therefore, ensure that the value of os_version is valid when creating a system disk image from the data disk. For details, see Values of Related Parameters.
func CreateImageFromECS ¶
func CreateImageFromECS(client *golangsdk.ServiceClient, opts CreateImageFromECSOpts) (*string, error)
CreateImageFromECS This API is used to create a private image. The following methods are supported:
Create a system or data disk image from an ECS. Create a system disk image from an external image file uploaded to an OBS bucket. Create a system disk image from a data disk. 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.
You cannot export public images (such as Windows, SUSE Linux, Red Hat Linux, Oracle Linux, and Ubuntu) or private images created using these public images.
func CreateImageFromOBS ¶
func CreateImageFromOBS(client *golangsdk.ServiceClient, opts CreateImageFromOBSOpts) (*string, error)
func ImportImageQuick ¶
func ImportImageQuick(client *golangsdk.ServiceClient, opts ImportImageQuickOpts) (*string, error)
Types ¶
type CreateImageFromDiskOpts ¶
type CreateImageFromDiskOpts struct { // Specifies the name of the system disk image. Name string `json:"name" required:"true"` // Specifies the data disk ID. VolumeId string `json:"volume_id" required:"true"` // Specifies the OS version. // // Set the parameter value based on Values of Related Parameters. Otherwise, the created system disk image may be unavailable. // // During the creation of a system disk image, if the OS can be detected from the data disk, the OS version in the data disk is used. In this case, the os_version value is invalid. If the OS can be detected from the data disk, the os_version value is used. OsVersion string `json:"os_version" required:"true"` // Specifies the image type. // // The value can be ECS, BMS, FusionCompute, or Ironic. // // ECS and FusionCompute: indicates an ECS image. // BMS and Ironic: indicates a BMS image. // The default value is ECS. Type string `json:"type,omitempty"` // Specifies the image description. This parameter is left blank by default. For details, see Image Attributes. // // The image description must meet the following requirements: // // Contains only letters and digits. // Cannot contain carriage returns and angle brackets (< >). // Cannot exceed 1024 characters. Description string `json:"description,omitempty"` // Specifies the minimum memory size (MB) required for running the image. // // The parameter value depends on the ECS specifications. The default value is 0. MinRam int `json:"min_ram,omitempty"` // Specifies the maximum memory size (MB) required for running the image. // // The parameter value depends on the ECS specifications. The default value is 0. MaxRam int `json:"max_ram,omitempty"` // Specifies tags of the image. This parameter is left blank by default. // // Use either tags or image_tags. Tags []string `json:"tags,omitempty"` // Specifies tags of the image. This parameter is left blank by default. // // Use either tags or image_tags. ImageTags []tags.ResourceTag `json:"image_tags,omitempty"` }
CreateImageFromDiskOpts Create a system disk image from a data disk.
type CreateImageFromECSOpts ¶
type CreateImageFromECSOpts struct { // Specifies the name of the system disk image. For detailed description, see Image Attributes. Name string `json:"name,omitempty"` // Specifies the image description. 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 ID of the ECS used to create the 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,omitempty"` // Specifies the data disk information to be converted. This parameter is mandatory when the data disk of an ECS is used to create a private data disk image. For details, see Table 1. // // If the ECS data disk is not used to create a data disk image, the parameter is empty by default. // // NOTE: // When you create a data disk image using a data disk, if other parameters (such as name, description, and tags) in this table have values, the system uses the value of data_images. You cannot specify instance_id. DataImages []ECSDataImage `json:"data_images,omitempty"` // Specifies tags of the image. This parameter is left blank by default. // // Use either tags or image_tags. Tags []string `json:"tags,omitempty"` // Specifies tags of the image. This parameter is left blank by default. // // Use either tags or image_tags. ImageTags []tags.ResourceTag `json:"image_tags,omitempty"` // Specifies the maximum memory of the image in the unit of MB. 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"` }
type CreateImageFromOBSOpts ¶
type CreateImageFromOBSOpts struct { // Specifies the name of the system disk image. For detailed description, see Image Attributes. Name string `json:"name" required:"true"` // Specifies the image description. 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. The value can be Linux, Windows, or Other. OsType string `json:"os_type,omitempty"` // Specifies the OS version. // // This parameter is valid if an external image file uploaded to the OBS bucket is used to create an image. For its value, see Values of Related Parameters. // // NOTE: // This parameter is mandatory when the value of is_quick_import is true, that is, a system disk image is imported using the quick import method. OsVersion string `json:"os_version,omitempty"` // Specifies the URL of the external image file in the OBS bucket. // // This parameter is mandatory if an external image file in the OBS bucket is used to create an image. The format is OBS bucket name:Image file name. // // To obtain an OBS bucket name: // Log in to the management console and choose Storage > Object Storage Service. // All OBS buckets are displayed in the list. // // Filter the OBS buckets by region and locate the target bucket in the current region. // To obtain an OBS image file name: // Log in to the management console and choose Storage > Object Storage Service. // All OBS buckets are displayed in the list. // // Filter the OBS buckets by region and locate the target bucket in the current region. // Click the name of the target bucket to go to the bucket details page. // In the navigation pane on the left, choose Objects to display objects in the OBS bucket and then locate the external image file used to create an image. // NOTE: // The storage class of the OBS bucket must be Standard. ImageUrl string `json:"image_url" required:"true"` // Specifies the minimum size of the system disk in the unit of GB. // // This parameter is mandatory if an external image file in the OBS bucket is used to create an image. The value ranges from 1 GB to 1024 GB. MinDisk int `json:"min_disk" required:"true"` // If automatic configuration is required, set the value to true. Otherwise, set the value to false The default value is false. // For details about automatic configuration, see Creating a Linux System Disk Image from an External Image File > Registering an External Image File as a Private Image (Linux) in Image Management Service User Guide. IsConfig bool `json:"is_config,omitempty"` // 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 tags of the image. This parameter is left blank by default. // Use either tags or image_tags. Tags []string `json:"tags,omitempty"` // Specifies tags of the image. This parameter is left blank by default. // Use either tags or image_tags. ImageTags []tags.ResourceTag `json:"image_tags,omitempty"` // Specifies the maximum memory of the image in the unit of MB. 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 data disk information to be imported. // An external image file can contain a maximum of three data disks. In this case, one system disk and three data disks will be created. // NOTE: // If a data disk image file is used to create a data disk image, the OS type of the data disk image must be the same as that of the system disk image. // If other parameters (such as name, description, and tags) in Table 2 are set, the system uses the values in data_images. DataImages []OBSDataImage `json:"data_images,omitempty"` // Specifies whether to use the quick import method to import a system disk image. // For details about the restrictions on quick import of image files, see Importing an Image File Quickly. IsQuickImport bool `json:"is_quick_import,omitempty"` // Specifies the image type. // The value can be ECS, BMS, FusionCompute, or Ironic. The default value is ECS. // ECS and FusionCompute: indicate an ECS image. // BMS and Ironic: indicate a BMS image.the image type, the value can be ECS,BMS,FusionCompute, or Ironic Type string `json:"type,omitempty"` }
CreateImageFromOBSOpts Create a system disk image from an external image file uploaded to an OBS bucket.
type ECSDataImage ¶
type ECSDataImage struct { // Specifies the name of a data disk image. Name string `json:"name" required:"true"` // Specifies the data disk ID. VolumeId string `json:"volume_id" required:"true"` // Specifies the data disk description. Description string `json:"description,omitempty"` // Specifies the data disk image tag. Tags []string `json:"tags,omitempty"` }
type ImageInfo ¶
type ImageInfo struct { // Specifies the backup ID. To create an image using a backup, set the value to the backup ID. Otherwise, this value is left empty. BackupId string `json:"__backup_id,omitempty"` // Specifies the image source. // // If the image is a public image, this parameter is left empty. DataOrigin string `json:"__data_origin,omitempty"` // Specifies the image description. For detailed description, see Image Attributes. Description string `json:"__description,omitempty"` // Specifies the size (bytes) of the image file. ImageSize string `json:"__image_size"` // Specifies the image backend storage type. Only UDS is supported currently. ImageSourceType string `json:"__image_source_type"` // Specifies the image type. The following types are supported: // // Public image: The value is gold. // Private image: The value is private. // Shared image: The value is shared. Imagetype string `json:"__imagetype"` // Specifies whether the image has been registered. The value can be true or false. Isregistered string `json:"__isregistered"` // Specifies the parent image ID. // // If the image is a public image or created from an image file, this value is left empty. Originalimagename string `json:"__originalimagename,omitempty"` // Specifies the OS architecture, 32 bit or 64 bit. OsBit string `json:"__os_bit,omitempty"` // Specifies the OS type. The value can be Linux, Windows, or Other. OsType string `json:"__os_type"` // Specifies the OS version. OsVersion string `json:"__os_version,omitempty"` // Specifies the image platform type. The value can be Windows, Ubuntu, RedHat, SUSE, CentOS, Debian, OpenSUSE, Oracle Linux, Fedora, Other, CoreOS, or EulerOS. Platform string `json:"__platform,omitempty"` // Specifies whether the image supports disk-intensive ECSs. If the image supports disk-intensive ECSs, the value is true. Otherwise, this parameter is not required. SupportDiskintensive string `json:"__support_diskintensive,omitempty"` // Specifies whether the image supports high-performance ECSs. If the image supports high-performance ECSs, the value is true. Otherwise, this parameter is not required. SupportHighperformance string `json:"__support_highperformance,omitempty"` // Specifies whether the image supports KVM. If yes, the value is true. Otherwise, this parameter is not required. SupportKvm string `json:"__support_kvm,omitempty"` // Specifies whether the image supports GPU-accelerated ECSs on the KVM platform. See Table 3 for its value. // // If the image does not support GPU-accelerated ECSs on the KVM platform, this parameter is not required. This attribute cannot co-exist with __support_xen and __support_kvm. SupportKvmGpuType string `json:"__support_kvm_gpu_type,omitempty"` // Specifies whether the image supports ECSs with the InfiniBand NIC on the KVM platform. If yes, the value is true. Otherwise, this parameter is not required. // // This attribute cannot co-exist with __support_xen. SupportKvmInfiniband string `json:"__support_kvm_infiniband,omitempty"` // Specifies whether the image supports large-memory ECSs. If the image supports large-memory ECSs, the value is true. Otherwise, this parameter is not required. SupportLargememory string `json:"__support_largememory,omitempty"` // Specifies whether the image supports Xen. If yes, the value is true. Otherwise, this parameter is not required. SupportXen string `json:"__support_xen,omitempty"` // Specifies whether the image supports GPU-accelerated ECSs on the Xen platform. See Table 2 for its value. If the image does not support GPU-accelerated ECSs on the Xen platform, this parameter is not required. This attribute cannot co-exist with __support_xen and __support_kvm. SupportXenGpuType string `json:"__support_xen_gpu_type,omitempty"` // Specifies whether the image supports HANA ECSs on the Xen platform. If yes, the value is true. Otherwise, this parameter is not required. // // This attribute cannot co-exist with __support_xen and __support_kvm. SupportXenHana string `json:"__support_xen_hana,omitempty"` // This parameter is unavailable currently. Checksum string `json:"checksum,omitempty"` // Specifies the container type. ContainerFormat string `json:"container_format"` // Specifies the time when the image was created. The value is in UTC format. CreatedAt time.Time `json:"created_at"` // Specifies the image format. The value can be vhd, raw, zvhd, or qcow2. The default value is vhd. DiskFormat string `json:"disk_format,omitempty"` // Specifies the enterprise project that the image belongs to. // // If the value is 0 or left blank, the image belongs to the default enterprise project. // If the value is a UUID, the image belongs to the enterprise project corresponding to the UUID. // For more information about enterprise projects, see Enterprise Management User Guide. EnterpriseProjectId string `json:"enterprise_project_id,omitempty"` // Specifies the URL for uploading and downloading the image file. File string `json:"file,omitempty"` // Specifies the image ID. Id string `json:"id"` // Specifies the minimum disk space (GB) required for running the image. The value ranges from 1 GB to 1024 GB. MinDisk int `json:"min_disk"` // Specifies the minimum memory size (MB) required for running the image. The parameter value depends on the ECS specifications. Generally, the value is 0. MinRam int `json:"min_ram"` // Specifies the image name. For detailed description, see Image Attributes. Name string `json:"name"` // Specifies the tenant to which the image belongs. Owner string `json:"owner"` // Specifies whether the image is protected. A protected image cannot be deleted. The value can be true or false. Protected *bool `json:"protected"` // Specifies the image schema. Schema string `json:"schema,omitempty"` // Specifies the image URL. Self string `json:"self"` // This parameter is unavailable currently. Size int `json:"size,omitempty"` // Specifies the image status. The value can be one of the following: // // queued: indicates that the image metadata has already been created, and it is ready for the image file to upload. // saving: indicates that the image file is being uploaded to the backend storage. // deleted: indicates that the image has been deleted. // killed: indicates that an error occurs on the image uploading. // active: indicates that the image is available for use. Status string `json:"status"` // Specifies tags of the image, through which you can manage private images in your own way. You can use the image tag API to add different tags to each image and filter images by tag. Tags []string `json:"tags"` // Specifies the time when the image was updated. The value is in UTC format. UpdatedAt time.Time `json:"updated_at"` // Specifies the environment where the image is used. The value can be FusionCompute, Ironic, DataImage, or IsoImage. // // For an ECS image, the value is FusionCompute. // For a data disk image, the value is DataImage. // For a BMS image, the value is Ironic. // For an ISO image, the value is IsoImage. VirtualEnvType string `json:"virtual_env_type"` // This parameter is unavailable currently. VirtualSize int `json:"virtual_size,omitempty"` // Specifies whether the image is available to other tenants. Available values include: // // private: private image // public: public image // shared: shared image Visibility string `json:"visibility"` // Specifies whether the image supports password/private key injection using Cloud-Init. // // If the value is set to true, password/private key injection using Cloud-Init is not supported. // // NOTE: // This parameter is valid only for ECS system disk images. SupportFcInject string `json:"__support_fc_inject,omitempty"` // Specifies the ECS boot mode. Available values include: // // bios indicates the BIOS boot mode. // uefi indicates the UEFI boot mode. HwFirmwareType string `json:"hw_firmware_type,omitempty"` // Specifies the maximum memory (MB) of the image. You can set this parameter based on the ECS specifications. Generally, you do not need to set this parameter. MaxRam string `json:"max_ram,omitempty"` // Specifies the ID of the key used to encrypt the image. SystemCmkid string `json:"__system__cmkid,omitempty"` // Specifies additional attributes of the image. The value is a list (in JSON format) of advanced features supported by the image. OsFeatureList string `json:"__os_feature_list,omitempty"` // Specifies whether the image supports NIC multi-queue. The value can be true or false. HwVifMultiqueueEnabled string `json:"hw_vif_multiqueue_enabled,omitempty"` // Specifies whether the image supports lazy loading. The value can be true, false, True, or False. Lazyloading string `json:"__lazyloading,omitempty"` // Specifies that the image is created from an external image file. Value: file RootOrigin string `json:"__root_origin,omitempty"` // Specifies the ECS system disk slot number corresponding to the image. // // Example value: 0 SequenceNum string `json:"__sequence_num,omitempty"` // Specifies the time when the image status became active. ActiveAt string `json:"active_at"` // Specifies whether the image uses AMD's x86 architecture. The value can be true or false. SupportAmd string `json:"__support_amd,omitempty"` // Specifies the location where the image is stored. ImageLocation string `json:"__image_location"` // Specifies the charging identifier for the image. AccountCode string `json:"__account_code"` SupportKvmNvmeSpdk string `json:"__support_kvm_nvme_spdk"` ImageLoginUser string `json:"__image_login_user"` SupportKvmHi1822Hiovs string `json:"__support_kvm_hi1822_hiovs"` }
func ListImages ¶
func ListImages(client *golangsdk.ServiceClient, opts ListImagesOpts) ([]ImageInfo, error)
ListImages This API is used to query images using search criteria and to display the images in a list.
func UpdateImage ¶
func UpdateImage(client *golangsdk.ServiceClient, imageId string, opts []UpdateImageOpts) (*ImageInfo, error)
UpdateImage This API is used to modify image attributes and update image information. Only information of images in active status can be changed.
type ImportImageQuickOpts ¶
type ImportImageQuickOpts 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 version. // This parameter is valid if an external image file uploaded to the OBS bucket is used to create an image. For its value, see Values of Related Parameters. // When a data disk image created, the value can be Linux or Windows. The default is Linux. OsVersion string `json:"os_version,omitempty"` // Specifies the URL of the external image file in the OBS bucket. // // This parameter is mandatory if an external image file in the OBS bucket is used to create an image. 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 system disk in the unit of GB. // // This parameter is mandatory if an external image file in the OBS bucket is used to create an image. The value ranges from 1 to 1024. MinDisk int `json:"min_disk" required:"true"` // Lists the image tags. This parameter is left blank by default. // // Set either tags or image_tags. Tags []string `json:"tags,omitempty"` // Lists the image tags. The value is left blank by default. // // Set either tags or image_tags. ImageTags []tags.ResourceTag `json:"image_tags,omitempty"` // Specifies the image type. // The parameter value is ECS/BMS for system disk images. The default value is ECS. // The parameter value is DataImage for data disk images. Type string `json:"type,omitempty"` }
type ListImagesOpts ¶
type ListImagesOpts struct { // Specifies the image type. The following types are supported: // // Public image: The value is gold. // Private image: The value is private. // Shared image: The value is shared. // NOTE: // The __imagetype of images you share with other tenants or those other tenants share with you and you have accepted is shared. You can use field owner to distinguish the two types of shared images. You can use member_status to filter out shared images you have accepted. ImageType string `q:"__imagetype,omitempty"` // Specifies whether the image is available. The value can be true. The value is true for all extension APIs by default. Common users can query only the images for which the value of this parameter is true. IsRegistered string `q:"__isregistered,omitempty"` // Specifies whether the image is a full-ECS image. The value can be true or false. WholeImage *bool `q:"__whole_image,omitempty"` // Specifies the ID of the key used to encrypt the image. You can obtain the ID from the IMS console or by calling the Querying Image Details (Native OpenStack API) API. SystemCmkId string `q:"__system__cmkid,omitempty"` // Specifies the OS architecture, 32 bit or 64 bit. OsBit string `q:"__os_bit,omitempty"` // Specifies the image OS type. Available values include: // // Linux // Windows // Other OsType string `q:"__os_type,omitempty"` // Specifies the image platform type. The value can be Windows, Ubuntu, RedHat, SUSE, CentOS, Debian, OpenSUSE, Oracle Linux, Fedora, Other, CoreOS, or EulerOS. Platform string `q:"__platform,omitempty"` // Specifies whether the image supports disk-intensive ECSs. If the image supports disk-intensive ECSs, the value is true. Otherwise, this parameter is not required. SupportDiskIntensive string `q:"__support_diskintensive,omitempty"` // Specifies whether the image supports high-performance ECSs. If the image supports high-performance ECSs, the value is true. Otherwise, this parameter is not required. SupportHighPerformance string `q:"__support_highperformance,omitempty"` // Specifies whether the image supports KVM. If yes, the value is true. Otherwise, this parameter is not required. SupportKvm string `q:"__support_kvm,omitempty"` // Specifies whether the image supports GPU-accelerated ECSs on the KVM platform. See Table 3 for its value. If the image does not support GPU-accelerated ECSs on the KVM platform, this parameter is not required. This attribute cannot co-exist with __support_xen and __support_kvm. SupportKvmGpuType string `q:"__support_kvm_gpu_type,omitempty"` // Specifies whether the image supports ECSs with the InfiniBand NIC on the KVM platform. If yes, the value is true. Otherwise, this parameter is not required. // // This attribute cannot co-exist with __support_xen. SupportKvmInfiniband string `q:"__support_kvm_infiniband,omitempty"` // Specifies whether the image supports large-memory ECSs. If the image supports large-memory ECSs, the value is true. Otherwise, this parameter is not required. SupportLargeMemory string `q:"__support_largememory,omitempty"` // Specifies whether the image supports Xen. If yes, the value is true. Otherwise, this parameter is not required. SupportXen string `q:"__support_xen,omitempty"` // Specifies whether the image supports GPU-accelerated ECSs on the Xen platform. See Table 2 for its value. If the image does not support GPU-accelerated ECSs on the Xen platform, this parameter is not required. This attribute cannot co-exist with __support_xen and __support_kvm. SupportXenGpuType string `q:"__support_xen_gpu_type,omitempty"` // Specifies whether the image supports HANA ECSs on the Xen platform. If yes, the value is true. Otherwise, this parameter is not required. // // This attribute cannot co-exist with __support_xen and __support_kvm. SupportXenHana string `q:"__support_xen_hana,omitempty"` // Specifies the container type. The value is bare. ContainerFormat string `q:"container_format,omitempty"` // Specifies the image format. The value can be vhd, raw, zvhd, or qcow2. The default value is zvhd2. DiskFormat string `q:"disk_format,omitempty"` // Specifies the enterprise project to which the images to be queried belong. // If the value is 0, images of enterprise project default are to be queried. // If the value is UUID, images of the enterprise project corresponding to the UUID are to be queried. // If the value is all_granted_eps, images of all enterprise projects are to be queried. // For more information about enterprise projects and how to obtain enterprise project IDs, see Enterprise Management User Guide. EnterpriseProjectId string `q:"enterprise_project_id,omitempty"` // Specifies the image ID Id string `q:"id,omitempty"` // Specifies the number of images to be queried. The value is an integer and is 500 by default. Limit int `q:"limit,omitempty"` // Specifies the start number from which images are queried. The value is the image ID. Marker string `q:"marker,omitempty"` // Specifies the member status. The value can be accepted, rejected, or pending. accepted: indicates that the shared image is accepted. rejected indicates that the image shared by others is rejected. pending indicates that the image shared by others needs to be confirmed. To use this parameter, set visibility to shared during the query. MemberStatus string `q:"member_status,omitempty"` // Specifies the minimum disk space (GB) required for running the image. The value ranges from 1 GB to 1024 GB. MinDisk int `q:"min_disk,omitempty"` // Specifies the minimum memory size (MB) required for running the image. The parameter value depends on the ECS specifications. Generally, the value is 0. MinRam int `q:"min_ram,omitempty"` // Specifies the image name. Exact matching is used. For detailed description, see Image Attributes. Name string `q:"name,omitempty"` // Specifies the tenant to which the image belongs. Owner string `q:"owner,omitempty"` // Specifies whether the image is protected. The value can be true or false. Set it to true when you query public images. This parameter is optional when you query private images. Protected *bool `q:"protected,omitempty"` // Specifies whether the query results are sorted in ascending or descending order. Its value can be desc (default) or asc. This parameter is used together with parameter sort_key. The default value is desc. SortDir string `q:"sort_dir,omitempty"` // Specifies the field for sorting the query results. The value can be an attribute of the image: name, container_format, disk_format, status, id, size, or created_at. The default value is created_at. SortKey string `q:"sort_key,omitempty"` // Specifies the image status. The value can be one of the following: // // queued: indicates that the image metadata has already been created, and it is ready for the image file to upload. // saving: indicates that the image file is being uploaded to the backend storage. // deleted: indicates that the image has been deleted. // killed: indicates that an error occurs on the image uploading. // active: indicates that the image is available for use. Status string `q:"status,omitempty"` // Specifies a tag added to an image. Tags can be used as a filter to query images. // // NOTE: // The tagging function has been upgraded. If the tags added before the function upgrade are in the format of "Key.Value", query tags using "Key=Value". For example, an existing tag is a.b. After the tag function upgrade, query the tag using "tag=a=b". Tag string `q:"tag,omitempty"` // Specifies the environment where the image is used. The value can be FusionCompute, Ironic, DataImage, or IsoImage. // // For an ECS image (system disk image), the value is FusionCompute. // For a data disk image, the value is DataImage. // For a BMS image, the value is Ironic. // For an ISO image, the value is IsoImage. VirtualEnvType string `q:"virtual_env_type,omitempty"` // Specifies whether the image is available to other tenants. Available values include: // // public: public image // private: private image // shared: shared image Visibility string `q:"visibility,omitempty"` // Specifies the time when the image was created. Images can be queried by time. The value is in the format of Operator:UTC time. // // The following operators are supported: // // gt: greater than // gte: greater than or equal to // lt: less than // lte: less than or equal to // eq: equal to // neq: not equal to // The time format is yyyy-MM-ddThh:mm:ssZ or yyyy-MM-dd hh:mm:ss. // // For example, to query images created before Oct 28, 2018 10:00:00, set the value of created_at as follows: // // created_at=lt:2018-10-28T10:00:00Z CreatedAt string `q:"created_at,omitempty"` // Specifies the time when the image was modified. Images can be queried by time. The value is in the format of Operator:UTC time. // // The following operators are supported: // // gt: greater than // gte: greater than or equal to // lt: less than // lte: less than or equal to // eq: equal to // neq: not equal to // The time format is yyyy-MM-ddThh:mm:ssZ or yyyy-MM-dd hh:mm:ss. // // For example, to query images updated before Oct 28, 2018 10:00:00, set the value of updated_at as follows: // // updated_at=lt:2018-10-28T10:00:00Z UpdatedAt string `q:"updated_at,omitempty"` // SizeMin filters on the size_min image property. SizeMin int64 `q:"size_min"` // SizeMax filters on the size_max image property. SizeMax int64 `q:"size_max"` }
type OBSDataImage ¶
type OBSDataImage struct { // Specifies the image name. Name string `json:"name,omitempty"` // Specifies the enterprise project that the image belongs to. The value is left blank by default. // // The value contains a maximum of 1024 characters and consists of only letters and digits. Carriage returns and angle brackets (< >) are not allowed. Description string `json:"description,omitempty"` // Specifies the URL of the external image file in the OBS bucket. // // The format is OBS bucket name:Image file name. // // To obtain an OBS bucket name: // Log in to the management console and choose Storage > Object Storage Service. // All OBS buckets are displayed in the list. // // Filter the OBS buckets by region and locate the target bucket in the current region. // To obtain an OBS image file name: // Log in to the management console and choose Storage > Object Storage Service. // All OBS buckets are displayed in the list. // // Filter the OBS buckets by region and locate the target bucket in the current region. // Click the name of the target bucket to go to the bucket details page. // In the navigation pane on the left, choose Objects to display objects in the OBS bucket and then locate the external image file used to create an image. // NOTE: // The storage class of the OBS bucket must be Standard. ImageUrl string `json:"image_url" required:"true"` // Specifies the data disk ID. VolumeId string `json:"volume_id"` // Specifies the minimum size of the data disk. // Unit: GB // Value range: 1–2048 MinDisk int `json:"min_disk" required:"true"` // Specifies whether an image file is imported quickly to create a data disk image. IsQuickImport bool `json:"is_quick_import,omitempty"` // Specifies tags of the image. This parameter is left blank by default. // Use either tags or image_tags. Tags []string `json:"tags,omitempty"` // Specifies tags of the image. This parameter is left blank by default. // Use either tags or image_tags. ImageTags []tags.ResourceTag `json:"image_tags,omitempty"` }
type UpdateImageOpts ¶
type UpdateImageOpts struct { // Specifies the operation. The value can be add, replace, or remove. Op string `json:"op" required:"true"` // Specifies the name of the attribute to be modified. / needs to be added in front of it. // // You can modify the following attributes: // // name: specifies the image name. // __description: specifies the image description. // __support_xen: Xen is supported. // __support_largememory: Ultra-large memory is supported. // __support_diskintensive: Intensive storage is supported. // __support_highperformance: High-performance computing (HPC) is supported. // __support_xen_gpu_type: GPU-accelerated ECSs that use Xen for virtualization are supported. // __support_kvm_gpu_type: GPU-accelerated ECSs that use KVM for virtualization are supported. // __support_xen_hana: HANA ECSs that use Xen for virtualization are supported. // __is_config_init: specifies whether initialization configuration is complete. // enterprise_project_id: specifies the enterprise project ID. // min_ram: specifies the minimum memory. // hw_vif_multiqueue_enabled: The NIC multi-queue feature is supported. // hw_firmware_type: specifies the boot mode. The value can be bios or uefi. // You can add or delete extension attributes. Path string `json:"path" required:"true"` // Specifies the new value of the attribute. For detailed description, see Image Attributes. Value interface{} `json:"value"` }