Skip to content

get_capacity_task async

get_capacity_task(
    capacity_task_id: CapacityTaskId,
    outpost_identifier: OutpostIdentifier,
    *,
    config_overrides: Optional[AsyncOutpostsClientConfig] = None,
) -> GetCapacityTaskOutput

Gets details of the specified capacity task.

Parameters:

  • capacity_task_id (CapacityTaskId) –

    ID of the capacity task.

  • outpost_identifier (OutpostIdentifier) –

    ID or ARN of the Outpost associated with the specified capacity task.

Raises:

Source code in docs_src/capo_outposts/_services/async_outposts.py
async def get_capacity_task(
    self,
    capacity_task_id: "capo_outposts.types.capacity_task_id.CapacityTaskId",
    outpost_identifier: "capo_outposts.types.outpost_identifier.OutpostIdentifier",
    *,
    config_overrides: Optional[AsyncOutpostsClientConfig] = None,
) -> "capo_outposts.types.get_capacity_task_output.GetCapacityTaskOutput":
    """<p>Gets details of the specified capacity task.</p>

    Args:
        capacity_task_id: <p>ID of the capacity task.</p>
        outpost_identifier: <p>ID or ARN of the Outpost associated with the specified capacity task.</p>

    Raises:
        capo_outposts.errors.access_denied_exception.AccessDeniedException: <p>You do not have permission to perform this operation.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_outposts.types.get_capacity_task_input.GetCapacityTaskInput]",
    ) -> AsyncOperationResponse[
        "capo_outposts.types.get_capacity_task_output.GetCapacityTaskOutput"
    ]:
        import capo_outposts._operations.outposts_olaf_service.get_capacity_task

        (
            output,
            http_response,
        ) = await capo_outposts._operations.outposts_olaf_service.get_capacity_task.async_get_capacity_task(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCapacityTask")
    )
    input_: capo_outposts.types.get_capacity_task_input.GetCapacityTaskInput = {
        "capacity_task_id": capacity_task_id,
        "outpost_identifier": outpost_identifier,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output