Skip to content

update_gateway_information

update_gateway_information(
    gateway_arn: GatewayARN,
    *,
    config_overrides: Optional[StorageGatewayClientConfig] = None,
    gateway_name: Optional[GatewayName] = None,
    gateway_timezone: Optional[GatewayTimezone] = None,
    cloud_watch_log_group_arn: Optional[CloudWatchLogGroupARN] = None,
    gateway_capacity: Optional[GatewayCapacity] = None,
) -> UpdateGatewayInformationOutput

Updates a gateway's metadata, which includes the gateway's name, time zone, and metadata cache size. To specify which gateway to update, use the Amazon Resource Name (ARN) of the gateway in your request.

For gateways activated after September 2, 2015, the gateway's ARN contains the gateway ID rather than the gateway name. However, changing the name of the gateway has no effect on the gateway's ARN.

Parameters:

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 gateway's metadata Updates a gateway's metadata, which includes the gateway's name and time zone.

>>> client.update_gateway_information(gateway_arn='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B', gateway_name='MyGateway2', gateway_timezone='GMT-12:00')
Source code in docs_src/capo_storage_gateway/_services/storage_gateway.py
def update_gateway_information(
    self,
    gateway_arn: "capo_storage_gateway.types.gateway_arn.GatewayARN",
    *,
    config_overrides: Optional[StorageGatewayClientConfig] = None,
    gateway_name: Optional[
        "capo_storage_gateway.types.gateway_name.GatewayName"
    ] = None,
    gateway_timezone: Optional[
        "capo_storage_gateway.types.gateway_timezone.GatewayTimezone"
    ] = None,
    cloud_watch_log_group_arn: Optional[
        "capo_storage_gateway.types.cloud_watch_log_group_arn.CloudWatchLogGroupARN"
    ] = None,
    gateway_capacity: Optional[
        "capo_storage_gateway.types.gateway_capacity.GatewayCapacity"
    ] = None,
) -> "capo_storage_gateway.types.update_gateway_information_output.UpdateGatewayInformationOutput":
    """<p>Updates a gateway's metadata, which includes the gateway's name, time zone, and metadata cache size. To specify which gateway to update, use the Amazon Resource Name (ARN) of the gateway in your request.</p> <note> <p>For gateways activated after September 2, 2015, the gateway's ARN contains the gateway ID rather than the gateway name. However, changing the name of the gateway has no effect on the gateway's ARN.</p> </note>

    Args:
        gateway_timezone: <p>A value that indicates the time zone of the gateway.</p>
        cloud_watch_log_group_arn: <p>The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that you want to use to monitor and log events in the gateway.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html">What is Amazon CloudWatch Logs?</a> </p>
        gateway_capacity: <p>Specifies the size of the gateway's metadata cache. This setting impacts gateway performance and hardware recommendations. For more information, see <a href="https://docs.aws.amazon.com/filegateway/latest/files3/performance-multiple-file-shares.html">Performance guidance for gateways with multiple file shares</a> in the <i>Amazon S3 File Gateway User Guide</i>.</p>

    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 gateway's metadata
        Updates a gateway's metadata, which includes the gateway's name and time zone.

        >>> client.update_gateway_information(gateway_arn='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B', gateway_name='MyGateway2', gateway_timezone='GMT-12:00')
    """

    def _handler(
        req: "OperationRequest[capo_storage_gateway.types.update_gateway_information_input.UpdateGatewayInformationInput]",
    ) -> OperationResponse[
        "capo_storage_gateway.types.update_gateway_information_output.UpdateGatewayInformationOutput"
    ]:
        import capo_storage_gateway._operations.storage_gateway_20130630.update_gateway_information

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateGatewayInformation")
    )
    input_: capo_storage_gateway.types.update_gateway_information_input.UpdateGatewayInformationInput = {
        "gateway_arn": gateway_arn
    }
    if gateway_name is not None:
        input_["gateway_name"] = gateway_name
    if gateway_timezone is not None:
        input_["gateway_timezone"] = gateway_timezone
    if cloud_watch_log_group_arn is not None:
        input_["cloud_watch_log_group_arn"] = cloud_watch_log_group_arn
    if gateway_capacity is not None:
        input_["gateway_capacity"] = gateway_capacity

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