MNX.io Docs
Search
K

Images

An image contains the software packages that will be available on newly-provisioned instance. In the case of hardware virtual machines, the image also includes the operating system.

ListImages (GET /:login/images)

Provides a list of images available in this datacenter.
Note: Currently, Docker images are not included in this endpoint's responses. You must use docker images against the docker service for this datacenter.

Inputs

The following optional query parameters are available to filter the list of images:
Field
Type
Description
name
String
The "friendly" name for this image
os
String
The underlying operating system for this image
version
String
The version for this image
public
Boolean
Filter public/private images
state
String
Filter on image state. By default only active images are shown. Use ?state=all to list all images
owner
String
Filter on owner UUID
type
String
Filter on image type. The types changed in v8.0.0

Returns

An array of images. Image objects include the following fields:
Field
Type
Description
id
UUID
Unique id for this image
name
String
The "friendly" name for this image
os
String
The underlying operating system for this image
version
String
The version for this image
type
String
What kind of image this is. The values differ after v8.0.0+
requirements
Object
Contains a grouping of various minimum requirements for provisioning an instance with this image. For example 'password' indicates that a password must be provided
requirements.max_ram
String
Indicates the maximum RAM requirement that must be provided in the VM manifest to provision a VM based on this image.
requirements.max_memory
String
Indicates the maximum RAM requirement that must be provided in the VM manifest to provision a VM based on this image.
requirements.min_ram
String
Indicates the minimum RAM requirement that must be provided in the VM manifest to provision a VM based on this image.
requirements.min_memory
String
Indicates the minimum RAM requirement that must be provided in the VM manifest to provision a VM based on this image.
requirements.brand
String
Indicates which brand has to be used in the VM manifest to provision a VM based on this image.
homepage
String
The URL for a web page with more detailed information for this image
files
Array
An array of image files that make up each image. Currently only a single file per image is supported
files[0].compression
String
The type of file compression used for the image file. One of 'bzip2', 'gzip', 'none'
files[0].sha1
String
SHA-1 hex digest of the file content. Used for corruption checking
files[0].size
Number
File size in bytes
published_at
ISO8859 date
The time this image has been made publicly available
owner
String
The UUID of the user who owns this image
public
Boolean
Indicates if this image is publicly available
state
String
The current state of the image. One of 'active', 'unactivated', 'disabled', 'creating', 'failed'
tags
Object
An object of key/value pairs that allows clients to categorize images by any given criteria
eula
String
URL of the End User License Agreement (EULA) for the image
acl
Array
Access Control List. An array of account UUIDs given access to a private image. The field is only relevant to private images.
error
Object
If state=="failed", resulting from CreateImageFromMachine failure, then there may be an error object of the form {"code": "<string error code>", "message": "<string desc>"}
error.code
String
A CamelCase string code for this error, e.g. "PrepareImageDidNotRun". See GetImage docs for a table of error.code values
error.message
String
A short description of the image creation failure

Errors

For all possible errors, see CloudAPI HTTP Responses.
Error Code
Description
ResourceNotFound
If login does not exist

CLI Command

triton image list
or
sdc-listimages

Example Request

GET /my/images HTTP/1.1
Host: api.example.com
Authorization: Signature keyId...
Accept: application/json
Api-Version: ~8

Example Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 611
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, Api-Version, Response-Time
Access-Control-Allow-Methods: GET, HEAD, POST
Access-Control-Expose-Headers: Api-Version, Request-Id, Response-Time
Connection: Keep-Alive
Content-MD5: 9eDxMdIxc+3aED7Z3qyL8w==
Date: Thu, 21 Jan 2016 07:57:59 GMT
Server: Joyent Triton 8.0.0
Api-Version: 8.0.0
Request-Id: af34a510-c014-11e5-9c73-6767e338bf5d
Response-Time: 1506
[
{
"id": "2b683a82-a066-11e3-97ab-2faa44701c5a",
"name": "base",
"version": "13.4.0",
"os": "smartos",
"requirements": {},
"type": "zone-dataset",
"description": "A 32-bit SmartOS image with just essential packages installed. Ideal for users who are comfortable with setting up their own environment and tools.",
"files": [
{
"compression": "gzip",
"sha1": "3bebb6ae2cdb26eef20cfb30fdc4a00a059a0b7b",
"size": 110742036
}
],
"tags": {
"role": "os",
"group": "base-32"
},
"homepage": "https://docs.joyent.com/images/smartos/base",
"published_at": "2014-02-28T10:50:42Z",
"owner": "930896af-bf8c-48d4-885c-6573a94b1853",
"public": true,
"state": "active"
},
...
]

