updateNodeState method

Future<UpdateNodeStateResponse> updateNodeState({
  1. required String clusterId,
  2. required String nodeId,
  3. UpdateNodeStateShape? state,
})

Update the state of a node.

May throw BadGatewayException. May throw BadRequestException. May throw ConflictException. May throw ForbiddenException. May throw GatewayTimeoutException. May throw InternalServerErrorException. May throw TooManyRequestsException. May throw UnprocessableEntityException.

Parameter clusterId : The ID of the cluster

Parameter nodeId : The ID of the node.

Parameter 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.

Implementation

Future<UpdateNodeStateResponse> updateNodeState({
  required String clusterId,
  required String nodeId,
  UpdateNodeStateShape? state,
}) async {
  final $payload = <String, dynamic>{
    if (state != null) 'state': state.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/prod/clusters/${Uri.encodeComponent(clusterId)}/nodes/${Uri.encodeComponent(nodeId)}/state',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateNodeStateResponse.fromJson(response);
}