2.5
Table Of Contents
Procedure
1 Create a string that has the following format for the HTTP request.
Option Description
HTTP verb
POST, GET, PUT, or DELETE.
url
The URL consists of the host name and the path. The host name is the network
name of the computer that is running Data Director. The path is the path to
the Data Director API package on your computer or network.
headers
The Data Director API supports standard HTTP Accept headers as follows:
Content-type
The value of the Content-type header is
application/xml or application/json, depending on
which request format you use. Always use a Content-
type header with PUT or POST requests that include
a request body.
Accepts
The value of the Accepts header is application/xml
or application/json, depending on the return format
you require. Always use the Accepts header with
GET requests that expect a response body in return.
Authorization:
HTTP basic authentication (RFC 2617).
Location
Requests that create an object, including all
asynchronous requests, which create a task object,
return the created object's URL via this header.
what to do
Either an action or a request body. For simple boolean requests, use an action.
Otherwise, use a request body. See the VMware vFabric Data Director Call
Reference . For examples of object representations, see
http://.../datadirector/api/dataformat.
When you use HTTP GET with any of the Enumerate calls (collection URLs),
the call returns a list of URLs that contain the names of the objects in a
collection. Use HTTP GET again with each of the URLs to retrieve the data
for a specific object. All collection URLs support encoding as application/xml,
application/json, or text/plain media types.
2 Specify authentication information.
REST APIs accept HTTP basic authentication on each request, encoded with an existing Data Director
username and password credential.
3 Encode the XML or JSON request body, if needed.
4 Send the request to your Data Director HTTP server.
5 Read the response and parse the XML or JSON data within the response.
When you receive a 202 Accepted status and a URL, this is an asynchronous response and you must poll
to find out the results of the call. Use GET followed by the URL to retrieve the results of an asynchronous
response.
6 Use the data in your application.
Example: Request Body
The request body of a RoleCreate call can use XML or JSON.
VMware vFabric Data Director Programming Guide
12 VMware, Inc.