GetImage (GET /:login/images/:id)

Gets an individual image by id.

Inputs

None

Returns

Field
Type
Description
id
UUID
Unique id for this image
name
String
The "friendly" name for this image
os
String
The underlying operating system for this image
version
String
The version for this image
type
String
What kind of image this is. The values differ after v8.0.0+
requirements
Object
Contains a grouping of various minimum requirements for provisioning an instance with this image. For example 'password' indicates that a password must be provided
requirements.max_ram
String
Indicates the maximum RAM requirement that must be provided in the VM manifest to provision a VM based on this image.
requirements.max_memory
String
Indicates the maximum RAM requirement that must be provided in the VM manifest to provision a VM based on this image.
requirements.min_ram
String
Indicates the minimum RAM requirement that must be provided in the VM manifest to provision a VM based on this image.
requirements.min_memory
String
Indicates the minimum RAM requirement that must be provided in the VM manifest to provision a VM based on this image.
requirements.brand
String
Indicates which brand has to be used in the VM manifest to provision a VM based on this image.
homepage
String
The URL for a web page with more detailed information for this image
files
Array
An array of image files that make up each image. Currently only a single file per image is supported
files[0].compression
String
The type of file compression used for the image file. One of 'bzip2', 'gzip', 'none'
files[0].sha1
String
SHA-1 hex digest of the file content. Used for corruption checking
files[0].size
Number
File size in bytes
published_at
ISO8859 date
The time this image has been made publicly available
owner
String
The UUID of the user who owns this image
public
Boolean
Indicates if this image is publicly available
state
String
The current state of the image. One of 'active', 'unactivated', 'disabled', 'creating', 'failed'
tags
Object
An object of key/value pairs that allows clients to categorize images by any given criteria
eula
String
URL of the End User License Agreement (EULA) for the image
acl
Array
Access Control List. An array of account UUIDs given access to a private image. The field is only relevant to private images.
error
Object
If state=="failed", resulting from CreateImageFromMachine failure, then there may be an error object of the form {"code": "<string error code>", "message": "<string desc>"}
error.code
String
A CamelCase string code for this error, e.g. "PrepareImageDidNotRun". See GetImage docs for a table of error.code values
error.message
String
A short description of the image creation failure
Possible error.code values:
error.code
Details
PrepareImageDidNotRun
This typically means that the target harware virtual machine (e.g. Linux) has old guest tools that pre-date the image creation feature. Guest tools can be upgraded with installers at https://download.joyent.com/pub/guest-tools/. Other possibilities are: a boot time greater than the five-minute timeout, or a bug or crash in the image-preparation script
VmHasNoOrigin
Origin image data could not be found for the instance. Typically this is for an instance migrated before image creation support was added
NotSupported
Indicates an error due to functionality that isn't currently supported. One example is that custom image creation of an instance based on a custom image isn't currently supported
InternalError
A catch-all error for unexpected or internal errors

Errors

For all possible errors, see CloudAPI HTTP Responses.

CLI Command

triton image get 2b683a82-a066-11e3-97ab-2faa44701c5a
or
sdc-getimage 2b683a82-a066-11e3-97ab-2faa44701c5a
Example Request
GET /my/images/2b683a82-a066-11e3-97ab-2faa44701c5a HTTP/1.1
Host: api.example.com
Authorization: Signature keyId...
Accept: application/json
Api-Version: ~8
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 609
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, Api-Version, Response-Time
Access-Control-Allow-Methods: GET, HEAD, POST, DELETE
Access-Control-Expose-Headers: Api-Version, Request-Id, Response-Time
Connection: Keep-Alive
Content-MD5: 42n5PWY5xZP0lnjdMb7Omg==
Date: Thu, 21 Jan 2016 08:00:09 GMT
Server: Joyent Triton 8.0.0
Api-Version: 8.0.0
Request-Id: fd5679d0-c014-11e5-a8f8-951890fd520a
Response-Time: 876
{
"id": "2b683a82-a066-11e3-97ab-2faa44701c5a",
"name": "base",
"version": "13.4.0",
"os": "smartos",
"requirements": {},
"type": "zone-dataset",
"description": "A 32-bit SmartOS image with just essential packages installed. Ideal for users who are comfortable with setting up their own environment and tools.",
"files": [
{
"compression": "gzip",
"sha1": "3bebb6ae2cdb26eef20cfb30fdc4a00a059a0b7b",
"size": 110742036
}
],
"tags": {
"role": "os",
"group": "base-32"
},
"homepage": "https://docs.joyent.com/images/smartos/base",
"published_at": "2014-02-28T10:50:42Z",
"owner": "930896af-bf8c-48d4-885c-6573a94b1853",
"public": true,
"state": "active"
}

