ves-io-schema-virtual_site-API-Create
On This Page:
Examples of creating virtual_site
Usecase:
Create virtual-site-1
Request using vesctl:
vesctl configuration create virtual_site -i virtual_site.yaml
where file virtualsite.yaml has following contents (virtualsite.CreateRequest):
metadata:
name: virtual-site-1
namespace: documentation
spec:
siteSelector:
expressions:
- some-label
siteType: CUSTOMER_EDGE
vesctl yaml response:
metadata:
annotations: {}
labels: {}
name: virtual-site-1
namespace: documentation
spec:
siteSelector:
expressions:
- some-label
siteType: CUSTOMER_EDGE
systemMetadata:
creationTimestamp: "2021-03-31T08:30:47.113706900Z"
creatorClass: examplesvc
creatorId: examplesvc
finalizers: []
tenant: acmecorp
uid: e801bb31-c721-4581-a410-a5667fe8ddb7
Request using curl:
curl -X 'POST' -d '{"metadata":{"name":"virtual-site-1","namespace":"documentation"},"spec":{"siteSelector":{"expressions":["some-label"]},"siteType":"CUSTOMER_EDGE"}}' -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/documentation/virtual_sites'
curl response:
HTTP/1.1 200 OK
Content-Length: 713
Content-Type: application/json
Date: Wed, 31 Mar 2021 08:30:47 GMT
Vary: Accept-Encoding
{
"metadata": {
"name": "virtual-site-1",
"namespace": "documentation",
"labels": {
},
"annotations": {
},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "e801bb31-c721-4581-a410-a5667fe8ddb7",
"creation_timestamp": "2021-03-31T08:30:47.113706900Z",
"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_selector": {
"expressions": [
"some-label"
]
},
"site_type": "CUSTOMER_EDGE"
}
}