3.1.4.2.159 ApiSetGroupSetDependencyExpression (Opnum 177)

The ApiSetGroupSetDependencyExpression method<146> instructs the server to set the dependency relationship for the cluster group set that is identified by hGroupSet to the complex dependency, as specified in section 3.1.1.1.2, using the dependency expression represented by lpszDependencyExpression. For successful completion of the method, the server MUST add the dependency information to the nonvolatile cluster state.

Servers MUST maintain complex group set dependencies as nonvolatile configuration data in their cluster state.

Dependency expressions are "ANDs" only; "ORs" are not allowed, and parentheticals, "(" and ")" are ignored. Example dependency expressions can be as follows: a and b, a and (b and c), a and b … and n, and so on. The server MUST fail this method with ERROR_INVALID_PARAMETER if the dependency expression contains "ORs". The client MUST provide an input lpszDependencyExpression that conforms to the following grammar:

 expression:
     and_expression
   | "(" and_expression ")"
   | "(" and_expression ")" "and" and_expression
  
 and_expression:
     groupset
   | groupset "and" and expression
   | "(" and_expression ")" "and" and_expression
  
 groupset:
     "[" groupSetID "]"

In this grammar, "groupSetID" represents the ID of a group, as returned by CLUSCTL_GROUPSET_GET_ID (3.1.4.3.8.7).

The server MUST clear the dependency relationship for hGroupSet if the null Unicode string (0x0000) is specified.

The server MUST fail this method using ERROR_INVALID_PARAMETER in the following cases:

  • If the dependency expression does not conform to the above grammar.

  • If adding a dependency would introduce a circular dependency.

  • If the dependent group set is a global group set and the provider group set is not a global group set.

The server MUST accept an ApiSetGroupSetDependencyExpression request only if its protocol server state is read/write, as specified in section 3.1.1.

The server MUST require that the access level associated with the hGroup context handle is "All" (section 3.1.4).

 error_status_t
 ApiSetGroupSetDependencyExpression (
   [ in ] HGROUPSET_RPC hGroupSet,
   [ in ] LPCWSTR lpszDependencyExpression,
   [ out ] error_status_t *rpc_status
 );

hGroupSet: An HGROUPSET_RPC (section 2.2.1.11) context handle that is obtained in a previous ApiOpenGroupSet (section 3.1.4.2.147) or ApiCreateGroupSet (section 3.1.4.2.146) method call.

lpszDependencyExpression: A pointer to a null-terminated Unicode string buffer containing a valid dependency expression.

rpc_status: A 32-bit integer used to indicate success or failure. The RPC runtime MUST indicate by writing to this parameter whether the runtime 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 hGroupSet parameter does not represent a valid HGROUPSET_RPC context handle.

0x00000057

ERROR_INVALID_PARAMETER

See the preceding text for details of when this error can occur.

0x00001768

ERROR_GROUPSET_NOT_FOUND

The cluster group set could not be found.

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.