DeleteImage (DELETE /:login/images/:id)

Delete an image. Caller must be the owner of the image to delete it.

Inputs

None

Returns

Responds with HTTP 204 'No Content'.

Errors

For all possible errors, see CloudAPI HTTP Responses.
Error Code
Description
ResourceNotFound
If :login or :id does not exist

CLI Command

triton image delete 2b683a82-a066-11e3-97ab-2faa44701c5a
or
sdc-deleteimage 2b683a82-a066-11e3-97ab-2faa44701c5a
Example Request
DELETE /my/images/2b683a82-a066-11e3-97ab-2faa44701c5a HTTP/1.1
Authorization: ...
Host: api.example.com
Accept: application/json
Api-Version: ~8
Example Response
HTTP/1.1 204 No Content
Content-Type: application/json
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, Api-Version, Response-Time
Access-Control-Allow-Methods: GET, HEAD, POST, DELETE
Access-Control-Expose-Headers: Api-Version, Request-Id, Response-Time
Connection: Keep-Alive
Content-MD5: 83MuHssrpOMWvPXLB9stgg==
Date: Thu, 21 Jan 2016 08:02:08 GMT
Server: Joyent Triton 8.0.0
Api-Version: 8.0.0
Request-Id: 440f5590-c015-11e5-b5f9-2b49303f7fc4
Response-Time: 1262

ExportImage (POST /:login/images/:id?action=export)

Exports an image to the specified Manta path. Caller must be the owner of the image, and the correspondent Manta path prefix, in order to export it. Both the image manifest and the image file will be exported, and their filenames will default to the following format when the specified manta path is a directory:
<manta_path>/NAME-VER.imgmanifest
<manta_path>/NAME-VER.zfs.FILE-EXT
Where NAME is the image name and VER is the image version. FILE-EXT is the file extension of the image file. As an example, exporting a foo-1.0.0 image to /user/stor/cloudapi would result in the following files being exported:
/user/stor/cloudapi/foo-1.0.0.imgmanifest
/user/stor/cloudapi/foo-1.0.0.zfs.gz
By contrast, if the basename of the given prefix is not a directory, then "MANTA_PATH.imgmanifest" and "MANTA_PATH.zfs[.EXT]" are created. As an example, the following shows how to export foo-1.0.0 with a custom name:
/my/images/<uuid>?action=export&manta_path=/user/stor/my-image
/user/stor/my-image.imgmanifest
/user/stor/my-image.zfs.gz

Inputs

Field
Type
Description
manta_path
String
Manta path prefix used when exporting the image

Returns

A Manta location response object. It provides the properties that allow a CloudAPI user to retrieve the image file and manifest from Manta: manta_url, image_path, manifest_path.

Errors

For all possible errors, see CloudAPI HTTP Responses.
Error Code
Description
ResourceNotFound
If :login or :id does not exist

CLI Command

sdc-exportimage --mantaPath=/user/stor/my-image 0c428eb9-7f03-4bb0-ac9f-c0718945d604
Example Request
POST /my/images/e42f8c84-bbea-11e2-b920-078fab2aab1f?action=export&manta_path=/user/stor/my-image HTTP/1.1
Authorization: ...
Host: api.example.com
Accept: application/json
Api-Version: ~8
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 150
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, Api-Version, Response-Time
Access-Control-Allow-Methods: GET, HEAD, POST, DELETE
Access-Control-Expose-Headers: Api-Version, Request-Id, Response-Time
Connection: Keep-Alive
Content-MD5: qSUhN+dwdJKEFlcyrUdBiw==
Date: Thu, 21 Jan 2016 08:00:09 GMT
Server: Joyent Triton 8.0.0
Api-Version: 8.0.0
Request-Id: 8180ad80-14ef-11e3-a62d-89e8106c294e
Response-Time: 670
{
"manta_url": "https://us-east.manta.joyent.com",
"image_path": "/user/stor/my-image.zfs.gz",
"manifest_path": "/user/stor/my-image.imgmanifest"
}

CreateImageFromMachine (POST /:login/images)

