gravitino.client.gravitino_admin_client.GravitinoAdminClient¶
- class gravitino.client.gravitino_admin_client.GravitinoAdminClient(uri: str, check_version: bool = True, auth_data_provider: AuthDataProvider | None = None)¶
Bases:
GravitinoClientBase
Gravitino Client for the administrator to interact with the Gravitino API. It allows the client to list, load, create, and alter Metalakes. Normal users should use {@link GravitinoClient} to connect with the Gravitino server.
- __init__(uri: str, check_version: bool = True, auth_data_provider: AuthDataProvider | None = None)¶
Methods
__init__
(uri[, check_version, ...])alter_metalake
(name, *changes)Alters a specific Metalake using the Gravitino API.
check_metalake_name
(metalake_name)Check the compatibility of the client with the target server.
close
()Closes the GravitinoClient and releases any underlying resources.
create_metalake
(name, comment, properties)Creates a new Metalake using the Gravitino API.
disable_metalake
(name)Disable the metalake with specified name.
drop_metalake
(name[, force])Drops a specific Metalake using the Gravitino API.
enable_metalake
(name)Enable the metalake with specified name.
Retrieves the version of the Gravitino Python Client.
Retrieves the version of the Gravitino API.
Retrieves a list of Metalakes from the Gravitino API.
load_metalake
(name)Loads a specific Metalake from the Gravitino API.
Attributes
The REST API path prefix for load a specific metalake
The REST API path for listing metalakes
- API_METALAKES_IDENTIFIER_PATH = 'api/metalakes/'¶
The REST API path prefix for load a specific metalake
- API_METALAKES_LIST_PATH = 'api/metalakes'¶
The REST API path for listing metalakes
- alter_metalake(name: str, *changes: MetalakeChange) GravitinoMetalake ¶
Alters a specific Metalake using the Gravitino API.
- Args:
name: The name of the Metalake to be altered. changes: The changes to be applied to the Metalake.
- Returns:
A GravitinoMetalake instance representing the updated Metalake.
TODO: @throws NoSuchMetalakeException If the specified Metalake does not exist. TODO: @throws IllegalArgumentException If the provided changes are invalid or not applicable.
- check_version()¶
Check the compatibility of the client with the target server.
- Raises:
GravitinoRuntimeException If the client version is greater than the server version.
- close()¶
Closes the GravitinoClient and releases any underlying resources.
- create_metalake(name: str, comment: str, properties: Dict[str, str]) GravitinoMetalake ¶
Creates a new Metalake using the Gravitino API.
- Args:
name: The name of the new Metalake. comment: The comment for the new Metalake. properties: The properties of the new Metalake.
- Returns:
A GravitinoMetalake instance representing the newly created Metalake. TODO: @throws MetalakeAlreadyExistsException If a Metalake with the specified identifier already exists.
- disable_metalake(name: str)¶
Disable the metalake with specified name. If the metalake is already disabled, does nothing.
- Args:
name: the name of the metalake.
- Raises:
NoSuchMetalakeException if the metalake with specified name does not exist.
- drop_metalake(name: str, force: bool = False) bool ¶
Drops a specific Metalake using the Gravitino API.
- Args:
name: The name of the Metalake to be dropped. force: Whether to force the drop operation.
- Returns:
True if the Metalake was successfully dropped, false if the Metalake does not exist.
- enable_metalake(name: str)¶
Enable the metalake with specified name. If the metalake is already in use, this method does nothing.
- Args:
name: the name of the metalake.
- Raises:
NoSuchMetalakeException if the metalake with specified name does not exist.
- get_client_version() GravitinoVersion ¶
Retrieves the version of the Gravitino Python Client.
- Returns:
A GravitinoVersion instance representing the version of the Gravitino Python Client.
- get_server_version() GravitinoVersion ¶
Retrieves the version of the Gravitino API.
- Returns:
A GravitinoVersion instance representing the version of the Gravitino API.
- list_metalakes() List[GravitinoMetalake] ¶
Retrieves a list of Metalakes from the Gravitino API.
- Returns:
An array of GravitinoMetalake objects representing the Metalakes.
- load_metalake(name: str) GravitinoMetalake ¶
Loads a specific Metalake from the Gravitino API.
- Args:
name: The name of the Metalake to be loaded.
- Returns:
A GravitinoMetalake instance representing the loaded Metalake.
- Raises:
NoSuchMetalakeException If the specified Metalake does not exist.