Skip to content

describe_instance_event_windows async

describe_instance_event_windows(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    instance_event_window_ids: Optional[InstanceEventWindowIdSet] = None,
    filters: Optional[FilterList] = None,
    max_results: Optional[ResultRange] = None,
    next_token: Optional[String] = None,
) -> DescribeInstanceEventWindowsResult

Describes the specified event windows or all event windows.

If you specify event window IDs, the output includes information for only the specified event windows. If you specify filters, the output includes information for only those event windows that meet the filter criteria. If you do not specify event windows IDs or filters, the output includes information for all event windows, which can affect performance. We recommend that you use pagination to ensure that the operation returns quickly and successfully.

For more information, see Define event windows for scheduled events in the Amazon EC2 User Guide.

Parameters:

  • 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.

  • instance_event_window_ids (Optional[InstanceEventWindowIdSet], default: None ) –

    The IDs of the event windows.

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

    One or more filters.

    • dedicated-host-id - The event windows associated with the specified Dedicated Host ID.

    • event-window-name - The event windows associated with the specified names.

    • instance-id - The event windows associated with the specified instance ID.

    • instance-tag - The event windows associated with the specified tag and value.

    • instance-tag-key - The event windows associated with the specified tag key, regardless of the value.

    • instance-tag-value - The event windows associated with the specified tag value, regardless of the key.

    • tag: - The key/value combination of a tag assigned to the event window. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value CMX, specify tag:Owner for the filter name and CMX for the filter value.

    • tag-key - The key of a tag assigned to the event window. Use this filter to find all event windows that have a tag with a specific key, regardless of the tag value.

    • tag-value - The value of a tag assigned to the event window. Use this filter to find all event windows that have a tag with a specific value, regardless of the tag key.

  • max_results (Optional[ResultRange], default: None ) –

    The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned NextToken value. This value can be between 20 and 500. You cannot specify this parameter and the event window IDs parameter in the same call.

  • next_token (Optional[String], default: None ) –

    The token to request the next page of results.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def describe_instance_event_windows(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    instance_event_window_ids: Optional[
        "capo_ec2.types.instance_event_window_id_set.InstanceEventWindowIdSet"
    ] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    max_results: Optional["capo_ec2.types.result_range.ResultRange"] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.describe_instance_event_windows_result.DescribeInstanceEventWindowsResult":
    """<p>Describes the specified event windows or all event windows.</p> <p>If you specify event window IDs, the output includes information for only the specified event windows. If you specify filters, the output includes information for only those event windows that meet the filter criteria. If you do not specify event windows IDs or filters, the output includes information for all event windows, which can affect performance. We recommend that you use pagination to ensure that the operation returns quickly and successfully. </p> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/event-windows.html">Define event windows for scheduled events</a> in the <i>Amazon EC2 User Guide</i>.</p>

    Args:
        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>
        instance_event_window_ids: <p>The IDs of the event windows.</p>
        filters: <p>One or more filters.</p> <ul> <li> <p> <code>dedicated-host-id</code> - The event windows associated with the specified Dedicated Host ID.</p> </li> <li> <p> <code>event-window-name</code> - The event windows associated with the specified names. </p> </li> <li> <p> <code>instance-id</code> - The event windows associated with the specified instance ID.</p> </li> <li> <p> <code>instance-tag</code> - The event windows associated with the specified tag and value.</p> </li> <li> <p> <code>instance-tag-key</code> - The event windows associated with the specified tag key, regardless of the value.</p> </li> <li> <p> <code>instance-tag-value</code> - The event windows associated with the specified tag value, regardless of the key.</p> </li> <li> <p> <code>tag:<key></code> - The key/value combination of a tag assigned to the event window. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>CMX</code>, specify <code>tag:Owner</code> for the filter name and <code>CMX</code> for the filter value. </p> </li> <li> <p> <code>tag-key</code> - The key of a tag assigned to the event window. Use this filter to find all event windows that have a tag with a specific key, regardless of the tag value. </p> </li> <li> <p> <code>tag-value</code> - The value of a tag assigned to the event window. Use this filter to find all event windows that have a tag with a specific value, regardless of the tag key. </p> </li> </ul>
        max_results: <p>The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned <code>NextToken</code> value. This value can be between 20 and 500. You cannot specify this parameter and the event window IDs parameter in the same call.</p>
        next_token: <p>The token to request the next page of results.</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_instance_event_windows_request.DescribeInstanceEventWindowsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.describe_instance_event_windows_result.DescribeInstanceEventWindowsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_instance_event_windows

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeInstanceEventWindows")
    )
    input_: capo_ec2.types.describe_instance_event_windows_request.DescribeInstanceEventWindowsRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if instance_event_window_ids is not None:
        input_["instance_event_window_ids"] = instance_event_window_ids
    if filters is not None:
        input_["filters"] = filters
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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