ves-io-schema-api_credential-CustomAPI-Get

Examples of performing api_credential CustomAPI Get

Usecase:

Create kubeconfig for vk8s-documentation for user-1

Request:

Request using vesctl:

vesctl request rpc api_credential.CustomAPI.Get -i request.yaml --uri /public/namespaces/system/api_credentials --http-method POST

where file request.yaml has following contents:

expirationTimestamp: "2021-06-01T11:17:19.500126429Z"
name: user-1-kubeconfig
namespace: documentation
spec:
  type: KUBE_CONFIG
  virtualK8sName: vk8s-documentation
  virtualK8sNamespace: documentation

vesctl yaml response:

{}

Request using curl:

curl -X 'POST' -d '{"namespace":"documentation","name":"user-1-kubeconfig","spec":{"type":"KUBE_CONFIG","virtualK8sNamespace":"documentation","virtualK8sName":"vk8s-documentation"},"expirationTimestamp":"2021-06-01T11:17:19.500126429Z"}' -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/web/namespaces/system/api_credentials'

curl response:

HTTP/1.1 200 OK
Content-Length: 30
Content-Type: application/json
Date: Wed, 12 May 2021 11:17:25 GMT
Vary: Accept-Encoding

{
  "data": "",
  "name": ""
}

Usecase:

Get kubeconfig for user-1 created in earlier example

Request:

Request using vesctl:

vesctl request rpc api_credential.CustomAPI.Get -i request.yaml --uri /public/namespaces/system/api_credentials --http-method GET

where file request.yaml has following contents:

name: user-1-kubeconfig-2d3bff4b-920c-4192-82f4-617546917bac
namespace: documentation

vesctl yaml response:

{}

Request using curl:

curl -X 'GET' -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/web/namespaces/system/api_credentials?name=user-1-kubeconfig-2d3bff4b-920c-4192-82f4-617546917bac&namespace=documentation'

curl response:

HTTP/1.1 200 OK
Content-Length: 20
Content-Type: application/json
Date: Wed, 12 May 2021 11:17:25 GMT
Vary: Accept-Encoding

{
  "items": [
  ]
}