Exposed Resources Hierarchy
Remote Service Resource
Contents:
RemoteService resource offers the functionality of managing the remote services of a datacenter in a logical way.
RemoteService Data Model
| Field Name | Type | Occurs | Required | Description |
|---|---|---|---|---|
| uri | String | 1 | true | The uri where the remote service is located |
| type | Enumeration | 1 | false | The type of the remote service. It can be VIRTUAL_FACTORY, STORAGE_SYSTEM_MONITOR, VIRTUAL_SYSTEM_MONITOR, NODE_COLLECTOR, APPLIANCE_MANAGER, BPM_SERVICE and DHCP_SERVICE |
| status | String | 1 | false | The current status 0 -> Available, 1 -> Not available |
| edit | Link | 1 | false | Link to the url for editing the resource |
| configurationErrors | Errors | 1 | false | see section |
Configuration errors
Sometimes the remote services need extra configuration steps behind the scenes but the address is received correctly. If an unexpected error occurs during these configuration steps, the remote service is created properly and we return the list of problems under the element `configurationErrors`. This is a list of the same Error element that we can find when the API returns simple errors but they are included under the remote service element. This is an example of a remote service with configuration errors when we could not connect with the remote server:
<remoteService>
<type>STORAGE_SYSTEM_MONITOR</type>
<uri>http://example.com/ssm</uri>
<configurationErrors>
<error>
<code>RS-74</code>
<message>Storage monitor, we couldn't establish connection with the remote server</message>
</error>
</configurationErrors>
</remoteService>
Methods related to RemoteService Resource
Retrieve a list of RemoteServices
Synopsis: GET http://example.com/api/admin/datacenters/{$datacenterId}/remoteServices
Roles needed: "ROLE_PHYS_DC_ENUMERATE" (Check out role definitions here)
REQUEST
Request Headers: Accept.
Request Parameters: N/A.
Request Message Body: N/A.
Example Request:
% curl --verbose 'http://example.com/api/admin/datacenters/1/remoteServices' \ -X GET \ -H "Accept:application/xml" \ -u user:password > GET /api/admin/datacenters/1/remoteServices HTTP/1.1 > User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15 > Host: example.com > Content-type:application/xml > Accept:application/xml
RESPONSE
Response Message Body: List of Remote Service.
Example Response:
< HTTP/1.1 200 OK
< Content-Type: application/xml
<
<remoteServices>
<remoteService>
<id>1</id>
<type>VIRTUAL_FACTORY</type>
<uri>http://example.com/virtualfactory</uri>
<name>random_name</name>
<status>0</status>
<link rel="edit" href="http://example.com/api/datacenters/1/remoteServices/virtual_factory"/>
</remoteService>
</remoteServices>
Create a new RemoteService
Synopsis: POST http://example.com/api/admin/datacenters/{$datacenterId}/remoteServices
Roles needed: "ROLE_PHYS_DC_MANAGE" (Check out role definitions here)
REQUEST
Request Headers: Accept, Content-Type.
Request Parameters: N/A.
Request Message Body: Remote Service
Request example: Create new RemoteService on a Datacenter
% curl --verbose 'http://example.com/api/admin/datacenters/1/remoteServices' \ -X "POST" \ -H "Content-type:application/xml" \ -H "Accept:application/xml" \ -d '<remoteService> <type>STORAGE_SYSTEM_MONITOR</type> <uri>http://example.com/ssm</uri> </remoteService>' \ -u user:password > POST /api/admin/datacenters/1/remoteServices HTTP/1.1 > User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15 > Host: example.com > Content-type:application/xml > Accept:application/xml <remoteService> <type>STORAGE_SYSTEM_MONITOR</type> <uri>http://example.com/ssm</uri> </remoteService>
RESPONSE
Response Message Body: RemoteService.
Response example:
< HTTP/1.1 201 Created < Content-Type: application/xml < Location: http://example.com/api/datacenters/1/remoteServices/storage_system_monitor < <remoteservice> <id>2</id> <type>STORAGE_SYSTEM_MONITOR</type> <uri>http://example.com/ssm</uri> <status>0</status> <link rel="edit" href="http://example.com/api/datacenters/1/remoteServices/storage_system_monitor"/> </remoteservice>
Retrieve a RemoteService
Synopsis: GET http://example.com/api/admin/datacenters/{$datacenterId}/remoteServices/{$type}
Roles needed: "ROLE_PHYS_DC_RETRIEVE_DETAILS" (Check out role definitions here)
REQUEST
Request Headers: Accept.
Request Parameters: N/A.
Request Message Body: N/A.
Example Request: Retrieve information about a RemoteService.
% curl --verbose 'http://example.com/api/admin/datacenters/1/remoteServices/storage_system_monitor' \ -X GET \ -H "Accept:application/xml" \ -u user:password > GET /api/admin/datacenters/1/remoteservice/storage_system_monitor HTTP/1.1 > User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15 > Host: example.com > Content-type:application/xml > Accept:application/xml
RESPONSE
Response Message Body: Remote Service
Example Response:
< HTTP/1.1 200 OK < Content-Type: application/xml < <remoteService> <id>2</id> <type>STORAGE_SYSTEM_MONITOR</type> <uri>http://example.com/ssm</uri> <status>0</status> <link rel="edit" href="http://example.com/api/datacenters/1/remoteServices/storage_system_monitor"/> </remoteService>
Update an existing RemoteService
Synopsis: PUT http://example.com/api/admin/datacenters/{$datacenterId}/remoteServices/{$type}
Roles needed: "ROLE_PHYS_DC_MANAGE" (Check out role definitions here)
REQUEST
Request Headers: Accept, Content-Type
Request Parameters: N/A.
Request Message Body: Remote Service
Example Request:
% curl --verbose 'http://example.com/api/admin/datacenters/1/remoteServices/storage_system_monitor' \ -X "PUT" \ -H "Content-type:application/xml" \ -H "Accept:applcation/json" \ -d '<remoteservice> <id>2</id> <type>STORAGE_SYSTEM_MONITOR</type> <uri>http://example.com/new_path_to_ssm</uri> <status>0</status> </remoteservice>' > PUT /api/admin/datacenters/1/remoteservices/storage_system_monitor HTTP/1.1 > User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15 > Host: example.com > Content-type:application/xml > Accept:application/xml <remoteService> <id>2</id> <type>STORAGE_SYSTEM_MONITOR</type> <uri>http://example.com/new_path_to_ssm</uri> <status>0</status> </remoteService>
RESPONSE
Response Message Body: Remote Service.
< HTTP/1.1 200 OK < Content-Type: application/xml < Content-Length: 0 <
Delete a RemoteService
Synopsis: DELETE http://example.com/api/admin/datacenters/{$datacenterId}/remoteServices/{$type}
Roles needed: "ROLE_PHYS_DC_MANAGE" (Check out role definitions here)
REQUEST
Request Headers: N/A.
Request Parameters: N/A.
Request Message Body: N/A.
Example Request:
% curl --verbose 'http://example.com/api/admin/datacenters/1/remoteServices/2' \ -X "DELETE" \ -u user:password > DELETE /api/admin/datacenters/1/remoteServices/storage_system_monitor HTTP/1.1 > User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15 > Host: example.com > Content-type:application/xml > Accept:application/xml
RESPONSE
Response Message Body: N/A.
Example Response:
< HTTP/1.1 204 NO CONTENT < Server: Apache-Coyote/1.1 < Content-Type: application/xml < Content-Length: 0 < Date: Tue, 15 Dec 2009 08:06:13 GMT <
Remote services actions
Each one of the remote services defines a collection of links that represent the actions that can be performed with them. Those links have the format:
http://example.com/api/admin/datacenters/{$datacenterId}/remoteServices/{$remoteServiceType}/actions/{$actionName}
For a brief description of the remote services, see [Creating a Datacenter] in the Abiquo User's Guide.
Check the status of a RemoteService
Synopsis: GET http://example.com/api/admin/datacenters/{$datacenterId}/remoteServices/{$type}/action/check
Roles needed: "ROLE_PHYS_DC_MANAGE" (Check out role definitions here)
REQUEST
Request Headers: Accept.
Request Parameters: N/A.
Request Message Body: N/A.
Example Request: Retrieve information about a RemoteService.
% curl --verbose 'http://example.com/api/admin/datacenters/1/remoteService/storage_system_monitor/action/check' \ -X GET \ -H "Accept:application/xml" \ -u user:password > GET /api/admin/datacenters/1/remoteservices/storage_system_monitor/action/check HTTP/1.1 > User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15 > Host: example.com > Content-type:application/xml > Accept:application/xml
RESPONSE
Response Message Body:Remote Service.
Example Response: Response of the GET over a RemoteService status
< HTTP/1.1 200 OK < Content-Type: application/xml < <remoteService> <id>2</id> <type>STORAGE_SYSTEM_MONITOR</type> <uri>http://example.com/ssm</uri> <status>0</status> <link rel="edit" href="http://example.com/api/datacenters/1/remoteServices/storage_system_monitor"/> </remoteService>


Comments (1)
Aug 24, 2010
Priya Ketkar says:
There are some <remoteService> </remoteservice> inconsistencies.There are some <remoteService> </remoteservice> inconsistencies.