Skip to content

update_plan async

update_plan(
    arn: PlanArn,
    workflows: WorkflowList,
    execution_role: IamRoleArn,
    *,
    config_overrides: Optional[AsyncARCRegionswitchClientConfig] = None,
    description: Optional[str] = None,
    recovery_time_objective_minutes: Optional[int] = None,
    associated_alarms: Optional[AssociatedAlarmMap] = None,
    triggers: Optional[TriggerList] = None,
    report_configuration: Optional[ReportConfiguration] = None,
    service_quota_checks_enabled: Optional[bool] = None,
) -> UpdatePlanResponse

Updates an existing Region switch plan. You can modify the plan's description, workflows, execution role, recovery time objective, associated alarms, and triggers.

Parameters:

  • arn (PlanArn) –

    The Amazon Resource Name (ARN) of the plan.

  • description (Optional[str], default: None ) –

    The updated description for the Region switch plan.

  • workflows (WorkflowList) –

    The updated workflows for the Region switch plan.

  • execution_role (IamRoleArn) –

    The updated IAM role ARN that grants Region switch the permissions needed to execute the plan steps.

  • recovery_time_objective_minutes (Optional[int], default: None ) –

    The updated target recovery time objective (RTO) in minutes for the plan.

  • associated_alarms (Optional[AssociatedAlarmMap], default: None ) –

    The updated CloudWatch alarms associated with the plan.

  • triggers (Optional[TriggerList], default: None ) –

    The updated conditions that can automatically trigger the execution of the plan.

  • report_configuration (Optional[ReportConfiguration], default: None ) –

    The updated report configuration for the plan.

  • service_quota_checks_enabled (Optional[bool], default: None ) –

    Specifies whether service quota checks are enabled for the Region switch plan.

Raises:

Source code in docs_src/capo_arc_region_switch/_services/async_arc_regionswitch.py
async def update_plan(
    self,
    arn: "capo_arc_region_switch.types.plan_arn.PlanArn",
    workflows: "capo_arc_region_switch.types.workflow_list.WorkflowList",
    execution_role: "capo_arc_region_switch.types.iam_role_arn.IamRoleArn",
    *,
    config_overrides: Optional[AsyncARCRegionswitchClientConfig] = None,
    description: Optional[str] = None,
    recovery_time_objective_minutes: Optional[int] = None,
    associated_alarms: Optional[
        "capo_arc_region_switch.types.associated_alarm_map.AssociatedAlarmMap"
    ] = None,
    triggers: Optional[
        "capo_arc_region_switch.types.trigger_list.TriggerList"
    ] = None,
    report_configuration: Optional[
        "capo_arc_region_switch.types.report_configuration.ReportConfiguration"
    ] = None,
    service_quota_checks_enabled: Optional[bool] = None,
) -> "capo_arc_region_switch.types.update_plan_response.UpdatePlanResponse":
    """<p>Updates an existing Region switch plan. You can modify the plan's description, workflows, execution role, recovery time objective, associated alarms, and triggers.</p>

    Args:
        arn: <p>The Amazon Resource Name (ARN) of the plan.</p>
        description: <p>The updated description for the Region switch plan.</p>
        workflows: <p>The updated workflows for the Region switch plan.</p>
        execution_role: <p>The updated IAM role ARN that grants Region switch the permissions needed to execute the plan steps.</p>
        recovery_time_objective_minutes: <p>The updated target recovery time objective (RTO) in minutes for the plan.</p>
        associated_alarms: <p>The updated CloudWatch alarms associated with the plan.</p>
        triggers: <p>The updated conditions that can automatically trigger the execution of the plan.</p>
        report_configuration: <p>The updated report configuration for the plan.</p>
        service_quota_checks_enabled: <p>Specifies whether service quota checks are enabled for the Region switch plan.</p>

    Raises:
        capo_arc_region_switch.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p> <p>HTTP Status Code: 404</p>
        capo_arc_region_switch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_arc_region_switch.types.update_plan_request.UpdatePlanRequest]",
    ) -> AsyncOperationResponse[
        "capo_arc_region_switch.types.update_plan_response.UpdatePlanResponse"
    ]:
        import capo_arc_region_switch._operations.arc_region_switch.update_plan

        (
            output,
            http_response,
        ) = await capo_arc_region_switch._operations.arc_region_switch.update_plan.async_update_plan(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_arc_region_switch.types.update_plan_request.UpdatePlanRequest",
    ) -> dict[str, Any]:
        import capo_arc_region_switch.types.update_plan_request

        return capo_arc_region_switch.types.update_plan_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_arc_region_switch.types.update_plan_response.UpdatePlanResponse",
    ) -> dict[str, Any]:
        import capo_arc_region_switch.types.update_plan_response

        return capo_arc_region_switch.types.update_plan_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdatePlan", redact_input=_redact_input, redact_output=_redact_output
        ),
    )
    input_: capo_arc_region_switch.types.update_plan_request.UpdatePlanRequest = {
        "arn": arn,
        "workflows": workflows,
        "execution_role": execution_role,
    }
    if description is not None:
        input_["description"] = description
    if recovery_time_objective_minutes is not None:
        input_["recovery_time_objective_minutes"] = recovery_time_objective_minutes
    if associated_alarms is not None:
        input_["associated_alarms"] = associated_alarms
    if triggers is not None:
        input_["triggers"] = triggers
    if report_configuration is not None:
        input_["report_configuration"] = report_configuration
    if service_quota_checks_enabled is not None:
        input_["service_quota_checks_enabled"] = service_quota_checks_enabled

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