Skip to content

register_compute async

register_compute(
    *,
    config_overrides: Optional[AsyncGameLiftClientConfig] = None,
    fleet_id: Optional[FleetIdOrArn] = None,
    compute_name: Optional[ComputeName] = None,
    certificate_path: Optional[NonZeroAndMaxString] = None,
    dns_name: Optional[DnsNameInput] = None,
    ip_address: Optional[IpAddress] = None,
    location: Optional[LocationStringModel] = None,
) -> RegisterComputeOutput

This API works with the following fleet types: Anywhere

Registers a compute resource in an Amazon GameLift Servers Anywhere fleet.

For an Anywhere fleet that's running the Amazon GameLift Servers Agent, the Agent handles all compute registry tasks for you. For an Anywhere fleet that doesn't use the Agent, call this operation to register fleet computes.

To register a compute, give the compute a name (must be unique within the fleet) and specify the compute resource's DNS name or IP address. Provide a fleet ID and a fleet location to associate with the compute being registered. You can optionally include the path to a TLS certificate on the compute resource.

If successful, this operation returns compute details, including an Amazon GameLift Servers SDK endpoint or Agent endpoint. Game server processes running on the compute can use this endpoint to communicate with the Amazon GameLift Servers service. Each server process includes the SDK endpoint in its call to the Amazon GameLift Servers server SDK action InitSDK().

To view compute details, call DescribeCompute with the compute name.

Learn more

Parameters:

  • fleet_id (Optional[FleetIdOrArn], default: None ) –

    A unique identifier for the fleet to register the compute to. You can use either the fleet ID or ARN value.

  • compute_name (Optional[ComputeName], default: None ) –

    A descriptive label for the compute resource.

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

    The path to a TLS certificate on your compute resource. Amazon GameLift Servers doesn't validate the path and certificate.

  • dns_name (Optional[DnsNameInput], default: None ) –

    The DNS name of the compute resource. Amazon GameLift Servers requires either a DNS name or IP address.

  • ip_address (Optional[IpAddress], default: None ) –

    The IP address of the compute resource. Amazon GameLift Servers requires either a DNS name or IP address. When registering an Anywhere fleet, an IP address is required.

  • location (Optional[LocationStringModel], default: None ) –

    The name of a custom location to associate with the compute resource being registered. This parameter is required when registering a compute for an Anywhere fleet.

Raises:

  • ConflictException –

    The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.

  • 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.

  • LimitExceededException –

    The requested operation would cause the resource to exceed the allowed service limit. Resolve the issue before retrying.

  • NotReadyException –

    The operation failed because Amazon GameLift Servers has not yet finished validating this compute. We recommend attempting 8 to 10 retries over 3 to 5 minutes with exponential backoffs and jitter.

  • UnauthorizedException –

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

  • UnsupportedRegionException –

    The requested operation is not supported in the Region specified.

  • UnknownServiceError –

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

