Role bindings API
The /rolebindings
API endpoint
/rolebindings
(GET)
The /rolebindings
API endpoint provides HTTP GET access to role binding data.
EXAMPLE
The following example demonstrates a request to the /rolebindings
API, resulting in
a JSON Array containing role binding definitions.
curl http://127.0.0.1:8080/api/core/v2/namespaces/default/rolebindings -H "Authorization: Bearer $SENSU_TOKEN"
HTTP/1.1 200 OK
[
{
"subjects": [
{
"type": "Group",
"name": "readers"
}
],
"role_ref": {
"type": "Role",
"name": "read-only"
},
"metadata": {
"name": "readers-group-binding",
"namespace": "default"
}
}
]
API Specification
/rolebindings (GET) | |
---|---|
description | Returns the list of role bindings. |
example url | http://hostname:8080/api/core/v2/namespaces/default/rolebindings |
pagination | This endpoint supports pagination using the limit and continue query parameters. See the API overview for details. |
response type | Array |
response codes |
|
output |
|
/rolebindings
(POST)
/rolebindings (POST) | |
---|---|
description | Create a Sensu role binding. |
example URL | http://hostname:8080/api/core/v2/namespaces/default/rolebindings |
payload |
|
response codes |
|
The /rolebindings/:rolebinding
API endpoint
/rolebindings/:rolebinding
(GET)
The /rolebindings/:rolebinding
API endpoint provides HTTP GET access to role binding data for specific :rolebinding
definitions, by role binding name
.
EXAMPLE
In the following example, querying the /rolebindings/:rolebinding
API returns a JSON Map
containing the requested :rolebinding
definition (in this example: for the :rolebinding
named
readers-group-binding
).
curl http://127.0.0.1:8080/api/core/v2/namespaces/default/rolebindings/readers-group-binding -H "Authorization: Bearer $SENSU_TOKEN"
HTTP/1.1 200 OK
{
"subjects": [
{
"type": "Group",
"name": "readers"
}
],
"role_ref": {
"type": "Role",
"name": "read-only"
},
"metadata": {
"name": "readers-group-binding",
"namespace": "default"
}
}
API Specification
/rolebindings/:rolebinding (GET) | |
---|---|
description | Returns a role binding. |
example url | http://hostname:8080/api/core/v2/namespaces/default/rolebindings/readers-group-binding |
response type | Map |
response codes |
|
output |
|
/rolebindings/:rolebinding
(PUT)
API Specification
/rolebindings/:rolebinding (PUT) | |
---|---|
description | Create or update a Sensu role binding. |
example URL | http://hostname:8080/api/core/v2/namespaces/default/rolebindings/readers-group-binding |
payload |
|
response codes |
|
/rolebindings/:rolebinding
(DELETE)
The /rolebindings/:rolebinding
API endpoint provides HTTP DELETE access to delete a role binding from Sensu given the role binding name.
EXAMPLE
The following example shows a request to delete the role binding dev-binding
, resulting in a successful HTTP 204 No Content response.
curl -X DELETE \
-H "Authorization: Bearer $SENSU_TOKEN" \
http://127.0.0.1:8080/api/core/v2/namespaces/default/rolebindings/dev-binding
HTTP/1.1 204 No Content
API Specification
/rolebindings/:rolebinding (DELETE) | |
---|---|
description | Removes a role binding from Sensu given the role binding name. |
example url | http://hostname:8080/api/core/v2/namespaces/default/rolebindings/dev-binding |
response codes |
|