URL
GET https://{api-url}/api/v2/tenants/{tenantId}/resources/search
Sample URLs
To retrieve all resources of the client:
https://{api-url}/api/v2/tenants/client_16/resources/search
To retrieve specific resources using query variables:
https://{api-url}/api/v2/tenants/msp_1/resources/search?pageNo=1&pageSize=3&queryString=agentInstalled:true%2Bstate:inactive
For this sample, the agent is installed and resources are in inactive state.
Notes
There are special characters that can be used in a query string:
- (+) represents the next field and must be URL-encoded.
- (:) represents equals. An example is
key : value
. - Space characters must be URL-encoded.
- Date format must be yyyy-MM-ddTHH:mm:ssZ (GMT).
Parameters
All parameters are optional:
Field | Default Value |
---|---|
pageNo={pageNo} | 1 |
pageSize={pageSize} | 100 |
isDescendingOrder={true/false} | true |
sortName={field} | id |
queryString={queryString} | NA |
includeStatus={true/false} | false |
NA indicates that the value is not applicable.
Query variables
Query Variables | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hostName/resourceName | Name of the host. | ||||||||||||||||||||||||||||||||||||||||||||
dnsName | Domain service name. | ||||||||||||||||||||||||||||||||||||||||||||
aliasName | Other name of resource. | ||||||||||||||||||||||||||||||||||||||||||||
id | Resource unique ID. Example: d5bce6fe-d19f-4ad7-8c50-5f639f2dd321 | ||||||||||||||||||||||||||||||||||||||||||||
serialNumber | Resource serial number. | ||||||||||||||||||||||||||||||||||||||||||||
ipAddress | Resource IP address. | ||||||||||||||||||||||||||||||||||||||||||||
systemUID | System unique ID. | ||||||||||||||||||||||||||||||||||||||||||||
state | Resource state. Supported values: active, inactive, discovered | ||||||||||||||||||||||||||||||||||||||||||||
type | Resource type. Learn more about the supported resource types. Example: DEVICE, SQL_SERVER | ||||||||||||||||||||||||||||||||||||||||||||
resourceType | Filter resources based on a resource type. Use Get Device Types API to fetch resource types supported by OpsRamp. Provide multiple resource types with comma-separated strings. Example: DEVICE, DOCUMENT_DB | ||||||||||||||||||||||||||||||||||||||||||||
deviceType | Filter resources based on device type. This parameter is required if the resource type is a device.Use Get Device Types API to retrieve the names of supported device types. Enumerate multiple device type names with comma-separated strings. Example: Windows, Linux | ||||||||||||||||||||||||||||||||||||||||||||
appRoles | Filter for applications running on the resources.List of supported applications:
| ||||||||||||||||||||||||||||||||||||||||||||
startCreationDate | Indicates the date to search the creation date of a resource. Start indicates from date. Example: 2018-01-12T04:53:53 0000 | ||||||||||||||||||||||||||||||||||||||||||||
endCreationDate | Indicates the date to search for the last date of resource creation. End indicates to date. Example: 2018-02-10T10:20:25 0000 | ||||||||||||||||||||||||||||||||||||||||||||
startUpdationDate | Search for a resource updated within a specific duration. Start indicates from date. Example: 2018-01-12T04:53:53 0000 | ||||||||||||||||||||||||||||||||||||||||||||
endUpdationDate | Search for a resource updated within a specific duration. End indicates to date. Example: 2018-02-10T10:20:25 0000 | ||||||||||||||||||||||||||||||||||||||||||||
tags | Additional details about a resource. Enumerate provide multiple tags separated by a comma. Example: parentDevice, category | ||||||||||||||||||||||||||||||||||||||||||||
template | Monitoring template assigned to a resource. Provide the monitoring template ID to fetch the list of resources attached to a monitoring template. | ||||||||||||||||||||||||||||||||||||||||||||
agentProfile | Search for resources with agent profile ID. Retrieve resources that belong to a particular agent. | ||||||||||||||||||||||||||||||||||||||||||||
gatewayProfile | Search for resources with Gateway profile ID. Fetch resources that belong to a particular gateway. | ||||||||||||||||||||||||||||||||||||||||||||
instanceId | Cloud instance ID. | ||||||||||||||||||||||||||||||||||||||||||||
accountNumber | Account number of public or private clouds. | ||||||||||||||||||||||||||||||||||||||||||||
installedIntgId | Installed integration ID. Search Installed Integrations retrieves the list of integrations installed. Provide the integration ID to fetch the resources associated with an integration. | ||||||||||||||||||||||||||||||||||||||||||||
agentInstalled | Filter for resources with agent installed:
| ||||||||||||||||||||||||||||||||||||||||||||
deviceGroup | Fetch resources that belong to specific device group. Provide a device group name. Example: Windows Servers | ||||||||||||||||||||||||||||||||||||||||||||
serviceGroup | Fetch resources that belong to a specific service group by providing the service group name. Example: Admin Group | ||||||||||||||||||||||||||||||||||||||||||||
deviceLocation | Fetch resources that are at a specific location. Provide a location name. Example: West-SJ | ||||||||||||||||||||||||||||||||||||||||||||
isEquals | Parameter to consider the exact match for a variable:
| ||||||||||||||||||||||||||||||||||||||||||||
firstAssetManagedTime | The first time a resource is managed. | ||||||||||||||||||||||||||||||||||||||||||||
assetManagedTime | The most recent time a resource is managed. The asset managed time gets updated whenever a resource is managed or unmanaged. | ||||||||||||||||||||||||||||||||||||||||||||
aliasIp | Alias IP address of the network you have. |
Sample response
{
"results": [
{
"id": "61fec02a-4370-4dfb-be4d-1bb9fe3e05aa",
"hostName": "TestHost",
"ipAddress": "1.1.1.2",
"dns": "",
"client": {
"id": 4,
"uniqueId": "client_4",
"name": "EHR"
},
"createdDate": "2019-05-20T09:31:50+0000",
"classCode": "device",
"deviceType": "Desktop",
"devicePath": "Desktop",
"type": "DEVICE",
"state": "active",
"make": "",
"model": "",
"osName": "",
"description": "test dummy device",
"gatewayProfileId": "0",
"source": "MANUAL",
"agentInstalled": false,
"attributes": {
"network": [
{
"ip": "172.24.133.91",
"mac": "f8:94:c2:0c:10:f2",
"aliasIp": "172.24.133.100, 172.24.133.101"
}
]
},
"aliasName": "TestAlias",
"name": "TestHost",
"resourceName": "TestResource",
"consoles": [],
"resourceType": "Desktop",
"assetManagedTime": "2019-05-20T09:31:50+0000",
"firstAssetManagedTime": "2019-05-20T09:31:50+0000",
"deleted": false,
"ts": 0,
"clientId": 0,
"locationOffset": 0,
"totalLocations": 0,
}
],
"totalResults": 1,
"orderBy": "name",
"pageNo": 1,
"pageSize": 100,
"totalPages": 1,
"nextPage": false,
"descendingOrder": false
}