ves-io-schema-infraprotect-CustomNetworkAPI-ListNetworks

Examples of performing infraprotect CustomNetworkAPI ListNetworks

Usecase:

List all customer networks

Request:

Request using vesctl:

vesctl request rpc infraprotect.CustomNetworkAPI.ListNetworks -i request.yaml --uri /public/namespaces/system/infraprotect/networks --http-method GET

where file request.yaml has following contents:

namespace: system

vesctl yaml response:

networks:
- id: "123"
  name: DDOS_network_1
  prefixes:
    prefix:
    - 192.168.0.1/32

Request using curl:

curl -X 'GET' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build038462651_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/infraprotect/namespaces/system/infraprotect/networks?namespace=system'

curl response:

HTTP/1.1 200 OK
Content-Length: 171
Content-Type: application/json
Date: Wed, 12 Jan 2022 14:48:51 GMT
Vary: Accept-Encoding

{
  "networks": [
    {
      "id": "123",
      "name": "DDOS_network_1",
      "prefixes": {
        "prefix": [
          "192.168.0.1/32"
        ]
      }
    }
  ]
}