Spaces#
- class SpacesClient(*, sdk_config: SDKConfiguration, generated_client: ApiClient)[source]#
Bases:
objectClient for managing Arize spaces.
This class is primarily intended for internal use within the SDK. Users are highly encouraged to access resource-specific functionality via
arize.ArizeClient.The spaces client is a thin wrapper around the generated REST API client, using the shared generated API client owned by
arize.config.SDKConfiguration.- Parameters:
sdk_config (SDKConfiguration) – Resolved SDK configuration.
generated_client (ApiClient) – Shared generated API client instance.
- list(*, organization_id: str | None = None, name: str | None = None, limit: int = DEFAULT_LIST_LIMIT, cursor: str | None = None) SpaceListResponse[source]#
List spaces the user has access to.
This endpoint supports cursor-based pagination. When provided,
organization_idfilters results to a particular organization.namefilters results to spaces whose name contains the given substring (case-insensitive).- Parameters:
organization_id (str | None) – Optional organization ID to filter results.
name (str | None) – Optional case-insensitive substring filter on space name.
limit (int) – Maximum number of spaces to return. The server may enforce an upper bound.
cursor (str | None) – Opaque pagination cursor from a previous response.
- Returns:
A paginated space list response from the Arize REST API.
- Raises:
ApiException – If the API request fails.
- Return type:
SpaceListResponse
- create(*, name: str, organization_id: str, description: str | None = None) Space[source]#
Create a new space.
Space names must be unique within the target organization.
- Parameters:
- Returns:
The created space object.
- Raises:
ApiException – If the API request fails.
- Return type:
- delete(*, space: str) None[source]#
Delete a space by ID or name.
This operation is irreversible. It deletes the space and all resources that belong to it (models, monitors, dashboards, datasets, custom metrics, etc).
- Parameters:
space (str) – Space ID or name to delete.
- Returns:
This method returns None on success (204 No Content response).
- Raises:
ApiException – If the API request fails (for example, space not found or insufficient permissions).
- Return type:
None
- update(*, space: str, name: str | None = None, description: str | None = None) Space[source]#
Update a space by ID or name.
- Parameters:
- Returns:
The updated space object.
- Raises:
ValueError – If neither
namenordescriptionis provided.ApiException – If the API request fails (for example, space not found or insufficient permissions).
- Return type:
- add_user(*, space: str, user_id: str, role: PredefinedSpaceRole | CustomSpaceRole) SpaceMembership[source]#
Add a user to a space (or update their role if already a member).
If the user is already a member of the space, their role is updated to the specified value (upsert). The user must already be a member of the space’s parent organization — auto-enrollment is not performed.
Role constraints
Users with an
annotatoraccount role can only be assigned theannotatorpredefined space role.Users with a non-annotator account role cannot be assigned the
annotatorpredefined space role.
Requires space admin role for predefined roles, or
ROLE_BINDING_CREATEpermission for custom roles.- Parameters:
space (str) – Space ID or name.
user_id (str) – Global ID of the user to add.
role (PredefinedSpaceRole | CustomSpaceRole) – Role assignment for the user. Use
PredefinedSpaceRole(name="<role>")for predefined roles (admin,member,read-only,annotator), orCustomRoleAssignment(type="custom", id="<role_id>")for a custom RBAC role.
- Returns:
The created or updated space membership record.
- Raises:
ApiException – If the API request fails (for example, space or user not found, user not in the parent organization, role constraint violation, or insufficient permissions).
- Return type:
SpaceMembership
- remove_user(*, space: str, user_id: str) None[source]#
Remove a user from a space.
Removes both the legacy space-membership row and any RBAC role bindings for the user on this space.
Requires space admin role (legacy auth) or
ROLE_BINDING_DELETEpermission (RBAC).- Parameters:
- Returns:
This method returns None on success (204 No Content response).
- Raises:
ApiException – If the API request fails (for example, space or user not found, or user is not a member of the space).
- Return type:
None
Response Types#
- class Space(*, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)], description: Annotated[str, Strict(strict=True)], created_at: datetime)[source]#
Bases:
BaseModelA space is a container within an organization for grouping related projects, datasets, and experiments. Spaces enable team collaboration or isolated experimentation with role-based access control.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
- id: StrictStr#
- name: StrictStr#
- description: StrictStr#
- created_at: datetime#
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of Space from a JSON string
- to_dict() Dict[str, Any][source]#
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True):
None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.