Skip to content

Entities resources

The API allows you to search for your entities and devices in Virtana Service Observability.

Resource list

Authentication

All Virtana Service Observability API endpoints require HTTPS, expect JSON in the request body when a body is required, and return a JSON response. You must have an authentication key to send requests to a Virtana Service Observability API endpoint. The key is sent in the zenoss-api-key header of each request. For the maintenance windows APIs you must use a key generated from a User API type API client.

All of the following API examples use curl to send a JSON request from a Bash shell to an endpoint. All examples use YOUR-API-ENDPOINT and YOUR-API-KEY as placeholders for endpoints and authentication keys.

POST /v1/modelcontext/entities:search

This endpoint allows you to search for devices by the criteria you specify.

  • search_input: Required. Used to provide the query, sort_by options, page_input options, and group_by options.

  • fields: Optional. Specify which fields you want returned for the matching entities. If omitted, default well-known fields will be returned.

Request template

This section provides an abstract preview of the JSON request used to search for an entity.

{
  "search_input": {
    "sortby": [
      {
        "field_kind": 1,
        "field": "_id",
        "order": 1
      }
    ],
    "page_input": {
      "limit": 10
    },
    "query": {
      "clause": {
        "and": {
          "clauses": [
            {
              "filter": {
                "field": "coreProperties.name",
                "value": "10.88.122.130",
                "operation": 1
              }
            },
            {
              "in": {
                "field": "schemaIds",
                "values": [
                  "Base.Device"
                ]
              }
            }
          ]
        }
      }
    }
  }
}

Request fields

search_input (object, required)

Criteria for search, using query.

query (object, required)
Specify entities using search criteria.
page_input (object, optional)

Page selection criteria.

limit (number, optional)
Limit of results.
cursor (string, optional)
EndCursor from previous page results.

Response fields

entities
Array of entity objects that match the search criteria specified for that tenant.
pageInfo
Object with startCursor and endCursor fields among others. EndCursor can be used to get remaining entities.

Status codes

  • 200 (success)
  • 400 (invalid request, for example, search input was empty)
  • 500 (internal server error)

Example

