restoreBackup
Parameters:request-Requestobject containing the parameters for the operation.Returns:Responseobject containing the results of the operation.Throws:GPUdbException- if an error occurs during the operation.restoreBackup
public RestoreBackupResponse restoreBackup(String backupName, Map<String, String> restoreObjectsMap, String datasourceName, Map<String, String> options) throws GPUdbException Parameters:backupName- Name of the backup to restore from, which must refer to an existing backup. The default value is ”.restoreObjectsMap- Map of database objects to be restored from the backup.ALL: All object types and data contained in the given schema(s).CATALOG: Data Lake catalog that is external to the database.CONTEXT: Context(s).CREDENTIAL: Credential(s).DATASINK: Data sink(s).DATASOURCE: Data source(s).DIRECTORY: KiFS File directory(ies).FUNCTION_ENVIRONMENT: Python UDF function environment(s).GRAPH: Graph definition(s). Source table(s), if applicable, are required in order to restore graph objects.MONITOR: Table monitor(s) / SQL stream(s).RESOURCE_GROUP: Resource group(s).ROLE: Role(s), role members (roles or users, recursively), and associated permissions.STORED_PROCEDURE: SQL procedure(s).TABLE: Table(s) and SQL view(s). Tables with subscriptions will by default be restored in the state they were in at the time of the snapshot. SeeRESTORE_SUBSCRIPTIONSfor options to override the default behavior.USER: User(s) (internal and external) and associated permissions.USER_DEFINED_FUNCTION: UDF(s).
datasourceName- Data source through which the backup will be restored.options- Optional parameters.BACKUP_ID: ID of the snapshot to restore. Leave empty to restore the most recent snapshot in the backup. The default value is ”.CHECKSUM: Whether or not to verify checksums for backup files when restoring. Supported values:The default value isFALSE.CREATE_SCHEMA_IF_NOT_EXIST: Behavior to apply when the schema containing any database object to restore does not already exist. Supported values:TRUE: If the schema containing any restored object does not exist, create it automatically.FALSE: If the schema containing any restored object does not exist, return an error.
TRUE.DDL_ONLY: Behavior to apply when restoring tables. Supported values:The default value isFALSE.DRY_RUN: Whether or not to perform a dry run of the restoration operation. Supported values:The default value isFALSE.RESTORE_SUBSCRIPTIONS: Behavior to apply when restoring datasource subscriptions on tables. Supported values:RESUME: Resume subscriptions that were active when the backup was made.PAUSE: Pause subscriptions that were active when the backup was made.CANCEL: Cancel active subscriptions.
RESUME.REINGEST: Behavior to apply when restoring table data. Supported values:TRUE: Restore table data by re-ingesting it. This is the default behavior if the cluster topology differs from that of the contained backup.FALSE: Restore the persisted data files directly.
FALSE.RENAMED_OBJECTS_SCHEMA: If theRESTORE_POLICYisRENAME, use this schema for relocated existing objects instead of the default generated one. The default value is ”.RESTORE_ALL_PERMISSIONS: Whether or not all permissions of restored principals should be restored or scoped to the restored objects. Supported values:The default value isFALSE.RESTORE_POLICY: Behavior to apply when any database object to restore already exists. Supported values:NONE: If an object to be restored already exists with the same name, abort and return error.REPLACE: If an object to be restored already exists with the same name, replace it with the backup version.RENAME: If an object to be restored already exists with the same name, move that existing one to the schema specified byRENAMED_OBJECTS_SCHEMA. This policy does not apply to non-schema objects.
NONE.TARGET_SCHEMA_MAP: Restore schema-based objects to alternate schema. Value is a comma delimitted list of key:value pairs mapping the original (source) schema name as it exists in the backup to a target (destination) schema namespace: “src: dst [, src: dst [, …]]”. Note that schema names are case sensitive and must adhere to the database schema naming criteria. The default value is ”.
Map.Returns:Responseobject containing the results of the operation.Throws:GPUdbException- if an error occurs during the operation.