Skip to content

restore_from_db_backup

restore_from_db_backup(
    name: DbResourceName,
    db_backup_id: DbBackupId,
    *,
    config_overrides: Optional[TimestreamInfluxDBClientConfig] = None,
    restore_to_time: Optional[datetime] = None,
    restore_mode: Optional[RestoreMode] = None,
    vpc_subnet_ids: Optional[VpcSubnetIdList] = None,
    vpc_security_group_ids: Optional[VpcSecurityGroupIdList] = None,
    publicly_accessible: Optional[bool] = None,
    log_delivery_configuration: Optional[LogDeliveryConfiguration] = None,
    maintenance_schedule: Optional[MaintenanceSchedule] = None,
    tags: Optional[RequestTagMap] = None,
    port: Optional[Port] = None,
    network_type: Optional[NetworkType] = None,
    deployment_type: Optional[ResourceDeploymentType] = None,
    db_backup_configurations: Optional[DbBackupConfigurationInputList] = None,
    kms_key_id: Optional[KmsKeyId] = None,
) -> RestoreFromDbBackupOutput

Restores a Timestream for InfluxDB resource from a backup. By default, a new resource is created. You can optionally restore to the same resource using the REPLACE_EXISTING restore mode.

Parameters:

  • name (DbResourceName) –

    The name of the new resource to create from the restore. If restoring to an existing resource, the name must match the existing resource name.

  • db_backup_id (DbBackupId) –

    The identifier of the backup to restore from.

  • restore_to_time (Optional[datetime], default: None ) –

    The point in time to restore to, for continuous backups. Must be within the backup's retention window.

  • restore_mode (Optional[RestoreMode], default: None ) –

    Specifies whether to restore to a new resource or replace the existing resource. Valid values are NEW_RESOURCE (default) and REPLACE_EXISTING.

  • vpc_subnet_ids (Optional[VpcSubnetIdList], default: None ) –

    A list of VPC subnet IDs for the restored resource. If not specified, the restored resource uses the same subnets as the backup.

  • vpc_security_group_ids (Optional[VpcSecurityGroupIdList], default: None ) –

    A list of VPC security group IDs for the restored resource. If not specified, the restored resource uses the same security groups as the backup.

  • publicly_accessible (Optional[bool], default: None ) –

    Specifies whether the restored resource is publicly accessible.

  • log_delivery_configuration (Optional[LogDeliveryConfiguration], default: None ) –

    Configuration for sending InfluxDB engine logs to the specified S3 bucket for the restored resource.

  • maintenance_schedule (Optional[MaintenanceSchedule], default: None ) –

    The maintenance schedule for the restored resource.

  • tags (Optional[RequestTagMap], default: None ) –

    A list of key-value pairs to associate with the restored resource.

  • port (Optional[Port], default: None ) –

    The port number on which the restored InfluxDB resource accepts connections.

  • network_type (Optional[NetworkType], default: None ) –

    Specifies the network type of the restored resource. Valid values are IPV4 and DUAL.

  • deployment_type (Optional[ResourceDeploymentType], default: None ) –

    Specifies the deployment type of the restored resource. Valid values are SINGLE_AZ, WITH_MULTIAZ_STANDBY, and MULTI_NODE_READ_REPLICAS.

  • db_backup_configurations (Optional[DbBackupConfigurationInputList], default: None ) –

    A list of backup configurations to apply to the restored resource.

  • kms_key_id (Optional[KmsKeyId], default: None ) –

    The Amazon Web Services KMS key identifier to use for encryption of the restored resource. Can be a key ID, key ARN, alias name, or alias ARN.

Raises:

