3.1.4.2.8 ApiCreateEnum (Opnum 7)

(Protocol Version 3) The ApiCreateEnum method returns a collection of names of objects from the cluster state that are of the specified enumeration type. If multiple enumeration types are indicated, the resulting ENUM_LIST contains zero or more entries of each type, and the type of each entry in the list is indicated by the ENUM_ENTRY data structure, as specified in section 2.2.3.4.

The server MUST accept an ApiCreateEnum request only if its protocol server state is read/write, as specified in section 3.1.1, except when the dwType parameter is CLUSTER_ENUM_NODE. If the dwType parameter is CLUSTER_ENUM_NODE, the server MUST accept an ApiCreateEnum request if the protocol server state is read/write, and the server SHOULD accept an ApiCreateEnum request when the protocol server state is read-only.

The server SHOULD accept an ApiCreateEnum request if the client's access level is at least "Read" (section 3.1.4).

 error_status_t ApiCreateEnum(
   [in] DWORD dwType,
   [out] PENUM_LIST *ReturnEnum,
   [out] error_status_t *rpc_status
 );

dwType: The type of enumeration to be returned by the server. This value MUST be set to the bitwise OR operator of one or more of the following values, except as noted for CLUSTER_ENUM_INTERNAL_NETWORK and CLUSTER_ENUM_SHARED_VOLUME_RESOURCE.

Value

Meaning

CLUSTER_ENUM_NODE

0x00000001

Returns an enumeration of names of cluster nodes.

CLUSTER_ENUM_RESTYPE

0x00000002

Returns an enumeration of names of resource types.

CLUSTER_ENUM_RESOURCE

0x00000004

Returns an enumeration of names of cluster resources.

CLUSTER_ENUM_GROUP

0x00000008

Returns an enumeration of names of cluster groups.

CLUSTER_ENUM_NETWORK

0x00000010

Returns an enumeration of names of cluster networks.

CLUSTER_ENUM_NETINTERFACE

0x00000020

Returns an enumeration of names of cluster network interfaces.

CLUSTER_ENUM_INTERNAL_NETWORK

0x80000000

Cannot be specified with any other value for this parameter. Returns an enumeration of names of cluster networks that can be used for internal communications.

CLUSTER_ENUM_SHARED_VOLUME_RESOURCE

0x40000000

Returns an enumeration of names of resources that represent cluster shared volumes (ResourceSharedVolumes state is TRUE).

Cannot be specified with any other value for this parameter.<77>

ReturnEnum: A pointer to a PENUM_LIST, as specified in section 2.2.3.5. The pointer contains the data that matches the enumeration type that is indicated by the dwType parameter. The server MUST allocate as much memory as is required to return the enumeration data. If the method fails, this parameter MUST be ignored.

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 conditions that are specified as follows.

Return value/code

Description

0x00000000

ERROR_SUCCESS

Success.

0x00000008

ERROR_NOT_ENOUGH_MEMORY

The server failed to allocate enough memory for the ReturnEnum parameter.

0x00000057

ERROR_INVALID_PARAMETER

The enumeration type that is specified by dwType is not valid.

For any other condition, the server 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. However, the client SHOULD treat errors specified in 3.2.4.6 as recoverable errors and initiate the reconnect procedure as specified in section 3.2.4.6.