weaviate.backup package
Module for backup/restore operations
- class weaviate.backup.Backup(connection: Connection)[source]
Bases:
object
Backup class used to schedule and/or check the status of a backup process of Weaviate objects.
Initialize a Classification class instance.
Parameters
- connectionweaviate.connect.Connection
Connection object to an active and running Weaviate instance.
- create(backup_id: str, backend: str, include_classes: List[str] | str | None = None, exclude_classes: List[str] | str | None = None, wait_for_completion: bool = False) dict [source]
Create a backup of all/per class Weaviate objects.
Parameters
- backup_idstr
The identifier name of the backup. NOTE: Case insensitive.
- backendstr
- The backend storage where to create the backup. Currently available options are:
“filesystem”, “s3”, “gcs” and “azure”.
NOTE: Case insensitive.
- include_classesUnion[List[str], str, None], optional
The class/list of classes to be included in the backup. If not specified all classes will be included. Either include_classes or exclude_classes can be set. By default None.
- exclude_classesUnion[List[str], str, None], optional
The class/list of classes to be excluded in the backup. Either include_classes or exclude_classes can be set. By default None.
- wait_for_completionbool, optional
Whether to wait until the backup is done. By default False.
Returns
- dict
Backup creation response.
Raises
- requests.ConnectionError
If the network connection to weaviate fails.
- weaviate.UnexpectedStatusCodeException
If weaviate reports a none OK status.
- TypeError
One of the arguments have a wrong type.
- ValueError
‘backend’ does not have an accepted value.
- get_create_status(backup_id: str, backend: str) Dict[str, Any] [source]
Checks if a started classification job has completed.
Parameters
- backup_idstr
The identifier name of the backup. NOTE: Case insensitive.
- backendstr
- The backend storage where the backup was created. Currently available options are:
“filesystem”, “s3”, “gcs” and “azure”.
NOTE: Case insensitive.
Returns
- dict
Status of the backup create.
- get_restore_status(backup_id: str, backend: str) Dict[str, Any] [source]
Checks if a started classification job has completed.
Parameters
- backup_idstr
The identifier name of the backup. NOTE: Case insensitive.
- backendstr
- The backend storage where to create the backup. Currently available options are:
“filesystem”, “s3”, “gcs” and “azure”.
NOTE: Case insensitive.
Returns
- dict
Status of the backup create.
- restore(backup_id: str, backend: str, include_classes: List[str] | str | None = None, exclude_classes: List[str] | str | None = None, wait_for_completion: bool = False) dict [source]
Restore a backup of all/per class Weaviate objects.
Parameters
- backup_idstr
The identifier name of the backup. NOTE: Case insensitive.
- backendstr
- The backend storage from where to restore the backup. Currently available options are:
“filesystem”, “s3”, “gcs” and “azure”.
NOTE: Case insensitive.
- include_classesUnion[List[str], str, None], optional
The class/list of classes to be included in the backup restore. If not specified all classes will be included (that were backup-ed). Either include_classes or exclude_classes can be set. By default None.
- exclude_classesUnion[List[str], str, None], optional
The class/list of classes to be excluded in the backup restore. Either include_classes or exclude_classes can be set. By default None.
- wait_for_completionbool, optional
Whether to wait until the backup restore is done.
Returns
- dict
Backup restore response.
Raises
- requests.ConnectionError
If the network connection to weaviate fails.
- weaviate.UnexpectedStatusCodeException
If weaviate reports a none OK status.
- class weaviate.backup.BackupStorage(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
str
,Enum
Which backend should be used to write the backup to.
- AZURE = 'azure'
- FILESYSTEM = 'filesystem'
- GCS = 'gcs'
- S3 = 's3'
Submodules
weaviate.backup.backup module
Backup class definition.
- class weaviate.backup.backup.Backup(connection: Connection)[source]
Bases:
object
Backup class used to schedule and/or check the status of a backup process of Weaviate objects.
Initialize a Classification class instance.
Parameters
- connectionweaviate.connect.Connection
Connection object to an active and running Weaviate instance.
- create(backup_id: str, backend: str, include_classes: List[str] | str | None = None, exclude_classes: List[str] | str | None = None, wait_for_completion: bool = False) dict [source]
Create a backup of all/per class Weaviate objects.
Parameters
- backup_idstr
The identifier name of the backup. NOTE: Case insensitive.
- backendstr
- The backend storage where to create the backup. Currently available options are:
“filesystem”, “s3”, “gcs” and “azure”.
NOTE: Case insensitive.
- include_classesUnion[List[str], str, None], optional
The class/list of classes to be included in the backup. If not specified all classes will be included. Either include_classes or exclude_classes can be set. By default None.
- exclude_classesUnion[List[str], str, None], optional
The class/list of classes to be excluded in the backup. Either include_classes or exclude_classes can be set. By default None.
- wait_for_completionbool, optional
Whether to wait until the backup is done. By default False.
Returns
- dict
Backup creation response.
Raises
- requests.ConnectionError
If the network connection to weaviate fails.
- weaviate.UnexpectedStatusCodeException
If weaviate reports a none OK status.
- TypeError
One of the arguments have a wrong type.
- ValueError
‘backend’ does not have an accepted value.
- get_create_status(backup_id: str, backend: str) Dict[str, Any] [source]
Checks if a started classification job has completed.
Parameters
- backup_idstr
The identifier name of the backup. NOTE: Case insensitive.
- backendstr
- The backend storage where the backup was created. Currently available options are:
“filesystem”, “s3”, “gcs” and “azure”.
NOTE: Case insensitive.
Returns
- dict
Status of the backup create.
- get_restore_status(backup_id: str, backend: str) Dict[str, Any] [source]
Checks if a started classification job has completed.
Parameters
- backup_idstr
The identifier name of the backup. NOTE: Case insensitive.
- backendstr
- The backend storage where to create the backup. Currently available options are:
“filesystem”, “s3”, “gcs” and “azure”.
NOTE: Case insensitive.
Returns
- dict
Status of the backup create.
- restore(backup_id: str, backend: str, include_classes: List[str] | str | None = None, exclude_classes: List[str] | str | None = None, wait_for_completion: bool = False) dict [source]
Restore a backup of all/per class Weaviate objects.
Parameters
- backup_idstr
The identifier name of the backup. NOTE: Case insensitive.
- backendstr
- The backend storage from where to restore the backup. Currently available options are:
“filesystem”, “s3”, “gcs” and “azure”.
NOTE: Case insensitive.
- include_classesUnion[List[str], str, None], optional
The class/list of classes to be included in the backup restore. If not specified all classes will be included (that were backup-ed). Either include_classes or exclude_classes can be set. By default None.
- exclude_classesUnion[List[str], str, None], optional
The class/list of classes to be excluded in the backup restore. Either include_classes or exclude_classes can be set. By default None.
- wait_for_completionbool, optional
Whether to wait until the backup restore is done.
Returns
- dict
Backup restore response.
Raises
- requests.ConnectionError
If the network connection to weaviate fails.
- weaviate.UnexpectedStatusCodeException
If weaviate reports a none OK status.
- pydantic model weaviate.backup.backup.BackupReturn[source]
Bases:
BackupStatusReturn
Return type of the backup creation and restore methods.
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.
- field collections: List[str] [Optional] (alias 'classes')
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class weaviate.backup.backup.BackupStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
str
,Enum
The status of a backup.
- FAILED = 'FAILED'
- STARTED = 'STARTED'
- SUCCESS = 'SUCCESS'
- TRANSFERRED = 'TRANSFERRED'
- TRANSFERRING = 'TRANSFERRING'
- pydantic model weaviate.backup.backup.BackupStatusReturn[source]
Bases:
BaseModel
Return type of the backup status methods.
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.
- field path: str [Required]
- field status: BackupStatus [Required]
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.