home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / msclus.idl < prev    next >
Text File  |  1998-04-25  |  28KB  |  950 lines

  1. //
  2. // Copyright (C) Microsoft Corporation, 1997.  All rights reserved.
  3. //
  4.  
  5. // msclus.idl : IDL source for msclus.dll
  6. // ~~~~~~~~~~
  7. //
  8. // History
  9. // ?? Mar 1997    - Original creation.
  10. // 12 May 1997    - Changed the collections to use Add/Remove/Create/Delete
  11. // 14 May 1997    - Changed interface names per code review
  12. // 22 July 1997   - Added new interfaces Domains and ClusterDomain.
  13. // 20 Aug 1997    - Created new interfaces ClusNetwork and ClusNetInterface.
  14. //                - Added new base interfaces ClusObj and ClusObjCollection for all collections and 
  15. //                - cluster objects respectively.
  16. //                - Added the following new collections.
  17. //                - ClusNetworks,ClusNetInterfaces,ClusResDependencies, ClusResTypeResources,
  18. //                - ClusGroupOwners and ClusResOwners.
  19. //  27 Aug 1997   - New comments. 
  20. //                - New methods to ICluster.
  21. // This file will be processed by the MIDL tool to
  22. // produce the type library (msclus.tlb) and marshalling code.
  23.  
  24.  
  25.  
  26. // f2e606ea-2631-11d1-89f1-00a0c90d061e -- interface ClusResTypes
  27. // f2e606eb-2631-11d1-89f1-00a0c90d061e -- interface ClusProperty
  28. // f2e606ec-2631-11d1-89f1-00a0c90d061e -- interface ClusProperties
  29. // f2e606ed-2631-11d1-89f1-00a0c90d061e -- interface DomainNames
  30. // f2e606ee-2631-11d1-89f1-00a0c90d061e -- interface ClusObjCollection
  31. // f2e606ef-2631-11d1-89f1-00a0c90d061e -- interface ClusObj
  32. // f2e606f0-2631-11d1-89f1-00a0c90d061e -- library MSClusterLib
  33. // f2e606f1-2631-11d1-89f1-00a0c90d061e -- coclass Application
  34. // f2e606f2-2631-11d1-89f1-00a0c90d061e -- coclass Cluster
  35. // f2e606f3-2631-11d1-89f1-00a0c90d061e -- interface ClusNetwork
  36. // f2e606f4-2631-11d1-89f1-00a0c90d061e -- interface ClusNetInterface
  37. // f2e606f5-2631-11d1-89f1-00a0c90d061e -- interface ClusResDependencies
  38. // f2e606f6-2631-11d1-89f1-00a0c90d061e -- interface ClusGroupResources
  39. // f2e606f7-2631-11d1-89f1-00a0c90d061e -- interface ClusResTypeResources
  40. // f2e606f8-2631-11d1-89f1-00a0c90d061e -- interface ClusGroupOwners
  41. // f2e606f9-2631-11d1-89f1-00a0c90d061e -- interface ClusResOwners
  42. // f2e606fa-2631-11d1-89f1-00a0c90d061e -- interface ClusNetworks
  43. // f2e606fb-2631-11d1-89f1-00a0c90d061e -- interface ClusNetInterfaces
  44. // f2e606fc-2631-11d1-89f1-00a0c90d061e -- interface ClusNetworkNetInterfaces
  45. // f2e606fd-2631-11d1-89f1-00a0c90d061e -- interface ClusNodeNetInterfaces
  46. // f2e606fe-2631-11d1-89f1-00a0c90d061e -- interface ClusRefObject
  47. // f2e606ff-2631-11d1-89f1-00a0c90d061e
  48. // f2e60700-2631-11d1-89f1-00a0c90d061e
  49. // f2e60701-2631-11d1-89f1-00a0c90d061e
  50. // f2e60702-2631-11d1-89f1-00a0c90d061e
  51. // f2e60703-2631-11d1-89f1-00a0c90d061e
  52. // f2e60704-2631-11d1-89f1-00a0c90d061e
  53. // f2e60705-2631-11d1-89f1-00a0c90d061e
  54. // f2e60706-2631-11d1-89f1-00a0c90d061e
  55. // f2e60707-2631-11d1-89f1-00a0c90d061e
  56.  
  57. // UUIDS for MSCLUS
  58. // f2e606e0-2631-11d1-89f1-00a0c90d061e -- interface IClusterApplication;
  59. // f2e606e1-2631-11d1-89f1-00a0c90d061e -- interface ClusterNames
  60. // f2e606e2-2631-11d1-89f1-00a0c90d061e -- interface ICluster
  61. // f2e606e3-2631-11d1-89f1-00a0c90d061e -- interface ClusNode
  62. // f2e606e4-2631-11d1-89f1-00a0c90d061e -- interface ClusNodes
  63. // f2e606e5-2631-11d1-89f1-00a0c90d061e -- interface ClusResGroup
  64. // f2e606e6-2631-11d1-89f1-00a0c90d061e -- interface ClusResGroups
  65. // f2e606e7-2631-11d1-89f1-00a0c90d061e -- interface ClusResource
  66. // f2e606e8-2631-11d1-89f1-00a0c90d061e -- interface ClusResources
  67. // f2e606e9-2631-11d1-89f1-00a0c90d061e -- interface ClusResType
  68.  
  69.  
  70. import "oaidl.idl";
  71. cpp_quote("#ifndef _CLUSTER_API_TYPES_")
  72. #include "clusapi.h"
  73. cpp_quote("#define _CLUSTER_API_TYPES_")
  74. cpp_quote("#endif // _CLUSTER_API_TYPES_")
  75.  
  76. ///////////////////////////////////////
  77. // definitions
  78. interface IClusterApplication;
  79. interface ICluster;
  80. // A reference Object that reference Counts the Cluster Handle.
  81. // This wouldn't close the Cluster, till the reference count becomes
  82. // zero. Every interface is passed this object instead of the Cluster 
  83. // Handle. The interfaces increment the reference count as they are passed
  84. // this object and decrements on removal. This eliminates the Circular
  85. // reference problem. 
  86.  
  87. interface ClusRefObject; 
  88. interface ClusObjCollection; // Base Class for all collections.
  89. interface DomainNames;
  90. interface ClusterNames;
  91. interface ClusObj;  // Base Class for all the Cluster Objects viz. ClusNode, ClusResGroup, 
  92.         // ClusNetwork, ClusNetInterface and ClusResource.
  93.  
  94. //old interface ClusterNode;
  95. interface ClusNode;
  96. //old interface ClusterNodes;
  97. interface ClusNodes;
  98.  
  99. //old interface ResourceGroup;
  100. interface ClusResGroup;
  101. //old interface ResourceGroups;
  102. interface ClusResGroups;
  103.  
  104. //old interface Resource;
  105. interface ClusResource;
  106. //old interface Resources;
  107. // resource collection in ICluster.
  108. interface ClusResources; 
  109.  
  110. //old interface ResourceType;
  111. interface ClusResType;
  112. //old interface ResourceTypes;
  113. interface ClusResTypes;
  114.  
  115. //old interface ClusterProperty;
  116. interface ClusProperty;
  117. //old interface ClusterProperties;
  118. interface ClusProperties;
  119.  
  120. // New ClusObj derived interfaces.
  121. interface ClusNetwork;
  122. interface ClusNetInterface;
  123.  
  124. // New Collections.
  125. // resouce collection in ClusResource.            
  126. interface ClusResDependencies;
  127. // resource collection in ClusResGroup.
  128. interface ClusGroupResources;
  129. // resource collection in ClusResourceType.
  130. interface ClusResTypeResources;
  131. // Nodes collection in ClusResGroup.
  132. interface ClusGroupOwners;
  133. // Nodes collection in ClusResource.
  134. interface ClusResOwners;
  135. // Networks collection in ICluster.
  136. interface ClusNetworks;
  137. // Netinterface collection in ICluster.
  138. interface ClusNetInterfaces;
  139. // Netinterface collection in ClusNetwork.
  140. interface ClusNodeNetInterfaces;
  141. // Netinterface collection in ICluster.
  142. interface ClusNetworkNetInterfaces;
  143. //
  144. ///////////////////////////////////////
  145.  
  146.  
  147. /////////////////////////////////////////////////
  148. // Application
  149. [
  150.     object,
  151.     uuid(f2e606e0-2631-11d1-89f1-00a0c90d061e),
  152.     dual,
  153.     helpstring("Application Interface"),
  154.     hidden,
  155.     pointer_default(unique)
  156. ]
  157. interface IClusterApplication : IDispatch
  158. {
  159.     [propget]
  160.     HRESULT DomainNames( [out, retval] DomainNames ** ppDomains );
  161.  
  162.     [propget]
  163.     HRESULT ClusterNames( [in] BSTR bstrDomainName, [out, retval] ClusterNames ** ppClusters );
  164.  
  165.     HRESULT OpenCluster( [in] BSTR bstrClusterName, [out, retval] ICluster ** pCluster );
  166. };
  167.  
  168. /////////////////////////////////////////////////
  169. // ClusObjCollection
  170. [
  171.     object,
  172.     uuid(f2e606ee-2631-11d1-89f1-00a0c90d061e),
  173.     dual,
  174.     helpstring("collections Base Class"),
  175.     pointer_default(unique)
  176. ]
  177. interface ClusObjCollection : IDispatch
  178. {
  179.     [propget]
  180.     HRESULT Count( [out, retval] LONG * pnCount );
  181.     [propget, restricted, id(DISPID_NEWENUM),
  182.         helpstring("returns an enumerator for the collection.")]    // Must be propget. 
  183.     HRESULT _NewEnum([out, retval] IUnknown** retval);    
  184.  
  185.     [helpstring("Refresh data in collection")]
  186.     HRESULT Refresh();
  187. };
  188.  
  189.  
  190.  
  191. /////////////////////////////////////////////////
  192. // DomainNames
  193. [
  194.     object,
  195.     uuid(f2e606ed-2631-11d1-89f1-00a0c90d061e),
  196.     dual,
  197.     helpstring("Domain Names collection"),
  198.     pointer_default(unique)
  199. ]
  200. interface DomainNames : ClusObjCollection
  201. {
  202.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  203.     HRESULT Item([in] LONG nIndex , [out, retval] BSTR* pbstrDomainName);
  204. };
  205.  
  206.  
  207. /////////////////////////////////////////////////
  208. // ClusterNames
  209. [
  210.     object,
  211.     uuid(f2e606e1-2631-11d1-89f1-00a0c90d061e),
  212.     dual,
  213.     helpstring("ClusterNames collection"),
  214.     pointer_default(unique)
  215. ]
  216. interface ClusterNames : ClusObjCollection
  217. {
  218.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  219.     HRESULT Item([in] LONG nIndex , [out, retval] BSTR* pbstrClusterName);
  220.     [propget]
  221.     HRESULT DomainName( [out, retval] BSTR * pbstrDomainName );
  222. };
  223.  
  224.  
  225. /////////////////////////////////////////////////
  226. // ClusRefObject
  227. [
  228.     object,
  229.     uuid(f2e606fe-2631-11d1-89f1-00a0c90d061e),
  230.     dual,
  231.     helpstring("Cluster Reference Object Interface"),
  232.     hidden,
  233.     pointer_default(unique)
  234. ]
  235. interface ClusRefObject : IDispatch
  236. {
  237.     [propget]
  238.     HRESULT Handle( [out, retval] LONG * phandle );
  239. };
  240.  
  241.  
  242.  
  243. /////////////////////////////////////////////////
  244. // ClusObj
  245. [
  246.     object,
  247.     uuid(f2e606ef-2631-11d1-89f1-00a0c90d061e),
  248.     dual,
  249.     helpstring("Cluster Object Base Class"),
  250.     pointer_default(unique)
  251. ]
  252. interface ClusObj : IDispatch
  253. {
  254.     [propget]
  255.     HRESULT Name( [out, retval] BSTR * pbstrName );
  256.  
  257.     [propget]
  258.     HRESULT CommonProperties( [out, retval] ClusProperties ** ppProperties );
  259.  
  260.     [propget]
  261.     HRESULT PrivateProperties( [out, retval] ClusProperties ** ppProperties );
  262.  
  263.     [propget]
  264.     HRESULT CommonROProperties( [out, retval] ClusProperties ** ppProperties );
  265.  
  266.     [propget]
  267.     HRESULT PrivateROProperties( [out, retval] ClusProperties ** ppProperties );
  268. };
  269.  
  270.  
  271. /////////////////////////////////////////////////
  272. // ICluster
  273. [
  274.     object,
  275.     uuid(f2e606e2-2631-11d1-89f1-00a0c90d061e),
  276.     dual,
  277.     helpstring("ICluster Interface"),
  278.     hidden,
  279.     pointer_default(unique)
  280. ]
  281. interface ICluster : ClusObj
  282. {    
  283.     /////////////////////////////////
  284.     // Cluster 
  285.     [propget, hidden]
  286.     HRESULT Handle( [out, retval] LONG * phandle );
  287.  
  288.     HRESULT Open( [in] BSTR bstrClusterName );
  289.  
  290. //    HRESULT Close();
  291.  
  292.     [propput]
  293.     HRESULT Name( [in] BSTR bstrClusterName );  
  294.  
  295.     HRESULT GetVersion( 
  296.         [out] BSTR * pbstrClusterName,
  297.         [out] SHORT * MajorVersion,
  298.         [out] SHORT * MinorVersion,
  299.         [out] SHORT * BuildNumber,
  300.         [out] BSTR * pbstrVendorId,
  301.         [out] BSTR * pbstrCSDVersion );
  302.  
  303.  
  304.     /////////////////////////////////
  305.     // Quorum Resource
  306.     [propput]
  307.     HRESULT QuorumResource( [in] ClusResource * pClusterResource );
  308.  
  309.     [propget]
  310.     HRESULT QuorumResource( [out, retval] ClusResource ** pClusterResource );
  311.     /////////////////////////////////
  312.     // Quorum Info
  313.     HRESULT SetQuorumInfo([in] BSTR DevicePath, [in] LONG nLogSize);
  314.  
  315.     HRESULT GetQuorumInfo([out] BSTR* DevicePath, [out] LONG* pLogSize);
  316.  
  317.     /////////////////////////////////
  318.     // Cluster Nodes
  319.  
  320.     [propget]
  321.     HRESULT Nodes( [out, retval] ClusNodes ** ppClusterNodes );
  322.  
  323.  
  324.     /////////////////////////////////
  325.     // Cluster Resource Groups
  326.  
  327.  
  328.     [propget]
  329.     HRESULT ResourceGroups( [out, retval] ClusResGroups ** ppClusterResourceGroups );
  330.  
  331.  
  332.     /////////////////////////////////
  333.     // Cluster Resources
  334.  
  335.     [propget]
  336.     HRESULT Resources( [out, retval] ClusResources ** ppClusterResources );
  337.  
  338.  
  339.     /////////////////////////////////
  340.     // Cluster Resource Types
  341.  
  342.     [propget]
  343.     HRESULT ResourceTypes( [out, retval] ClusResTypes ** ppResourceTypes );
  344.  
  345.     /////////////////////////////////
  346.     // Cluster Networks
  347.     [propget]
  348.     HRESULT Networks( [out, retval] ClusNetworks ** ppNetworks );
  349.  
  350.     /////////////////////////////////
  351.     // Cluster NetInterfaces
  352.     [propget]
  353.     HRESULT NetInterfaces( [out, retval] ClusNetInterfaces ** ppNetInterfaces );
  354. };
  355.  
  356.  
  357.  
  358.  
  359.  
  360. /////////////////////////////////////////////////
  361. // ClusNode
  362. [
  363.     object,
  364.     uuid(f2e606e3-2631-11d1-89f1-00a0c90d061e),
  365.     dual,
  366.     helpstring("Cluster Node Interface"),
  367.     pointer_default(unique)
  368. ]
  369. interface ClusNode : ClusObj
  370. {
  371.     [propget, hidden]
  372.     HRESULT Handle( [out, retval] LONG * phandle );
  373.  
  374.     [propget]
  375.     HRESULT NodeID( [out, retval] BSTR * pbstrNodeID );
  376.  
  377.     [propget]
  378.     HRESULT State( [out,retval] CLUSTER_NODE_STATE* dwState );
  379.  
  380.     HRESULT Pause();
  381.  
  382.     HRESULT Resume();
  383.  
  384.     HRESULT Evict();
  385.  
  386.     [propget]
  387.     HRESULT ResourceGroups( [out, retval] ClusResGroups ** ppResourceGroups );
  388.  
  389.     [propget]
  390.     HRESULT Cluster( [out,retval] ICluster ** ppCluster );
  391.  
  392.     [propget]
  393.     HRESULT NetInterfaces( [out,retval] ClusNodeNetInterfaces ** ppClusNetInterfaces );
  394.  
  395. };
  396.  
  397.  
  398.  
  399. /////////////////////////////////////////////////
  400. // ClusNodes
  401. [
  402.     object,
  403.     uuid(f2e606e4-2631-11d1-89f1-00a0c90d061e),
  404.     dual,
  405.     helpstring("Cluster Nodes Interface"),
  406.     pointer_default(unique)
  407. ]
  408. interface ClusNodes : ClusObjCollection
  409. {
  410.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  411.    HRESULT Item([in] VARIANT varIndex , [out, retval] ClusNode ** ppClusNode);
  412. };
  413.  
  414.  
  415.  
  416. /////////////////////////////////////////////////
  417. // ClusNetwork
  418. [
  419.     object,
  420.     uuid(f2e606f3-2631-11d1-89f1-00a0c90d061e),
  421.     dual,
  422.     helpstring("Cluster Network Interface"),
  423.     pointer_default(unique)
  424. ]
  425. interface ClusNetwork : ClusObj
  426. {
  427.     [propget, hidden]
  428.     HRESULT Handle( [out, retval] LONG * phandle );
  429.  
  430.     [propput]
  431.     HRESULT Name( [in] BSTR bstrNetworkName );
  432.     [propget]
  433.     HRESULT NetworkID( [out, retval] BSTR * pbstrNetworkID );
  434.  
  435.     [propget]
  436.     HRESULT State( [out,retval] CLUSTER_NETWORK_STATE* dwState );
  437.  
  438.     [propget]
  439.     HRESULT NetInterfaces([out, retval] ClusNetworkNetInterfaces ** ppClusNetInterfaces); 
  440.  
  441.     [propget]
  442.     HRESULT Cluster( [out,retval] ICluster ** ppCluster );
  443. };
  444.  
  445.  
  446. /////////////////////////////////////////////////
  447. // ClusNetworks
  448. [
  449.     object,
  450.     uuid(f2e606fa-2631-11d1-89f1-00a0c90d061e),
  451.     dual,
  452.     helpstring("Cluster Network Collection Interface"),
  453.     pointer_default(unique)
  454. ]
  455. interface ClusNetworks : ClusObjCollection
  456. {
  457.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  458.    HRESULT Item([in] VARIANT varIndex , [out, retval] ClusNetwork ** ppClusNetwork);
  459. };
  460.  
  461. /////////////////////////////////////////////////
  462. // ClusNetInterface
  463. [
  464.     object,
  465.     uuid(f2e606f4-2631-11d1-89f1-00a0c90d061e),
  466.     dual,
  467.     helpstring("Cluster NetInterface Interface"),
  468.     pointer_default(unique)
  469. ]
  470. interface ClusNetInterface : ClusObj
  471. {
  472.     [propget, hidden]
  473.     HRESULT Handle( [out, retval] LONG * phandle );
  474.  
  475.     [propget]
  476.     HRESULT State( [out,retval] CLUSTER_NETINTERFACE_STATE * dwState );
  477.  
  478.     [propget]
  479.     HRESULT Cluster( [out,retval] ICluster ** ppCluster );
  480. };
  481.  
  482.  
  483. /////////////////////////////////////////////////
  484. // ClusNetInterfaces
  485. [
  486.     object,
  487.     uuid(f2e606fb-2631-11d1-89f1-00a0c90d061e),
  488.     dual,
  489.     helpstring("Cluster NetInterface Collection Interface in ICluster"),
  490.     pointer_default(unique)
  491. ]
  492. interface ClusNetInterfaces : ClusObjCollection
  493. {
  494.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  495.    HRESULT Item([in] VARIANT varIndex , [out, retval] ClusNetInterface ** ppClusNetInterface);
  496. };
  497.  
  498. /////////////////////////////////////////////////
  499. // ClusNodeNetInterfaces
  500. [
  501.     object,
  502.     uuid(f2e606fd-2631-11d1-89f1-00a0c90d061e),
  503.     dual,
  504.     helpstring("Cluster NetInterface Collection Interface in Node"),
  505.     pointer_default(unique)
  506. ]
  507. interface ClusNodeNetInterfaces : ClusObjCollection
  508. {
  509.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  510.    HRESULT Item([in] VARIANT varIndex , [out, retval] ClusNetInterface ** ppClusNetInterface);
  511. };
  512.  
  513.  
  514. /////////////////////////////////////////////////
  515. // ClusNetworkNetInterfaces
  516. [
  517.     object,
  518.     uuid(f2e606fc-2631-11d1-89f1-00a0c90d061e),
  519.     dual,
  520.     helpstring("Cluster NetInterface Collection Interface in ClusNetwork"),
  521.     pointer_default(unique)
  522. ]
  523. interface ClusNetworkNetInterfaces : ClusObjCollection
  524. {
  525.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  526.    HRESULT Item([in] VARIANT varIndex , [out, retval] ClusNetInterface ** ppClusNetInterface);
  527. };
  528.  
  529. /////////////////////////////////////////////////
  530. // ClusResGroup
  531. [
  532.     object,
  533.     uuid(f2e606e5-2631-11d1-89f1-00a0c90d061e),
  534.     dual,
  535.     helpstring("Cluster Resource Group Interface"),
  536.     pointer_default(unique)
  537. ]
  538. interface ClusResGroup : ClusObj
  539. {
  540.     [propget, hidden]
  541.     HRESULT Handle( [out, retval] LONG * phandle );
  542.  
  543.     [propput]
  544.     HRESULT Name( [in] BSTR bstrGroupName );
  545.  
  546.     [propget]
  547.     HRESULT State( [out,retval] CLUSTER_GROUP_STATE * dwState );
  548.  
  549.     [propget]
  550.     HRESULT OwnerNode( [out,retval] ClusNode ** ppOwnerNode );
  551.  
  552.     [propget]
  553.     HRESULT Resources( [out, retval] ClusGroupResources ** ppClusterGroupResources );
  554.  
  555.     [propget]
  556.     HRESULT PreferredOwnerNodes( [out, retval] ClusGroupOwners ** ppOwnerNodes );
  557.  
  558.     HRESULT SetPreferredOwnerNodes();
  559.  
  560.     HRESULT Delete();
  561.  
  562.     HRESULT Online( [in] LONG nTimeout, [in, optional] ClusNode * pDestinationNode,[out,retval] LONG*  bPending );
  563.  
  564.     HRESULT Move( [in] LONG nTimeout, [in, optional] ClusNode * pDestinationNode,[out,retval] LONG*  bPending );
  565.  
  566.     HRESULT Offline([in] LONG nTimeout, [out,retval] LONG*  bPending);
  567.  
  568.     [propget]
  569.     HRESULT Cluster( [out,retval] ICluster ** ppCluster );
  570. };
  571.  
  572.  
  573. /////////////////////////////////////////////////
  574. // ClusResGroups
  575. [
  576.     object,
  577.     uuid(f2e606e6-2631-11d1-89f1-00a0c90d061e),
  578.     dual,
  579.     helpstring("Cluster Resource Groups Interface"),
  580.     pointer_default(unique)
  581. ]
  582. interface ClusResGroups : ClusObjCollection
  583. {
  584.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  585.     HRESULT Item([in] VARIANT varIndex , [out, retval] ClusResGroup ** ppClusResGroup);
  586.  
  587.    [helpstring("Create a new resource group")]
  588.     HRESULT CreateItem( [in] BSTR bstrResourceGroupName, [out, retval] ClusResGroup ** ppResourceGroup );
  589.  
  590.     [helpstring("Delete a resource group")]
  591.     HRESULT DeleteItem( [in] VARIANT varIndex );
  592.  
  593. };
  594.  
  595.  
  596. /////////////////////////////////////////////////
  597. // ClusResource
  598. [
  599.     object,
  600.     uuid(f2e606e7-2631-11d1-89f1-00a0c90d061e),
  601.     dual,
  602.     helpstring("Cluster Resource Interface"),
  603.     pointer_default(unique)
  604. ]
  605. interface ClusResource : ClusObj
  606. {
  607.     [propget, hidden]
  608.     HRESULT Handle( [out, retval] LONG * phandle );
  609.  
  610.     [propput]
  611.     HRESULT Name( [in] BSTR bstrResourceName );
  612.  
  613.     [propget]
  614.     HRESULT State( [out,retval] CLUSTER_RESOURCE_STATE* dwState );
  615.  
  616.     HRESULT BecomeQuorumResource( [in] BSTR bstrDevicePath, [in] LONG lMaxLogSize );
  617.  
  618.     HRESULT Delete();
  619.  
  620.     HRESULT Fail();
  621.     HRESULT Online(LONG nTimeout,LONG*  bPending);
  622.     HRESULT Offline(LONG nTimeout, LONG*  bPending);
  623.  
  624.     HRESULT ChangeResourceGroup( [in] ClusResGroup * pResourceGroup );
  625.  
  626.     HRESULT AddResourceNode( [in] ClusNode * pNode );
  627.     HRESULT RemoveResourceNode( [in] ClusNode * pNode );
  628.  
  629. //    HRESULT AddResourceDependency( [in] ClusResource * pResource );
  630. //    HRESULT RemoveResourceDependency( [in] ClusResource * pResource );
  631.     HRESULT CanResourceBeDependent( [in] ClusResource * pResource, [out, retval] BOOL * bDependent );
  632.  
  633.     [propget]
  634.     HRESULT PossibleOwnerNodes( [out, retval] ClusResOwners ** ppNodes );
  635.  
  636.     [propget]
  637.     HRESULT Dependencies( [out, retval] ClusResDependencies ** ppResDependencies );
  638.  
  639.     [propget]
  640.     HRESULT Group( [out, retval] ClusResGroup ** ppResGroup );
  641.  
  642.     [propget]
  643.     HRESULT OwnerNode( [out, retval] ClusNode ** ppNode );
  644.  
  645.     [propget]
  646.     HRESULT Cluster( [out, retval] ICluster ** ppCluster );
  647. };
  648.  
  649. /////////////////////////////////////////////////
  650. // ClusResDependencies
  651. [
  652.     object,
  653.     uuid(f2e606f5-2631-11d1-89f1-00a0c90d061e),
  654.     dual,
  655.     helpstring("Resource Dependencies for a resource"),
  656.     pointer_default(unique)
  657. ]
  658. interface ClusResDependencies : ClusObjCollection
  659. {
  660.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  661.     HRESULT Item([in] VARIANT varIndex , [out, retval] ClusResource ** ppClusResource);
  662.  
  663.     [helpstring("Create a new resource.and add it to the dependency list")]
  664.     HRESULT CreateItem( 
  665.         [in] BSTR bstrResourceName,
  666.         [in] BSTR bstrResourceType,
  667.         [in] BSTR bstrGroupName,
  668.         [in] CLUSTER_RESOURCE_CREATE_FLAGS dwFlags,
  669.         [out, retval] ClusResource ** ppClusterResource );
  670.  
  671.     [helpstring("Delete a resource by name or index.")]
  672.     HRESULT DeleteItem( [in] VARIANT varIndex );
  673.  
  674.     [helpstring("Add a resource to the list.")]
  675.     HRESULT AddItem( [in] ClusResource* pResource );
  676.  
  677.     [helpstring("Remove a resource from the list by name or index.")]
  678.     HRESULT RemoveItem( [in] VARIANT varIndex );
  679.  
  680. };
  681.  
  682.  
  683. /////////////////////////////////////////////////
  684. // ClusGroupResources
  685. [
  686.     object,
  687.     uuid(f2e606f6-2631-11d1-89f1-00a0c90d061e),
  688.     dual,
  689.     helpstring("Resources Collection in a group"),
  690.     pointer_default(unique)
  691. ]
  692. interface ClusGroupResources : ClusObjCollection
  693. {
  694.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  695.     HRESULT Item([in] VARIANT varIndex , [out, retval] ClusResource ** ppClusResource);
  696.  
  697.     [helpstring("Create a new resource.")]
  698.     HRESULT CreateItem( 
  699.         [in] BSTR bstrResourceName,
  700.         [in] BSTR bstrResourceType,
  701.         [in] CLUSTER_RESOURCE_CREATE_FLAGS dwFlags,
  702.         [out, retval] ClusResource ** ppClusterResource );
  703.  
  704.     [helpstring("Delete a resource by name or index.")]
  705.     HRESULT DeleteItem( [in] VARIANT varIndex );
  706.  
  707. };
  708.  
  709. /////////////////////////////////////////////////
  710. // ClusResTypeResources
  711. [
  712.     object,
  713.     uuid(f2e606f7-2631-11d1-89f1-00a0c90d061e),
  714.     dual,
  715.     helpstring("ClusResTypeResources Collection"),
  716.     pointer_default(unique)
  717. ]
  718. interface ClusResTypeResources : ClusObjCollection
  719. {
  720.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  721.     HRESULT Item([in] VARIANT varIndex , [out, retval] ClusResource ** ppClusResource);
  722.  
  723.     [helpstring("Create a new resource.")]
  724.     HRESULT CreateItem( 
  725.         [in] BSTR bstrResourceName, 
  726.         [in] BSTR bstrGroupName, 
  727.         [in] CLUSTER_RESOURCE_CREATE_FLAGS dwFlags,
  728.         [out, retval] ClusResource ** ppClusterResource );
  729.  
  730.     [helpstring("Delete a resource by name or index.")]
  731.     HRESULT DeleteItem( [in] VARIANT varIndex );
  732. };
  733.  
  734.  
  735. // A Resource Collection in the ICluster Object.
  736.  
  737. /////////////////////////////////////////////////
  738. // ClusResources
  739. [
  740.     object,
  741.     uuid(f2e606e8-2631-11d1-89f1-00a0c90d061e),
  742.     dual,
  743.     helpstring("Cluster Resources Collection"),
  744.     pointer_default(unique)
  745. ]
  746. interface ClusResources : ClusObjCollection
  747. {
  748.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  749.     HRESULT Item([in] VARIANT varIndex , [out, retval] ClusResource ** ppClusResource);
  750.  
  751.     [helpstring("Create a new resource and add it to the Resource list in the Cluster Object")]
  752.     HRESULT CreateItem( 
  753.         [in] BSTR bstrResourceName,
  754.         [in] BSTR bstrResourceType,
  755.         [in] BSTR bstrGroupName,
  756.         [in] CLUSTER_RESOURCE_CREATE_FLAGS dwFlags,
  757.         [out, retval] ClusResource ** ppClusterResource );
  758.     [helpstring("Delete a resource by name or index.")]
  759.     HRESULT DeleteItem( [in] VARIANT varIndex );
  760. };
  761.  
  762. /////////////////////////////////////////////////
  763. // ClusGroupOwners
  764. [
  765.     object,
  766.     uuid(f2e606f8-2631-11d1-89f1-00a0c90d061e),
  767.     dual,
  768.     helpstring("Owner Nodes Collection"),
  769.     pointer_default(unique)
  770. ]
  771. interface ClusGroupOwners : ClusObjCollection
  772. {
  773.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  774.     HRESULT Item([in] VARIANT varIndex , [out, retval] ClusNode ** ppClusNode);
  775.  
  776.     [helpstring("Insert a Node into the collection")]
  777.     HRESULT InsertItem([in] ClusNode *pClusNode, [in,optional] LONG nPosition );
  778.     
  779.     [helpstring("Delete a Node by name or index.")]
  780.     HRESULT RemoveItem( [in] VARIANT varIndex );
  781.     
  782.     [propget]
  783.     HRESULT Modified([out,retval] boolean * flag);
  784.  
  785.  
  786. };
  787.  
  788. /////////////////////////////////////////////////
  789. // ClusResOwners
  790. [
  791.     object,
  792.     uuid(f2e606f9-2631-11d1-89f1-00a0c90d061e),
  793.     dual,
  794.     helpstring("Owner Nodes Collection"),
  795.     pointer_default(unique)
  796. ]
  797. interface ClusResOwners : ClusObjCollection
  798. {
  799.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  800.     HRESULT Item([in] VARIANT varIndex , [out, retval] ClusNode ** ppClusNode);
  801.  
  802.     [helpstring("Add OwnerNode  to the Possible Owner List of the Resource.")]
  803.     HRESULT AddItem( [in] ClusNode* pNode );
  804.     
  805.     [helpstring("Remove a OwnerNode from the list by name or index.")]
  806.     HRESULT RemoveItem( [in] VARIANT varIndex );
  807.     [propget]
  808.     HRESULT Modified([out,retval] boolean * pbflag);
  809. };
  810.  
  811.  
  812. /////////////////////////////////////////////////
  813. // ClusResType
  814. [
  815.     object,
  816.     uuid(f2e606e9-2631-11d1-89f1-00a0c90d061e),
  817.     dual,
  818.     helpstring("Cluster Resource Type"),
  819.     pointer_default(unique)
  820. ]
  821. interface ClusResType : ClusObj
  822. {
  823.  
  824.     HRESULT Delete();
  825.  
  826.     [propget]
  827.     HRESULT Cluster( [out,retval] ICluster ** ppCluster );
  828.  
  829.     /////////////////////////////////
  830.     // Cluster Resources
  831.     [propget]
  832.     HRESULT Resources( [out, retval] ClusResTypeResources ** ppClusterResTypeResources );
  833. };
  834.  
  835.  
  836. /////////////////////////////////////////////////
  837. // ClusResTypes
  838. [
  839.     object,
  840.     uuid(f2e606ea-2631-11d1-89f1-00a0c90d061e),
  841.     dual,
  842.     helpstring("Cluster Resource Types Collection"),
  843.     pointer_default(unique)
  844. ]
  845. interface ClusResTypes : ClusObjCollection
  846. {
  847.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  848.     HRESULT Item([in] VARIANT varIndex , [out, retval] ClusResType ** ppClusResType);
  849.  
  850.     [helpstring("Create a resource type")]
  851.     HRESULT CreateItem(
  852.         [in] BSTR bstrResourceTypeName,
  853.         [in] BSTR bstrDisplayName,
  854.         [in] BSTR bstrResourceTypeDll,
  855.         [in] LONG dwLooksAlivePollInterval,
  856.         [in] LONG dwIsAlivePollInterval,
  857.         [out, retval] ClusResType ** ppResourceType );
  858.     [helpstring("Delete a resource type")]
  859.     HRESULT DeleteItem( [in] VARIANT varIndex );
  860.  
  861. };
  862.  
  863.  
  864.  
  865.  
  866.  
  867. /////////////////////////////////////////////////
  868. // ClusProperty
  869. [
  870.     object,
  871.     uuid(f2e606eb-2631-11d1-89f1-00a0c90d061e),
  872.     dual,
  873.     helpstring("Property of an object in the cluster"),
  874.     pointer_default(unique)
  875. ]
  876. interface ClusProperty : IDispatch
  877. {
  878.     [propget]
  879.     HRESULT Name( [out, retval] BSTR * pbstrName );
  880.  
  881.     [propget]
  882.     HRESULT Value( [out, retval] VARIANT * pvarValue );
  883.  
  884.     [propput, id(DISPID_VALUE)]
  885.     HRESULT Value( [in] VARIANT varValue );
  886. };
  887.  
  888.  
  889.  
  890. /////////////////////////////////////////////////
  891. // ClusProperties
  892. [
  893.     object,
  894.     uuid(f2e606ec-2631-11d1-89f1-00a0c90d061e),
  895.     dual,
  896.     helpstring("ClusProperty collection"),
  897.     pointer_default(unique)
  898. ]
  899. interface ClusProperties : ClusObjCollection
  900. {
  901.     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
  902.     HRESULT Item([in] VARIANT varIndex , [out, retval] ClusProperty ** ppClusProperty);
  903.  
  904.     [helpstring("Add an object")]
  905.     HRESULT Add( [in] BSTR bstrName, [in] VARIANT varValue, [out, retval] ClusProperty ** pProperty );
  906.  
  907.     [helpstring("Remove an object")]
  908.     HRESULT Remove( [in] VARIANT varIndex );
  909.  
  910.     [helpstring("Save all property changes")]
  911.     HRESULT SaveChanges();
  912. };
  913.  
  914.  
  915.  
  916. /////////////////////////////////////////////////////////
  917. // MSClusterLib
  918. [
  919.     uuid(f2e606f0-2631-11d1-89f1-00a0c90d061e),
  920.     version(1.0),
  921.     helpstring("MS Cluster 1.0 Type Library")
  922. ]
  923. library MSClusterLib
  924. {
  925.     importlib("stdole32.tlb");
  926.  
  927.     // Temporary include file for CLUSAPI constants.
  928.     //    #include "cluconst.idl"
  929.  
  930.  
  931.     [
  932.         uuid(f2e606f1-2631-11d1-89f1-00a0c90d061e),
  933.         helpstring("Application Class")
  934.     ]
  935.     coclass Application
  936.     {
  937.         [default] interface IClusterApplication;
  938.     };
  939.  
  940.     [
  941.         uuid(f2e606f2-2631-11d1-89f1-00a0c90d061e),
  942.         helpstring("Cluster Class")
  943.     ]
  944.     coclass Cluster
  945.     {
  946.         [default] interface ICluster;
  947.     };
  948.  
  949. };
  950.