Documentation ¶
Index ¶
- func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*images.ImageInfo, error)
- func Delete(client *golangsdk.ServiceClient, opts DeleteImageOpts) (err error)
- func ExtractImages(r pagination.Page) ([]images.ImageInfo, error)
- func Get(client *golangsdk.ServiceClient, id string) (*images.ImageInfo, error)
- func List(c *golangsdk.ServiceClient, opts images.ListImagesOpts) pagination.Pager
- func Update(client *golangsdk.ServiceClient, imageId string, opts []images.UpdateImageOpts) (*images.ImageInfo, error)
- func Upload(client *golangsdk.ServiceClient, id string, data io.Reader) (err error)
- type CreateOpts
- type DeleteImageOpts
- type ImagePage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*images.ImageInfo, error)
Create implements create image request.
func Delete ¶
func Delete(client *golangsdk.ServiceClient, opts DeleteImageOpts) (err error)
func ExtractImages ¶
func ExtractImages(r pagination.Page) ([]images.ImageInfo, error)
ExtractImages interprets the results of a single page from a List() call, producing a slice of Image entities.
func List ¶
func List(c *golangsdk.ServiceClient, opts images.ListImagesOpts) pagination.Pager
List implements image list request.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // Specifies the image OS version. For the value range, see Values of Related Parameters. // // If this parameter is not specified, the value Other Linux(64 bit) will be used. In that case, the ECS creation using this image may fail, and the ECS created using this image may fail to run properly. OsVersion string `json:"__os_version,omitempty"` // Specifies the container format. // // The default value is bare. ContainerFormat string `json:"container_format,omitempty"` // Specifies the image format. The value can be zvhd2, vhd, zvhd, raw, or qcow2. The default value is zvhd2. DiskFormat string `json:"disk_format,omitempty"` // Specifies the minimum disk space (GB) required for running the image. The value ranges from 1 GB to 1024 GB. // // The value of this parameter must be greater than the image system disk capacity. Otherwise, the ECS creation may fail. MinDisk int `json:"min_disk,omitempty"` // Specifies the minimum memory size (MB) required for running the image. The parameter value depends on ECS specifications. The default value is 0. MinRam int `json:"min_ram,omitempty"` // Specifies the image name. If this parameter is not specified, its value is empty by default. In that case, ECS creation using this image will fail. The name contains 1 to 255 characters. For detailed description, see Image Attributes. This parameter is left blank by default. Name string `json:"name,omitempty"` // Lists the image tags. The tag contains 1 to 255 characters. The value is left blank by default. Tags []string `json:"tags,omitempty"` // Specifies whether the image is available to other tenants. // // The default value is private. When creating image metadata, the value of visibility can be set to private only. Visibility string `json:"visibility,omitempty"` // Specifies whether the image is protected. A protected image cannot be deleted. The default value is false. Protected bool `json:"protected,omitempty"` }
type DeleteImageOpts ¶
type DeleteImageOpts struct { ImageId string `json:"-" required:"true"` // Specifies whether to delete the CSBS backups or CBR backups associated with a full-ECS image when the image is deleted. The value can be true or false. // true: When a full-ECS image is deleted, its CSBS backups or CBR backups are also deleted. // false: When a full-ECS image is deleted, its CSBS backups or CBR backups are not deleted. DeleteBackup bool `json:"delete_backup,omitempty"` }
type ImagePage ¶
type ImagePage struct { pagination.LinkedPageBase // contains filtered or unexported fields }
ImagePage represents the results of a List request.
func (ImagePage) NextPageURL ¶
NextPageURL uses the response's embedded link reference to navigate to the next page of results.
Click to show internal directories.
Click to hide internal directories.