graviti.manager.storage_config
#
The implementation of the StorageConfig and StorageConfigManager.
Module Contents#
Classes#
This class defines the structure of the storage config of Graviti Data Platform. |
|
This class defines the operations on the storage config in Graviti. |
- class graviti.manager.storage_config.StorageConfig(workspace, name)[source]#
Bases:
graviti.utility.ReprMixin
This class defines the structure of the storage config of Graviti Data Platform.
- Parameters
workspace (graviti.Workspace) – The workspace of the storage config.
response –
The response of the OpenAPI associated with the storage config:
{ "id": <str> "name": <str> "config_type": <str> "backend_type": <str> }
name (str) –
- name#
The name of the storage config.
- classmethod from_response(cls, workspace, response)[source]#
Create a
StorageConfig
instance from the response.- Parameters
workspace (graviti.Workspace) – The workspace of the storage config.
response (Dict[str, Any]) –
The response of the storage config:
{ "id": <str> "name": <str> "config_type": <str> "backend_type": <str> }
cls (Type[_T]) –
- Returns
A
StorageConfig
instance created from the response.- Return type
_T
- class graviti.manager.storage_config.StorageConfigManager(workspace)[source]#
This class defines the operations on the storage config in Graviti.
- Parameters
workspace (graviti.Workspace) – Class
Workspace
instance.
- property default_storage_config(self)[source]#
The default storage config of this worksapce.
- Returns
The default storage config of this worksapce.
- Return type
str
- get(self, name)[source]#
Get a Graviti storage config with given name.
- Parameters
name (str) – The name of the storage config.
- Returns
The requested
storage_config
instance.- Raises
ResourceNameError – When the given storage config name is invalid.
- Return type
- list(self)[source]#
List Graviti storage configs.
- Returns
The LazyPagingList of
StorageConfig
instances.- Return type
- edit(self, *, default_storage_config)[source]#
Update Graviti storage config related configs.
- Parameters
default_storage_config (str) – The name of the new default storage config.
- Raises
ResourceNameError – When the given default storage config name is invalid.
- Return type
None