updateFleet method
Updates a fleet.
May throw AccessDeniedException.
May throw InternalServerErrorException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter farmId :
The farm ID to update.
Parameter fleetId :
The fleet ID to update.
Parameter clientToken :
The unique token which the server uses to recognize retries of the same
request.
Parameter configuration :
The fleet configuration to update.
Parameter description :
The description of the fleet to update.
Parameter displayName :
The display name of the fleet to update.
Parameter hostConfiguration :
Provides a script that runs as a worker is starting up that you can use to
provide additional configuration for workers in your fleet.
Parameter maxWorkerCount :
The maximum number of workers in the fleet.
Deadline Cloud limits the number of workers to less than or equal to the
fleet's maximum worker count. The service maintains eventual consistency
for the worker count. If you make multiple rapid calls to
CreateWorker before the field updates, you might exceed your
fleet's maximum worker count. For example, if your
maxWorkerCount is 10 and you currently have 9 workers, making
two quick CreateWorker calls might successfully create 2
workers instead of 1, resulting in 11 total workers.
Parameter minWorkerCount :
The minimum number of workers in the fleet.
Parameter roleArn :
The IAM role ARN that the fleet's workers assume while running jobs.
Implementation
Future<void> updateFleet({
required String farmId,
required String fleetId,
String? clientToken,
FleetConfiguration? configuration,
String? description,
String? displayName,
HostConfiguration? hostConfiguration,
int? maxWorkerCount,
int? minWorkerCount,
String? roleArn,
}) async {
_s.validateNumRange(
'maxWorkerCount',
maxWorkerCount,
0,
2147483647,
);
_s.validateNumRange(
'minWorkerCount',
minWorkerCount,
0,
2147483647,
);
final headers = <String, String>{
if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(),
};
final $payload = <String, dynamic>{
if (configuration != null) 'configuration': configuration,
if (description != null) 'description': description,
if (displayName != null) 'displayName': displayName,
if (hostConfiguration != null) 'hostConfiguration': hostConfiguration,
if (maxWorkerCount != null) 'maxWorkerCount': maxWorkerCount,
if (minWorkerCount != null) 'minWorkerCount': minWorkerCount,
if (roleArn != null) 'roleArn': roleArn,
};
final response = await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri:
'/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}',
headers: headers,
exceptionFnMap: _exceptionFns,
);
}