Child pages
  • For Developers: Developer API

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • succeeded or failed


List VMs

 

RESTful call

/listvms

Purpose

Give key information of the VMs that are not deleted

Method

GET

Input Parameter

none

Response

200:

Code Block
{	
	"vmsInfo":[
			{
				"created_at":<created_at>,
				"host":<ip>,
				"memorySize":<memorySize>,
				"numCPUs":<numCPUs>,
				"numHostCPUCores":<numHostCPUCores>,
				"numHostMemoryGB":<numHostMemoryGB>,
				"vmmode":<mode>,
				"vmid":<vmid>,
				"vmState":<state>, 
            	"type": <type>,      
                "roles": [
                	{
                    	"email": <user_email>,
                    	"full_access": <user's_full_access>,
                    	"guid": <user_guid>,
                    	"role": <"OWNER-CONTROLLER"/"OWNER"/"CONTROLLER"/"SHAREE">
                    	"tou": true
                	}
            	],
				"userEmail":null,
				"username":null
		}
	]
}


500 - internal error

List available VM images

 

RESTful call

/listimage

Purpose

list available image names

Method

GET

Response

200 - {{imagename:<image_name>}}

500 - internal error

 

...

RESTful call

/updateusertou

Purpose

Retrieve or update user's TOU parameter. This is the parameter that indicates whether the user has accepted general/per-capsule TOU agreement.

Method

POST : If vmid == null, update general tou parameter, if vmid != null, update per-capsule tou parameter

GET : Retrieve whether you has accepted general TOU agreement

Input Parameter

POST : vmId=<vmId>,tou=<true/false>

GET : username is extracted from the JWT token

Response

200 - successful completion, {tou: true/false}

400 - no user/vm is found

500 - internal error


Migrate Vm

 

RESTful call

/migratevm

Purpose

Migrate VM from one host to another host

Method

POST : Migrate VM to another host

PUT : Alter only the database entries after VM is migrated manually

Input Parameter

POST : vmId=<vmId>,host=<host>

PUT :vmId=<vmId>,host=<host>,sshport=<sshport>,vncport=<vncport>

Response

200 - successful completion

400 - no user/vm is found, invalid host name, no port resources found, invalid VM state

500 - internal error


Add VM Sharee

 

RESTful call

/addsharees

Purpose

Add a sharee to the VM by owner

Method

POST

Input Parameter

vmId=<vmId>,sharees=<[{"giud":<guid>,"email":<email>}]>,desc_shared=<reason_for_sharing_research-full_capsule>

Response

200 - successful completion

400 - no user/vm is found, permission denied, invalid sharees input, invalid VM state/mode, full-access request pending, exceeds no. of sharees limit 

500 - internal error


Remove VM Sharee

 

RESTful call

/deletesharees

Purpose

Remove a sharee/(s) from the VM by owner

Method

POST

Input Parameter

vmId=<vmId>,sharees=<guid1,guid2>

Response

200 - successful completion

400 - no user/vm is found, permission denied, invalid sharees input, invalid VM state, invalid role(should be SHAREE)

500 - internal error


Manage Controller

 

RESTful call

/managecontroller

Purpose

Owner or Controller Delegate control of VM to another sharee/ Owner revoke control of VM from the controller

Method

POST

Input Parameter

vmId=<vmId>,controller=<guid_of_sharee/controller>,action=<DELEGATE/REVOKE>

Response

200 - successful completion

400 - no user/vm is found, permission denied, invalid VM state, invalid transition of roles

500 - internal error