Skip to main content

List Roles

Retrieve a list of all roles in the cluster.

Endpoint

GET /api/v1/roles

Query Parameters

config
string
required
The kubeconfig identifier for the cluster connection
cluster
string
required
The cluster name to query
namespace
string
Filter roles by namespace. If not provided, returns roles from all namespaces.

Response

Returns an array of role objects.
uid
string
Unique identifier for the role
namespace
string
The namespace where the role is located
name
string
The name of the role
age
string
Creation timestamp of the role
spec
object
Role specification

Example Request

curl -X GET "https://api.kubewall.io/api/v1/roles?config=default&cluster=production&namespace=default" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Example Response

[
  {
    "uid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "namespace": "default",
    "name": "pod-reader",
    "age": "2024-01-15T10:30:00Z",
    "spec": {
      "rules": 3
    }
  }
]

Get Role Details

Retrieve detailed information about a specific role.

Endpoint

GET /api/v1/roles/:name

Path Parameters

name
string
required
The name of the role

Query Parameters

config
string
required
The kubeconfig identifier for the cluster connection
cluster
string
required
The cluster name to query
namespace
string
required
The namespace where the role is located

Example Request

curl -X GET "https://api.kubewall.io/api/v1/roles/pod-reader?config=default&cluster=production&namespace=default" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Get Role YAML

Retrieve the YAML manifest of a role.

Endpoint

GET /api/v1/roles/:name/yaml

Path Parameters

name
string
required
The name of the role

Query Parameters

config
string
required
The kubeconfig identifier for the cluster connection
cluster
string
required
The cluster name to query
namespace
string
required
The namespace where the role is located

Example Request

curl -X GET "https://api.kubewall.io/api/v1/roles/pod-reader/yaml?config=default&cluster=production&namespace=default" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Get Role Events

Retrieve events related to a specific role.

Endpoint

GET /api/v1/roles/:name/events

Path Parameters

name
string
required
The name of the role

Query Parameters

config
string
required
The kubeconfig identifier for the cluster connection
cluster
string
required
The cluster name to query
namespace
string
required
The namespace where the role is located

Example Request

curl -X GET "https://api.kubewall.io/api/v1/roles/pod-reader/events?config=default&cluster=production&namespace=default" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Delete Role

Delete one or more roles.

Endpoint

DELETE /api/v1/roles

Query Parameters

config
string
required
The kubeconfig identifier for the cluster connection
cluster
string
required
The cluster name to query
namespace
string
required
The namespace where the role is located
name
string
required
The name of the role to delete. Can be a comma-separated list for multiple deletions.

Example Request

curl -X DELETE "https://api.kubewall.io/api/v1/roles?config=default&cluster=production&namespace=default&name=pod-reader" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Build docs developers (and LLMs) love