curl https://<YOUR-API-ENDPOINT>/v1/modelcontext/entities:search \
  -H "zenoss-api-key: <YOUR-API-KEY>" \
  -X POST -s \
  -d '{
      "search_input": {
        "page_input": {
        "limit": 10
        },
        "query": {
            "clause": {
                "and": {
                "clauses": [
                    {
                    "filter": {
                        "field": "coreProperties.name",
                        "value": "10.88.122.130",
                        "operation": 1
                    }
                    },
                    {
                    "in": {
                        "field": "schemaIds",
                        "values": [
                        "Base.Device"
                        ]
                    }
                    }
                ]
                }
            }
        }
    }
}'
{
    "entities": {
        "entities": [
        {
            "id": "AAAAAzxIDQsTlnweGQ04by62PDA=",
            "factIds": [],
            "schemaIds": [
            "Base.Device"
            ],
            "name": "10.88.122.130",
            "timestamp": "1775440665000",
            "tenant": "svc",
            "fields": null,
            "dimensions": {
            "contextUUID": "672267b5-d86a-4600-b96f-97cfc0a7997a",
            "source": "cz0"
            },
            "coreProperties": {
            "HWManufacturer": [
                "VMware, Inc."
            ],
            "HWModel": [
                "VMware Virtual Platform"
            ],
            "HWSerialNumber": [
                "00376-30000-00299-AA408"
            ],
            "HWTag": [
                "System Enclosure 0"
            ],
            "OSManufacturer": [
                "Microsoft Corporation"
            ],
            "OSModel": [
                "Windows Server 2016 Standard"
            ],
            "_zen_direct_entity_id": [
                "AAAAAzxIDQsTlnweGQ04by62PDA="
            ],
            "_zen_impactedEntities": [
                "AAAAA-H8aY6Ii7eeXv2bcbb8HGY=",
                "AAAAA-maSR2oySfT79lSWYgKFi4=",
                "AAAAA0SgtV8XWS_-aoCLuH6QUlY=",
                "AAAAA1O0v211bKH38ttlg76vesI=",
                "AAAAA1xRi1M670LmjiG_4xCznlQ=",
                "AAAAA2tKhBdYxIOAKnFywb-wBXY=",
                "AAAAA3UEOvORDWGyMFgq5f21c_w=",
                "AAAAA3ZffC58Bkj8l7XDP8dYmdU=",
                "AAAAA3t3fwgIz3g6eVZt9DsI4MI=",
                "AAAAA45Ov77K58ugWQKzX_0hQ8k=",
                "AAAAA4MWJPjciJpxPDsfMk8YNgg=",
                "AAAAA50ozsZyj3KahqL8O_heMtA=",
                "AAAAA9hTin5YMA5Tjin8V_XXLSk=",
                "AAAAA_eyR6MJFRd_bA1D5ksk9kw=",
                "AAAAA_jsDndSqMQmcv3M4hrSEVc=",
                "AAAAAwy65UsQ5giiBHCifRc4M5Q=",
                "AAAAAx333V2kevTC38BS2cAdHjs="
            ],
            "_zen_parent_entity_id": [
                "AAAAA-H8aY6Ii7eeXv2bcbb8HGY="
            ],
            "_zen_schemaIds": [
                "Base.Device"
            ],
            "_zen_tenant_id": [
                "dwgywhbbjomrhbtg"
            ],
            "_zorgs_device_class": [
                "/Server/Microsoft/Cluster/ZenossQA"
            ],
            "_zorgs_groups": [
                "/moreThan40"
            ],
            "contextUUID": [
                "672267b5-d86a-4600-b96f-97cfc0a7997a"
            ],
            "device": [
                "10.88.122.130"
            ],
            "name": [
                "10.88.122.130"
            ],
            "parent": [
                "06f442aa-73de-4571-b0ab-8b82631b0585"
            ],
            "source": [
                "cz0"
            ],
            "source-type": [
                "cz"
            ]
            },
            "createTime": "1713148087000",
            "updateTime": "1775440665000",
            "productionState": "400",
            "priority": "3",
            "livenessTime": "1775440665000",
            "customProperties": null
        }
        ],
        "response": [
        {
            "standard": {
            "id": "AAAAAzxIDQsTlnweGQ04by62PDA=",
            "factIds": [],
            "schemaIds": [
                "Base.Device"
            ],
            "name": "10.88.122.130",
            "timestamp": "1775440665000",
            "tenant": "svc",
            "fields": null,
            "dimensions": {
                "contextUUID": "672267b5-d86a-4600-b96f-97cfc0a7997a",
                "source": "cz0"
            },
            "coreProperties": {
                "HWManufacturer": [
                "VMware, Inc."
                ],
                "HWModel": [
                "VMware Virtual Platform"
                ],
                "HWSerialNumber": [
                "00376-30000-00299-AA408"
                ],
                "HWTag": [
                "System Enclosure 0"
                ],
                "OSManufacturer": [
                "Microsoft Corporation"
                ],
                "OSModel": [
                "Windows Server 2016 Standard"
                ],
                "_zen_direct_entity_id": [
                "AAAAAzxIDQsTlnweGQ04by62PDA="
                ],
                "_zen_impactedEntities": [
                "AAAAA-H8aY6Ii7eeXv2bcbb8HGY=",
                "AAAAA-maSR2oySfT79lSWYgKFi4=",
                "AAAAA0SgtV8XWS_-aoCLuH6QUlY=",
                "AAAAA1O0v211bKH38ttlg76vesI=",
                "AAAAA1xRi1M670LmjiG_4xCznlQ=",
                "AAAAA2tKhBdYxIOAKnFywb-wBXY=",
                "AAAAA3UEOvORDWGyMFgq5f21c_w=",
                "AAAAA3ZffC58Bkj8l7XDP8dYmdU=",
                "AAAAA3t3fwgIz3g6eVZt9DsI4MI=",
                "AAAAA45Ov77K58ugWQKzX_0hQ8k=",
                "AAAAA4MWJPjciJpxPDsfMk8YNgg=",
                "AAAAA50ozsZyj3KahqL8O_heMtA=",
                "AAAAA9hTin5YMA5Tjin8V_XXLSk=",
                "AAAAA_eyR6MJFRd_bA1D5ksk9kw=",
                "AAAAA_jsDndSqMQmcv3M4hrSEVc=",
                "AAAAAwy65UsQ5giiBHCifRc4M5Q=",
                "AAAAAx333V2kevTC38BS2cAdHjs="
                ],
                "_zen_parent_entity_id": [
                "AAAAA-H8aY6Ii7eeXv2bcbb8HGY="
                ],
                "_zen_schemaIds": [
                "Base.Device"
                ],
                "_zen_tenant_id": [
                "dwgywhbbjomrhbtg"
                ],
                "_zorgs_device_class": [
                "/Server/Microsoft/Cluster/ZenossQA"
                ],
                "_zorgs_groups": [
                "/moreThan40"
                ],
                "contextUUID": [
                "672267b5-d86a-4600-b96f-97cfc0a7997a"
                ],
                "device": [
                "10.88.122.130"
                ],
                "name": [
                "10.88.122.130"
                ],
                "parent": [
                "06f442aa-73de-4571-b0ab-8b82631b0585"
                ],
                "source": [
                "cz0"
                ],
                "source-type": [
                "cz"
                ]
            },
            "createTime": "1713148087000",
            "updateTime": "1775440665000",
            "productionState": "400",
            "priority": "3",
            "livenessTime": "1775440665000",
            "customProperties": null
            }
        }
        ]
    },
    "pageInfo": {
        "startCursor": "8iS2WCwiNfapPB8V7YxFnA==",
        "endCursor": "BXouZzSn_NqHf3kCi3P0AA==",
        "count": "1",
        "totalCount": "1",
        "hasNext": false,
        "hasPrev": false,
        "pending": "PENDING_FALSE"
    }
    }

