Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example for setting up CLOUDAPI_SERVICES sapi metadata
> triton -p west1 services
NAME    ENDPOINT
cmon    https://cmon.us-west-1.triton.zone:9163
docker  tcp://us-west-1.docker.joyent.com:2376
> triton -p west1 services -j
{"docker":"tcp://us-west-1.docker.joyent.com:2376","cmon":"https://cmon.us-west-1.triton.zone:9163"}
> triton -p west1 services -j | json
{
  "docker": "tcp://us-west-1.docker.joyent.com:2376",
  "cmon": "https://cmon.us-west-1.triton.zone:9163"
}

All sapi metadata takes strings. When adding a json object it needs to be encoded as a string first.

[bbennett@headnode (us-west-1) ~]$ sdc-sapi /services?name=cloudapi | json -Ha metadata | grep CLOUDAPI_SERVICES
  "CLOUDAPI_SERVICES": "{\"docker\":\"tcp://us-west-1.docker.joyent.com:2376\",\"cmon\":\"https://cmon.us-west-1.triton.zone:9163\"}",
[bbennett@headnode (us-west-1) ~]$ sdc-sapi /services?name=cloudapi | json -Ha metadata.CLOUDAPI_SERVICES
{"docker":"tcp://us-west-1.docker.joyent.com:2376","cmon":"https://cmon.us-west-1.triton.zone:9163"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.