Skip to content
This repository was archived by the owner on Jan 9, 2019. It is now read-only.
ahonor edited this page Sep 29, 2011 · 5 revisions

YANA provides a Web API for use with your application.

URLs

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/

XML

The API calls require XML for input and output.

Authentication

API Contents

Listing Nodes

List the Nodes

URL:

GET /nodes

Parameters:

Result:

Adding a Node

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>

Getting a Node definition.

Get information about the node.

URL:

GET /nodes/{id}

Updating a Node definition

Update a node.

URL:

POST /nodes/{id}

Deleting a Node definition.

Delete a Node.

URL:

 DELETE /nodes/{id}

/attributes

  • GET: List the externals
  • POST: Add an external

/attributes/{id}

  • GET: List the externals
  • POST: Add an external
  • DELETE: Delete an external

Clone this wiki locally