Account

You can obtain your account details and update them through CloudAPI, although login cannot be changed, and password can not be retrieved.

GetAccount (GET /:login)

Retrieves your account details. Instead of providing your login name, you can also provide 'my' (i.e. GET /my).

Inputs

  • None

Returns

Account object:

Field

Type

Description

id

UUID

Unique id for this account

login

String

Your login name

email

String

Email address

companyName

String

...

firstName

String

...

lastName

String

...

address

String

...

postalCode

String

...

city

String

...

state

String

...

country

String

...

phone

String

...

created

ISO8601 date

When this account was created

updated

ISO8601 date

When this account's details was last updated

triton_cns_enabled

Boolean

true if Triton CNS is enabled for account

Errors

For all possible errors, see CloudAPI HTTP Responses.

Error Code

Description

ResourceNotFound

If :login does not exist

CLI Command

triton account get

or

sdc-getaccount

Example Request

GET /my HTTP/1.1
authorization: Signature keyId="..."
accept: application/json
accept-version: ~8
host: api.example.com

Example Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 285
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, PUT
Access-Control-Expose-Headers: Api-Version, Request-Id, Response-Time
Connection: Keep-Alive
Content-MD5: Sz+3BJ3EKDxL3MLQQumPgg==
Date: Tue, 22 Dec 2015 05:06:33 GMT
Server: Joyent Triton 8.0.0
Api-Version: 8.0.0
Request-Id: c3d496f0-a869-11e5-8662-47ccf5717dbf
Response-Time: 2122

{
  "id": "b89d9dd3-62ce-4f6f-eb0d-f78e57d515d9",
  "login": "barbar",
  "email": "barbar@example.com",
  "companyName": "Example Inc",
  "firstName": "BarBar",
  "lastName": "Jinks",
  "phone": "123-456-7890",
  "updated": "2015-12-21T11:48:54.884Z",
  "created": "2015-12-21T11:48:54.884Z"
}

UpdateAccount (POST /:login)

Update your account details with the given parameters.

Inputs

Field

Type

Description

email

String

Email address

companyName

String

...

firstName

String

...

lastName

String

...

address

String

...

postalCode

String

...

city

String

...

state

String

...

country

String

...

phone

String

...

triton_cns_enabled

Boolean

Enable or disable the Triton CNS

Returns

Account object:

Field

Type

Description

id

UUID

Unique id for this account

login

String

Your login name

email

String

Email address

companyName

String

...

firstName

String

...

lastName

String

...

address

String

...

postalCode

String

...

city

String

...

state

String

...

country

String

...

phone

String

...

created

ISO8601 date

When this account was created

updated

ISO8601 date

When this account's details was last updated

triton_cns_enabled

Boolean

true if Triton CNS is enabled for account

Errors

For all possible errors, see CloudAPI HTTP Responses.

Error Code

Description

ResourceNotFound

If :login does not exist

CLI Command

triton account update postalCode=12345 phone='1 (234) 567 890'

or

sdc-updateaccount --postal-code=12345 --phone='1 (234) 567 890'

Example Request

POST /my HTTP/1.1
authorization: Signature keyId="...
accept: application/json
content-type: application/json
accept-version: ~8
content-length: 48
content-md5: 6kCHdE651hsI9N82TUkU/g==
host: api.example.com
connection: keep-alive

postal-code=12345&phone=1%20(234)%20567%20890

Example Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 309
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, PUT
Access-Control-Expose-Headers: Api-Version, Request-Id, Response-Time
Connection: Keep-Alive
Content-MD5: xxJ5ppNDrEyAf5VIlt4GZw==
Date: Tue, 22 Dec 2015 12:16:37 GMT
Server: Joyent Triton 8.0.0
Api-Version: 8.0.0
Request-Id: d8db9e90-a8a5-11e5-90c9-4dcf4848c834
Response-Time: 1244

{
  "id": "b89d9dd3-62ce-4f6f-eb0d-f78e57d515d9",
  "login": "barbar",
  "email": "barbar@example.com",
  "companyName": "Example Inc",
  "firstName": "BarBar",
  "lastName": "Jinks",
  "postalCode": "12345",
  "phone": "1 (234) 567 890",
  "updated": "2015-12-22T12:16:37.781Z",
  "created": "2015-12-21T11:48:54.884Z"
}

GetAccountLimits (GET /:login/limits)

When the operator has enabled the CloudAPI Provisioning Limits plugin, you can retreive your account limits and usage through this API.

See the Provisioning Limits plugin for how limits are configured and used in Triton.

Inputs

  • None

Returns

An array of provisioning limit objects. Possible values for each provisioning limit object are:

Field

Type

Description

Possible values

by

String

The type of limit. Note that "machines" means the "number of machines".

"ram", "quota", or "machines".

value

Number

The limit value. I.e. the total number of machines, total ram or total quota.

Ram is defined in terms of MiB. Quota is defined in terms of GiB.

used

Number

How much of the limit is used by existing machines.

Ram is defined in terms of MiB. Quota is defined in terms of GiB.

check

String

Optional. Restricts the limit to an image name or to an image os.

"image" or "os".

os

String

Optional. When check is set to "os", this is the Image os name this limit will be restricted to.

Usually, this will be one of windows, linux, smartos, bsd or other. See IMGAPI os values.

image

String

Optional. When check is set to "image", this is the Image name this limit will be restricted to.

Errors

For all possible errors, see CloudAPI HTTP Responses.

Error Code

Description

ResourceNotFound

If :login does not exist

Example Request

GET /my/limits HTTP/1.1
authorization: Signature keyId="..."
accept: application/json
accept-version: ~9
host: api.example.com

Example Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 285
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, PUT
Access-Control-Expose-Headers: Api-Version, Request-Id, Response-Time
Connection: Keep-Alive
Content-MD5: Sz+3BJ3EKDxL3MLQQumPgg==
Date: Tue, 01 Aug 2019 05:06:33 GMT
Server: Joyent Triton 9.8.0
Api-Version: 9.0.0
Request-Id: c3d496f0-a869-11e5-8662-47ccf5717dbf
Response-Time: 1455

[
  {
    "by": "machines",
    "value": 100,
    "used": 2
  },
  {
    "by": "ram",
    "value": 1024,
    "used": 512
  },
  {
    "check": "os",
    "os": "linux",
    "by": "quota",
    "value": 1024,
    "used": 1
  }
]

Keys

Last updated