Hosts

List hosts with filter

Retrieve a list of all hosts with given filter.

To use this endpoint, you must have one of the following roles: comply-admin comply-operator comply-viewer

post/v1/hosts/filter

Request

Query parameters

offsetinteger

The offset where list should start response at.

limitinteger

The offset where list should start response at.

Request body

environmentsstring[] nullable

If specified, only nodes in at least one of the given environments will be included.

hostnamesstring[] nullable

If specified, nodes with at least one of the hostname will be included.

node_groupsstring[] nullable

If specified, only nodes in at least one of the given node groups will be included.

operating_systemsstring[] nullable

If specified, only nodes of the given operating systems will be included. Each operating system must be specified as a string with the name and version separated by a space.

Example request

{
  "environments": [
    "production"
  ],
  "hostnames": [
    "hostname.example"
  ],
  "node_groups": [
    "node group"
  ],
  "operating_systems": [
    "redhat 7",
    "redhat 8"
  ]
}

Response

HostsFilteredListResponse is the response for a list hosts request with filter.

limitinteger

If specified limit, you retrieve a subset of records limited to the given value..

nextstring nullable

Next page value .

offsetinteger

Offset is the position in the dataset of a particular record. By specifying offset, you retrieve a subset of records starting with the offset value.

totalinteger required

Total number of records.

Example response

{
  "data": [
    {
      "assessor_version": "4.3.1",
      "environment": "Test_Environment",
      "id": 123,
      "name": "example.node.net",
      "operating_system": {
        "compatible_benchmarks": [
          {
            "id": 123,
            "name": "3.1.2 CIS CentOS Linux 7"
          }
        ],
        "id": 123,
        "name": "CentOS 7"
      }
    }
  ],
  "limit": 10,
  "next": "/api/public/v_/_api_?offset=10&limit=10",
  "total": 123
}

Changes

No recorded changes to this operation across all 1 revision of this API.