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):

RequestJSON:

{"metadata":{"name":"token-1","namespace":"system"},"spec":{}} `

vesctl yaml response:

ResponseJSON:

  "metadata": {
    "name": "token-1",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "96110817-cbf4-403c-bc30-67a5bf664195",
    "creation_timestamp": "2022-07-28T12:13:34.291684141Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null,
    "labels": {
    }
  },
  "spec": {
    "state": "UNKNOWN"
  }
}```
`

Request using curl:

    


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



curl response:

	


HTTP/1.1 200 OK Content-Length: 630 Content-Type: application/json Date: Thu, 28 Jul 2022 12:13:34 GMT Vary: Accept-Encoding

{ "metadata": { "name": "token-1", "namespace": "system", "labels": { }, "annotations": { }, "description": "", "disable": false }, "system_metadata": { "uid": "96110817-cbf4-403c-bc30-67a5bf664195", "creation_timestamp": "2022-07-28T12:13:34.291684141Z", "deletion_timestamp": null, "modification_timestamp": null, "initializers": null, "finalizers": [ ], "tenant": "acmecorp", "creator_class": "examplesvc", "creator_id": "examplesvc", "object_index": 0, "owner_view": null, "labels": { } }, "spec": { "state": "UNKNOWN" } }