Source code in docs_src/capo_timestream_influxdb/_services/timestream_influx_db.py
def restore_from_db_backup(
    self,
    name: "capo_timestream_influxdb.types.db_resource_name.DbResourceName",
    db_backup_id: "capo_timestream_influxdb.types.db_backup_id.DbBackupId",
    *,
    config_overrides: Optional[TimestreamInfluxDBClientConfig] = None,
    restore_to_time: Optional[datetime.datetime] = None,
    restore_mode: Optional[
        "capo_timestream_influxdb.types.restore_mode.RestoreMode"
    ] = None,
    vpc_subnet_ids: Optional[
        "capo_timestream_influxdb.types.vpc_subnet_id_list.VpcSubnetIdList"
    ] = None,
    vpc_security_group_ids: Optional[
        "capo_timestream_influxdb.types.vpc_security_group_id_list.VpcSecurityGroupIdList"
    ] = None,
    publicly_accessible: Optional[bool] = None,
    log_delivery_configuration: Optional[
        "capo_timestream_influxdb.types.log_delivery_configuration.LogDeliveryConfiguration"
    ] = None,
    maintenance_schedule: Optional[
        "capo_timestream_influxdb.types.maintenance_schedule.MaintenanceSchedule"
    ] = None,
    tags: Optional[
        "capo_timestream_influxdb.types.request_tag_map.RequestTagMap"
    ] = None,
    port: Optional["capo_timestream_influxdb.types.port.Port"] = None,
    network_type: Optional[
        "capo_timestream_influxdb.types.network_type.NetworkType"
    ] = None,
    deployment_type: Optional[
        "capo_timestream_influxdb.types.resource_deployment_type.ResourceDeploymentType"
    ] = None,
    db_backup_configurations: Optional[
        "capo_timestream_influxdb.types.db_backup_configuration_input_list.DbBackupConfigurationInputList"
    ] = None,
    kms_key_id: Optional[
        "capo_timestream_influxdb.types.kms_key_id.KmsKeyId"
    ] = None,
) -> "capo_timestream_influxdb.types.restore_from_db_backup_output.RestoreFromDbBackupOutput":
    """<p>Restores a Timestream for InfluxDB resource from a backup. By default, a new resource is created. You can optionally restore to the same resource using the REPLACE_EXISTING restore mode.</p>

    Args:
        name: <p>The name of the new resource to create from the restore. If restoring to an existing resource, the name must match the existing resource name.</p>
        db_backup_id: <p>The identifier of the backup to restore from.</p>
        restore_to_time: <p>The point in time to restore to, for continuous backups. Must be within the backup's retention window.</p>
        restore_mode: <p>Specifies whether to restore to a new resource or replace the existing resource. Valid values are NEW_RESOURCE (default) and REPLACE_EXISTING.</p>
        vpc_subnet_ids: <p>A list of VPC subnet IDs for the restored resource. If not specified, the restored resource uses the same subnets as the backup.</p>
        vpc_security_group_ids: <p>A list of VPC security group IDs for the restored resource. If not specified, the restored resource uses the same security groups as the backup.</p>
        publicly_accessible: <p>Specifies whether the restored resource is publicly accessible.</p>
        log_delivery_configuration: <p>Configuration for sending InfluxDB engine logs to the specified S3 bucket for the restored resource.</p>
        maintenance_schedule: <p>The maintenance schedule for the restored resource.</p>
        tags: <p>A list of key-value pairs to associate with the restored resource.</p>
        port: <p>The port number on which the restored InfluxDB resource accepts connections.</p>
        network_type: <p>Specifies the network type of the restored resource. Valid values are IPV4 and DUAL.</p>
        deployment_type: <p>Specifies the deployment type of the restored resource. Valid values are SINGLE_AZ, WITH_MULTIAZ_STANDBY, and MULTI_NODE_READ_REPLICAS.</p>
        db_backup_configurations: <p>A list of backup configurations to apply to the restored resource.</p>
        kms_key_id: <p>The Amazon Web Services KMS key identifier to use for encryption of the restored resource. Can be a key ID, key ARN, alias name, or alias ARN.</p>

    Raises:
        capo_timestream_influxdb.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_timestream_influxdb.errors.conflict_exception.ConflictException: <p>The request conflicts with an existing resource in Timestream for InfluxDB.</p>
        capo_timestream_influxdb.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_timestream_influxdb.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found or does not exist.</p>
        capo_timestream_influxdb.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeds the service quota.</p>
        capo_timestream_influxdb.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_timestream_influxdb.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by Timestream for InfluxDB.</p>
        capo_timestream_influxdb.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_timestream_influxdb.types.restore_from_db_backup_input.RestoreFromDbBackupInput]",
    ) -> OperationResponse[
        "capo_timestream_influxdb.types.restore_from_db_backup_output.RestoreFromDbBackupOutput"
    ]:
        import capo_timestream_influxdb._operations.amazon_timestream_influx_db.restore_from_db_backup

        output, http_response = (
            capo_timestream_influxdb._operations.amazon_timestream_influx_db.restore_from_db_backup.restore_from_db_backup(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RestoreFromDbBackup")
    )
    input_: capo_timestream_influxdb.types.restore_from_db_backup_input.RestoreFromDbBackupInput = {
        "name": name,
        "db_backup_id": db_backup_id,
    }
    if restore_to_time is not None:
        input_["restore_to_time"] = restore_to_time
    if restore_mode is not None:
        input_["restore_mode"] = restore_mode
    if vpc_subnet_ids is not None:
        input_["vpc_subnet_ids"] = vpc_subnet_ids
    if vpc_security_group_ids is not None:
        input_["vpc_security_group_ids"] = vpc_security_group_ids
    if publicly_accessible is not None:
        input_["publicly_accessible"] = publicly_accessible
    if log_delivery_configuration is not None:
        input_["log_delivery_configuration"] = log_delivery_configuration
    if maintenance_schedule is not None:
        input_["maintenance_schedule"] = maintenance_schedule
    if tags is not None:
        input_["tags"] = tags
    if port is not None:
        input_["port"] = port
    if network_type is not None:
        input_["network_type"] = network_type
    if deployment_type is not None:
        input_["deployment_type"] = deployment_type
    if db_backup_configurations is not None:
        input_["db_backup_configurations"] = db_backup_configurations
    if kms_key_id is not None:
        input_["kms_key_id"] = kms_key_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output