OpenClovis Logo

clAmsMgmtClientIpi.h
1 /*
2  * Copyright (C) 2002-2012 OpenClovis Solutions Inc. All Rights Reserved.
3  *
4  * This file is available under a commercial license from the
5  * copyright holder or the GNU General Public License Version 2.0.
6  *
7  * The source code for this program is not published or otherwise
8  * divested of its trade secrets, irrespective of what has been
9  * deposited with the U.S. Copyright office.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * For more information, see the file COPYING provided with this
17  * material.
18  */
19 /*******************************************************************************
20  * ModuleName : amf
21  * File : clAmsMgmtClientIpi.h
22  *******************************************************************************/
23 
24 /*******************************************************************************
25  * Description :
26  *
27  * This header file contains AMS management function related definitions. The
28  * management function is used by a management client (or an intermediatory
29  * called by a management client to manipulate the AMS config database.
30  *
31  *
32  ***************************** Editor Commands ********************************
33  * For vi/vim
34  * :set shiftwidth=4
35  * :set softtabstop=4
36  * :set expandtab
37  *****************************************************************************/
38 
39 
40 /**************************************************************************************
41 *********************************AMS Management Client Functions***********************
42 ***************************************************************************************/
43 /* pageams101 : clAmsMgmtInitialize */
44 /* pageams102 : clAmsMgmtFinalize */
45 /* pageams103 : clAmsMgmtAMSEnable */
46 /* pageams104 : clAmsMgmtAMSDisable */
47 /* pageams105 : clAmsMgmtEntityCreate */
48 /* pageams106 : clAmsMgmtEntityDelete */
49 /* pageams107 : clAmsMgmtEntityFindByName */
50 /* pageams108 : clAmsMgmtEntityFindByAttribute */
51 /* pageams109 : clAmsMgmtEntitySetConfig */
52 /* pageams110 : clAmsMgmtEntityLockAssignment */
53 /* pageams111 : clAmsMgmtEntityLockInstantiation */
54 /* pageams112 : clAmsMgmtEntityUnlock */
55 /* pageams113 : clAmsMgmtEntityShutdown */
56 /* pageams114 : clAmsMgmtEntityRestart */
57 /* pageams115 : clAmsMgmtEntityRepaired */
58 /* pageams116 : clAmsMgmtEntityStartMonitoringEntity */
59 /* pageams117 : clAmsMgmtEntityStopMonitoringEntity */
60 /* pageams118 : clAmsMgmtSGAdjustPreference */
61 /* pageams119 : clAmsMgmtSGAssignSUtoSG */
62 /* pageams120 : clAmsMgmtSISwap */
63 /* pageams121 : clAmsMgmtEntityListEntityRefAdd */
64 /* pageams122 : clAmsMgmtEntityGetEntityList */
65 /* pageams123 : clAmsMgmtEntitySetRef */
66 /* pageams124 : clAmsMgmtCSISetNVP */
67 /* pageams125 : clAmsMgmtDebugEnable */
68 /* pageams126 : clAmsMgmtDebugDisable */
69 /* pageams127 : clAmsMgmtDebugGet */
70 /* */
71 /**************************************************************************************/
72 
73 
74 /******************************************************************************
75  * TO DO ITEMS
76  * - Return values for functions are not comprehensive
77  * - Confirm how management API will be RMDized
78  *****************************************************************************/
79 
80 #ifndef _CL_AMS_MGMT_CLIENT_IPI_H_
81 #define _CL_AMS_MGMT_CLIENT_IPI_H_
82 
83 #ifdef __cplusplus
84 extern "C" {
85 #endif
86 
87 /******************************************************************************
88  * Include files needed to compile this file
89  *****************************************************************************/
90 
91 #include <clCommon.h>
92 #include <clCommonErrors.h>
93 
94 #include <clAmsTypes.h>
95 #include <clAmsEntities.h>
96 
97 // XXX Clean this up later
98 #include <clAmsMgmtCommon.h>
99 #include <clLogApi.h>
100 /******************************************************************************
101  * Management API related data structures
102  *****************************************************************************/
103 
104 /******************************************************************************
105  * Generic functions for all AMS entities
106  *****************************************************************************/
107 /*
108  ************************************
109  * \page pageams105 clAmsMgmtEntityCreate
110  *
111  * \par Synopsis:
112  * Creates a new instance of an AMS entity.
113  *
114  * \par Header File:
115  * clAmsMgmtClientIpi.h
116  *
117  *
118  *
119  *
120  * \par Syntax:
121  * \code ClRcT clAmsMgmtEntityCreate(
122  * CL_IN ClAmsMgmtHandleT amsHandle,
123  * CL_IN const ClAmsEntityT *entity);
124  * \endcode
125  *
126  * \param amsHandle: Handle assigned to function user.
127  * \param entity: Entity type and name.
128  *
129  * \retval CL_OK: The function executed successfully.
130  * \retval CL_ERR_INVALID_HANDLE: Error: Handle was invalid.
131  *
132  * \par Description:
133  * Create a new instance of an AMS entity such as Node, Application, SG,
134  * SU, SI, Component or CSI in the AMS entity database.
135  *
136  * The entity is created with a default config and only the entity name
137  * and type is set by default. All other entity attributes must be
138  * configured by calling the clAmsMgmtEntitySetConfig function. All
139  * entities are created with a management state of disabled and must be
140  * explicitly added into the active entity database.
141  *
142  * This function wraps equivalent AMS database function functions.
143  *
144  * \par Library File:
145  *
146  * \par Related function(s):
147  */
148 
149 extern ClRcT clAmsMgmtEntityCreate(
150  CL_IN ClAmsMgmtHandleT amsHandle,
151  CL_IN const ClAmsEntityT *entity);
152 
153 /*
154  ************************************
155  * \page pageams106 clAmsMgmtEntityDelete
156  *
157  * \par Synopsis:
158  * Removes an instance of an AMS entity.
159  *
160  * \par Header File:
161  * clAmsMgmtClientIpi.h
162  *
163  *
164  *
165  *
166  * \par Syntax:
167  * \code ClRcT clAmsMgmtEntityDelete(
168  * CL_IN ClAmsMgmtHandleT amsHandle,
169  * CL_IN const ClAmsEntityT *entity);
170  * \endcode
171  *
172  * \param amsHandle: Handle assigned to function user.
173  * \param entity: Entity type and name.
174  *
175  * \retval CL_OK: The function executed successfully.
176  * \retval CL_ERR_INVALID_HANDLE: Error: Handle was invalid.
177  *
178  * \par Description:
179  * This function is used to remove an instance of an AMS entity such as Node, Application, SG, SU,
180  * SI, Component or CSI from the AMS entity database.
181  *
182  * The entity is identified either by an handle, or if its null, then by
183  * the entity type and name.
184  *
185  * For all entities with an admin state (node, application, SG, SU, SI),
186  * the entity is first brought into a locked state, before being removed
187  * from the database. The state transitions will trigger the evaluation
188  * of necessary AMS policies. If state transitions are locked for an entity,
189  * the locks are overridden. Entities without an admin state (component
190  * and CSI) are removed from the appropriate data bases after removing
191  * the entities from service.
192  *
193  * This function wraps equivalent AMS database and client function functions.
194  *
195  * \par Library File:
196  *
197  * \par Related function(s):
198  */
199 
200 extern ClRcT clAmsMgmtEntityDelete(
201  CL_IN ClAmsMgmtHandleT amsHandle,
202  CL_IN const ClAmsEntityT *entity);
203 /*
204  ************************************
205  * \page pageams107 clAmsMgmtEntityFindByName
206  *
207  * \par Synopsis:
208  * Finds an instance of an AMS entity.
209  *
210  * \par Header File:
211  * clAmsMgmtClientIpi.h
212  *
213  *
214  *
215  *
216  * \par Syntax:
217  * \code ClRcT clAmsMgmtEntityFindByName(
218  * CL_IN ClAmsMgmtHandleT amsHandle,
219  * CL_INOUT ClAmsEntityRefT *entityRef);
220  * \endcode
221  *
222  * \param amsHandle: Handle assigned to function user.
223  * \param entity: (in/out) Entity type and name.
224  *
225  *
226  * \retval CL_OK: The function executed successfully.
227  * \retval CL_ERR_INVALID_HANDLE: Error: Handle was invalid.
228  * \retval CL_ERR_NOT_EXIST: Error: Resource/Entity does not exist.
229  *
230  * \par Description:
231  * This function is used to find an instance of an AMS entity in the appropriate AMS entity
232  * database. The entity is identified by the entity type and name
233  * and returns the entity handle.
234  *
235  * This function wraps equivalent AMS database functions.
236  *
237  * \par Library File:
238  *
239  * \par Related function(s):
240  */
241 
242 extern ClRcT clAmsMgmtEntityFindByName(
243  CL_IN ClAmsMgmtHandleT amsHandle,
244  CL_INOUT ClAmsEntityRefT *entityRef);
245 
246 /*
247  ************************************
248  * \page pageams109 clAmsMgmtEntitySetConfig
249  *
250  * \par Synopsis:
251  * Configures attributes for AMS entities.
252  *
253  * \par Header File:
254  * clAmsMgmtClientIpi.h
255  *
256  *
257  *
258  *
259  * \par Syntax:
260  * \code ClRcT clAmsMgmtEntitySetConfig(
261  * CL_IN ClAmsMgmtHandleT amsHandle,
262  * CL_IN const ClAmsEntityT *entity,
263  * CL_IN ClAmsEntityConfigT *entityConfig,
264  * CL_IN ClUint32T peInstantiateFlag );
265  * \endcode
266  *
267  * \param amsHandle: Handle assigned to function user.
268  * \param entity: Entity type and name.
269  * \param attributeChangeList: Structure indicating which attributes to change and values.
270  *
271  *
272  * \retval CL_OK: The function executed successfully.
273  * \retval CL_ERR_INVALID_HANDLE: Error: Handle was invalid.
274  * \retval CL_ERR_NOT_EXIST: Error: Resource/Entity does not exist.
275  * \retval CL_ERR_INVALID_STATE: Error: The operation is not valid in the current state.
276  *
277  * \par Description:
278  * This function is used to configure attributes for AMS entities.
279  * The entity is identified either by an handle, or if its null, then by
280  * the entity type and name.
281  *
282  * \par Library File:
283  *
284  * \par Related function(s):
285  */
286 // XXX Need to fix how attributes are indicated in the fn call
287 
288 extern ClRcT clAmsMgmtEntitySetConfig(
289  CL_IN ClAmsMgmtHandleT amsHandle,
290  CL_IN const ClAmsEntityT *entity,
291  CL_IN ClAmsEntityConfigT *entityConfig,
292  CL_IN ClUint32T peInstantiateFlag );
293 
294 extern ClRcT clAmsMgmtSGAssignSUtoSG(
295  CL_IN ClAmsMgmtHandleT amsHandle,
296  CL_IN const ClAmsEntityT *suEntity,
297  CL_IN const ClAmsEntityT *sgEntity);
298 
299 /*
300  ************************************
301  * \page pageams121 clAmsMgmtEntityListEntityRefAdd
302  *
303  * \par Synopsis:
304  * Adds reference of an entity to another entity's list.
305  *
306  * \par Header File:
307  * clAmsMgmtClientIpi.h
308  *
309  *
310  * \par Syntax:
311  * \code ClRcT clAmsMgmtEntityListEntityRefAdd(
312  * CL_IN ClAmsMgmtHandleT amsHandle,
313  * CL_IN ClAmsEntityT *sourceEntity,
314  * CL_IN ClAmsEntityT *targetEntity,
315  * CL_IN ClAmsEntityListTypeT entityListName);
316  * \endcode
317  *
318  * \param amsHandle: Handle assigned to function user.
319  * \param sourceEntity: Entity type and name whose list has to be modified.
320  * \param targetEntity: Entity type and name whose reference has to be added in the list.
321  * \param entityListName: Name of the list in which the target entity reference will be added.
322  *
323  *
324  * \retval CL_OK: The function executed successfully.
325  * \retval CL_ERR_INVALID_HANDLE: Error: Handle was invalid
326  * \retval CL_ERR_INVALID_STATE: Error: The operation is not valid in the current state,
327  * \retval CL_ERR_NOT_EXIST: Error: Resource/Entity does not exist.
328  *
329  * \par Description:
330  * This function is used to add reference of an entity to another entity's list
331  * The entity is identified either by an handle, or if its null, then by
332  * the entity type and name.
333  *
334  * \par Library File:
335  * ClAmsMgmtClient
336  * \par Related function(s):
337  *
338  *
339  */
340 
341 extern ClRcT clAmsMgmtEntityListEntityRefAdd(
342  CL_IN ClAmsMgmtHandleT amsHandle,
343  CL_IN ClAmsEntityT *sourceEntity,
344  CL_IN ClAmsEntityT *targetEntity,
345  CL_IN ClAmsEntityListTypeT entityListName);
346 
347 /*
348  ************************************
349  * \page pageams123 clAmsMgmtEntitySetRef
350  *
351  * \par Synopsis:
352  * Sets a reference of an entity for a given entity.
353  *
354  * \par Header File:
355  * clAmsMgmtClientIpi.h
356  *
357  *
358  * \par Syntax:
359  * \code ClRcT clAmsMgmtEntitySetRef(
360  * CL_IN ClAmsMgmtHandleT amsHandle,
361  * CL_IN const ClAmsEntityT *sourceEntity,
362  * CL_IN const ClAmsEntityT *targetEntity );
363  * \endcode
364  *
365  * \param amsHandle: Handle assigned to function user.
366  * \param sourceEntity: Entity type and name which needs the reference to be added.
367  * \param targetEntity: Entity type and name whose reference has to be added.
368  *
369  *
370  * \retval CL_OK: The function executed successfully.
371  * \retval CL_ERR_INVALID_HANDLE: Error: Handle was invalid
372  * \retval CL_ERR_INVALID_STATE: Error: The operation is not valid in the current state,
373  * \retval CL_ERR_NOT_EXIST: Error: Resource/Entity does not exist.
374  *
375  * \par Description:
376  *
377  * \par Library File:
378  * ClAmsMgmtClient
379  * \par Related function(s):
380  *
381  *
382  */
383 
384 extern ClRcT
385 clAmsMgmtEntitySetRef(
386  CL_IN ClAmsMgmtHandleT amsHandle,
387  CL_IN const ClAmsEntityT *sourceEntity,
388  CL_IN const ClAmsEntityT *targetEntity );
389 
390 /*
391  ************************************
392  * \page pageams124 clAmsMgmtCSISetNVP
393  *
394  * \par Synopsis:
395  * Adds a name value pair to a CSIs name value pair list
396  *
397  * \par Header File:
398  * clAmsMgmtClientIpi.h
399  *
400  *
401  * \par Syntax:
402  * \code ClRcT clAmsMgmtCSISetNVP(
403  * CL_IN ClAmsMgmtHandleT amsHandle,
404  * CL_IN const ClAmsEntityT *sourceEntity,
405  * CL_IN ClAmsCSINameValuePairT nvp );
406  * \endcode[-=]=[-]
407  *
408  * \param amsHandle: Handle assigned to function user.
409  * \param sourceEntity: Entity type and name of the CSI whose NVP list has to be added with new NVP.
410  * \param nvp: Name value pair which needs to be added to the CSI's NVP list.
411  *
412  *
413  * \retval CL_OK: The function executed successfully.
414  * \retval CL_ERR_INVALID_HANDLE: Error: Handle was invalid
415  * \retval CL_ERR_INVALID_STATE: Error: The operation is not valid in the current state,
416  * \retval CL_ERR_NOT_EXIST: Error: Resource/Entity does not exist.
417  *
418  * \par Description:
419  *
420  * \par Library File:
421  * ClAmsMgmtClient
422  * \par Related function(s):
423  *
424  *
425  */
426 
427 extern ClRcT
428 clAmsMgmtCSISetNVP(
429  CL_IN ClAmsMgmtHandleT amsHandle,
430  CL_IN const ClAmsEntityT *sourceEntity,
432 
433 
434 #ifdef __cplusplus
435 }
436 #endif
437 
438 #endif // #ifndef _CL_AMS_MGMT_CLIENT_IPI_H_
439 
440 

Generated on Tue Jan 10 10:29:15 PST 2012 for OpenClovis SDK using Doxygen