Repository REST API

The repository API is actually a group of restful services (and URLs where data can be posted).

All the Repository Client methods that retrieve information from the repository sends XML to the Repository, and the Repository responds with XML. All deploy methods post bytes to the Repository (information encoded in URL) and the Repository return XML to acknowledge. The format of the XML sent and received is governed by a DTD found here.

Here is an example of all the XML based requests, all messages must start with the following declaration


    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE repository-request PUBLIC "-//Kapow Technologies//DTD Repository 1.3//EN" "http://www.kapowtech.com/robosuite/repository_1_3.dtd">
              


If the Management Console is deployed at http://localhost:8080/ManagementConsole, the requests must be posted to http://localhost:8080/ManagementConsole/secure/RepositoryAPI?format=xml

Method

Example request

Example response

delete-file (robot)

<repository-request> <delete-file file-type="robot" silent="true"> <project-name>Default project</project-name> <file-name>InputA.type</file-name> </delete-file> </repository-request>

<repository-response><delete-successful/></repository-response>
delete-file (type)

<repository-request> <delete-file file-type="type" silent="false"> <project-name>Default project</project-name> <file-name>InputA.type</file-name> </delete-file> </repository-request>

<repository-response><error type="file-not-found">Could not find a Type named InputA.type in project 'Default project'</error></repository-response>
delete-file (snippet)

<repository-request> <delete-file file-type="snippet" silent="true"> <project-name>Default project</project-name> <file-name>InputA.type</file-name> </delete-file> </repository-request>

<repository-response><delete-successful/></repository-response>
delete-file (resource)

<repository-request> <delete-file file-type="resource" silent="true"> <project-name>Default project</project-name> <file-name>InputA.type</file-name> </delete-file> </repository-request>

<repository-response><delete-successful/></repository-response>
get-projects

<repository-request> <get-projects/> </repository-request>

<repository-response><project-list><project-name>Default project</project-name></project-list></repository-response>
get-robots-in-project

<repository-request> <get-robots-in-project> <project-name>Default project</project-name> </get-robots-in-project> </repository-request>

<repository-response><robot-list><robot><robot-name>DoNothing.robot</robot-name><version>7.2</version><last-modified>2011-10-11 18:24:12.648</last-modified></robot></robot-list></repository-response>
get-robot-signature

<repository-request> <get-robot-signature> <project-name>Default project</project-name> <robot-name>DoNothing.robot</robot-name> </get-robot-signature> </repository-request>

<repository-response><robot-signature><robot-name>DoNothing.robot</robot-name><version>7.2</version><last-modified>2011-10-11 18:24:12.648</last-modified><input-object-list><input-object><variable-name>InputA</variable-name><type-name>InputA</type-name><input-attribute-list><input-attribute><attribute-name>aString</attribute-name><attribute-type>Short Text</attribute-type></input-attribute><input-attribute><attribute-name>anInt</attribute-name><attribute-type>Integer</attribute-type></input-attribute><input-attribute><attribute-name>aNumber</attribute-name><attribute-type>Number</attribute-type></input-attribute><input-attribute><attribute-name>aSession</attribute-name><attribute-type>Session</attribute-type></input-attribute><input-attribute><attribute-name>aBoolean</attribute-name><attribute-type>Boolean</attribute-type></input-attribute><input-attribute><attribute-name>aDate</attribute-name><attribute-type>Date</attribute-type></input-attribute><input-attribute><attribute-name>aCharacter</attribute-name><attribute-type>Character</attribute-type></input-attribute><input-attribute><attribute-name>anImage</attribute-name><attribute-type>Image</attribute-type></input-attribute></input-attribute-list></input-object><input-object><variable-name>InputB</variable-name><type-name>InputB</type-name><input-attribute-list><input-attribute required="true"><attribute-name>aString</attribute-name><attribute-type>Short Text</attribute-type></input-attribute><input-attribute required="true"><attribute-name>anInt</attribute-name><attribute-type>Integer</attribute-type></input-attribute><input-attribute required="true"><attribute-name>aNumber</attribute-name><attribute-type>Number</attribute-type></input-attribute><input-attribute required="true"><attribute-name>aSession</attribute-name><attribute-type>Session</attribute-type></input-attribute><input-attribute required="true"><attribute-name>aBoolean</attribute-name><attribute-type>Boolean</attribute-type></input-attribute><input-attribute required="true"><attribute-name>aDate</attribute-name><attribute-type>Date</attribute-type></input-attribute><input-attribute required="true"><attribute-name>aCharacter</attribute-name><attribute-type>Character</attribute-type></input-attribute><input-attribute required="true"><attribute-name>anImage</attribute-name><attribute-type>Image</attribute-type></input-attribute></input-attribute-list></input-object></input-object-list><returned-type-list><returned-type><type-name>OutputA</type-name><returned-attribute-list><returned-attribute><attribute-name>aString</attribute-name><attribute-type>Short Text</attribute-type></returned-attribute></returned-attribute-list></returned-type></returned-type-list><stored-type-list/></robot-signature></repository-response>
get-clusters

<repository-request> <get-clusters/> </repository-request>

<repository-response><clusters><cluster name="Cluster 1" ssl="false"><roboserver host="localhost" port="50000"/></cluster></clusters></repository-response>

REST operations


The deployment is done by posting the raw bytes (the octet-stream is sent as a post body) to the following URLs. Here is an example where the repository is deployed on http://localhost:8080/ManagementConsole

operation

URL

deploy robot http://localhost:8080/ManagementConsole/secure/RepositoryAPI?format=bytes&operation=deployRobot&projectName=Default project&fileName=DoNothing.robot&failIfExists=true
deploy type http://localhost:8080/ManagementConsole/secure/RepositoryAPI?format=bytes&operation=deployType&projectName=Default project&fileName=InputA.type&failIfExists=true
deploy Snippet http://localhost:8080/ManagementConsole/secure/RepositoryAPI?format=bytes&operation=deploySnippet&projectName=Default project&fileName=A.snippet&failIfExists=true
deploy resource http://localhost:8080/ManagementConsole/secure/RepositoryAPI?format=bytes&operation=deployResource&projectName=Default project&fileName=resource.txt&failIfExists=true
deploy library http://localhost:8080/ManagementConsole/secure/RepositoryAPI?format=bytes&operation=deployLibrary&projectName=Default project&fileName=NA&failIfExists=true

Methods of the deploy operations


If authentication is enabled on Management Console the URL http://localhost:8080/ManagementConsole/secure/RepositoryAPI is protected by basic authentication. This allows you to include credentials in the URL in the following manner http://username:password@localhost:8080/ManagementConsole/secure/RepositoryAPI.