CAPM OpenAPI: Query Syntax Options (rel: 2.4)

Document created by jason_normandin Employee on Jan 14, 2015Last modified by SamCreek on Dec 17, 2016
Version 5Show Document
  • View in full screen mode

Standard Parameters:

 

$metadata


Possible values: N/A

Default: N/A

Provides the Odata schema definition for the target system. This includes the definition of all schema entities and attributes as well as the relationships between the entities.


Example: To view the schema diagram

Load the $metadata file into an Odata schema explorer (such as XOData: http://pragmatiqa.com/xodata/) and Filter the display to view the specific attributes and relationships of a specific entity.

 

/odata/api/<entity>


Possible values: See schema

Default: N/A

Represents the primary entity (end-point in REST implementations) from which the data set will be derived. This includes not only the direct attributes of the specific entity but the attributes of all schema related entities


Example: To see all routers:

/odata/api/routers

 

$expand


Possible values: See schema

Default: none

Defines the related schema objects (‘1 to many’ and ‘many to 1’ relationships) that will be included in the results set. Entities defined in the filter statement are not required for inclusion in the expand clause. Entities defined in the “select” clause require explicate inclusion in the expand clause.


Example: To include all interfaces of the routers

/odata/api/routers?$expand=interfaces

 

$select


Possible values: Columns for the primary or related entities

Default: All columns

Defines the columns (item attributes or metrics) to be returned in the results set. Inclusion of any schema related entities must also be included in the expand clause.


Example: To include the ID and Name of the Router as well as the ID, Name, and Description of the interfaces in the results set:

/odata/api/routers?$expand=interfaces, routersmfs&$select=ID, Name, interfaces/ID, interfaces/Name, interfaces/Description

 

$filter


Possible values: N/A

Default: N/A

Defines the condition to which the data must comply to be included in the results set. This includes the ability to filter against any attribute of the primary entity as well as any schema related entities

 

Example to limit the interfaces returned to Gigabit or higher on routers with an IP beginning with 10.0.1 and SpeedIn greater than 1 gigabit:

/odata/api/routers?$expand=interfaces&$select=ID, Name, interfaces/ID, interfaces/Name, interfaces/Description&$filter=startswith(PrimaryIPAddress,'10.0.1') eq true and interfaces/SpeedIn ge 1000000000

 

$orderby


Possible values: N/A

Default: N/A

Defines the order by column and sort order type (asc|desc)


Example: To sort the results by Router Name in ascending order:

/odata/api/routers?$expand=interfaces&$select=ID, Name, interfaces/ID, interfaces/Name, interfaces/Description&$filter=startswith(PrimaryIPAddress,'10.0.1') eq true and interfaces/SpeedIn ge 1000000000&$sort=Name asc

 

$top


Possible values: 1 to MAX (controlled via maxTopLimit parameter)

Default: 50 (controlled via defaultTopLimit parameter)

Maximum number of primary rows returned (does not control the number of expand rows). When used with “sort” and “pagesize” a user can page through large results sets to minimize impact to client


Example to limit the number of routers returned to 10:

/odata/api/routers?$expand=interfaces&$select=ID, Name, interfaces/ID, interfaces/Name, interfaces/Description&$filter=startswith(PrimaryIPAddress,'10.0.1') eq true and interfaces/SpeedIn ge 1000000000&$top=10

 

$skip


Possible values: N/A

Default: N/A

Controls the offset of the results count by “skipping” the specified number of results


Example to skip the 1st 10 devices:

/odata/api/routers?$expand=interfaces&$select=ID, Name, interfaces/ID, interfaces/Name, interfaces/Description&$filter=startswith(PrimaryIPAddress,'10.0.1') eq true and interfaces/SpeedIn ge 1000000000&$top=10&$skip=10

 

$format


Possible values: ATOM, JSON, XML

Default: XML

Defines the OData output format. Current options: XML (default), JSON, and ATOM


Example to return the output in JSON format:

/odata/api/routers?$expand=interfaces&$select=ID, Name, interfaces/ID, interfaces/Name, interfaces/Description&$filter=startswith(PrimaryIPAddress,'10.0.1') eq true and interfaces/SpeedIn ge 1000000000&$top=10&$format=json

 

Custom Parameters


Note: Custom parameters do not include the "$" character prefix

 

top


Possible values: 1 to 100,000 (controlled by maxTopLimit parameter)

Default: 100 (controlled by expandTopLimit parameter)

Maximum number of secondary (expanded) rows returned (does not control the number of the primary entity rows).


Example to define the max number of interfaces included at 50:

/odata/api/routers?$expand=interfaces&$select=ID, Name, interfaces/ID, interfaces/Name, interfaces/Description&$filter=startswith(PrimaryIPAddress,'10.0.1') eq true and interfaces/SpeedIn ge 1000000000&$top=10&$format=json&top=50

 

starttime


Possible values: 10 digit UNIX EPOCH time value

Default: N/A

The UTC Unix Epoch start time of the data set. Equates to a filter on the “Timestamp” column of the metric.

 

endtime


Possible values: 10 digit UNIX EPOCH time value

Default: N/A

The UTC Unix Epoch stop time of the data sent. Equates to a filter on the “Timestamp” column of the metric

 

resolution


Possible values: 300 (as-polled), 3600 (hourly), 86400 (daily)

Default: 300

Defines the data resolution to be included in the results set.

Attachments

    Outcomes