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:
expirationDays: 20name: user-1-service-credsnamespace: documentationnamespaceRoles:- namespace: system role: ves-io-monitor-role- namespace: shared role: ves-io-monitor-role- namespace: app-ns1 role: ves-io-developer-roletype: SERVICE_API_TOKENvesctl yaml response:
{}Request using curl:
curl -X 'POST' -d '{"type":"SERVICE_API_TOKEN","namespace":"documentation","name":"user-1-service-creds","namespace_roles":[{"namespace":"system","role":"ves-io-monitor-role"},{"namespace":"shared","role":"ves-io-monitor-role"},{"namespace":"app-ns1","role":"ves-io-developer-role"}],"expiration_days":20}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_q2_3kp8z3zs0x5_m7pk1bgb0_ph0000gp_T_go-build1655461974_b001_apidocs.test/host=MTY6VVHQPH/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/web/namespaces/system/service_credentials'curl response:
HTTP/1.1 200 OKContent-Length: 81Content-Type: application/jsonDate: Fri, 19 Jun 2026 22:02:15 GMTVary: Accept-Encoding
{ "data": "", "name": "", "active": false, "expiration_timestamp": null}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:
apiToken: nullexpirationDays: 20name: user-1-service-credsnamespace: documentationnamespaceRoles:- namespace: system role: ves-io-monitor-role- namespace: shared role: ves-io-monitor-role- namespace: app-ns1 role: ves-io-developer-roletype: SERVICE_API_TOKENvesctl yaml response:
{}Request using curl:
curl -X 'POST' -d '{"type":"SERVICE_API_TOKEN","namespace":"documentation","name":"user-1-service-creds","namespace_roles":[{"namespace":"system","role":"ves-io-monitor-role"},{"namespace":"shared","role":"ves-io-monitor-role"},{"namespace":"app-ns1","role":"ves-io-developer-role"}],"expiration_days":20,"api_token":null}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_q2_3kp8z3zs0x5_m7pk1bgb0_ph0000gp_T_go-build1655461974_b001_apidocs.test/host=MTY6VVHQPH/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/web/namespaces/system/service_credentials'curl response:
HTTP/1.1 200 OKContent-Length: 81Content-Type: application/jsonDate: Fri, 19 Jun 2026 22:02:15 GMTVary: Accept-Encoding
{ "data": "", "name": "", "active": false, "expiration_timestamp": null}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:
expirationDays: 20name: user-1-service-credsnamespace: documentationnamespaceRoles:- namespace: system role: ves-io-monitor-role- namespace: shared role: ves-io-monitor-role- namespace: app-ns1 role: ves-io-developer-roletype: KUBE_CONFIGvk8sKubeconfig: vk8sClusterName: virtual-k8s-name vk8sNamespace: virtual-k8s-namespacevesctl yaml response:
{}Request using curl:
curl -X 'POST' -d '{"type":"KUBE_CONFIG","namespace":"documentation","name":"user-1-service-creds","namespace_roles":[{"namespace":"system","role":"ves-io-monitor-role"},{"namespace":"shared","role":"ves-io-monitor-role"},{"namespace":"app-ns1","role":"ves-io-developer-role"}],"expiration_days":20,"vk8s_kubeconfig":{"vk8s_namespace":"virtual-k8s-namespace","vk8s_cluster_name":"virtual-k8s-name"}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_q2_3kp8z3zs0x5_m7pk1bgb0_ph0000gp_T_go-build1655461974_b001_apidocs.test/host=MTY6VVHQPH/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/web/namespaces/system/service_credentials'curl response:
HTTP/1.1 200 OKContent-Length: 81Content-Type: application/jsonDate: Fri, 19 Jun 2026 22:02:15 GMTVary: Accept-Encoding
{ "data": "", "name": "", "active": false, "expiration_timestamp": null}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:
apiCertificate: password: passW@Rd!expirationDays: 20name: user-1-service-credsnamespace: documentationnamespaceRoles:- namespace: system role: ves-io-monitor-role- namespace: shared role: ves-io-monitor-role- namespace: app-ns1 role: ves-io-developer-rolevesctl yaml response:
{}Request using curl:
curl -X 'POST' -d '{"namespace":"documentation","name":"user-1-service-creds","namespace_roles":[{"namespace":"system","role":"ves-io-monitor-role"},{"namespace":"shared","role":"ves-io-monitor-role"},{"namespace":"app-ns1","role":"ves-io-developer-role"}],"expiration_days":20,"api_certificate":{"password":"passW@Rd!"}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_q2_3kp8z3zs0x5_m7pk1bgb0_ph0000gp_T_go-build1655461974_b001_apidocs.test/host=MTY6VVHQPH/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/web/namespaces/system/service_credentials'curl response:
HTTP/1.1 200 OKContent-Length: 81Content-Type: application/jsonDate: Fri, 19 Jun 2026 22:02:15 GMTVary: Accept-Encoding
{ "data": "", "name": "", "active": false, "expiration_timestamp": null}