ves-io-schema-token-API-Create

Examples of creating token

Usecase:

Create token-1

Request using vesctl:

vesctl configuration create token -i token.yaml

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

metadata:
  name: token-1
  namespace: documentation
spec: {}

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: token-1
  namespace: documentation
spec: {}
systemMetadata:
  creationTimestamp: "2020-09-23T09:54:04.615710300Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 899942ff-809c-4ca4-927a-c662ffe677bc

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"token-1","namespace":"documentation"},"spec":{}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build823219857_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/register/namespaces/documentation/tokens'

curl response:

HTTP/1.1 200 OK
Content-Length: 592
Content-Type: application/json
Date: Wed, 23 Sep 2020 09:54:04 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "token-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "899942ff-809c-4ca4-927a-c662ffe677bc",
    "creation_timestamp": "2020-09-23T09:54:04.615710300Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {

  }
}