ves-io-schema-token-CustomAPI-TokenState

Examples of performing token CustomAPI TokenState

Usecase:

Perform TokenState on token

Request:

Request using vesctl:

vesctl request rpc token.CustomAPI.TokenState -i request.yaml --uri /public/namespaces/namespace-literal/tokens/name-literal/state --http-method POST

where file request.yaml has following contents:

{}

vesctl yaml response:

obj:
  metadata:
    annotations:
      tu-generated: "yes"
    labels:
      abc: def
    name: token-7fc9e340-6ec8-44c2-85fd-668eb85cef4b
    namespace: system
    uid: 7fc9e340-6ec8-44c2-85fd-668eb85cef4b
  spec:
    gcSpec:
      state: VALID
  systemMetadata:
    finalizers: []
    namespace: []
    tenant: customer1
    uid: 7fc9e340-6ec8-44c2-85fd-668eb85cef4b

Request using curl:

curl -X 'POST' -d '{}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build672621555_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/register/namespaces/namespace-literal/tokens/name-literal/state'

curl response:

HTTP/1.1 200 OK
Content-Length: 905
Content-Type: application/json
Date: Wed, 12 May 2021 11:18:54 GMT
Vary: Accept-Encoding

{
  "obj": {
    "metadata": {
      "name": "token-7fc9e340-6ec8-44c2-85fd-668eb85cef4b",
      "namespace": "system",
      "uid": "7fc9e340-6ec8-44c2-85fd-668eb85cef4b",
      "labels": {
        "abc": "def"
      },
      "annotations": {
        "tu-generated": "yes"
      },
      "description": "",
      "disable": false
    },
    "system_metadata": {
      "uid": "7fc9e340-6ec8-44c2-85fd-668eb85cef4b",
      "creation_timestamp": null,
      "deletion_timestamp": null,
      "modification_timestamp": null,
      "initializers": null,
      "finalizers": [
      ],
      "tenant": "customer1",
      "creator_class": "",
      "creator_id": "",
      "creator_cookie": "",
      "trace_info": "",
      "object_index": 0,
      "namespace": [
      ],
      "owner_view": null,
      "sre_disable": false
    },
    "spec": {
      "gc_spec": {
        "state": "VALID"
      }
    }
  }
}