startCapacityTask method
Starts the specified capacity task. You can have one active capacity task for each order and each Outpost.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw NotFoundException.
May throw ValidationException.
Parameter instancePools :
The instance pools specified in the capacity task.
Parameter outpostIdentifier :
The ID or ARN of the Outposts associated with the specified capacity task.
Parameter assetId :
The ID of the Outpost asset. An Outpost asset can be a single server
within an Outposts rack or an Outposts server configuration.
Parameter dryRun :
You can request a dry run to determine if the instance type and instance
size changes is above or below available instance capacity. Requesting a
dry run does not make any changes to your plan.
Parameter instancesToExclude :
List of user-specified running instances that must not be stopped in order
to free up the capacity needed to run the capacity task.
Parameter orderId :
The ID of the Amazon Web Services Outposts order associated with the
specified capacity task.
Parameter taskActionOnBlockingInstances :
Specify one of the following options in case an instance is blocking the
capacity task from running.
-
WAIT_FOR_EVACUATION- Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task. -
FAIL_TASK- The capacity task fails.
Implementation
Future<StartCapacityTaskOutput> startCapacityTask({
required List<InstanceTypeCapacity> instancePools,
required String outpostIdentifier,
String? assetId,
bool? dryRun,
InstancesToExclude? instancesToExclude,
String? orderId,
TaskActionOnBlockingInstances? taskActionOnBlockingInstances,
}) async {
final $payload = <String, dynamic>{
'InstancePools': instancePools,
if (assetId != null) 'AssetId': assetId,
if (dryRun != null) 'DryRun': dryRun,
if (instancesToExclude != null) 'InstancesToExclude': instancesToExclude,
if (orderId != null) 'OrderId': orderId,
if (taskActionOnBlockingInstances != null)
'TaskActionOnBlockingInstances': taskActionOnBlockingInstances.value,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/outposts/${Uri.encodeComponent(outpostIdentifier)}/capacity',
exceptionFnMap: _exceptionFns,
);
return StartCapacityTaskOutput.fromJson(response);
}