The role_bindings client methods are currently in BETA. The API may change without notice. A one-time warning is emitted on first use.
Role bindings assign a role to a user on a specific resource (SPACE or PROJECT). Attempting to create a binding when one already exists for the user on the resource raises an error (HTTP 409 Conflict).
List Role Bindings
The list method is currently in ALPHA. The API may change without notice.
List role bindings for your account, filtered by resource type. resource_type is required; optionally filter to a single user with user_id.
from arize.role_bindings.types import RoleBindingResourceType
resp = client.role_bindings.list(
resource_type=RoleBindingResourceType.PROJECT, # SPACE or PROJECT
user_id="your-user-id", # optional
limit=50,
)
for binding in resp.role_bindings:
print(binding.id, binding.user_id, binding.role_id)
For details on pagination, field introspection, and data conversion (to dict/JSON/DataFrame), see Response Objects.
Create a Role Binding
from arize.role_bindings.types import RoleBindingResourceType
binding = client.role_bindings.create(
user_id="your-user-id",
role_id="your-role-id",
resource_type=RoleBindingResourceType.PROJECT, # SPACE or PROJECT
resource_id="your-project-id",
)
print(binding.id)
Get a Role Binding
binding = client.role_bindings.get(binding_id="your-binding-id")
print(binding.user_id, binding.role_id)
Update a Role Binding
Only the role_id can be changed. The user, resource type, and resource ID remain the same.
binding = client.role_bindings.update(
binding_id="your-binding-id",
role_id="your-new-role-id",
)
print(binding.role_id)
Delete a Role Binding
client.role_bindings.delete(binding_id="your-binding-id")