ves-io-schema-virtual_k8s-API-Create

Examples of creating virtual_k8s

Usecase:

Create virtual-k8s-1

Request using vesctl:

vesctl configuration create virtual_k8s -i virtual_k8s.yaml

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

metadata:
  name: virtual-k8s-1
  namespace: documentation
spec: {}

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: virtual-k8s-1
  namespace: documentation
spec:
  vsiteRefs: []
systemMetadata:
  creationTimestamp: "2021-03-31T08:30:43.846203500Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 426d6836-b9a3-4443-927b-46096dc0dc25

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"virtual-k8s-1","namespace":"documentation"},"spec":{}}' -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_k8ss'

curl response:

HTTP/1.1 200 OK
Content-Length: 655
Content-Type: application/json
Date: Wed, 31 Mar 2021 08:30:43 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "virtual-k8s-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "426d6836-b9a3-4443-927b-46096dc0dc25",
    "creation_timestamp": "2021-03-31T08:30:43.846203500Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "vsite_refs": [
    ],
    "default_flavor_ref": null
  }
}