Skip to content

update_scheduled_action

update_scheduled_action(
    domain_name: DomainName,
    action_id: String,
    action_type: ActionType,
    schedule_at: ScheduleAt,
    *,
    config_overrides: Optional[OpenSearchClientConfig] = None,
    desired_start_time: Optional[Long] = None,
) -> UpdateScheduledActionResponse

Reschedules a planned domain configuration change for a later time. This change can be a scheduled service software update or a blue/green Auto-Tune enhancement.

Parameters:

  • domain_name (DomainName) –

    The name of the domain to reschedule an action for.

  • action_id (String) –

    The unique identifier of the action to reschedule. To retrieve this ID, send a ListScheduledActions request.

  • action_type (ActionType) –

    The type of action to reschedule. Can be one of SERVICE_SOFTWARE_UPDATE, JVM_HEAP_SIZE_TUNING, or JVM_YOUNG_GEN_TUNING. To retrieve this value, send a ListScheduledActions request.

  • schedule_at (ScheduleAt) –

    When to schedule the action.

    • NOW - Immediately schedules the update to happen in the current hour if there's capacity available.

    • TIMESTAMP - Lets you specify a custom date and time to apply the update. If you specify this value, you must also provide a value for DesiredStartTime.

    • OFF_PEAK_WINDOW - Marks the action to be picked up during an upcoming off-peak window. There's no guarantee that the change will be implemented during the next immediate window. Depending on capacity, it might happen in subsequent days.

  • desired_start_time (Optional[Long], default: None ) –

    The time to implement the change, in Coordinated Universal Time (UTC). Only specify this parameter if you set ScheduleAt to TIMESTAMP.

Raises:

  • BaseException –

    An error occurred while processing the request.

  • ConflictException –

    An error occurred because the client attempts to remove a resource that is currently in use.

  • InternalException –

    Request processing failed because of an unknown error, exception, or internal failure.

  • LimitExceededException –

    An exception for trying to create more than the allowed number of resources or sub-resources.

  • ResourceNotFoundException –

    An exception for accessing or deleting a resource that doesn't exist.

  • SlotNotAvailableException –

    An exception for attempting to schedule a domain action during an unavailable time slot.

  • ValidationException –

    An exception for accessing or deleting a resource that doesn't exist.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_opensearch/_services/open_search.py
def update_scheduled_action(
    self,
    domain_name: "capo_opensearch.types.domain_name.DomainName",
    action_id: "capo_opensearch.types.string.String",
    action_type: "capo_opensearch.types.action_type.ActionType",
    schedule_at: "capo_opensearch.types.schedule_at.ScheduleAt",
    *,
    config_overrides: Optional[OpenSearchClientConfig] = None,
    desired_start_time: Optional["capo_opensearch.types.long.Long"] = None,
) -> "capo_opensearch.types.update_scheduled_action_response.UpdateScheduledActionResponse":
    """<p>Reschedules a planned domain configuration change for a later time. This change can be a scheduled <a href="https://docs.aws.amazon.com/opensearch-service/latest/developerguide/service-software.html">service software update</a> or a <a href="https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html#auto-tune-types">blue/green Auto-Tune enhancement</a>.</p>

    Args:
        domain_name: <p>The name of the domain to reschedule an action for.</p>
        action_id: <p>The unique identifier of the action to reschedule. To retrieve this ID, send a <a href="https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_ListScheduledActions.html">ListScheduledActions</a> request.</p>
        action_type: <p>The type of action to reschedule. Can be one of <code>SERVICE_SOFTWARE_UPDATE</code>, <code>JVM_HEAP_SIZE_TUNING</code>, or <code>JVM_YOUNG_GEN_TUNING</code>. To retrieve this value, send a <a href="https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_ListScheduledActions.html">ListScheduledActions</a> request.</p>
        schedule_at: <p>When to schedule the action.</p> <ul> <li> <p> <code>NOW</code> - Immediately schedules the update to happen in the current hour if there's capacity available.</p> </li> <li> <p> <code>TIMESTAMP</code> - Lets you specify a custom date and time to apply the update. If you specify this value, you must also provide a value for <code>DesiredStartTime</code>.</p> </li> <li> <p> <code>OFF_PEAK_WINDOW</code> - Marks the action to be picked up during an upcoming off-peak window. There's no guarantee that the change will be implemented during the next immediate window. Depending on capacity, it might happen in subsequent days.</p> </li> </ul>
        desired_start_time: <p>The time to implement the change, in Coordinated Universal Time (UTC). Only specify this parameter if you set <code>ScheduleAt</code> to <code>TIMESTAMP</code>.</p>

    Raises:
        capo_opensearch.errors.base_exception.BaseException: <p>An error occurred while processing the request.</p>
        capo_opensearch.errors.conflict_exception.ConflictException: <p>An error occurred because the client attempts to remove a resource that is currently in use.</p>
        capo_opensearch.errors.internal_exception.InternalException: <p>Request processing failed because of an unknown error, exception, or internal failure.</p>
        capo_opensearch.errors.limit_exceeded_exception.LimitExceededException: <p>An exception for trying to create more than the allowed number of resources or sub-resources.</p>
        capo_opensearch.errors.resource_not_found_exception.ResourceNotFoundException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
        capo_opensearch.errors.slot_not_available_exception.SlotNotAvailableException: <p>An exception for attempting to schedule a domain action during an unavailable time slot.</p>
        capo_opensearch.errors.validation_exception.ValidationException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
        capo_opensearch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_opensearch.types.update_scheduled_action_request.UpdateScheduledActionRequest]",
    ) -> OperationResponse[
        "capo_opensearch.types.update_scheduled_action_response.UpdateScheduledActionResponse"
    ]:
        import capo_opensearch._operations.amazon_open_search_service.update_scheduled_action

        output, http_response = (
            capo_opensearch._operations.amazon_open_search_service.update_scheduled_action.update_scheduled_action(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateScheduledAction")
    )
    input_: capo_opensearch.types.update_scheduled_action_request.UpdateScheduledActionRequest = {
        "domain_name": domain_name,
        "action_id": action_id,
        "action_type": action_type,
        "schedule_at": schedule_at,
    }
    if desired_start_time is not None:
        input_["desired_start_time"] = desired_start_time

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