3.1.4.2.11 ApiDeleteResource (Opnum 10)

msdn link

(Protocol Version 3) The ApiDeleteResource method removes the designated resource from the nonvolatile cluster state.

If the resource has the CLUS_CHAR_BROADCAST_DELETE characteristic and the server executes a delete action indicated by the type of the resource, then all nodes in the cluster MUST execute the same delete action. Actions indicated by a resource type are implementation-specific.

The server MUST fail this method for any of the following conditions:

  • The resource is not in either the ClusterResourceOffline or ClusterResourceFailed state, as specified in section 3.1.4.2.13.

  • Another resource is directly dependent on the designated resource.

  • The resource has the CLUS_CHAR_DELETE_REQUIRES_ALL_NODES characteristic, as specified in section 2.2.2.4, and one or more nodes are not active within the cluster.

  • The resource is a core resource.

A client SHOULD immediately close the HRES_RPC handle to the resource using the ApiCloseResource method upon successful completion of this method.

The server MUST accept an ApiDeleteResource 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 hResource context handle is "All" (section 3.1.4).

 error_status_t ApiDeleteResource(
   [in] HRES_RPC hResource,
   [out] error_status_t *rpc_status
 );

hResource: An HRES_RPC context handle that was obtained in a previous ApiOpenResource, ApiOpenResourceEx, or ApiCreateResource method call.

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 hResource parameter does not represent a valid HRES_RPC context handle.

0x00001389

ERROR_DEPENDENT_RESOURCE_EXISTS

The resource represented by the hResource parameter has other resources dependent on it.

0x0000138E

ERROR_RESOURCE_NOT_AVAILABLE

The resource represented by the hResource parameter no longer exists in the nonvolatile cluster state.

0x0000139B

ERROR_RESOURCE_ONLINE

The resource represented by the hResource parameter is not in the Offline or Failed state.

0x0000139F

ERROR_INVALID_STATE

The group or resource is not in the correct state to perform the requested operation.

0x000013A2

ERROR_CORE_RESOURCE

The resource represented by the hResource parameter is a core resource.

0x000013AD

ERROR_ALL_NODES_NOT_AVAILABLE

The resource represented by the hResource parameter requires all nodes in the cluster to be active in order to be deleted.

For any other condition, the server MUST set Status to a value that is not one of the values listed in the preceding table. The client MUST treat all values that are not listed in the preceding table the same, except as specified in section 3.2.4.6.