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:

name: user-1-kubeconfig
namespace: documentation
spec:
  type: KUBE_CONFIG
  users:
  - name: user-1@acmecorp.com
    uid: d1abcbba-4fc8-4a34-bf76-6e8e1c6f2e81
  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","users":[{"uid":"d1abcbba-4fc8-4a34-bf76-6e8e1c6f2e81","name":"user-1@acmecorp.com"}],"virtualK8sNamespace":"documentation","virtualK8sName":"vk8s-documentation"}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build896999001_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: Fri, 31 Jul 2020 12:53:57 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/kubeconfig-1 --http-method GET

where file request.yaml has following contents:

name: user-1-kubeconfig
namespace: documentation

vesctl yaml response:

{}

Request using curl:

curl -X 'GET' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build896999001_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/web/namespaces/system/api_credentials/kubeconfig-1?name=user-1-kubeconfig&namespace=documentation'

curl response:

HTTP/1.1 200 OK
Content-Length: 20
Content-Type: application/json
Date: Fri, 31 Jul 2020 12:53:57 GMT
Vary: Accept-Encoding

{
  "object": null
}