Skip to content

start_capacity_task

start_capacity_task(
    outpost_identifier: OutpostIdentifier,
    instance_pools: RequestedInstancePools,
    *,
    config_overrides: Optional[OutpostsClientConfig] = None,
    order_id: Optional[OrderId] = None,
    asset_id: Optional[AssetIdInput] = None,
    instances_to_exclude: Optional[InstancesToExclude] = None,
    dry_run: Optional[DryRun] = None,
    task_action_on_blocking_instances: Optional[TaskActionOnBlockingInstances] = None,
) -> StartCapacityTaskOutput

Starts the specified capacity task. You can have one active capacity task for each order and each Outpost.

Parameters:

  • outpost_identifier (OutpostIdentifier) –

    The ID or ARN of the Outposts associated with the specified capacity task.

  • order_id (Optional[OrderId], default: None ) –

    The ID of the Amazon Web Services Outposts order associated with the specified capacity task.

  • asset_id (Optional[AssetIdInput], default: None ) –

    The ID of the Outpost asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.

  • instance_pools (RequestedInstancePools) –

    The instance pools specified in the capacity task.

  • instances_to_exclude (Optional[InstancesToExclude], default: None ) –

    List of user-specified running instances that must not be stopped in order to free up the capacity needed to run the capacity task.

  • dry_run (Optional[DryRun], default: None ) –

    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.

  • task_action_on_blocking_instances (Optional[TaskActionOnBlockingInstances], default: None ) –

    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.

Raises:

Source code in docs_src/capo_outposts/_services/outposts.py
def start_capacity_task(
    self,
    outpost_identifier: "capo_outposts.types.outpost_identifier.OutpostIdentifier",
    instance_pools: "capo_outposts.types.requested_instance_pools.RequestedInstancePools",
    *,
    config_overrides: Optional[OutpostsClientConfig] = None,
    order_id: Optional["capo_outposts.types.order_id.OrderId"] = None,
    asset_id: Optional["capo_outposts.types.asset_id_input.AssetIdInput"] = None,
    instances_to_exclude: Optional[
        "capo_outposts.types.instances_to_exclude.InstancesToExclude"
    ] = None,
    dry_run: Optional["capo_outposts.types.dry_run.DryRun"] = None,
    task_action_on_blocking_instances: Optional[
        "capo_outposts.types.task_action_on_blocking_instances.TaskActionOnBlockingInstances"
    ] = None,
) -> "capo_outposts.types.start_capacity_task_output.StartCapacityTaskOutput":
    """<p>Starts the specified capacity task. You can have one active capacity task for each order and each Outpost.</p>

    Args:
        outpost_identifier: <p>The ID or ARN of the Outposts associated with the specified capacity task.</p>
        order_id: <p>The ID of the Amazon Web Services Outposts order associated with the specified capacity task.</p>
        asset_id: <p>The ID of the Outpost asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
        instance_pools: <p>The instance pools specified in the capacity task.</p>
        instances_to_exclude: <p>List of user-specified running instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
        dry_run: <p>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.</p>
        task_action_on_blocking_instances: <p>Specify one of the following options in case an instance is blocking the capacity task from running.</p> <ul> <li> <p> <code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p> </li> <li> <p> <code>FAIL_TASK</code> - The capacity task fails.</p> </li> </ul>

    Raises:
        capo_outposts.errors.access_denied_exception.AccessDeniedException: <p>You do not have permission to perform this operation.</p>
        capo_outposts.errors.conflict_exception.ConflictException: <p>Updating or deleting this resource can cause an inconsistent state.</p>
        capo_outposts.errors.internal_server_exception.InternalServerException: <p>An internal error has occurred.</p>
        capo_outposts.errors.not_found_exception.NotFoundException: <p>The specified request is not valid.</p>
        capo_outposts.errors.validation_exception.ValidationException: <p>A parameter is not valid.</p>
        capo_outposts.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_outposts.types.start_capacity_task_input.StartCapacityTaskInput]",
    ) -> OperationResponse[
        "capo_outposts.types.start_capacity_task_output.StartCapacityTaskOutput"
    ]:
        import capo_outposts._operations.outposts_olaf_service.start_capacity_task

        output, http_response = (
            capo_outposts._operations.outposts_olaf_service.start_capacity_task.start_capacity_task(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartCapacityTask")
    )
    input_: capo_outposts.types.start_capacity_task_input.StartCapacityTaskInput = {
        "outpost_identifier": outpost_identifier,
        "instance_pools": instance_pools,
    }
    if order_id is not None:
        input_["order_id"] = order_id
    if asset_id is not None:
        input_["asset_id"] = asset_id
    if instances_to_exclude is not None:
        input_["instances_to_exclude"] = instances_to_exclude
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if task_action_on_blocking_instances is not None:
        input_["task_action_on_blocking_instances"] = (
            task_action_on_blocking_instances
        )

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output