Source code in docs_src/capo_gamelift/_services/async_game_lift.py
async def register_compute(
    self,
    *,
    config_overrides: Optional[AsyncGameLiftClientConfig] = None,
    fleet_id: Optional["capo_gamelift.types.fleet_id_or_arn.FleetIdOrArn"] = None,
    compute_name: Optional["capo_gamelift.types.compute_name.ComputeName"] = None,
    certificate_path: Optional[
        "capo_gamelift.types.non_zero_and_max_string.NonZeroAndMaxString"
    ] = None,
    dns_name: Optional["capo_gamelift.types.dns_name_input.DnsNameInput"] = None,
    ip_address: Optional["capo_gamelift.types.ip_address.IpAddress"] = None,
    location: Optional[
        "capo_gamelift.types.location_string_model.LocationStringModel"
    ] = None,
) -> "capo_gamelift.types.register_compute_output.RegisterComputeOutput":
    """<p> <b>This API works with the following fleet types:</b> Anywhere</p> <p>Registers a compute resource in an Amazon GameLift Servers Anywhere fleet. </p> <p>For an Anywhere fleet that's running the Amazon GameLift Servers Agent, the Agent handles all compute registry tasks for you. For an Anywhere fleet that doesn't use the Agent, call this operation to register fleet computes.</p> <p>To register a compute, give the compute a name (must be unique within the fleet) and specify the compute resource's DNS name or IP address. Provide a fleet ID and a fleet location to associate with the compute being registered. You can optionally include the path to a TLS certificate on the compute resource.</p> <p>If successful, this operation returns compute details, including an Amazon GameLift Servers SDK endpoint or Agent endpoint. Game server processes running on the compute can use this endpoint to communicate with the Amazon GameLift Servers service. Each server process includes the SDK endpoint in its call to the Amazon GameLift Servers server SDK action <code>InitSDK()</code>. </p> <p>To view compute details, call <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeCompute.html">DescribeCompute</a> with the compute name. </p> <p> <b>Learn more</b> </p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-anywhere.html">Create an Anywhere fleet</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-testing.html">Test your integration</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-serversdk.html">Server SDK reference guides</a> (for version 5.x)</p> </li> </ul>

    Args:
        fleet_id: <p>A unique identifier for the fleet to register the compute to. You can use either the fleet ID or ARN value.</p>
        compute_name: <p>A descriptive label for the compute resource.</p>
        certificate_path: <p>The path to a TLS certificate on your compute resource. Amazon GameLift Servers doesn't validate the path and certificate.</p>
        dns_name: <p>The DNS name of the compute resource. Amazon GameLift Servers requires either a DNS name or IP address.</p>
        ip_address: <p>The IP address of the compute resource. Amazon GameLift Servers requires either a DNS name or IP address. When registering an Anywhere fleet, an IP address is required.</p>
        location: <p>The name of a custom location to associate with the compute resource being registered. This parameter is required when registering a compute for an Anywhere fleet.</p>

    Raises:
        capo_gamelift.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.</p> <p></p>
        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.limit_exceeded_exception.LimitExceededException: <p>The requested operation would cause the resource to exceed the allowed service limit. Resolve the issue before retrying.</p>
        capo_gamelift.errors.not_ready_exception.NotReadyException: <p> The operation failed because Amazon GameLift Servers has not yet finished validating this compute. We recommend attempting 8 to 10 retries over 3 to 5 minutes with <a href="http://aws.amazon.com/blogs/https:/aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/">exponential backoffs and jitter</a>. </p>
        capo_gamelift.errors.unauthorized_exception.UnauthorizedException: <p>The client failed authentication. Clients should not retry such requests.</p>
        capo_gamelift.errors.unsupported_region_exception.UnsupportedRegionException: <p>The requested operation is not supported in the Region specified.</p>
        capo_gamelift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_gamelift.types.register_compute_input.RegisterComputeInput]",
    ) -> AsyncOperationResponse[
        "capo_gamelift.types.register_compute_output.RegisterComputeOutput"
    ]:
        import capo_gamelift._operations.game_lift.register_compute

        (
            output,
            http_response,
        ) = await capo_gamelift._operations.game_lift.register_compute.async_register_compute(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_gamelift.types.register_compute_input.RegisterComputeInput",
    ) -> dict[str, Any]:
        import capo_gamelift.types.register_compute_input

        return capo_gamelift.types.register_compute_input.redact_sensitive(input_)

    def _redact_output(
        output: "capo_gamelift.types.register_compute_output.RegisterComputeOutput",
    ) -> dict[str, Any]:
        import capo_gamelift.types.register_compute_output

        return capo_gamelift.types.register_compute_output.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "RegisterCompute",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_gamelift.types.register_compute_input.RegisterComputeInput = {}
    if fleet_id is not None:
        input_["fleet_id"] = fleet_id
    if compute_name is not None:
        input_["compute_name"] = compute_name
    if certificate_path is not None:
        input_["certificate_path"] = certificate_path
    if dns_name is not None:
        input_["dns_name"] = dns_name
    if ip_address is not None:
        input_["ip_address"] = ip_address
    if location is not None:
        input_["location"] = location

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