Skip to content

update_node_state

update_node_state(
    cluster_id: __string,
    node_id: __string,
    *,
    config_overrides: Optional[MediaLiveClientConfig] = None,
    state: Optional[UpdateNodeStateShape] = None,
) -> UpdateNodeStateResponse

Update the state of a node.

Parameters:

  • cluster_id (__string) –

    The ID of the cluster

  • node_id (__string) –

    The ID of the node.

  • state (Optional[UpdateNodeStateShape], default: None ) –

    The state to apply to the Node. Set to ACTIVE (COMMISSIONED) to indicate that the Node is deployable. MediaLive Anywhere will consider this node it needs a Node to run a Channel on, or when it needs a Node to promote from a backup node to an active node. Set to DRAINING to isolate the Node so that MediaLive Anywhere won't use it.

Raises:

Source code in docs_src/capo_medialive/_services/media_live.py
def update_node_state(
    self,
    cluster_id: "capo_medialive.types.__string.__string",
    node_id: "capo_medialive.types.__string.__string",
    *,
    config_overrides: Optional[MediaLiveClientConfig] = None,
    state: Optional[
        "capo_medialive.types.update_node_state_shape.UpdateNodeStateShape"
    ] = None,
) -> "capo_medialive.types.update_node_state_response.UpdateNodeStateResponse":
    """Update the state of a node.

    Args:
        cluster_id: The ID of the cluster
        node_id: The ID of the node.
        state: The state to apply to the Node. Set to ACTIVE (COMMISSIONED) to indicate that the Node is deployable. MediaLive Anywhere will consider this node it needs a Node to run a Channel on, or when it needs a Node to promote from a backup node to an active node. Set to DRAINING to isolate the Node so that MediaLive Anywhere won't use it.

    Raises:
        capo_medialive.errors.bad_gateway_exception.BadGatewayException: Placeholder documentation for BadGatewayException
        capo_medialive.errors.bad_request_exception.BadRequestException: Placeholder documentation for BadRequestException
        capo_medialive.errors.conflict_exception.ConflictException: Placeholder documentation for ConflictException
        capo_medialive.errors.forbidden_exception.ForbiddenException: Placeholder documentation for ForbiddenException
        capo_medialive.errors.gateway_timeout_exception.GatewayTimeoutException: Placeholder documentation for GatewayTimeoutException
        capo_medialive.errors.internal_server_error_exception.InternalServerErrorException: Placeholder documentation for InternalServerErrorException
        capo_medialive.errors.too_many_requests_exception.TooManyRequestsException: Placeholder documentation for TooManyRequestsException
        capo_medialive.errors.unprocessable_entity_exception.UnprocessableEntityException: Placeholder documentation for UnprocessableEntityException
        capo_medialive.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_medialive.types.update_node_state_request.UpdateNodeStateRequest]",
    ) -> OperationResponse[
        "capo_medialive.types.update_node_state_response.UpdateNodeStateResponse"
    ]:
        import capo_medialive._operations.media_live.update_node_state

        output, http_response = (
            capo_medialive._operations.media_live.update_node_state.update_node_state(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateNodeState")
    )
    input_: capo_medialive.types.update_node_state_request.UpdateNodeStateRequest = {
        "cluster_id": cluster_id,
        "node_id": node_id,
    }
    if state is not None:
        input_["state"] = state

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