ves-io-schema-virtual_network-API-Create

Examples of creating virtual_network

Usecase:

Create virtual-network-1

Request using vesctl:

vesctl configuration create virtual_network -i virtual_network.yaml

where file virtualnetwork.yaml has following contents (virtualnetwork.CreateRequest):

metadata:
  name: virtual-network-1
  namespace: system
spec:
  siteLocalNetwork: {}
  staticRoutes:
  - attrs:
    - ROUTE_ATTR_INSTALL_FORWARDING
    ipAddress: 10.1.2.3
    ipPrefixes:
    - 10.1.1.0/24

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: virtual-network-1
  namespace: system
spec:
  siteLocalNetwork: {}
  staticRoutes: []
systemMetadata:
  creationTimestamp: "2021-06-02T10:22:56.369059776Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: bcaa96c2-dc82-4da1-93d9-87d67b38accf

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"virtual-network-1","namespace":"system"},"spec":{"siteLocalNetwork":{},"staticRoutes":[{"ipPrefixes":["10.1.1.0/24"],"ipAddress":"10.1.2.3","attrs":["ROUTE_ATTR_INSTALL_FORWARDING"]}]}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build186462253_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/virtual_networks'

curl response:

HTTP/1.1 200 OK
Content-Length: 659
Content-Type: application/json
Date: Wed, 02 Jun 2021 10:22:56 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "virtual-network-1",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "bcaa96c2-dc82-4da1-93d9-87d67b38accf",
    "creation_timestamp": "2021-06-02T10:22:56.369059776Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "site_local_network": {

    },
    "static_routes": [
    ]
  }
}