Skip to content

disassociate_instance_event_window

disassociate_instance_event_window(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    instance_event_window_id: Optional[InstanceEventWindowId] = None,
    association_target: Optional[InstanceEventWindowDisassociationRequest] = None,
) -> DisassociateInstanceEventWindowResult

Disassociates one or more targets from an 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.

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

    The ID of the event window.

  • association_target (Optional[InstanceEventWindowDisassociationRequest], default: None ) –

    One or more targets to disassociate from the specified event window.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def disassociate_instance_event_window(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    instance_event_window_id: Optional[
        "capo_ec2.types.instance_event_window_id.InstanceEventWindowId"
    ] = None,
    association_target: Optional[
        "capo_ec2.types.instance_event_window_disassociation_request.InstanceEventWindowDisassociationRequest"
    ] = None,
) -> "capo_ec2.types.disassociate_instance_event_window_result.DisassociateInstanceEventWindowResult":
    """<p>Disassociates one or more targets from an 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>
        instance_event_window_id: <p>The ID of the event window.</p>
        association_target: <p>One or more targets to disassociate from the specified 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.disassociate_instance_event_window_request.DisassociateInstanceEventWindowRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.disassociate_instance_event_window_result.DisassociateInstanceEventWindowResult"
    ]:
        import capo_ec2._operations.amazon_ec2.disassociate_instance_event_window

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisassociateInstanceEventWindow")
    )
    input_: capo_ec2.types.disassociate_instance_event_window_request.DisassociateInstanceEventWindowRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if instance_event_window_id is not None:
        input_["instance_event_window_id"] = instance_event_window_id
    if association_target is not None:
        input_["association_target"] = association_target

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