3.1.4.2.69 ApiGetNodeState (Opnum 68)

(Protocol Version 3) The ApiGetNodeState method returns the current state of the specified node.

The server SHOULD accept an ApiGetNodeState request if its protocol server state is read-only, and MUST accept the request for processing if it is in the read/write state, as specified in section 3.1.1.

The state of a node SHOULD change according to implementation-specific methods and protocols between servers, such as when other active nodes detect that a configured node is active or has failed. A client MAY query the current state of a node.

The server SHOULD accept an ApiGetNodeState request if the access level associated with the hNode context handle is at least "Read" (section 3.1.4).

 error_status_t ApiGetNodeState(
   [in] HNODE_RPC hNode,
   [out] DWORD *State,
   [out] error_status_t *rpc_status
 );

hNode: An HNODE_RPC context handle that was obtained in a previous ApiOpenNode or ApiOpenNodeEx method.

State: The current state of the node, which is written by the server after successful completion of this method. If the method fails, this parameter MUST be ignored. If the method succeeds, this field MUST be set to one of the following values.

Value

Meaning

ClusterNodeUp

0x00000000

The node is active.

ClusterNodeDown

0x00000001

The node is not active.

ClusterNodeJoining

0x00000003

The node is in the process of becoming active by joining a cluster.

ClusterNodePaused

0x00000002

The node is active, but it has temporarily suspended activity, as specified in section 3.1.4.2.70.

ClusterNodeStateUnknown

0xFFFFFFFF

The operation to retrieve the node state was not successful.

rpc_status: A 32-bit integer used to indicate success or failure. The RPC runtime MUST indicate, by writing to this parameter, whether it succeeded in executing this method on the server. The encoding of the value passed in this parameter MUST conform to encoding for comm_status and fault_status, as specified in Appendix E of [C706].

Return Values: The method MUST return the following error codes for the specified conditions.

Return value/code

Description

0x00000000

ERROR_SUCCESS

Success.

0x00000006

ERROR_INVALID_HANDLE

The data that is pointed to by the hNode parameter does not represent a valid HNODE_RPC context handle.

For any other condition, this method MUST return a value that is not one of the values listed in the preceding table. The client MUST behave in one consistent, identical manner for all values that are not listed in the preceding table. The client SHOULD treat errors specified in section 3.2.4.6 as recoverable errors and initiate the reconnect procedure as specified in section 3.2.4.6.