api.image.base
¶
/image¶
-
api.image.base.views.
image_list
(*args, **kwargs)¶ List (
GET
) all server disk images.-
GET
/image
¶ DC-bound?: Permissions: Asynchronous?: Parameters: - data.full (boolean) – Return list of objects with all server disk image details (default: false)
- data.extended (boolean) – Return list of objects with extended server disk image details (default: false)
- data.order_by (string) – Available fields for sorting:
name
,created
(default:name
)
Status Codes: - 200 OK – SUCCESS
- 403 Forbidden – Forbidden
-
/image/(name)¶
-
api.image.base.views.
image_manage
(*args, **kwargs)¶ Show (
GET
), import (POST
), update (PUT
) or delete (DELETE
) a server disk image.-
GET
/image/
(name)¶ DC-bound?: Permissions: - ImageAdmin -
dc_bound=true
- SuperAdmin -
dc_bound=false
Asynchronous?: Parameters: - name (string) – required - Server disk image name
- data.extended (boolean) – Display extended disk image details (default: false)
Status Codes: - 200 OK – SUCCESS
- 403 Forbidden – Forbidden
- 404 Not Found – Image not found
- ImageAdmin -
Note
The behaviour of the following API functions depends on whether a global image server (
VMS_IMAGE_VM
) is configured in the system. With no image server configured all operations will be performed at database level only.-
POST
/image/
(name)¶ Note
You can also import images from remote disk image repositories by using the
POST /imagestore/(name)/image/(uuid)
API function.DC-bound?: Permissions: - ImageImportAdmin -
dc_bound=true
- SuperAdmin -
dc_bound=false
Asynchronous?: Parameters: - name (string) – required - Server disk image name
- data.manifest_url (string) – required - Disk image manifest URL
- data.file_url (string) – Optional image file URL (will be assembled from manifest URL if not provided)
- data.alias (string) – Short image name (default:
name
) - data.access (integer) – Access type (1 - Public, 3 - Private, 4 - Deleted) (default: 3)
- data.owner (string) – User that owns the image (default: logged in user)
- data.desc (string) – Image description (default: read from manifest)
- data.version (string) – Image version (default: read from manifest)
- data.resize (boolean) – Whether the image is able to resize the disk during an initial start or deploy process (default: read from manifest / true for OS zones, otherwise false)
- data.deploy (boolean) – Whether the image is able to shut down the server after an initial start (default: read from manifest / false)
- data.tags (array) – Image tags will be inherited by VMs which will use this image (default: read from manifest)
- data.dc_bound (boolean) – Whether the disk image is bound to a datacenter (requires SuperAdmin permission) (default: true)
- data.dc (string) – Name of the datacenter the disk image will be attached to (required if DC-bound)
Status Codes: - 200 OK – SUCCESS
- 201 Created – PENDING
- 400 Bad Request – FAILURE
- 403 Forbidden – Forbidden
- 404 Not Found – Datacenter not found
- 406 Not Acceptable – Image already exists
- 423 Locked – Node is not operational
- 417 Expectation Failed – Image status is not OK
- 428 – Image server is not available
- ImageImportAdmin -
-
PUT
/image/
(name)¶ DC-bound?: Permissions: - ImageAdmin -
dc_bound=true
- SuperAdmin -
dc_bound=false
Asynchronous?: Parameters: - name (string) – required - Server disk image name
- data.alias (string) – Short image name
- data.access (integer) – Access type (1 - Public, 3 - Private, 4 - Deleted)
- data.owner (string) – User that owns the image
- data.desc (string) – Image description
- data.version (string) – Image version
- data.resize (boolean) – Whether the image is able to resize the disk during an initial start or deploy process
- data.deploy (boolean) – Whether the image is able to shut down the server after an initial start
- data.tags (array) – Image tags will be inherited by VMs which will use this image
- data.dc_bound (boolean) – Whether the image is bound to a datacenter (requires SuperAdmin permission)
Status Codes: - 200 OK – SUCCESS
- 201 Created – PENDING
- 400 Bad Request – FAILURE
- 403 Forbidden – Forbidden
- 404 Not Found – Image not found
- 423 Locked – Node is not operational
- 417 Expectation Failed – Image status is not OK
- 428 – Image server is not available
- ImageAdmin -
-
DELETE
/image/
(name)¶ Note
A server disk image cannot be deleted when it is used by even one virtual server. In order to disable further use of such a disk image, the image can be marked as deleted by
changing its access property to deleted (4)
.DC-bound?: Permissions: - ImageAdmin -
dc_bound=true
- SuperAdmin -
dc_bound=false
Asynchronous?: Parameters: - name (string) – required - Server disk image name
Status Codes: - 200 OK – SUCCESS
- 201 Created – PENDING
- 400 Bad Request – FAILURE
- 403 Forbidden – Forbidden
- 404 Not Found – Image not found
- 423 Locked – Node is not operational
- 417 Expectation Failed – Image status is not OK
- 428 – Image is used by some VMs / Image server is not available
- ImageAdmin -
-
/vm/(hostname_or_uuid)/snapshot/(snapname)/image/(name)¶
-
api.image.base.views.
image_snapshot
(*args, **kwargs)¶ Create (
POST
) a server disk image from a disk snapshot.Note
A global image server (
VMS_IMAGE_VM
) must be configured in the system.-
POST
/vm/
(hostname_or_uuid)/snapshot/
(snapname)/image/
(name)¶ DC-bound?: Permissions: Asynchronous?: Parameters: - name (string) – required - Server disk image name
- hostname_or_uuid (string) – required - Server hostname or uuid
- snapname (string) – required - Snapshot name
- data.disk_id (integer) – required - Disk number/ID (default: 1)
- data.alias (string) – Short image name (default:
name
) - data.access (integer) – Access type (1 - Public, 3 - Private, 4 - Deleted) (default: 3)
- data.owner (string) – User that owns the image (default: logged in user)
- data.desc (string) – Image description
- data.version (string) – Image version (default: 1.0)
- data.resize (boolean) – Whether the image is able to resize the disk during an initial start or deploy process (default: false)
- data.deploy (boolean) – Whether the image is able to shut down the server after an initial start (default: false)
Status Codes: - 200 OK – SUCCESS
- 201 Created – PENDING
- 400 Bad Request – FAILURE
- 403 Forbidden – Forbidden
- 404 Not Found – VM not found
- 406 Not Acceptable – Image already exists
- 412 Precondition Failed – Invalid disk_id
- 423 Locked – Node is not operational / VM is not operational
- 417 Expectation Failed – Image status is not OK / VM snapshot status is not OK
- 428 – Image server is not available
-