This repository was archived by the owner on Jan 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
WebAPI
ahonor edited this page Sep 29, 2011
·
5 revisions
YANA provides a Web API for use with your application.
The YANA server has a "Base URL", where you access the server. Your YANA Server URL may look like: http://myserver:8080.
The root URL path for all calls to the API is:
$YANA_SERVER_URL/api/
The API calls require XML for input and output.
List the Nodes
URL:
GET /nodes
Parameters:
Result:
Add a new node.
URL:
POST /nodes
XML:
Minimal definition:
<node>
<attributes/>
<description>the 9th ubuntu</description>
<externalAttributes/>
<name>ubuntu9</name>
<osFamily>unix</osFamily>
<osName>Ubuntu</osName>
<tags/>
</node>
Bells and whistles:
<node id="7">
<attributes>
<attribute id="7">
<dataType>string</dataType>
<name>primary-interface</name>
<value>eth0</value>
</attribute>
</attributes>
<description>the 7th ubuntu</description>
<name>ubuntu7</name>
<osFamily>unix</osFamily>
<osName>ubuntu</osName>
<tags>
<tag id="9">
<name>web</name>
</tag>
<tag id="10">
<name>dev</name>
</tag>
</tags>
<externalAttributes>
<attributes id="1">
<external>
<externalAttribute id="3">
<dataType>string</dataType>
<name>hoho</name>
<value>501</value>
</externalAttribute>
<externalAttribute id="2">
<dataType>string</dataType>
<name>alexh</name>
<value>500</value>
</externalAttribute>
</external>
<name>users</name>
</attributes>
</externalAttributes>
</node>
Get information about the node.
URL:
GET /nodes/{id}
Update a node.
URL:
POST /nodes/{id}
Delete a Node.
URL:
DELETE /nodes/{id}
- GET: List the externals
- POST: Add an external
- GET: List the externals
- POST: Add an external
- DELETE: Delete an external