Citrix

Produktdokumentation



Ganzes Dokument herunterladen

General API Usage

Oct. 21, 2015

REST (Representational State Transfer) is an architectural style based on simple HTTP requests and responses between the client and the server. REST is used to query or change the state of objects on the server side. In REST, the server side is modelled as a set of entities where each entity is identified by a unique URL.

Note

This section provides a few examples for using the CloudBridge NITRO API. For a detailed description of all the NITRO resources, see API Reference.

Each resource also has a state on which the following operations can be performed:

  • Create. Clients can create new server-side resources on a "container" resource. You can think of container resources as folders, and child resources as files or subfolders. The calling client provides the state for the resource to be created. The state can be specified in the request by using JSON format. The HTTP method used for create requests is POST.
  • Read. Clients can retrieve the state of a resource by specifying its URL with the HTTP GET method. The response message contains the resource state, expressed in JSON format.
  • Update. You can update the state of an existing resource by specifying the URL that identifies that object and its new state in JSON, using the PUT HTTP method.
  • Delete. You can destroy a resource that exists on the server-side by using the DELETE HTTP method and the URL identifying the resource to be removed.

In addition to the above four operations, resources can support other operations or actions. These operations use the HTTP POST method, with the request body (if applicable) in JSON specifying the details of the operation.

Before going into the details of the NITRO operations, you must be aware of the following functionality:

  • Every NITRO request must be authenticated by providing the credentials in the request header. The credentials must be provided in base64 encoded format as follows:

    Authorization: Basic <base64 encoded(username:password)>

  • Resources are identified by unique identifiers. Some resources have a single key acting as unique identifier and a few resources have multiple keys forming the unique identifier.
    • For resources which have a single key acting as the unique identifier, you can get its details or delete it by providing the URL as follows:

      https://<cb_ip>/cb/nitro/v1/config/<resource>/<value_of_unique_id>

    • For resources which have multiple keys as the unique identifier, you can get its details or delete it by providing the identifiers in the URL as follows:

      https://<cb_ip>/cb/nitro/v1/config/<resource>/<unique-id1>=<value>&<unique-id2>=<value>

  • All NITRO operations are logged in the /var/log/nitro.log file on the CloudBridge appliance.
Back to Top