Packages

Packages are named collections of resources to describe the dimensions of either a container or a hardware virtual machine. These resources include (but are not limited to) RAM, DISK & CPU caps.

ListPackages (GET /:login/packages)

Provides a list of packages available in this datacenter.

Inputs

  • The following are all optional inputs:

Field

Type

Description

name

String

The "friendly" name for this package

memory

Number

How much memory will by available (in MiB)

disk

Number

How much disk space will be available (in MiB)

swap

Number

How much swap space will be available (in MiB)

lwps

Number

Maximum number of light-weight processes (threads) allowed

vcpus

Number

Number of vCPUs for this package

version

String

The version of this package

group

String

The group this package belongs to

flexible_disk

Boolean

Whether this is a flexible_disk package

When any values are provided for one or more of the aforementioned inputs, the retrieved packages will match all of them.

When querying, wildcards (i.e. '') are allowed for string fields. For example, to list all packages with a name that starts with "foo", give "foo" as the package name.

Returns

An array of objects, of the form:

Field

Type

Description

id

UUID

Unique id for this package

name

String

The "friendly" name for this package

memory

Number

How much memory will by available (in MiB)

disk

Number

How much disk space will be available (in MiB)

swap

Number

How much swap space will be available (in MiB)

lwps

Number

Maximum number of light-weight processes (threads) allowed

vcpus

Number

Number of vCPUs for this package

version

String

The version of this package

group

String

The group this package belongs to

description

String

A human-friendly description about this package

disks

Array

The disks this package contains (Allowed when flexible_disk is true)

flexible_disk

Boolean

Whether this is a flexible_disk package (bhyve only)

default

Boolean

(deprecated) Whether this is the default package in this datacenter

Errors

For all possible errors, see CloudAPI HTTP Responses.

Error Code

Description

ResourceNotFound

If :login does not exist

CLI Command

triton package list

or

sdc-listpackages

Example Request

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

Example Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 314
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
Access-Control-Expose-Headers: Api-Version, Request-Id, Response-Time
Connection: Keep-Alive
Content-MD5: u0+0E3G28WL4Y4K8p6+pIg==
Date: Thu, 21 Jan 2016 08:33:52 GMT
Server: Joyent Triton 8.0.0
Api-Version: 8.0.0
Request-Id: b24219e0-c019-11e5-99e1-8339f3270a9f
Response-Time: 1992

[
  {
    "id": "7b17343c-94af-6266-e0e8-893a3b9993d0",
    "name": "sdc_128",
    "memory": 128,
    "disk": 12288,
    "swap": 256,
    "vcpus": 1,
    "lwps": 1000,
    "default": false,
    "version": "1.0.0"
  },
  ...
]

GetPackage (GET /:login/packages/:id)

Gets a package by name or id.

Inputs

  • None

Returns

Field

Type

Description

id

UUID

Unique id for this package

name

String

The "friendly" name for this package

memory

Number

How much memory will by available (in MiB)

disk

Number

How much disk space will be available (in MiB)

swap

Number

How much swap space will be available (in MiB)

lwps

Number

Maximum number of light-weight processes (threads) allowed

vcpus

Number

Number of vCPUs for this package

version

String

The version of this package

group

String

The group this package belongs to

description

String

A human-friendly description about this package

disks

Array

The disks this package contains (Allowed when flexible_disk is true)

flexible_disk

Boolean

Whether this is a flexible_disk package (bhyve only)

default

Boolean

(deprecated) Whether this is the default package in this datacenter

Errors

For all possible errors, see CloudAPI HTTP Responses.

Error Code

Description

ResourceNotFound

If :login or :id does not exist

CLI Command

triton package get 7b17343c-94af-6266-e0e8-893a3b9993d0

or

sdc-getpackage 7b17343c-94af-6266-e0e8-893a3b9993d0

Example Request

GET /my/packages/7b17343c-94af-6266-e0e8-893a3b9993d0 HTTP/1.1
Host: api.example.com
Authorization: ...
Accept: application/json
Api-Version: ~8

Example Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 156
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
Access-Control-Expose-Headers: Api-Version, Request-Id, Response-Time
Connection: Keep-Alive
Content-MD5: MEUpS89GsEaHBykatBp5rg==
Date: Thu, 21 Jan 2016 08:37:04 GMT
Server: Joyent Triton 8.0.0
Api-Version: 8.0.0
Request-Id: 253dd4c0-c01a-11e5-b5f9-2b49303f7fc4
Response-Time: 1482

{
  "id": "7b17343c-94af-6266-e0e8-893a3b9993d0",
  "name": "sdc_128",
  "memory": 128,
  "disk": 12288,
  "swap": 256,
  "vcpus": 1,
  "lwps": 1000,
  "default": false,
  "version": "1.0.0"
}

Last updated