Role Binding

class perses_api.role_binding.GlobalRoleBinding[source]

Bases: RoleBindingBase

The class includes all necessary methods to access the Perses global role bindings API

Parameters:

perses_api_model (APIModel) – Inject a Perses API model object that includes all necessary values and information

api

This is where we store the api

Type:

Api

class perses_api.role_binding.ProjectRoleBinding[source]

Bases: RoleBindingBase

The class includes all necessary methods to access the Perses project-scoped role bindings API

Parameters:
  • perses_api_model (APIModel) – Inject a Perses API model object that includes all necessary values and information

  • project_name (str) – Specify the name of the project to scope role binding operations to

api

This is where we store the api

Type:

Api

project_name

This is where we store the project_name

Type:

str

__init__(perses_api_model: APIModel, project_name: str)[source]
class perses_api.role_binding.RoleBindingBase[source]

Bases: ResourceBase

The class includes all necessary base methods to access the Perses role bindings API

Parameters:

perses_api_model (APIModel) – Inject a Perses API model object that includes all necessary values and information

api

This is where we store the api

Type:

Api

create_role_binding(role_binding) dict[source]

The method includes a functionality to create a new role binding

Parameters:

role_binding (RoleBinding | GlobalRoleBinding) – Specify the role binding resource to create

Raises:

Exception – Unspecified error by executing the API call

Returns:

The created role binding dict

Return type:

dict

delete_role_binding(name: str) None[source]

The method includes a functionality to delete a role binding by name

Parameters:

name (str) – Specify the name of the role binding to delete

Raises:

ValueError – Missed specifying a necessary value

get_role_binding(name: str) dict[source]

The method includes a functionality to retrieve a single role binding by name

Parameters:

name (str) – Specify the name of the role binding to retrieve

Raises:
  • ValueError – Missed specifying a necessary value

  • Exception – Unspecified error by executing the API call

Returns:

The role binding dict

Return type:

dict

get_role_bindings(name: str = None) list[source]

The method includes a functionality to retrieve all role bindings

Parameters:

name (str) – Specify a name to filter the results (default None)

Raises:

Exception – Unspecified error by executing the API call

Returns:

A list of role binding dicts

Return type:

list

update_role_binding(name: str, role_binding) dict[source]

The method includes a functionality to update an existing role binding by name

Parameters:
  • name (str) – Specify the name of the role binding to update

  • role_binding (RoleBinding | GlobalRoleBinding) – Specify the updated role binding resource

Raises:
  • ValueError – Missed specifying a necessary value

  • Exception – Unspecified error by executing the API call

Returns:

The updated role binding dict

Return type:

dict