Skip to content

create_db_backup async

create_db_backup(
    name: DbBackupName,
    db_resource_id: DbResourceId,
    *,
    config_overrides: Optional[AsyncTimestreamInfluxDBClientConfig] = None,
    retention_days: Optional[RetentionDays] = None,
    tags: Optional[RequestTagMap] = None,
) -> CreateDbBackupOutput

Creates a new on-demand backup of a Timestream for InfluxDB resource.

Parameters:

  • name (DbBackupName) –

    The name of the backup. Must be unique within the account and region.

  • db_resource_id (DbResourceId) –

    The id of the DB instance or DB cluster to back up.

  • retention_days (Optional[RetentionDays], default: None ) –

    The number of days to retain the backup. Valid values are 1 to 3650.

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

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

Raises:

Source code in docs_src/capo_timestream_influxdb/_services/async_timestream_influx_db.py
async def create_db_backup(
    self,
    name: "capo_timestream_influxdb.types.db_backup_name.DbBackupName",
    db_resource_id: "capo_timestream_influxdb.types.db_resource_id.DbResourceId",
    *,
    config_overrides: Optional[AsyncTimestreamInfluxDBClientConfig] = None,
    retention_days: Optional[
        "capo_timestream_influxdb.types.retention_days.RetentionDays"
    ] = None,
    tags: Optional[
        "capo_timestream_influxdb.types.request_tag_map.RequestTagMap"
    ] = None,
) -> "capo_timestream_influxdb.types.create_db_backup_output.CreateDbBackupOutput":
    """<p>Creates a new on-demand backup of a Timestream for InfluxDB resource.</p>

    Args:
        name: <p>The name of the backup. Must be unique within the account and region.</p>
        db_resource_id: <p>The id of the DB instance or DB cluster to back up.</p>
        retention_days: <p>The number of days to retain the backup. Valid values are 1 to 3650.</p>
        tags: <p>A list of key-value pairs to associate with the backup.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_timestream_influxdb.types.create_db_backup_input.CreateDbBackupInput]",
    ) -> AsyncOperationResponse[
        "capo_timestream_influxdb.types.create_db_backup_output.CreateDbBackupOutput"
    ]:
        import capo_timestream_influxdb._operations.amazon_timestream_influx_db.create_db_backup

        (
            output,
            http_response,
        ) = await capo_timestream_influxdb._operations.amazon_timestream_influx_db.create_db_backup.async_create_db_backup(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDbBackup")
    )
    input_: capo_timestream_influxdb.types.create_db_backup_input.CreateDbBackupInput = {
        "name": name,
        "db_resource_id": db_resource_id,
    }
    if retention_days is not None:
        input_["retention_days"] = retention_days
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output