Skip to content

update_alias

update_alias(
    *,
    config_overrides: Optional[GameLiftClientConfig] = None,
    alias_id: Optional[AliasIdOrArn] = None,
    name: Optional[NonBlankAndLengthConstraintString] = None,
    description: Optional[NonZeroAndMaxString] = None,
    routing_strategy: Optional[RoutingStrategy] = None,
) -> UpdateAliasOutput

This API works with the following fleet types: EC2, Anywhere, Container

Updates properties for an alias. Specify the unique identifier of the alias to be updated and the new property values.

When reassigning an alias to a new fleet, provide an updated routing strategy. If successful, the updated alias record is returned.

Related actions

All APIs by task

Parameters:

  • alias_id (Optional[AliasIdOrArn], default: None ) –

    A unique identifier for the alias that you want to update. You can use either the alias ID or ARN value.

  • name (Optional[NonBlankAndLengthConstraintString], default: None ) –

    A descriptive label that is associated with an alias. Alias names do not need to be unique.

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

    A human-readable description of the alias.

  • routing_strategy (Optional[RoutingStrategy], default: None ) –

    The routing configuration, including routing type and fleet target, for the alias.

Raises:

  • InternalServiceException –

    The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.

  • InvalidRequestException –

    One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.

  • NotFoundException –

    The requested resource was not found. The resource was either not created yet or deleted.

  • UnauthorizedException –

    The client failed authentication. Clients should not retry such requests.

  • UnknownServiceError –

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

Source code in docs_src/capo_gamelift/_services/game_lift.py
def update_alias(
    self,
    *,
    config_overrides: Optional[GameLiftClientConfig] = None,
    alias_id: Optional["capo_gamelift.types.alias_id_or_arn.AliasIdOrArn"] = None,
    name: Optional[
        "capo_gamelift.types.non_blank_and_length_constraint_string.NonBlankAndLengthConstraintString"
    ] = None,
    description: Optional[
        "capo_gamelift.types.non_zero_and_max_string.NonZeroAndMaxString"
    ] = None,
    routing_strategy: Optional[
        "capo_gamelift.types.routing_strategy.RoutingStrategy"
    ] = None,
) -> "capo_gamelift.types.update_alias_output.UpdateAliasOutput":
    """<p> <b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p> <p>Updates properties for an alias. Specify the unique identifier of the alias to be updated and the new property values.</p> <p>When reassigning an alias to a new fleet, provide an updated routing strategy. If successful, the updated alias record is returned.</p> <p> <b>Related actions</b> </p> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a> </p>

    Args:
        alias_id: <p>A unique identifier for the alias that you want to update. You can use either the alias ID or ARN value.</p>
        name: <p>A descriptive label that is associated with an alias. Alias names do not need to be unique.</p>
        description: <p>A human-readable description of the alias.</p>
        routing_strategy: <p>The routing configuration, including routing type and fleet target, for the alias.</p>

    Raises:
        capo_gamelift.errors.internal_service_exception.InternalServiceException: <p>The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.</p>
        capo_gamelift.errors.invalid_request_exception.InvalidRequestException: <p>One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.</p>
        capo_gamelift.errors.not_found_exception.NotFoundException: <p>The requested resource was not found. The resource was either not created yet or deleted.</p>
        capo_gamelift.errors.unauthorized_exception.UnauthorizedException: <p>The client failed authentication. Clients should not retry such requests.</p>
        capo_gamelift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_gamelift.types.update_alias_input.UpdateAliasInput]",
    ) -> OperationResponse[
        "capo_gamelift.types.update_alias_output.UpdateAliasOutput"
    ]:
        import capo_gamelift._operations.game_lift.update_alias

        output, http_response = (
            capo_gamelift._operations.game_lift.update_alias.update_alias(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateAlias")
    )
    input_: capo_gamelift.types.update_alias_input.UpdateAliasInput = {}
    if alias_id is not None:
        input_["alias_id"] = alias_id
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if routing_strategy is not None:
        input_["routing_strategy"] = routing_strategy

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