ves-io-schema-topology-CustomDataAPI-SiteTopology

Examples of performing topology CustomDataAPI SiteTopology

Usecase:

Get site topology for site-1

Request:

Request using vesctl:

vesctl request rpc topology.CustomDataAPI.SiteTopology -i request.yaml --uri /public/namespaces/system/topology/site/site-1 --http-method POST

where file request.yaml has following contents:

level: 1
metricSelector:
  edge:
  - METRIC_TYPE_LATENCY_SECONDS
  endTime: "1580407200"
  node:
  - METRIC_TYPE_IN_BYTES
  startTime: "1580403600"

vesctl yaml response:

edges:
- links:
  - info:
      status: LINK_STATUS_UP
    metric:
    - data:
      - labels: {}
        values:
        - value: "0.1"
      type: METRIC_TYPE_LATENCY_SECONDS
  nodeId1: id1
  nodeId2: id2
- links:
  - info:
      status: LINK_STATUS_UP
    metric:
    - data:
      - labels: {}
        values:
        - value: "0.12"
      type: METRIC_TYPE_LATENCY_SECONDS
  nodeId1: id2
  nodeId2: id1
- links:
  - info:
      name: tunnel-1
      status: LINK_STATUS_UP
    metric: []
  nodeId1: id1
  nodeId2: id3
nodes:
- id: id1
  metadata:
    name: site-1
  site:
    info:
      network: []
      tgw: []
    metric:
    - data:
      - labels: {}
        values:
        - value: "128"
- id: id2
  metadata:
    level: 1
    name: re-1
  site:
    info:
      network: []
      tgw: []
    metric: []
- id: id3
  metadata:
    name: tgw-1
  transitGateway:
    info:
      autoAcceptSharedAttachments: true
      network: []
    metric: []

Request using curl:

curl -X 'POST' -d '{"level":1,"metricSelector":{"startTime":"1580403600","endTime":"1580407200","node":["METRIC_TYPE_IN_BYTES"],"edge":["METRIC_TYPE_LATENCY_SECONDS"]}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build511723821_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/data/namespaces/system/topology/site/site-1'

curl response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 27 Oct 2021 18:30:29 GMT
Vary: Accept-Encoding

{
  "nodes": [
    {
      "id": "id1",
      "metadata": {
        "name": "site-1",
        "description": "",
        "level": 0
      },
      "site": {
        "info": {
          "network": [
          ],
          "tgw": [
          ]
        },
        "metric": [
          {
            "type": "METRIC_TYPE_IN_BYTES",
            "data": [
              {
                "labels": {
                },
                "values": [
                  {
                    "timestamp": 0,
                    "value": "128"
                  }
                ]
              }
            ]
          }
        ]
      }
    },
    {
      "id": "id2",
      "metadata": {
        "name": "re-1",
        "description": "",
        "level": 1
      },
      "site": {
        "info": {
          "network": [
          ],
          "tgw": [
          ]
        },
        "metric": [
        ]
      }
    },
    {
      "id": "id3",
      "metadata": {
        "name": "tgw-1",
        "description": "",
        "level": 0
      },
      "transit_gateway": {
        "info": {
          "network": [
          ],
          "auto_accept_shared_attachments": true,
          "dns_support": false,
          "vpn_ecmp_support": false
        },
        "metric": [
        ]
      }
    }
  ],
  "edges": [
    {
      "node_id1": "id1",
      "node_id2": "id2",
      "links": [
        {
          "info": {
            "name": "",
            "type": "LINK_TYPE_TUNNEL",
            "status": "LINK_STATUS_UP"
          },
          "metric": [
            {
              "type": "METRIC_TYPE_LATENCY_SECONDS",
              "data": [
                {
                  "labels": {
                  },
                  "values": [
                    {
                      "timestamp": 0,
                      "value": "0.1"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "node_id1": "id2",
      "node_id2": "id1",
      "links": [
        {
          "info": {
            "name": "",
            "type": "LINK_TYPE_TUNNEL",
            "status": "LINK_STATUS_UP"
          },
          "metric": [
            {
              "type": "METRIC_TYPE_LATENCY_SECONDS",
              "data": [
                {
                  "labels": {
                  },
                  "values": [
                    {
                      "timestamp": 0,
                      "value": "0.12"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "node_id1": "id1",
      "node_id2": "id3",
      "links": [
        {
          "info": {
            "name": "tunnel-1",
            "type": "LINK_TYPE_TUNNEL",
            "status": "LINK_STATUS_UP"
          },
          "metric": [
          ]
        }
      ]
    }
  ]
}