Skip to end of metadata
Go to start of metadata

Base Path: /api/<version>

User Management

ResourceMethodparametersDescriptionImplemented

Related Permission

Payload example
/usersGET Lists all usersyescloud->users->list 
 POSTuser, passwordCreates a new useryescloud->users->create 
/users/<uuid>GET Returns the useryesusers->ID->get{"password": "secret"}
 PUTpasswordChanges a passwordyesusers->ID->passwd{"password": "secret"}
 DELETE Deletes the useryesusers->ID->delete 
/users/<uuid>/permissionsGET Lists permissionsyesusers->ID->get 
/users/<uuid>/permissions/<permission>PUT Grants permissionyes

users->ID->grant &
permissions->PERMISSION->grant

 
 DELETE Revokes permissionyesusers->ID->revoke &
permissions->PERMISSION->revoke
 
/users/<uuid>/groupsGET Lists groupsyesusers->ID->get 
/users/<uuid>/groups/<group>PUT Joins groupyesusers->ID->join &
groups->ID->join 
 
/users/<uuid>/groups/<group>DELETE Leaves groupyes

users->UUID->edit &
groups->ID->edit

 
/users/<uuid>/keysGET Lists all install keysyesusers->UUID->get[{"some@key.id":"ssh-ras ... some@key.id"}]
 PUT<keyid>=<key>Adds a new SSH keyyesusers->UUID->edit{"some@key.id":"ssh-ras ... some@key.id"}
/users/<uuid>/keys/<keyid>DELETE Deletes a keyyesusers->UUID->edit 
/users/<uuid>/yubikeysGET Lists all install keysyesusers->UUID->get["<key id>", "<key id 2>", ...]
 PUT"otp"=<key>Adds a new SSH keyyesusers->UUID->edit{"otp":"some_opt_code"}
/users/<uuid>/yubikeys/<keyid>DELETE Deletes a keyyesusers->UUID->edit 
/users/<uuid>/orgsGET Lists user orgsyesusers->ID->get 
/users/<uuid>/orgs/<org>PUT{"active":"true"}Joins an org (optionally sets it to active)yesusers->ID->join &
groups->ID->join 
 
/users/<uuid>/metadata[/...]PUTany one key value pairSets a metadata keyyesusers->UUID->edit{"key": 42}
 DELETE Removes a key from the metadatayesusers->UUID->edit 
/sessionsPOSTuser, password, [otp]Tries to log inyes {"user":"test", "password":"test"}
/sessions/<session id>GET Tests for valid sessionyes  
/groupsGET Lists groupsyescloud->groups->list 
 POSTnameCreates a new groupyescloud->groups->create{"name":"group name"}
/groups/<uuid>PUT Creates a new groupyesgroups->ID->create 
 GET Returns a groupyesgroups->ID->get 
 DELETE Deletes a groupyesgroups->ID->delete 
/groups/<uuid>/permissionsGET Lists permissionsyesgroups->ID->get 
/groups/<uuid>/permissions/<permission>PUT Grants permissionyesgroups->ID->grant &
permissions->PERMISSION->grant
 
 DELETE Revokes permissionyesgroups->ID->revoke &
permissions->PERMISSION->revoke
 
/groups/<uuid>/metadata[/...]PUTany one key value pairSets a metadata keyyesgroups->UUID->edit{"key": 42}
 DELETE Removes a key from the metadatayesgroups->UUID->edit 
/orgsGET Lists all organisationsyescloud->orgs->list 
 POSTnameCreates a new orgyescloud->orgs->create 
/orgs/<uuid>GET Returns an organizationyesorgs->UUID->get 
 DELETE Deletes an organizationyesorgs->UUID->delete 
/orgs/<uuid>/triggersGET Lists the org triggersyesorgs->UUID->get 
/orgs/<uuid>/triggers/<group>/<permission .../...>PUT Adds a new org triggeryesorgs->UUID->edit && groups->GROUP->grant 
 DELETE Deletes an org triggeryesorgs->UUID->edit 
