Skip to content

describe_bundle_tasks async

describe_bundle_tasks(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    bundle_ids: Optional[BundleIdStringList] = None,
    dry_run: Optional[Boolean] = None,
    filters: Optional[FilterList] = None,
) -> DescribeBundleTasksResult

Describes the specified bundle tasks or all of your bundle tasks.

Completed bundle tasks are listed for only a limited time. If your bundle task is no longer in the list, you can still register an AMI from it. Just use RegisterImage with the Amazon S3 bucket name and image manifest name you provided to the bundle task.

The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.

Parameters:

  • bundle_ids (Optional[BundleIdStringList], default: None ) –

    The bundle task IDs.

    Default: Describes all your bundle tasks.

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

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • filters (Optional[FilterList], default: None ) –

    The filters.

    • bundle-id - The ID of the bundle task.

    • error-code - If the task failed, the error code returned.

    • error-message - If the task failed, the error message returned.

    • instance-id - The ID of the instance.

    • progress - The level of task completion, as a percentage (for example, 20%).

    • s3-bucket - The Amazon S3 bucket to store the AMI.

    • s3-prefix - The beginning of the AMI name.

    • start-time - The time the task started (for example, 2013-09-15T17:15:20.000Z).

    • state - The state of the task (pending | waiting-for-shutdown | bundling | storing | cancelling | complete | failed).

    • update-time - The time of the most recent update for the task.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def describe_bundle_tasks(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    bundle_ids: Optional[
        "capo_ec2.types.bundle_id_string_list.BundleIdStringList"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
) -> "capo_ec2.types.describe_bundle_tasks_result.DescribeBundleTasksResult":
    """<p>Describes the specified bundle tasks or all of your bundle tasks.</p> <note> <p>Completed bundle tasks are listed for only a limited time. If your bundle task is no longer in the list, you can still register an AMI from it. Just use <code>RegisterImage</code> with the Amazon S3 bucket name and image manifest name you provided to the bundle task.</p> </note> <note> <p>The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.</p> </note>

    Args:
        bundle_ids: <p>The bundle task IDs.</p> <p>Default: Describes all your bundle tasks.</p>
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        filters: <p>The filters.</p> <ul> <li> <p> <code>bundle-id</code> - The ID of the bundle task.</p> </li> <li> <p> <code>error-code</code> - If the task failed, the error code returned.</p> </li> <li> <p> <code>error-message</code> - If the task failed, the error message returned.</p> </li> <li> <p> <code>instance-id</code> - The ID of the instance.</p> </li> <li> <p> <code>progress</code> - The level of task completion, as a percentage (for example, 20%).</p> </li> <li> <p> <code>s3-bucket</code> - The Amazon S3 bucket to store the AMI.</p> </li> <li> <p> <code>s3-prefix</code> - The beginning of the AMI name.</p> </li> <li> <p> <code>start-time</code> - The time the task started (for example, 2013-09-15T17:15:20.000Z).</p> </li> <li> <p> <code>state</code> - The state of the task (<code>pending</code> | <code>waiting-for-shutdown</code> | <code>bundling</code> | <code>storing</code> | <code>cancelling</code> | <code>complete</code> | <code>failed</code>).</p> </li> <li> <p> <code>update-time</code> - The time of the most recent update for the task.</p> </li> </ul>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.describe_bundle_tasks_request.DescribeBundleTasksRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.describe_bundle_tasks_result.DescribeBundleTasksResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_bundle_tasks

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.describe_bundle_tasks.async_describe_bundle_tasks(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_ec2.types.describe_bundle_tasks_result.DescribeBundleTasksResult",
    ) -> dict[str, Any]:
        import capo_ec2.types.describe_bundle_tasks_result

        return capo_ec2.types.describe_bundle_tasks_result.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DescribeBundleTasks", redact_output=_redact_output),
    )
    input_: capo_ec2.types.describe_bundle_tasks_request.DescribeBundleTasksRequest = {}
    if bundle_ids is not None:
        input_["bundle_ids"] = bundle_ids
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if filters is not None:
        input_["filters"] = filters

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