GET /backends/{backend_id}/machines

List of all added machines for this backend

Example request:

GET /backends/2tK74h4mXbjjLlkjjO4SHn3/machines
Host: mist.io
Accept: application/json; charset=UTF-8

Example response:

[
   {
       "can_start": false,
       "can_reboot": true,
       "uuid": "447c23edbe944911f23145538915865ebddec230",
       "name": "i-5ebfdc59",
       "tags":
       [
           "ap-northeast-1a"
       ],
       "can_stop": true,
       "can_destroy": true,
       "extra":
       {
           "status": "running",
           "productcode":
           [
           ],
           "groups":
           [
               null
           ],
           "tags":
           {
           },
           "instanceId": "i-5ebfdc59",
           "dns_name": "ec2-173-21-215-201.ap-northeast-1.compute.amazonaws.com",
           "launchdatetime": "2014-01-13T13:58:03.000Z",
           "iam_profile": null,
           "imageId": "ami-2f61fe2e",
           "kernelid": "aki-42992843",
           "keyname": "Mykey",
           "availability": "ap-northeast-1a",
           "clienttoken": "",
           "launchindex": "0",
           "ramdiskid": null,
           "private_dns": "ip-10-153-6-20.ap-northeast-1.compute.internal",
           "instancetype": "t1.micro"
       },
       "public_ips":
       [
           "170.21.215.111"
       ],
       "private_ips":
       [
           "10.153.6.20"
       ],
       "imageId": "ami-2f61fe2e",
       "state": "running",
       "can_tag": true,
       "id": "i-5ebfdc59",
       "size": "t1.micro"
   }
]
POST /backends/{backend_id}/machines

Create machine

Example request:

POST /backends/2tK74h4mXbjjLlkjjO4SHn3/machines
Host: mist.io
Accept: application/json; charset=UTF-8

{
    "name":"WebServer 3",
    "key":"MyKey2",
    "image":"ami-2f61fe2e",
    "location":"0",
    "size":"t1.micro",
    "script":"echo `uptime` > new_file.txt",
    "image_extra":"",
    "disk":""
}
Json Parameters:
 
  • name (string) – required Name of the machine
  • key (string) – required The id of the key to be associated with the machine
  • image (string) – required Id of image to be used
  • location (string) – required Id of the location to be used
  • size (string) – required Id of size to be used
  • namerequired Bash command to be run when machine is initiated, given as a string
  • image_extra (string) – required Needed only by Linode backend, otherwise empty string
  • disk (string) – required Needed only by Linode backend, otherwise empty string

Example response:

{
   "public_ips":
   [
       "50.253.51.216"
   ],
   "extra":
   {
       "status": "running",
       "productcode":
       [
       ],
       "groups":
       [
           null
       ],
       "tags":
       {
           "Name": "WebServer 3"
       },
       "instanceId": "i-50dd7257",
       "dns_name": "ec2-50-253-51-216.ap-northeast-1.compute.amazonaws.com",
       "launchdatetime": "2014-01-15T05:37:50.000Z",
       "iam_profile": null,
       "imageId": "ami-2f61fe2e",
       "kernelid": "aki-42992843",
       "keyname": "MyKey2",
       "availability": "ap-northeast-1a",
       "clienttoken": "",
       "launchindex": "0",
       "ramdiskid": null,
       "private_dns": "ip-10-160-226-156.ap-northeast-1.compute.internal",
       "instancetype": "t1.micro"
   },
   "id": "i-50dd7257",
   "private_ips":
   [
       "10.160.226.156"
   ],
   "name": "WebServer 3"
}
POST /backends/{backend_id}/machines/{machine_id}

Machine actions like reboot, destroy, shutdown and start

Example request:

  POST /backends/2tK74h4mXbjjLlkjjO4SHn3/machines/i-50aa7257
  Host: mist.io
  Accept: application/json; charset=UTF-8

{
    "action":"reboot"
}
Json Parameters:
 
  • action (string) – required Can be reboot, shutdown, start or destroy depending on the available actions for each machine
POST /backends/{backend_id}/machines/{machine_id}/metadata

Add tags/metadata for machine

Example request:

POST /backends/2tK74h4mXbjjLlkjjO4SHn3/machines/i-50aa7257/metadata
Host: mist.io
Accept: application/json; charset=UTF-8

{
    "tag":"Backup Machine"
}
Json Parameters:
 
  • tag (string) – required Tags are used as metadata for each machine and can be handy to group machines with same tags