2.0
Table Of Contents
- VMware vFabric Data Director API Programming Guide
Making a Call 3
This section discusses the Data Director REST API requests and responses and gives you some examples.
This chapter includes the following topics:
n
“Data Director REST Requests,” on page 13
n
“API REST Response Codes,” on page 15
Data Director REST Requests
To retrieve object data, you can make HTTP requests to the Data Director API. The server returns the requested
data as XML or JSON values in response to POST, GET, PUT, or DELETE requests and the format you specify
in the HTTP header.
Creating a Request
As with most REST APIs, you perform the following steps to implement each call.
1. Create a string for the HTTP request that consists of the following format [HTTP verb][url] + [headers] +
(optional for some calls) or [Request Body].
2. Authentication. REST APIs accept HTTP Basic authentication on each request, encoded with an existing Data
Director username/password credential.
3. Use your programming language to encode the XML or JSON request body, if needed.
4. Use your language's network library (or higher level HTTP library) to send the request to your Data Director
http server.
5. Read the response using your programming language.
6. Use your programming language to parse the XML or JSON data within the response.
7. Use the data in your applications.
HTTP/REST Verbs
Each of the HTTP/REST verbs maps to one of the well-known database operations: Create, Retrieve, Update,
and Delete (CRUD); or the SQL statements: INSERT, SELECT, UPDATE, and DELETE.
Table 3-1. CRUD Operations Summary
HTTP/REST Operation SQL Statement Operation Summary
POST Create INSERT Creates a new object.
GET Retrieve SELECT Retrieves the representation of an
existing object.
VMware, Inc. 13