Skip to content

create_snapshot_schedule

create_snapshot_schedule(
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    schedule_definitions: Optional[ScheduleDefinitionList] = None,
    schedule_identifier: Optional[String] = None,
    schedule_description: Optional[String] = None,
    tags: Optional[TagList] = None,
    dry_run: Optional[BooleanOptional] = None,
    next_invocations: Optional[IntegerOptional] = None,
) -> SnapshotSchedule

Create a snapshot schedule that can be associated to a cluster and which overrides the default system backup schedule.

Parameters:

  • schedule_definitions (Optional[ScheduleDefinitionList], default: None ) –

    The definition of the snapshot schedule. The definition is made up of schedule expressions, for example "cron(30 12 *)" or "rate(12 hours)".

  • schedule_identifier (Optional[String], default: None ) –

    A unique identifier for a snapshot schedule. Only alphanumeric characters are allowed for the identifier.

  • schedule_description (Optional[String], default: None ) –

    The description of the snapshot schedule.

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

    An optional set of tags you can use to search for the schedule.

  • dry_run (Optional[BooleanOptional], default: None ) –

  • next_invocations (Optional[IntegerOptional], default: None ) –

Raises:

Source code in docs_src/capo_redshift/_services/redshift.py
def create_snapshot_schedule(
    self,
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    schedule_definitions: Optional[
        "capo_redshift.types.schedule_definition_list.ScheduleDefinitionList"
    ] = None,
    schedule_identifier: Optional["capo_redshift.types.string.String"] = None,
    schedule_description: Optional["capo_redshift.types.string.String"] = None,
    tags: Optional["capo_redshift.types.tag_list.TagList"] = None,
    dry_run: Optional[
        "capo_redshift.types.boolean_optional.BooleanOptional"
    ] = None,
    next_invocations: Optional[
        "capo_redshift.types.integer_optional.IntegerOptional"
    ] = None,
) -> "capo_redshift.types.snapshot_schedule.SnapshotSchedule":
    """<p>Create a snapshot schedule that can be associated to a cluster and which overrides the default system backup schedule. </p>

    Args:
        schedule_definitions: <p>The definition of the snapshot schedule. The definition is made up of schedule expressions, for example "cron(30 12 *)" or "rate(12 hours)". </p>
        schedule_identifier: <p>A unique identifier for a snapshot schedule. Only alphanumeric characters are allowed for the identifier.</p>
        schedule_description: <p>The description of the snapshot schedule.</p>
        tags: <p>An optional set of tags you can use to search for the schedule.</p>
        dry_run: <p></p>
        next_invocations: <p></p>

    Raises:
        capo_redshift.errors.invalid_schedule_fault.InvalidScheduleFault: <p>The schedule you submitted isn't valid.</p>
        capo_redshift.errors.invalid_tag_fault.InvalidTagFault: <p>The tag is invalid.</p>
        capo_redshift.errors.schedule_definition_type_unsupported_fault.ScheduleDefinitionTypeUnsupportedFault: <p>The definition you submitted is not supported.</p>
        capo_redshift.errors.snapshot_schedule_already_exists_fault.SnapshotScheduleAlreadyExistsFault: <p>The specified snapshot schedule already exists. </p>
        capo_redshift.errors.snapshot_schedule_quota_exceeded_fault.SnapshotScheduleQuotaExceededFault: <p>You have exceeded the quota of snapshot schedules. </p>
        capo_redshift.errors.tag_limit_exceeded_fault.TagLimitExceededFault: <p>You have exceeded the number of tags allowed.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_redshift.types.create_snapshot_schedule_message.CreateSnapshotScheduleMessage]",
    ) -> OperationResponse[
        "capo_redshift.types.snapshot_schedule.SnapshotSchedule"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.create_snapshot_schedule

        output, http_response = (
            capo_redshift._operations.redshift_service_version20121201.create_snapshot_schedule.create_snapshot_schedule(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateSnapshotSchedule")
    )
    input_: capo_redshift.types.create_snapshot_schedule_message.CreateSnapshotScheduleMessage = {}
    if schedule_definitions is not None:
        input_["schedule_definitions"] = schedule_definitions
    if schedule_identifier is not None:
        input_["schedule_identifier"] = schedule_identifier
    if schedule_description is not None:
        input_["schedule_description"] = schedule_description
    if tags is not None:
        input_["tags"] = tags
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if next_invocations is not None:
        input_["next_invocations"] = next_invocations

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