ves-io-schema-graph-infraprotect-CustomAPI-Query

Examples of performing graph_infraprotect CustomAPI Query

Usecase:

Get data for all graph

Request:

Request using vesctl:

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

where file request.yaml has following contents:

namespace: system

vesctl yaml response:

alertTraffic:
- name: https (443/tcp)
  values:
  - timestamp: 1591545000000
    value: "5000.000000"
  - timestamp: 1591545600000
    value: "4000.000000"
  - timestamp: 1591546200000
    value: "4800.000000"
- name: https (443/udp)
  values:
  - timestamp: 1591545000000
    value: "933.333333"
  - timestamp: 1591545600000
    value: "933.333333"
  - timestamp: 1591546200000
    value: "1133.333333"
- name: 52349 (52349/tcp)
  values: []
- name: 52113 (52113/tcp)
  values: []
destinationTraffic:
- name: -Private Use AS-,ZZ (65020)
  values:
  - timestamp: 1591545000000
    value: "149177120.000000"
  - timestamp: 1591545600000
    value: "158182773.333333"
  - timestamp: 1591546200000
    value: "160132106.666667"
- name: AMAZON-02,US (16509)
  values:
  - timestamp: 1591545000000
    value: "48682346.666667"
  - timestamp: 1591545600000
    value: "43581333.333333"
  - timestamp: 1591546200000
    value: "28729386.666667"
- name: VFM-AS Vodafone Malta Ltd AS,MT (33874)
  values: []
protocolRepartition:
- name: https
  values:
  - timestamp: 1591545000000
    value: "95179898.380000"
  - timestamp: 1591545600000
    value: "62261081.575556"
  - timestamp: 1591546200000
    value: "54906793.155556"
- name: ESP
  values:
  - timestamp: 1591545000000
    value: "15154566.842222"
  - timestamp: 1591545600000
    value: "17548093.977778"
  - timestamp: 1591546200000
    value: "17445504.755556"
- name: mysql
  values: []
- name: blp4
  values: []
sourceTraffic:
- name: -Private Use AS-,ZZ (65020)
  values:
  - timestamp: 1591545000000
    value: "38989760.000000"
  - timestamp: 1591545600000
    value: "47784586.666667"
  - timestamp: 1591546200000
    value: "52891040.000000"
- name: AMAZON-02,US (16509)
  values:
  - timestamp: 1591545000000
    value: "17240373.333333"
  - timestamp: 1591545600000
    value: "19382880.000000"
  - timestamp: 1591546200000
    value: "18891733.333333"
- name: VFM-AS Vodafone Malta Ltd AS,MT (33874)
  values: []
trafficSummary:
- name: AMAZON-02,US (16509) ---- MGE,FR (41728)
  values:
  - timestamp: 1591545000000
    value: "33123359.628889"
  - timestamp: 1591545600000
    value: "29410441.226667"
  - timestamp: 1591546200000
    value: "12782407.313333"
- name: -Private Use AS-,ZZ (65020) ---- MGE,FR (41728)
  values:
  - timestamp: 1591545000000
    value: "38191845.204444"
  - timestamp: 1591545600000
    value: "40943460.175556"
  - timestamp: 1591546200000
    value: "36243437.171111"
- name: MGE,FR (41728) ---- VODAFONE-IT-ASN,IT (30722)
  values: []

Request using curl:

curl -X 'POST' -d '{"namespace":"system"}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build896999001_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/infraprotect/namespaces/system/graph/infraprotect'

curl response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Fri, 31 Jul 2020 12:54:14 GMT
Vary: Accept-Encoding

{
  "source_traffic": [
    {
      "name": "-Private Use AS-,ZZ (65020)",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "38989760.000000"
        },
        {
          "timestamp": 1591545600000,
          "value": "47784586.666667"
        },
        {
          "timestamp": 1591546200000,
          "value": "52891040.000000"
        }
      ]
    },
    {
      "name": "AMAZON-02,US (16509)",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "17240373.333333"
        },
        {
          "timestamp": 1591545600000,
          "value": "19382880.000000"
        },
        {
          "timestamp": 1591546200000,
          "value": "18891733.333333"
        }
      ]
    },
    {
      "name": "VFM-AS Vodafone Malta Ltd AS,MT (33874)",
      "values": [
      ]
    }
  ],
  "destination_traffic": [
    {
      "name": "-Private Use AS-,ZZ (65020)",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "149177120.000000"
        },
        {
          "timestamp": 1591545600000,
          "value": "158182773.333333"
        },
        {
          "timestamp": 1591546200000,
          "value": "160132106.666667"
        }
      ]
    },
    {
      "name": "AMAZON-02,US (16509)",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "48682346.666667"
        },
        {
          "timestamp": 1591545600000,
          "value": "43581333.333333"
        },
        {
          "timestamp": 1591546200000,
          "value": "28729386.666667"
        }
      ]
    },
    {
      "name": "VFM-AS Vodafone Malta Ltd AS,MT (33874)",
      "values": [
      ]
    }
  ],
  "traffic_summary": [
    {
      "name": "AMAZON-02,US (16509) ---- MGE,FR (41728)",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "33123359.628889"
        },
        {
          "timestamp": 1591545600000,
          "value": "29410441.226667"
        },
        {
          "timestamp": 1591546200000,
          "value": "12782407.313333"
        }
      ]
    },
    {
      "name": "-Private Use AS-,ZZ (65020) ---- MGE,FR (41728)",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "38191845.204444"
        },
        {
          "timestamp": 1591545600000,
          "value": "40943460.175556"
        },
        {
          "timestamp": 1591546200000,
          "value": "36243437.171111"
        }
      ]
    },
    {
      "name": "MGE,FR (41728) ---- VODAFONE-IT-ASN,IT (30722)",
      "values": [
      ]
    }
  ],
  "protocol_repartition": [
    {
      "name": "https",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "95179898.380000"
        },
        {
          "timestamp": 1591545600000,
          "value": "62261081.575556"
        },
        {
          "timestamp": 1591546200000,
          "value": "54906793.155556"
        }
      ]
    },
    {
      "name": "ESP",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "15154566.842222"
        },
        {
          "timestamp": 1591545600000,
          "value": "17548093.977778"
        },
        {
          "timestamp": 1591546200000,
          "value": "17445504.755556"
        }
      ]
    },
    {
      "name": "mysql",
      "values": [
      ]
    },
    {
      "name": "blp4",
      "values": [
      ]
    }
  ],
  "alert_traffic": [
    {
      "name": "https (443/tcp)",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "5000.000000"
        },
        {
          "timestamp": 1591545600000,
          "value": "4000.000000"
        },
        {
          "timestamp": 1591546200000,
          "value": "4800.000000"
        }
      ]
    },
    {
      "name": "https (443/udp)",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "933.333333"
        },
        {
          "timestamp": 1591545600000,
          "value": "933.333333"
        },
        {
          "timestamp": 1591546200000,
          "value": "1133.333333"
        }
      ]
    },
    {
      "name": "52349 (52349/tcp)",
      "values": [
      ]
    },
    {
      "name": "52113 (52113/tcp)",
      "values": [
      ]
    }
  ]
}