/orgs/<uuid>/metadata[/...]PUTany one key value pairSets a metadata keyyesorg->UUID->edit{"key": 42}
 DELETE Removes a key from the metadatayesorg->UUID->edit 

 

Cloud Management

ResourceMethodparametersDescriptionImplemented

Related Permission

Payload example
/cloudGET Returns the cloud statusyescloud 
/cloud/connectionGET Returns wiggle connection statusyesnot needed{"sniffle": 1, "howl": 1, "snarl":1}
/hypervisorsGET Returns all hypervisorsyescloud->hypervisors->list 
/hypervisors/<uuid>GET Returns hypervisor detailsyeshypervisors->UUID->get 
/hypervisors/<uuid>/configPUTaliasSets hypervisor configyeshypervisors->UUID->edit{"alias": "fritz"}
/hypervisors/<uuid>/metadata[/...]PUTany one key value pairSets a metadata keyyeshypervisors->UUID->edit{"key": 42}
/hypervisors/<uuid>/metadata/...DELETE Removes a key from the metadatayeshypervisors->UUID->edit 
/hypervisors/<uuid>/characteristics[/...]PUTany one key value pair

Sets a characteristics key (characteristics are
used to describe capabilities of the hypervisor
for the selection process)

yeshypervisors->UUID->edit{"key": 42}
/hypervisors/<uuid>/characteristics/...DELETE Removes a key from the hypervisors characteristicsyeshypervisors->UUID->edit 
/vmsGET Returns all VMsyescloud->vms->list 
 POSTdataset,package,config=[{networks: {nic: network...}}]Creates a new VMyescloud->vms->create

{"dataset":"60a3b1fa-0674-11e2-abf5-cb82934a8e24",
"package":"small",
"config": {"networks": {"net0": "network-uuid-thingy"}}}

/vms/<uuid>GET Returns a VM's stateyesvms->UUID->get 
 PUT

action:start/stop/reboot

