ves-io-schema-role-API-Create

Examples of creating role

Usecase:

Create role-1

Request using vesctl:

vesctl configuration create role -i role.yaml

where file role.yaml has following contents (role.CreateRequest):

metadata:
  name: role-1
  namespace: documentation
spec: {}

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: role-1
  namespace: documentation
spec:
  rbacPolicy: []
systemMetadata:
  creationTimestamp: "2021-08-25T09:03:48.128752374Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 9ca6c002-7a83-439d-927a-7b7321c184bd

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"role-1","namespace":"documentation"},"spec":{}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build970361017_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/web/namespaces/documentation/roles'

curl response:

HTTP/1.1 200 OK
Content-Length: 617
Content-Type: application/json
Date: Wed, 25 Aug 2021 09:03:48 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "role-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "9ca6c002-7a83-439d-927a-7b7321c184bd",
    "creation_timestamp": "2021-08-25T09:03:48.128752374Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "rbac_policy": [
    ]
  }
}