POST /v1/modelcontext/fields:listDefault

Returns the default fields and field sources for your tenant. Use the request parameters to filter by field type (core vs. all) and whether fields must be searchable using the API.

Request template

This section provides an abstract preview of the JSON request used to list default fields and fieldSources.

{
  "option":<0 or 1>,
  "searchable_only": <true or false>
}

Request fields

option (optional)
Number. Specify 0 to list only core fields. Specify 1 to list all fields. The default is 0.
searchable_only (optional)
Boolean. Specify true to list fields that can be searched through the API.

Response fields

fields
Array. A list of field keys on the tenant's entities, matching the request parameters.
fieldSources
Array. The source classification for each field key as follows: property keys can be searched directly, coreProperty keys need the coreProperties. prefix, and dimension keys need the dimensions. prefix.

Status codes

  • 200 (success)
  • 500 (internal server error)

Example

curl https://<YOUR-API-ENDPOINT>/v1/modelcontext/fields:listDefault \
  -H "zenoss-api-key: <YOUR-API-KEY>" \
  -X POST -s \
  -d '{
    "option": 0,
    "searchable_only":true
}'
{
    "fields": [
        "HWManufacturer",
        "HWModel",
        "HWSerialNumber",
        "HWTag",
        "OSManufacturer",
        "OSModel",
        "_zen_parent_entity_id",
        "_zen_schemaIds",
        "_zorgs_component_groups",
        "_zorgs_device_class",
        "_zorgs_groups",
        "_zorgs_impact_ds_organizer",
        "_zorgs_location",
        "_zorgs_systems",
        "device",
        "name",
        "source",
        "source-type"
    ],
    "fieldSources": {
        "HWManufacturer": "coreProperty",
        "HWModel": "coreProperty",
        "HWSerialNumber": "coreProperty",
        "HWTag": "coreProperty",
        "OSManufacturer": "coreProperty",
        "OSModel": "coreProperty",
        "_zen_clientid": "coreProperty",
        "_zen_direct_entity_id": "coreProperty",
        "_zen_impactedBy": "coreProperty",
        "_zen_impactedEntities": "coreProperty",
        "_zen_parent_entity_id": "coreProperty",
        "_zen_schemaIds": "coreProperty",
        "_zen_tenant_id": "coreProperty",
        "_zorgs_component_groups": "coreProperty",
        "_zorgs_device_class": "coreProperty",
        "_zorgs_groups": "coreProperty",
        "_zorgs_impact_ds_organizer": "coreProperty",
        "_zorgs_location": "coreProperty",
        "_zorgs_systems": "coreProperty",
        "contextUUID": "coreProperty",
        "device": "coreProperty",
        "name": "coreProperty",
        "parent": "coreProperty",
        "source": "coreProperty",
        "source-type": "coreProperty"
    }
}