Initiates a VM state changeyesvms->UUID->state{"action": "start", ["force": true]}
 PUTconfig, packageUpdates the config/package for a vMyesvms->UUID->edit{"package":"
60a3b1fa-0674-11e2-abf5-cb82934a8e24", "config":{"alias":"bla"}}
 DELETE Deletes a VMyesvms->UUID->delete 
 DELETE[location=hypervisor]Deletes a VM from the hypervisoryesvms->UUID->delete {"location":"hypervisor"}
/vms/<uuid>/ownerPUTorgChanges the owner of a VMyes

vms->UUID->edit

orgs->UUID->edit

{"org":"60a3b1fa-0674-11e2-abf5-cb82934a8e24"}
/vms/<uuid>/nicsPOSTnetworkAdds a new interface to a VMyesvms->UUID->edit{"network": "60a3b1fa-0674-11e2-abf5-cb82934a8e24"}
/vms/<uuid>/nics/<mac>PUTprimary:trueSets an interface as the primary interfaceyesvms->UUID->edit{"primary": true}
 DELETE Removes a nic from the VMyesvms->UUID->edit 
/vms/<uuid>/snapshotsGET Lists all snapshotsyesvms->UUID->get[{"comment":"snapshot","timestamp":1358218710837992}]
 POSTcommentCreates a new snapshotyesvms->UUID->snapshot{"comment":"snapshot"}
/vms/<uuid>/snapshots/<id>GET Returns a snapshotyesvms->UUID->snapshot 
 PUTaction=rollbackRolls back a snapshotyesvms->UUID->rollback{"action":"rollback"}
 DELETE Deletes a snapshotyesvms->UUID->snapshot_delete 
/vms/<uuid>/backupsGET Lists all backupsyesvms->UUID->get[{"comment":"snapshot","timestamp":1358218710837992}]
 POSTcomment, [delete, parent]Creates a new backupyesvms->UUID->backup[{"comment":"inc","parent":"60a3b1fa-0674-11e2-abf5-cb82934a8e24", "delete":false}]
/vms/<uuid>/backups/<id>GET gets the information about the snapshotyesvms->UUID->get 
 PUTaction, hypervisorrestores a backupyesvms->UUID->rollback{"action":"rollback"}
 DELETE deletes a snapshotyesvms->UUID->snapshot_delete 
/vms/<uuid>/metadata[/...]PUTany one key value pairSets a metadata keyyesvms->UUID->edit{"key": 42}
/vms/<uuid>/metadata/...DELETE Removes a key from the metadatayesvms->UUID->edit 
/vms/<uuid>/servicesGET Lists the services of a zoneyesvms->UUID->get{"service":"state"}
 PUT Changes state of a serviceyesvms->UUID->edit
{"action":"enable|disable|clear", "service":"svc:/some/service"}
/networksGET Lists all networksyescloud->networks->list 
 POSTnameCreate a new networkyescloud->networks->create{"name": "some network"}
/networks/<uuid>GET Returns a networkyesnetworks->UUID->get 
 DELETE Deletes a networkyesnetworks->UUID->delete 
/networks/<uuid>/ipranges/<iprange>PUT Adds an iprangeyesnetworks->UUID->edit 
 DELETE Removes an iprangeyesnetworks->UUID->edit 
/networks/<uuid>/metadata[/...]PUTany one key value pairSets a metadata keyyesnetworks->UUID->edit{"key": 42}
 DELETE Removes a key from the metadatayesnetworks->UUID->edit 
/iprangesGET Lists all IP Rangesyescloud->ipranges->list 
 POSTname, network, gateway, netmask, first, last, tag, vlanCreates/updates an IPrangeyescloud->ipranges->create

{"network":"192.168.0.0",
"gateway":"192.168.0.1",
"netmask":"255.255.255.0",
"first": "192.168.0.100",
"last": "192.168.0.200",
"tag": "admin",
"vlan": 1}

/ipranges/<uuid>GET Returns the details of an iprangeyesipranges->NAME->get 
 DELETE Deletes an IP rangeyesipranges->NAME->delete 
 POST Obtains an IPpostponed  
/ipranges/<uuid>/<ip>DELETE Releases an IPpostponed  
/ipranges/<uuid>/metadata[/...]PUTany one key value pairSets a metadata keyyesipranges->UUID->edit{"key": 42}
/ipranges/<uuid>/metadata/...DELETE Removes a key from the metadatayesipranges->UUID->edit 
/datasetsGET List all datasetsyescloud->datasets->list 
 POSTurlImports a dataset from a dsapi endpointyescloud->dataset->import{"url": "https://datasets.joint.com/datasets/aaa-bbb-ccc"}
/datasets/<uuid>GET Returns a datasetyesdatasets->UUID->get 
 PUTany one key value pairChanges dataset parametersyesdatasets->UUID->edit{"key": 42}
 POSTdataset manifestimports a manifestyesdatasets->UUID->create 
 DELETE Deletes a dataset (given it's not used anywhere)yesdatasets->UUID->delete 
/datasets/<uuid>/dataset.gzGETdownloads a datasetExports the binary datasetyesdatasets->UUID->export 
 PUTdataset binaryImports the binary part of a datasetyesdatasets->UUID->create 
/datasets/<uuid>/metadata[/...]PUTany one key value pairSets a metadata keyyesdatasets->UUID->edit{"key": 42}
/datasets/<uuid>/metadata/...DELETE Removes a key from the metadatayesdatasets->UUID->edit 
/packagesGET Lists packagesyescloud->packages->list 
 POSTname, ram, quota, cpu_cap, requirementsCreates/updates a packageyescloud->packages->create{"ram": 1024, "quota":10, "cpu_cap": 100}
/packages/<uuid>GET Gets package detailsyespackages->UUID->get 
 DELETE Deletes a packageyespackages->UUID->delete 
/packages/<uuid>/metadata[/...]PUTany one key value pairSets a metadata keyyespackages->UUID->edit{"key": 42}
/packages/<uuid>/metadata/...DELETE Removes a key from the metadatayespackages->UUID->edit 
/dtraceGET List all dtrace scriptsyescloud->dtraces->list 
 POSTname, script, configCreate a dtrace scriptyescloud->dtraces->create{"name": "ex", "script": "...", "config":{"start":0 ...}}
/dtrace/<uuid>GET Returns a specific dtrace scriptyesdtraces->UUID->get 
 DELETE Delete a dtrace scriptyesdtrace->UUID->delete 
 PUT Create a dtrace scriptnodtrace->UUID->edit 
/dtrace/<uuid>/metadata[/...]PUTany one key value pairSets a metadata keyyesdtrace->UUID->edit{"key": 42}
/dtrace/<uuid>/metadata/...DELETE Removes a key from the metadatayesdtrace->UUID->edit 

 

Curl Example

 

  • Getting a token:

curl -i 'http://fifo/api/0.1.0/sessions'  -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*'  --data-binary '{"user":"admin","password":"admin"}' |grep x-snarl-token:

x-snarl-token: 427a6032-2bd8-45d2-923b-5ae804300620

  • Using the token:

        curl http://fifo/api/0.1.0/vms -H 'Cookie: x-snarl-token=427a6032-2bd8-45d2-923b-5ae804300620;' -H 'Accept:
    application/json, text/plain, */*'

 

 

 

 

  • No labels

3 Comments

  1. Hi,

    Would it be possible to get curl example for vm creation?

    Thanks.

  2. Sure, actually if you create a new vm with chrome, you can see the network tab, right-click on the POST request and 'copy as cUrl'.

    Here is an example:

    curl 'https://nube.betazeta.com/api/0.1.0/vms' -H 'Pragma: no-cache' -H 'Origin: https://nube.betazeta.com' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es-419,es;q=0.8,en-US;q=0.6,en;q=0.4' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' -H 'Cache-Control: no-cache' -H 'Referer: https://nube.betazeta.com/' -H 'Cookie: x-snarl-token=aede3b3f-3207-4641-916d-9ed82bf0d722; __cfduid=d862fb90c0aa49729ace220080a45fc9b1390394345612; glt_3_hdgP0L2rO6SSWd093Ic1rsieuPVhXeZwL6ltbTcR3hV0kkDonP_DYdKaIuWMPVqL=LT1_fxPyN/jr/LlUNLHOFBcuTw%3D%3D%7CUUID%3Dfb18e14daa1d4c95b2fefb0fff5c1d09; gig3pc=1; __utma=148489000.843793824.1390394242.1391005193.1391022854.24; __utmb=148489000.107.10.1391022854; __utmc=148489000; __utmz=148489000.1390823706.12.4.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); x-snarl-token=aede3b3f-3207-4641-916d-9ed82bf0d722' -H 'Connection: keep-alive' --data-binary '{"package":"a1e4a02a-30a3-4ee4-97cd-fa5273db8bdd","dataset":"c353c568-69ad-11e3-a248-db288786ea63","config":{"networks":{"net0":"8d4d8b0a-e726-4b52-9c5c-0d8a41221ff2"},"metadata":{},"alias":"my_new_vm","hostname":"my_new_vm","requirements":[],"autoboot":true}}' --compressed

  3. to clean that up a bit:

    TOKEN="something_like: aede3b3f-3207-4641-916d-9ed82bf0d722"
    curl 'https://nube.betazeta.com/api/0.1.0/vms' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json' -H "x-snarl-token:$TOKEN" --data-binary '{"package":"a1e4a02a-30a3-4ee4-97cd-fa5273db8bdd","dataset":"c353c568-69ad-11e3-a248-db288786ea63","config":{"networks":{"net0":"8d4d8b0a-e726-4b52-9c5c-0d8a41221ff2"},"metadata":{},"alias":"my_new_vm","hostname":"my_new_vm","requirements":[],"autoboot":true}}'