Send Requests

Use these guidelines when sending requests using the REST API for Oracle Communications Unified Assurance Core.

URL Structure

The URL structure for the requests is:

https://host:port/resource-path
Where:
  • host:port: Host and port where Unified Assurance is running.
  • resource-path: The path that defines the resource.

Supported Methods

You can perform basic CRUD operations (create, read, update, and delete) on a resource by using standard HTTP method requests, as summarized in the following table.

HTTP Method Description
GET Retrieve information about an object.
POST Create an object. Can also be used in some update and batch delete requests.
PUT Update an object.
DELETE Delete an object.

Media Types

The Unified Assurance REST API supports the application/json media type.

Common Query Parameters

For most GET requests, you can use the query parameters described in the table to limit the results returned. Each request described in this guide specifies which query parameters are supported.

Parameter Description Value
start The page from which the list of results that are returned should start from. Used in conjunction with the limit parameter. An integer. For example, start=2.
limit The maximum number of results to return in a single page. An integer. For example, limit=5.
query A simple string to filter the results by. This is a primitive filter, generally applied as a filter on a name parameter, but each endpoint implements it differently. A string. For example, query=myDevice.
filter The properties to filter the results by.

This parameter's value is a JSON object that specifies property names and values, the operator to use, and the conjunctions to use between the properties.

If you use multiple JSON objects to combine filters, you cannot combine OR and AND conjunctions. The conjunction used for the last object applies to the entire list.

For example, although the following uses AND in the first item, only the OR from the final item applies. This filter would return all devices in Zone 2, all devices named Device1, and all devices named Device2 .

[
 { 
  "property": "Name", 
  "operator": "eq", 
  "value": "Device1", 
  "conjunction": "AND"
 },
 {
  "property": "Zone",
  "operator": "eq",
  "value": "2"
 },
 {
  "property": "Name",
  "operator": "eq",
  "value": "Device2", 
  "conjunction": "OR"
 }
]
A JSON object in the following format:
{
  "property": "property",
  "value": "propertyValue", 
  "operator": "operator",
  "conjunction": "conjunction"
}

In the example:

  • property is the name of the property you want to filter by. For example, DeviceName.
  • propertyValue is the value of the specified property name. For example, myDevice123
  • operator is the operator to use on the property value. You can use the following:
    • For fields with text strings:
      • LIKE: SQL operator that returns all values like the one specified.
      • NOT LIKE: SQL operator that returns all values not like the one specified.
      • NOT IN: SQL operator that returns all values that don't match the list of specified values.
      • re: A regular expression comparison.
      • not re: a regular expression "not" comparison.
    • For fields with numbers:
      • eq: equal to
      • ne: not equal to
      • gt: greater than
      • lt: less than
      • gte: greater than or equal to
      • lte: less than or equal to
  • conjunction is the conjunction to use between different properties. You can use AND or OR.
sort The field and direction to sort the results by.

This parameter's value is a JSON object.

A JSON object in the following format:
{
  "property": "property",
  "direction": "direction"
}

In the example:

  • property is the property of the object being returned to sort by. For example, DeviceID.
  • direction is the direction to sort. You can use ASC or DESC.

For example, while searching for devices, you could use the following request to return five results per page, and start at the third page:

curl -X GET 'http://host:port/api/device/devices?limit=5&start=3'