updateFleetPortSettings method
This API works with the following fleet types: EC2
Updates permissions that allow inbound traffic to connect to game sessions in the fleet.
To update settings, specify the fleet ID to be updated and specify the
changes to be made. List the permissions you want to add in
InboundPermissionAuthorizations, and permissions you want to
remove in InboundPermissionRevocations. Permissions to be
removed must match existing fleet permissions.
If successful, the fleet identifiers for the updated fleet are returned.
For fleets with remote locations, port setting updates can take time to
propagate across all locations. You can check the status of updates in
each location by calling DescribeFleetPortSettings with a
location name.
Learn more
Setting up Amazon GameLift Servers fleets
May throw ConflictException.
May throw InternalServiceException.
May throw InvalidFleetStatusException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw NotFoundException.
May throw UnauthorizedException.
Parameter fleetId :
A unique identifier for the fleet to update port settings for. You can use
either the fleet ID or ARN value.
Parameter inboundPermissionAuthorizations :
A collection of port settings to be added to the fleet resource.
Parameter inboundPermissionRevocations :
A collection of port settings to be removed from the fleet resource.
Implementation
Future<UpdateFleetPortSettingsOutput> updateFleetPortSettings({
required String fleetId,
List<IpPermission>? inboundPermissionAuthorizations,
List<IpPermission>? inboundPermissionRevocations,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'GameLift.UpdateFleetPortSettings'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'FleetId': fleetId,
if (inboundPermissionAuthorizations != null)
'InboundPermissionAuthorizations': inboundPermissionAuthorizations,
if (inboundPermissionRevocations != null)
'InboundPermissionRevocations': inboundPermissionRevocations,
},
);
return UpdateFleetPortSettingsOutput.fromJson(jsonResponse.body);
}