Create a new custom image from an instance. The typical process is:
  1. 1.
    Customize an instance the way you want it.
  2. 2.
    Call this endpoint (CreateImageFromMachine) to create a new image.
  3. 3.
    Repeat from step 1 if more customizations are desired with different images.
  4. 4.
    Use the new image(s) for provisioning via CreateMachine.

Inputs

All inputs except machine are image manifest fields as defined by the IMGAPI docs. Note that not all fields listed there can be specified here.
Field
Type
Required?
Description
machine
UUID
Yes
The prepared and stopped instance UUID from which the image is to be created
name
String
Yes
The name of the custom image, e.g. "my-image". See the IMGAPI docs for details
version
String
Yes
The version of the custom image, e.g. "1.0.0". See the IMGAPI docs for details
description
String
No
The image description
homepage
String
No
The image homepage
eula
String
No
The image eula
acl
String
No
The image acl
tags
String
No
The image tags

Returns

Field
Type
Description
id
UUID
Unique id for this image
name
String
The "friendly" name for this image
os
String
The underlying operating system for this image
version
String
The version for this image
type
String
What kind of image this is. The values differ after v8.0.0+
requirements
Object
Contains a grouping of various minimum requirements for provisioning an instance with this image. For example 'password' indicates that a password must be provided
homepage
String
The URL for a web page with more detailed information for this image
files
Array
An array of image files that make up each image. Currently only a single file per image is supported
files[0].compression
String
The type of file compression used for the image file. One of 'bzip2', 'gzip', 'none'
files[0].sha1
String
SHA-1 hex digest of the file content. Used for corruption checking
files[0].size
Number
File size in bytes
published_at
ISO8859 date
The time this image has been made publicly available
owner
String
The UUID of the user who owns this image
public
Boolean
Indicates if this image is publicly available
state
String
The current state of the image. One of 'active', 'unactivated', 'disabled', 'creating', 'failed'
tags
Object
An object of key/value pairs that allows clients to categorize images by any given criteria
eula
String
URL of the End User License Agreement (EULA) for the image
acl
Array
Access Control List. An array of account UUIDs given access to a private image. The field is only relevant to private images

Errors

For general errors, see CloudAPI HTTP Responses. Some typical and specific errors for this endpoint:
Error Code
Description
InsufficientServerVersionError
The machine given is running on a server that is too old
NotAvailable
Typically this indicates that image creation is not supported for the OS of the given hardware virtual machine

Example CLI Command

triton image create a44f2b9b-e7af-f548-b0ba-4d9270423f1a my-custom-image 1.0.0
or
sdc-createimagefrommachine --machine=a44f2b9b-e7af-f548-b0ba-4d9270423f1a --name=my-custom-image --imageVersion=1.0.0
Example HTTP Request
POST /my/images HTTP/1.1
Authorization: ...
Host: api.example.com
Accept: application/json
Api-Version: ~8
{
"machine": "a44f2b9b-e7af-f548-b0ba-4d9270423f1a",
"name": "my-custom-image",
"version": "1.0.0"
}
Example HTTP Response
HTTP/1.1 201 Created
x-joyent-jobid: 0b30ef20-d622-436a-9c30-7376ba7d904c
Location: /admin/images/b87616a2-7a49-4e02-a71d-2e0ce5a2f037
Content-Type: application/json
Content-Length: 125
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, Api-Version, Response-Time
Access-Control-Allow-Methods: GET, HEAD, POST
Access-Control-Expose-Headers: Api-Version, Request-Id, Response-Time
Connection: Keep-Alive
Content-MD5: 2sEZ45LmhRiretMPn5sqVA==
Date: Thu, 21 Jan 2016 08:00:09 GMT
Server: Joyent Triton 8.0.0
Api-Version: 8.0.0
Request-Id: 88af23b0-f952-11e2-8f2c-fff0ec35f4ce
Response-Time: 160
{
"id": "62306cd7-7b8a-c5dd-d44e-8491c83b9974",
"name": "my-custom-image",
"version": "1.2.3",
"requirements": {},
"owner": "47034e57-42d1-0342-b302-00db733e8c8a",
"public": false,
"state": "creating"
}

ImportImageFromDatacenter (POST /:login/images?action=import-from-datacenter)

This will copy the image with id from the source datacenter into this datacenter. The copied image will retain all fields (e.g. id, published_at) as the original image. All incremental images in the origin chain will also be copied.
You can use triton datacenters to view the list of datacenter names in the current cloud.

Inputs

The following query parameters are required, these parameters will be used to identify the image to be copied.
Field
Type
Description
datacenter
String
The datacenter name from where the image will be copied from.
id
UUID
The id of the image to be copied.

Returns

On success, an Image object is returned. See GetImage for the fields that are returned in the image object.

Errors

For general errors, see CloudAPI HTTP Responses. Some typical and specific errors for this endpoint:
Error Code
Description
ImageUuidAlreadyExistsError
The image with id already exists in this datacenter.
UnauthorizedError
If the source image is owned by the admin.
OriginIsNotActiveError
If one of the incremental (origin) images is not activated.

Example CLI Command

triton image copy 7eed8e50-e452-428d-9131-bf056aa911bd us-west-1
Example HTTP Request
POST /my/images?action=import-from-datacenter&datacenter=us-west-1&id=7eed8e50-e452-428d-9131-bf056aa911bd HTTP/1.1
Authorization: ...
Host: api.example.com
Accept: application/json
Api-Version: ~9
{}
Example HTTP Response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 125
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, Api-Version, Response-Time
Access-Control-Allow-Methods: GET, HEAD, POST
Access-Control-Expose-Headers: Api-Version, Request-Id, Response-Time
Connection: Keep-Alive
Content-MD5: 2sEZ45LmhRiretMPn5sqVA==
Date: Thu, 21 Jan 2018 08:00:09 GMT
Server: cloudapi/9.2.0
Api-Version: 9.0.0
Request-Id: 49af23b0-f952-11e2-8f2c-fff0ec35f4ce
Response-Time: 460
{
"id": "7eed8e50-e452-428d-9131-bf056aa911bd",
"name": "myimage",
"version": "1.4.0",
"os": "smartos",
"requirements": {},
"type": "zone-dataset",
"description": "A custom image used to test stuff.",
"files": [
{
"compression": "gzip",
"sha1": "3bebb6ae2cdb26eef20cfb30fdc4a00a059a0b7b",
"size": 110742036
}
],
"published_at": "2015-02-28T10:50:42Z",
"owner": "930896af-bf8c-48d4-885c-6573a94b1853",
"public": false,
"state": "active"
}

UpdateImage (POST /:login/images/:id?action=update)

Updates metadata about an image.

Inputs

Only the image attributes listed below can be updated.
Field
Type
Description
name
String
The name of the custom image, e.g. "my-image". See the IMGAPI docs for details
version
String
The version of the custom image, e.g. "1.0.0". See the IMGAPI docs for details
description
String
The image description
homepage
String
The image homepage
eula
String
The image eula
acl
String
The image acl
tags
String
The image tags

Returns

An updated image object.
Field
Type
Description
id
UUID
Unique id for this image
name
String
The "friendly" name for this image
os
String
The underlying operating system for this image
version
String
The version for this image
type
String
What kind of image this is. The values differ after v8.0.0+
requirements
Object
Contains a grouping of various minimum requirements for provisioning an instance with this image. For example 'password' indicates that a password must be provided
homepage
String
The URL for a web page with more detailed information for this image
files
Array
An array of image files that make up each image. Currently only a single file per image is supported
files[0].compression
String
The type of file compression used for the image file. One of 'bzip2', 'gzip', 'none'
files[0].sha1
String
SHA-1 hex digest of the file content. Used for corruption checking
files[0].size
Number
File size in bytes
published_at
ISO8859 date
The time this image has been made publicly available
owner
String
The UUID of the user who owns this image
public
Boolean
Indicates if this image is publicly available
state
String
The current state of the image. One of 'active', 'unactivated', 'disabled', 'creating', 'failed'
tags
Object
An object of key/value pairs that allows clients to categorize images by any given criteria
eula
String
URL of the End User License Agreement (EULA) for the image
acl
Array
Access Control List. An array of account UUIDs given access to a private image. The field is only relevant to private images

Errors

For general errors, see CloudAPI HTTP Responses. Some typical and specific errors for this endpoint:
Error Code
Description
ResourceNotFound
If :login or :id does not exist

Example CLI Command

sdc-updateimage --name=my-renamed-image eca995fe-b904-11e3-b05a-83a4899322dc
Example HTTP Request
POST /my/images/eca995fe-b904-11e3-b05a-83a4899322dc?action=update HTTP/1.1
Authorization: ...
Host: api.example.com
Accept: application/json
Api-Version: ~8
{
"name": "my-renamed-image&qu