Skip to content

Feature/limit dbconf results

Julien Andrieux requested to merge feature/limit-dbconf-results into develop

Management of the page size and page offset parameters for ListOrganizations, ListAgentsByOrganization, ListChannelsByOrganization, ListChannelTypes, ListTargetProbesByAgent, ListAlertsByOrganization, ListProbes and ListChecks.

Example for the ListProbes method:

$ curl -s -H "api-key: f90d9d23-b0cf-410a-b1cc-d0f8678f8b8b" -XGET 'http://localhost:7576/v1/probes?page_size=1' | jq                           {
  "probes": [
    {
      "name": "probes/xUkSnG_BSVCn-AX1khPLYg",
      "probe_name": "ping",
      "display_name": "Ping",
      "description": "Ping is a probe that sends an ICMP Echo message to a host and reports statistics on the round trip.\n\nResults are:\n- sent : the number of packets sent\n- received : the number of packets received\n- min : the minimum round trip time, in nanoseconds\n- max : the maximum round trip time, in nanoseconds\n- avg : the average round trip time, in nanoseconds\n- stddev : the standard deviation of round trip times, in nanoseconds.",
      "parameters": [
        {
          "name": "address",
          "type": "type.googleapis.com/google.protobuf.StringValue",
          "desc": "target address, IP or hostname",
          "mandatory": true
        },
        {
          "name": "interval",
          "type": "type.googleapis.com/google.protobuf.Duration",
          "desc": "the wait time between each packet send. Defaults to 1s"
        },
        {
          "name": "count",
          "type": "type.googleapis.com/google.protobuf.Int32Value",
          "desc": "the number of ICMP packets to send. Defaults to 4"
        },
        {
          "name": "timeout",
          "type": "type.googleapis.com/google.protobuf.Duration",
          "desc": "the time to run the ping, until it exits. If the timeout is reached before the packet count has been reached, exits anyway. Defaults to 10s"
        }
      ]
    }
  ],
  "next_page_token": "AggBAQ"
}


$ curl -s -H "api-key: f90d9d23-b0cf-410a-b1cc-d0f8678f8b8b" -XGET 'http://localhost:7576/v1/probes?page_size=1&page_token=AggBAQ' | jq
{
  "probes": [
    {
      "name": "probes/QKqt4vWKRqiUBgQkEB_2Lg",
      "probe_name": "checksum",
      "display_name": "File checksum",
      "description": "Checksum probe returns the checksum of a file.\n\nResults are:\n- checksum : The result of a checksum as a hexadecimal string.",
      "parameters": [
        {
          "name": "path",
          "type": "type.googleapis.com/google.protobuf.StringValue",
          "desc": "The path of the file to check.",
          "mandatory": true
        },
        {
          "name": "hash",
          "type": "type.googleapis.com/google.protobuf.StringValue",
          "desc": "The hash algorithm to use. One of `crc32`, `md5`, `sha1`, `sha256`. Defaults to `crc32`"
        }
      ]
    }
  ],
  "next_page_token": "AggBAg"
}
Edited by Julien Andrieux

Merge request reports