ves-io-schema-api_credential-CustomAPI-CreateServiceCredentials

Examples of performing api_credential CustomAPI CreateServiceCredentials

Usecase:

Create service credentials

Request:

Request using vesctl:

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

where file request.yaml has following contents:

expirationTimestamp: "2020-07-02T15:52:50.430605Z"
name: user-1-service-creds
namespace: documentation
namespaceRoles:
- namespace: system
  role: ves-io-admin-role3
type: KUBE_CONFIG

vesctl yaml response:

{}

Request using curl:

curl -X 'POST' -d '{"type":"KUBE_CONFIG","namespace":"documentation","name":"user-1-service-creds","namespaceRoles":[{"namespace":"system","role":"ves-io-admin-role3"}],"expirationTimestamp":"2020-07-02T15:52:50.430605Z"}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build743694289_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/web/namespaces/system/service_credentials'

curl response:

HTTP/1.1 200 OK
Content-Length: 30
Content-Type: application/json
Date: Thu, 02 Jul 2020 15:52:52 GMT
Vary: Accept-Encoding

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