ves-io-schema-graph-connectivity-CustomAPI-Query

Examples of performing graph_connectivity CustomAPI Query

Usecase:

Get graph connectivity data

Request:

Request using vesctl:

vesctl request rpc graph_connectivity.CustomAPI.Query -i request.yaml --uri /public/namespaces/system/graph/connectivity --http-method POST

where file request.yaml has following contents:

endTime: "1580407200"
fieldSelector:
  edge:
    metric:
      types:
      - EDGE_CONNECTION_STATUS
      - EDGE_OUT_THROUGHPUT
  node:
    metric:
      types:
      - NODE_CONNECTION_STATUS
      - NODE_OUT_THROUGHPUT
namespace: system
startTime: "1580403600"

vesctl yaml response:

edges:
- dstId:
    site: site2
  metric:
  - type: EDGE_CONNECTION_STATUS
    value:
      anomaly: []
      confidenceLowerBound: []
      confidenceUpperBound: []
      healthscore: []
      raw:
      - timestamp: 1580407200
        value: "1"
      trend: []
  - type: EDGE_OUT_THROUGHPUT
    value:
      anomaly: []
      confidenceLowerBound: []
      confidenceUpperBound: []
      healthscore: []
      raw:
      - timestamp: 1580407200
        value: "7.587077099800346"
      trend: []
  srcId:
    site: site1
nodes:
- id:
    site: site1
  instances: []
  interfaces: []
  metric:
  - type: NODE_CONNECTION_STATUS
    value:
      anomaly: []
      confidenceLowerBound: []
      confidenceUpperBound: []
      healthscore: []
      raw:
      - timestamp: 1580407200
        value: "1"
      trend: []
  - type: NODE_OUT_THROUGHPUT
    value:
      anomaly: []
      confidenceLowerBound: []
      confidenceUpperBound: []
      healthscore: []
      raw:
      - timestamp: 1580407200
        value: "7.587077099800346"
      trend: []
- id:
    site: site2
  instances: []
  interfaces: []
  metric:
  - type: NODE_CONNECTION_STATUS
    value:
      anomaly: []
      confidenceLowerBound: []
      confidenceUpperBound: []
      healthscore: []
      raw:
      - timestamp: 1580407200
        value: "1"
      trend: []
  - type: NODE_OUT_THROUGHPUT
    value:
      anomaly: []
      confidenceLowerBound: []
      confidenceUpperBound: []
      healthscore: []
      raw:
      - timestamp: 1580407200
        value: "7.587077099800346"
      trend: []

Request using curl:

curl -X 'POST' -d '{"namespace":"system","fieldSelector":{"node":{"metric":{"types":["NODE_CONNECTION_STATUS","NODE_OUT_THROUGHPUT"]}},"edge":{"metric":{"types":["EDGE_CONNECTION_STATUS","EDGE_OUT_THROUGHPUT"]}}},"startTime":"1580403600","endTime":"1580407200"}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/data/namespaces/system/graph/connectivity'

curl response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:07:06 GMT
Vary: Accept-Encoding

{
  "nodes": [
    {
      "id": {
        "site": "site1"
      },
      "metric": [
        {
          "type": "NODE_CONNECTION_STATUS",
          "value": {
            "raw": [
              {
                "timestamp": 1580407200,
                "value": "1"
              }
            ],
            "confidence_upper_bound": [
            ],
            "confidence_lower_bound": [
            ],
            "anomaly": [
            ],
            "trend": [
            ],
            "healthscore": [
            ]
          }
        },
        {
          "type": "NODE_OUT_THROUGHPUT",
          "value": {
            "raw": [
              {
                "timestamp": 1580407200,
                "value": "7.587077099800346"
              }
            ],
            "confidence_upper_bound": [
            ],
            "confidence_lower_bound": [
            ],
            "anomaly": [
            ],
            "trend": [
            ],
            "healthscore": [
            ]
          }
        }
      ],
      "interfaces": [
      ],
      "instances": [
      ],
      "healthscore": null
    },
    {
      "id": {
        "site": "site2"
      },
      "metric": [
        {
          "type": "NODE_CONNECTION_STATUS",
          "value": {
            "raw": [
              {
                "timestamp": 1580407200,
                "value": "1"
              }
            ],
            "confidence_upper_bound": [
            ],
            "confidence_lower_bound": [
            ],
            "anomaly": [
            ],
            "trend": [
            ],
            "healthscore": [
            ]
          }
        },
        {
          "type": "NODE_OUT_THROUGHPUT",
          "value": {
            "raw": [
              {
                "timestamp": 1580407200,
                "value": "7.587077099800346"
              }
            ],
            "confidence_upper_bound": [
            ],
            "confidence_lower_bound": [
            ],
            "anomaly": [
            ],
            "trend": [
            ],
            "healthscore": [
            ]
          }
        }
      ],
      "interfaces": [
      ],
      "instances": [
      ],
      "healthscore": null
    }
  ],
  "edges": [
    {
      "src_id": {
        "site": "site1"
      },
      "dst_id": {
        "site": "site2"
      },
      "metric": [
        {
          "type": "EDGE_CONNECTION_STATUS",
          "value": {
            "raw": [
              {
                "timestamp": 1580407200,
                "value": "1"
              }
            ],
            "confidence_upper_bound": [
            ],
            "confidence_lower_bound": [
            ],
            "anomaly": [
            ],
            "trend": [
            ],
            "healthscore": [
            ]
          }
        },
        {
          "type": "EDGE_OUT_THROUGHPUT",
          "value": {
            "raw": [
              {
                "timestamp": 1580407200,
                "value": "7.587077099800346"
              }
            ],
            "confidence_upper_bound": [
            ],
            "confidence_lower_bound": [
            ],
            "anomaly": [
            ],
            "trend": [
            ],
            "healthscore": [
            ]
          }
        }
      ],
      "healthscore": null
    }
  ]
}