Images
1. images(image_id)
Get the list of Image Object
Parameters:
| Name | Type | Description |
|---|---|---|
| image_id | string | specify it if you want to get specified one |
Return value: List Of Image Object
Return value example:
istack/image/v2/image Image
status : active
image_location : snapshot
image_state : available
tags : []
kernel_id : None
container_format : bare
min_ram : 0
ramdisk_id : None
updated_at : 2016-08-26T07:54:55Z
visibility : private
min_disk : 20
file : /v2/images/a57ae423-5f2c-40d7-923a-ea7ef2afe0b5/file
owner : 22475f0b415543bbbcc9f0117fb3ca8b
virtual_size : None
id : a57ae423-5f2c-40d7-923a-ea7ef2afe0b5
size : 1635844096
instance_uuid : 10068f84-d0bf-41ea-91bb-2d3f9bac5cdc
user_id : 5cb221da19514beb9d070205eaa9cf71
name : zhengcy0-201608260754
image_type : snapshot
checksum : 435a5c85e8969aee8fc637658f98bfbf
self : /v2/images/a57ae423-5f2c-40d7-923a-ea7ef2afe0b5
disk_format : qcow2
base_image_ref : e50cf54b-799c-4150-b974-588bd85d3896
protected : False
schema : /v2/schemas/image
created_at : 2016-08-26T07:54:17Z
owner_id : 22475f0b415543bbbcc9f0117fb3ca8b
2. create_image(**attrs)
Create an image instance.
Parameters: attributes
| Name | Type | Description |
|---|---|---|
| container_format (Optional) | enum | Format of the image container. A valid value is one of ami, ari, aki, bare, ovf, ova, ordocker. |
| disk_format (Optional) | enum | The format of the disk. A valid value is ami,ari, aki, vhd, vmdk, raw, qcow2, vdi, or iso. |
| id (Optional) | string | A unique, user-defined image UUID. |
| min_disk (Optional) | integer | Amount of disk space in GB that is required to boot the image. |
| min_ram (Optional) | integer | Amount of RAM in MB that is required to boot the image. |
| name (Optional) | string | The name of the image. |
| protected (Optional) | boolean | Image protection for deletion. Valid value is true or false. Default is false. |
| tags (Optional) | array | List of tags for this image. Each tag is a string of at most 255 chars. The maximum number of tags allowed on an image is set by the operator. |
| visibility (Optional) | string | Visibility for this image. Valid value is public or private. At most sites, only an administrator can make an image public. Default is private. |
Parameter example:
image = self.cloud.image.create_image(
container_format=r"bare",
disk_format=r"raw",
name=r"Python",
id=r"91088901-7fd6-4909-b888-a68bff256bee"
)
Return value: Image Instance
Return value example:
istack/image/v2/image Image
status : active
image_location : snapshot
image_state : available
tags : []
kernel_id : None
container_format : bare
min_ram : 0
ramdisk_id : None
updated_at : 2016-08-26T07:54:55Z
visibility : private
min_disk : 20
file : /v2/images/a57ae423-5f2c-40d7-923a-ea7ef2afe0b5/file
owner : 22475f0b415543bbbcc9f0117fb3ca8b
virtual_size : None
id : a57ae423-5f2c-40d7-923a-ea7ef2afe0b5
size : 1635844096
instance_uuid : 10068f84-d0bf-41ea-91bb-2d3f9bac5cdc
user_id : 5cb221da19514beb9d070205eaa9cf71
name : zhengcy0-201608260754
image_type : snapshot
checksum : 435a5c85e8969aee8fc637658f98bfbf
self : /v2/images/a57ae423-5f2c-40d7-923a-ea7ef2afe0b5
disk_format : qcow2
base_image_ref : e50cf54b-799c-4150-b974-588bd85d3896
protected : False
schema : /v2/schemas/image
created_at : 2016-08-26T07:54:17Z
owner_id : 22475f0b415543bbbcc9f0117fb3ca8b
3. update_image(image, **attrs)
Update Image Instance.
Parameters: image (Object), attributes
| Name | Type | Description |
|---|---|---|
| id | string | To update, id must be specified in the object of image, which is used as a parameter |
| container_format (Optional) | enum | Format of the image container. A valid value is one of ami, ari, aki, bare, ovf, ova, ordocker. |
| disk_format (Optional) | enum | The format of the disk. A valid value is ami,ari, aki, vhd, vmdk, raw, qcow2, vdi, or iso. |
| min_disk (Optional) | integer | Amount of disk space in GB that is required to boot the image. |
| min_ram (Optional) | integer | Amount of RAM in MB that is required to boot the image. |
| name (Optional) | string | The name of the image. |
| protected (Optional) | boolean | Image protection for deletion. Valid value is true or false. Default is false. |
| tags (Optional) | array | List of tags for this image. Each tag is a string of at most 255 chars. The maximum number of tags allowed on an image is set by the operator. |
| visibility (Optional) | string | Visibility for this image. Valid value is public or private. At most sites, only an administrator can make an image public. Default is private. |
Return value: Image Instance
Return value example:
istack/image/v2/image Image
status : active
image_location : snapshot
image_state : available
tags : []
kernel_id : None
container_format : bare
min_ram : 0
ramdisk_id : None
updated_at : 2016-08-26T07:54:55Z
visibility : private
min_disk : 20
file : /v2/images/a57ae423-5f2c-40d7-923a-ea7ef2afe0b5/file
owner : 22475f0b415543bbbcc9f0117fb3ca8b
virtual_size : None
id : a57ae423-5f2c-40d7-923a-ea7ef2afe0b5
size : 1635844096
instance_uuid : 10068f84-d0bf-41ea-91bb-2d3f9bac5cdc
user_id : 5cb221da19514beb9d070205eaa9cf71
name : zhengcy0-201608260754
image_type : snapshot
checksum : 435a5c85e8969aee8fc637658f98bfbf
self : /v2/images/a57ae423-5f2c-40d7-923a-ea7ef2afe0b5
disk_format : qcow2
base_image_ref : e50cf54b-799c-4150-b974-588bd85d3896
protected : False
schema : /v2/schemas/image
created_at : 2016-08-26T07:54:17Z
owner_id : 22475f0b415543bbbcc9f0117fb3ca8b
4. delete_image(image)
Delete an image instance。
Parameters: image object
| Name | Type | Description |
|---|---|---|
| id | string | inside (image) instance id must be at least specified in the parameter’s image instance |
Return value: None
5. reactivate(image_id)
Reactivate or activate an image.
Parameters: image_id
| Name | Type | Description |
|---|---|---|
| id | string | the target image id |
Return value: None
6. deactivate(image_id)
Deactivate an image.
Parameters: image_id
| Name | Type | Description |
|---|---|---|
| id | string | the target image id |
Return value: None