Skip to content

delete_instance_event_window

delete_instance_event_window(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    force_delete: Optional[Boolean] = None,
    instance_event_window_id: Optional[InstanceEventWindowId] = None,
) -> DeleteInstanceEventWindowResult

Deletes the specified event window.

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.

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

    Specify true to force delete the event window. Use the force delete parameter if the event window is currently associated with targets.

  • instance_event_window_id (Optional[InstanceEventWindowId], default: None ) –

    The ID of the event window.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def delete_instance_event_window(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    force_delete: Optional["capo_ec2.types.boolean.Boolean"] = None,
    instance_event_window_id: Optional[
        "capo_ec2.types.instance_event_window_id.InstanceEventWindowId"
    ] = None,
) -> "capo_ec2.types.delete_instance_event_window_result.DeleteInstanceEventWindowResult":
    """<p>Deletes the specified event window.</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>
        force_delete: <p>Specify <code>true</code> to force delete the event window. Use the force delete parameter if the event window is currently associated with targets.</p>
        instance_event_window_id: <p>The ID of the event window.</p>

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

    def _handler(
        req: "OperationRequest[capo_ec2.types.delete_instance_event_window_request.DeleteInstanceEventWindowRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.delete_instance_event_window_result.DeleteInstanceEventWindowResult"
    ]:
        import capo_ec2._operations.amazon_ec2.delete_instance_event_window

        output, http_response = (
            capo_ec2._operations.amazon_ec2.delete_instance_event_window.delete_instance_event_window(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteInstanceEventWindow")
    )
    input_: capo_ec2.types.delete_instance_event_window_request.DeleteInstanceEventWindowRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if force_delete is not None:
        input_["force_delete"] = force_delete
    if instance_event_window_id is not None:
        input_["instance_event_window_id"] = instance_event_window_id

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