RegisterCompute
Registers a compute resource to an Amazon GameLift Anywhere fleet. With Anywhere fleets you can incorporate your own computing hardware into an Amazon GameLift game hosting solution.
To register a compute to a fleet, give the compute a name (must be unique within the fleet) and specify the compute resource's DNS name or IP address. Provide the Anywhere 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 the compute details, including an Amazon GameLift SDK
endpoint. Game server processes that run on the compute use this endpoint to communicate
with the Amazon GameLift service. Each server process includes the SDK endpoint in its call to
the Amazon GameLift server SDK action InitSDK()
.
Learn more
-
Server SDK reference guides (for version 5.x)
Request Syntax
{
"CertificatePath": "string
",
"ComputeName": "string
",
"DnsName": "string
",
"FleetId": "string
",
"IpAddress": "string
",
"Location": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
Note
In the following list, the required parameters are described first.
- ComputeName
-
A descriptive label for the compute resource.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
^[a-zA-Z0-9\-]+
Required: Yes
- FleetId
-
A unique identifier for the fleet to register the compute to. You can use either the fleet ID or ARN value.
Type: String
Pattern:
^fleet-\S+|^arn:.*:fleet\/fleet-\S+
Required: Yes
- CertificatePath
-
The path to a TLS certificate on your compute resource. Amazon GameLift doesn't validate the path and certificate.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 1024.
Required: No
- DnsName
-
The DNS name of the compute resource. Amazon GameLift requires either a DNS name or IP address.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern:
^[0-9a-zA-Z_\-\.]+
Required: No
- IpAddress
-
The IP address of the compute resource. Amazon GameLift requires either a DNS name or IP address.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
^[0-9A-Fa-f\:\.]+
Required: No
- Location
-
The name of a custom location to associate with the compute resource being registered.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
^[A-Za-z0-9\-]+
Required: No
Response Syntax
{
"Compute": {
"ComputeArn": "string",
"ComputeName": "string",
"ComputeStatus": "string",
"CreationTime": number,
"DnsName": "string",
"FleetArn": "string",
"FleetId": "string",
"GameLiftServiceSdkEndpoint": "string",
"IpAddress": "string",
"Location": "string",
"OperatingSystem": "string",
"Type": "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
Errors
For information about the errors that are common to all actions, see Common Errors.
- 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.
HTTP Status Code: 400
- InternalServiceException
-
The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.
HTTP Status Code: 500
- InvalidRequestException
-
One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.
HTTP Status Code: 400
- UnauthorizedException
-
The client failed authentication. Clients should not retry such requests.
HTTP Status Code: 400
Examples
Register your laptop as a testing compute resource
The following example registers a development laptop with the IP address of
10.1.2.3.4
to an Anywhere fleet with the fleet ID
fleet-1234
.
Sample Request
{
"FleetId": "fleet-1234",
"ComputeName": "DevLaptop",
"IpAddress": "10.1.2.3"
}
Sample Response
{
FleetId = fleet-1234,
ComputeName = DevLaptop,
Status = ACTIVE,
IpAddress = 10.1.2.3,
GameLiftServiceSdkEndpoint = wss://12345678.execute-api.amazonaws.com/
}
See Also
For more information about using this API in one of the language-specific Amazon SDKs, see the following: