Skip to content

update_snapshot_schedule

update_snapshot_schedule(
    volume_arn: VolumeARN,
    start_at: HourOfDay,
    recurrence_in_hours: RecurrenceInHours,
    *,
    config_overrides: Optional[StorageGatewayClientConfig] = None,
    description: Optional[Description] = None,
    tags: Optional[Tags] = None,
) -> UpdateSnapshotScheduleOutput

Updates a snapshot schedule configured for a gateway volume. This operation is only supported in the cached volume and stored volume gateway types.

The default snapshot schedule for volume is once every 24 hours, starting at the creation time of the volume. You can use this API to change the snapshot schedule configured for the volume.

In the request you must identify the gateway volume whose snapshot schedule you want to update, and the schedule information, including when you want the snapshot to begin on a day and the frequency (in hours) of snapshots.

Parameters:

  • volume_arn (VolumeARN) –

    The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to return a list of gateway volumes.

  • start_at (HourOfDay) –

    The hour of the day at which the snapshot schedule begins represented as hh, where hh is the hour (0 to 23). The hour of the day is in the time zone of the gateway.

  • recurrence_in_hours (RecurrenceInHours) –

    Frequency of snapshots. Specify the number of hours between snapshots.

  • description (Optional[Description], default: None ) –

    Optional description of the snapshot that overwrites the existing description.

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

    A list of up to 50 tags that can be assigned to a snapshot. Each tag is a key-value pair.

    Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.

Raises:

  • InternalServerError –

    An internal server error has occurred during the request. For more information, see the error and message fields.

  • InvalidGatewayRequestException –

    An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To update a volume snapshot schedule Updates a snapshot schedule configured for a gateway volume.

>>> client.update_snapshot_schedule(volume_arn='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B/volume/vol-1122AABB', start_at=0, recurrence_in_hours=1, description='Hourly snapshot')
Source code in docs_src/capo_storage_gateway/_services/storage_gateway.py
def update_snapshot_schedule(
    self,
    volume_arn: "capo_storage_gateway.types.volume_arn.VolumeARN",
    start_at: "capo_storage_gateway.types.hour_of_day.HourOfDay",
    recurrence_in_hours: "capo_storage_gateway.types.recurrence_in_hours.RecurrenceInHours",
    *,
    config_overrides: Optional[StorageGatewayClientConfig] = None,
    description: Optional[
        "capo_storage_gateway.types.description.Description"
    ] = None,
    tags: Optional["capo_storage_gateway.types.tags.Tags"] = None,
) -> "capo_storage_gateway.types.update_snapshot_schedule_output.UpdateSnapshotScheduleOutput":
    """<p>Updates a snapshot schedule configured for a gateway volume. This operation is only supported in the cached volume and stored volume gateway types.</p> <p>The default snapshot schedule for volume is once every 24 hours, starting at the creation time of the volume. You can use this API to change the snapshot schedule configured for the volume.</p> <p>In the request you must identify the gateway volume whose snapshot schedule you want to update, and the schedule information, including when you want the snapshot to begin on a day and the frequency (in hours) of snapshots.</p>

    Args:
        volume_arn: <p>The Amazon Resource Name (ARN) of the volume. Use the <a>ListVolumes</a> operation to return a list of gateway volumes.</p>
        start_at: <p>The hour of the day at which the snapshot schedule begins represented as <i>hh</i>, where <i>hh</i> is the hour (0 to 23). The hour of the day is in the time zone of the gateway.</p>
        recurrence_in_hours: <p>Frequency of snapshots. Specify the number of hours between snapshots.</p>
        description: <p>Optional description of the snapshot that overwrites the existing description.</p>
        tags: <p>A list of up to 50 tags that can be assigned to a snapshot. Each tag is a key-value pair.</p> <note> <p>Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.</p> </note>

    Raises:
        capo_storage_gateway.errors.internal_server_error.InternalServerError: <p>An internal server error has occurred during the request. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.invalid_gateway_request_exception.InvalidGatewayRequestException: <p>An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To update a volume snapshot schedule
        Updates a snapshot schedule configured for a gateway volume.

        >>> client.update_snapshot_schedule(volume_arn='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B/volume/vol-1122AABB', start_at=0, recurrence_in_hours=1, description='Hourly snapshot')
    """

    def _handler(
        req: "OperationRequest[capo_storage_gateway.types.update_snapshot_schedule_input.UpdateSnapshotScheduleInput]",
    ) -> OperationResponse[
        "capo_storage_gateway.types.update_snapshot_schedule_output.UpdateSnapshotScheduleOutput"
    ]:
        import capo_storage_gateway._operations.storage_gateway_20130630.update_snapshot_schedule

        output, http_response = (
            capo_storage_gateway._operations.storage_gateway_20130630.update_snapshot_schedule.update_snapshot_schedule(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateSnapshotSchedule")
    )
    input_: capo_storage_gateway.types.update_snapshot_schedule_input.UpdateSnapshotScheduleInput = {
        "volume_arn": volume_arn,
        "start_at": start_at,
        "recurrence_in_hours": recurrence_in_hours,
    }
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

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