ves-io-schema-namespace_role-API-Create

Examples of creating namespace_role

Usecase:

Create namespace-role-1

Request using vesctl:

vesctl configuration create namespace_role -i namespace_role.yaml

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

RequestJSON:

{"metadata":{"name":"namespace-role-1","namespace":"documentation"},"spec":{"user":[{"kind":"user","name":"alice"}],"role":[{"kind":"role","name":"admin"}]}} `

vesctl yaml response:

ResponseJSON:

  "metadata": {
    "name": "namespace-role-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "3aa774a1-9126-484e-9e0c-a868f551f73b",
    "creation_timestamp": "2022-07-28T12:10:58.588685041Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null,
    "labels": {
    }
  },
  "spec": {
    "user": [
      {
        "kind": "user",
        "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
        "tenant": "acmecorp",
        "namespace": "documentation",
        "name": "alice"
      }
    ],
    "role": [
      {
        "kind": "role",
        "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
        "tenant": "acmecorp",
        "namespace": "documentation",
        "name": "admin"
      }
    ],
    "namespace": ""
  }
}```
`

Request using curl:

    


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



curl response:

	


HTTP/1.1 200 OK Content-Length: 1059 Content-Type: application/json Date: Thu, 28 Jul 2022 12:10:58 GMT Vary: Accept-Encoding

{ "metadata": { "name": "namespace-role-1", "namespace": "documentation", "labels": { }, "annotations": { }, "description": "", "disable": false }, "system_metadata": { "uid": "3aa774a1-9126-484e-9e0c-a868f551f73b", "creation_timestamp": "2022-07-28T12:10:58.588685041Z", "deletion_timestamp": null, "modification_timestamp": null, "initializers": null, "finalizers": [ ], "tenant": "acmecorp", "creator_class": "examplesvc", "creator_id": "examplesvc", "object_index": 0, "owner_view": null, "labels": { } }, "spec": { "user": [ { "kind": "user", "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff", "tenant": "acmecorp", "namespace": "documentation", "name": "alice" } ], "role": [ { "kind": "role", "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff", "tenant": "acmecorp", "namespace": "documentation", "name": "admin" } ], "namespace": "" } }