Operations Manager search APIs
Operations Manager includes two search APIs that support advanced functionality through query parameters.
The information on this page applies only to the /jobs and /tasks APIs.
Query parameter syntax
Operations Manager uses an object syntax to express operators and their relationship to the fields they operate on. To get all documents where a field equals a particular value, use:
This syntax allows the search API to accept multiple field conditions in a single request. For example, to get all jobs with the name Job name 1 and description Job description 1:
The API supports querying on nested properties using dotted path notation. For example, to get all tasks started after 2021-11-18:
Workflow task query parameter syntax
The /operations-manager/jobs and /operations-manager/tasks APIs can be invoked in workflows using the getJobs and getTasks workflow tasks, respectively. Query parameters are provided to these tasks in JSON object format using the queryParameters variable. To get all documents with a field equal to a particular value:
To get all jobs with the name Job name 1 and description Job description 1:
Response format
Operations Manager standardizes the top-level structure of all responses — both success and error — with the following fields:
Example response
Basic examples
To get all jobs with a name starting with Job name prefix:
API format
Workflow task format
To get the IDs and names of all jobs started after November 18, 2021 (Unix epoch time format):
API format
Workflow task format
Search operators
equals
The equals operator returns documents with a field exactly matching the specified value. Operations Manager knows the field type, so you do not need to specify whether fields should be interpreted as dates, ObjectIds, booleans, etc.
API format
Workflow task format
starts-with, ends-with, contains
These three operators return documents with a field that starts with, ends with, or contains the specified string.
For the /jobs API, the description property has special behavior when queried with contains. MongoDB text search syntax is supported, allowing efficient searching for complex expressions in the description field even as the jobs collection grows large. See the MongoDB text search documentation for details.
API format
Workflow task format
in, not-in
The in operator accepts a comma-separated list of options and returns documents with a field exactly equal to one of the specified options. For example, to get jobs with a name of Name 1, Name 2, or Name 3:
The not-in operator accepts the same format and returns documents with a field not equal to any of the specified options.
If the search value contains a comma, percent-encode it as %2C to prevent Operations Manager from treating it as a delimiter. For example, to search for jobs named Name,1 or Name,2:
API format
Workflow task format
gt, lt, gte, lte
These operators support comparison searches. Use gt for greater than, lt for less than, gte for greater than or equal to, and lte for less than or equal to.
API format
Workflow task format
?q=
The ?q= query parameter supports more complex searches than the top-level query parameters, including logical combinations with and, or, and not.
Projection parameters
Projection parameters limit the fields returned in the API response using either an inclusive list with include or an exclusive list with exclude.
When specifying an inclusive list, the _id field is implicitly included even if not specified. To exclude it, add &exclude=_id alongside the include expression.
include
The include parameter accepts a comma-delineated list of property names to include in the response.
API format
Workflow task format
Response
exclude
The exclude parameter specifies the set of properties to exclude from the response.
API format
Workflow task format
Response
Sort parameters
Sort parameters arrange query results in a specified order using ?sort=<field> and ?order=<-1|1>. Both parameters must be used together.
ordermust be-1or1sortmust be a valid field path within the queried document type
When querying /jobs, you can use:
The sort field must not be excluded from the response via projection parameters.
Pagination parameters
Use ?skip=<number> and ?limit=<number> to control the paging of results:
- Both must be numbers
limitdefaults to100andskipdefaults to0
Further reading
For more information about Operations Manager APIs, see the app-operations_manager section of the Itential API References.