ves-io-schema-virtual_network-API-Create
On This Page:
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-03-31T08:30:45.603039500Z"
creatorClass: examplesvc
creatorId: examplesvc
finalizers: []
tenant: acmecorp
uid: ad53751b-2de1-4747-a41e-62d3c7326f55
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-build318584715_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, 31 Mar 2021 08:30:45 GMT
Vary: Accept-Encoding
{
"metadata": {
"name": "virtual-network-1",
"namespace": "system",
"labels": {
},
"annotations": {
},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "ad53751b-2de1-4747-a41e-62d3c7326f55",
"creation_timestamp": "2021-03-31T08:30:45.603039500Z",
"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": [
]
}
}