Describes the progress of the AMI store tasks. You can describe the store tasks for specified AMIs. If you don't specify the AMIs, you get a paginated list of store tasks from the last 31 days.
For each AMI task, the response indicates if the task is InProgress, Completed, or Failed. For tasks InProgress, the response shows the estimated progress as a percentage.
Tasks are listed in reverse chronological order. Currently, only tasks from the past 31 days can be viewed.
To use this API, you must have the required permissions. For more information, see Permissions for storing and restoring AMIs using S3 in the Amazon EC2 User Guide.
For more information, see Store and restore an AMI using S3 in the Amazon EC2 User Guide.
Parameters:
-
image_ids
(Optional[ImageIdList], default:
None
)
–
The AMI IDs for which to show progress. Up to 20 AMI IDs can be included in a request.
-
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.
-
task-state - Returns tasks in a certain state (InProgress | Completed | Failed)
-
bucket - Returns task information for tasks that targeted a specific bucket. For the filter value, specify the bucket name.
When you specify the ImageIds parameter, any filters that you specify are ignored. To use the filters, you must remove the ImageIds parameter.
-
next_token
(Optional[String], default:
None
)
–
The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.
-
max_results
(Optional[DescribeStoreImageTasksRequestMaxResults], default:
None
)
–
The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.
You cannot specify this parameter and the ImageIds parameter in the same call.
Raises:
Source code in docs_src/capo_ec2/_services/async_ec2.py
| async def describe_store_image_tasks(
self,
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
image_ids: Optional["capo_ec2.types.image_id_list.ImageIdList"] = None,
dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
next_token: Optional["capo_ec2.types.string.String"] = None,
max_results: Optional[
"capo_ec2.types.describe_store_image_tasks_request_max_results.DescribeStoreImageTasksRequestMaxResults"
] = None,
) -> (
"capo_ec2.types.describe_store_image_tasks_result.DescribeStoreImageTasksResult"
):
"""<p>Describes the progress of the AMI store tasks. You can describe the store tasks for specified AMIs. If you don't specify the AMIs, you get a paginated list of store tasks from the last 31 days.</p> <p>For each AMI task, the response indicates if the task is <code>InProgress</code>, <code>Completed</code>, or <code>Failed</code>. For tasks <code>InProgress</code>, the response shows the estimated progress as a percentage.</p> <p>Tasks are listed in reverse chronological order. Currently, only tasks from the past 31 days can be viewed.</p> <p>To use this API, you must have the required permissions. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/work-with-ami-store-restore.html#ami-s3-permissions">Permissions for storing and restoring AMIs using S3</a> in the <i>Amazon EC2 User Guide</i>.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html">Store and restore an AMI using S3</a> in the <i>Amazon EC2 User Guide</i>.</p>
Args:
image_ids: <p>The AMI IDs for which to show progress. Up to 20 AMI IDs can be included in a request.</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>task-state</code> - Returns tasks in a certain state (<code>InProgress</code> | <code>Completed</code> | <code>Failed</code>)</p> </li> <li> <p> <code>bucket</code> - Returns task information for tasks that targeted a specific bucket. For the filter value, specify the bucket name.</p> </li> </ul> <note> <p>When you specify the <code>ImageIds</code> parameter, any filters that you specify are ignored. To use the filters, you must remove the <code>ImageIds</code> parameter.</p> </note>
next_token: <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
max_results: <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p> <p>You cannot specify this parameter and the <code>ImageIds</code> parameter in the same call.</p>
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_store_image_tasks_request.DescribeStoreImageTasksRequest]",
) -> AsyncOperationResponse[
"capo_ec2.types.describe_store_image_tasks_result.DescribeStoreImageTasksResult"
]:
import capo_ec2._operations.amazon_ec2.describe_store_image_tasks
(
output,
http_response,
) = await capo_ec2._operations.amazon_ec2.describe_store_image_tasks.async_describe_store_image_tasks(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeStoreImageTasks")
)
input_: capo_ec2.types.describe_store_image_tasks_request.DescribeStoreImageTasksRequest = {}
if image_ids is not None:
input_["image_ids"] = image_ids
if dry_run is not None:
input_["dry_run"] = dry_run
if filters is not None:
input_["filters"] = filters
if next_token is not None:
input_["next_token"] = next_token
if max_results is not None:
input_["max_results"] = max_results
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|