ves-io-schema-fast_acl-CustomDataAPI-FastACLHits

Examples of performing fast_acl CustomDataAPI FastACLHits

Usecase:

Get Fast ACL hits

Request:

Request using vesctl:

vesctl request rpc fast_acl.CustomDataAPI.FastACLHits -i request.yaml --uri /public/namespaces/system/fast_acl/hits --http-method POST

where file request.yaml has following contents:

endTime: "1593622800"
groupBy:
- FAST_ACL_RULE
- SITE
labelFilter:
- label: FAST_ACL
  value: fast-acl-1
namespace: system
startTime: "1593619200"

vesctl yaml response:

data:
- id:
    fastAclRule: rule-1
    site: site-1
  metric:
  - timestamp: 1593622800
    value: "100"
- id:
    fastAclRule: rule-1
    site: site-2
  metric:
  - timestamp: 1593622800
    value: "50"

Request using curl:

curl -X 'POST' -d '{"namespace":"system","labelFilter":[{"label":"FAST_ACL","value":"fast-acl-1"}],"groupBy":["FAST_ACL_RULE","SITE"],"startTime":"1593619200","endTime":"1593622800"}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build823219857_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/data/namespaces/system/fast_acl/hits'

curl response:

HTTP/1.1 200 OK
Content-Length: 519
Content-Type: application/json
Date: Wed, 23 Sep 2020 09:53:17 GMT
Vary: Accept-Encoding

{
  "data": [
    {
      "id": {
        "namespace": "",
        "fast_acl": "",
        "fast_acl_rule": "rule-1",
        "site": "site-1"
      },
      "metric": [
        {
          "timestamp": 1593622800,
          "value": "100"
        }
      ]
    },
    {
      "id": {
        "namespace": "",
        "fast_acl": "",
        "fast_acl_rule": "rule-1",
        "site": "site-2"
      },
      "metric": [
        {
          "timestamp": 1593622800,
          "value": "50"
        }
      ]
    }
  ]
}