BUG#: 8730
[tpot/pegasus/.git] / src / Clients / cimcli / CIMCLIClient.h
1 //%LICENSE////////////////////////////////////////////////////////////////
2 //
3 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
16 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 //////////////////////////////////////////////////////////////////////////
29 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef _CLI_CLIENTLIB_H
33 #define _CLI_CLIENTLIB_H
34
35 #include <Pegasus/Common/Config.h>
36 #include <Clients/cimcli/Linkage.h>
37 #include <Pegasus/Common/PegasusAssert.h>
38 #include <Pegasus/General/Stopwatch.h>
39 #include "CIMCLIOptionStruct.h"
40
41
42 PEGASUS_NAMESPACE_BEGIN
43 #define CDEBUG(X) PEGASUS_STD(cout) << "cimcli " << X << PEGASUS_STD(endl)
44 //#define CDEBUG(X)
45
46 // Defined here because apparently not all platforms support max and min.
47 #define LOCAL_MAX(a, b) ((a > b) ? a : b)
48 #define LOCAL_MIN(a, b) ((a < b) ? a : b)
49
50 static const char MSG_PATH [] = "pegasus/pegasusCLI";
51
52
53 ////////////////////////////////////////////////////////////////////////////
54 //
55 // Return codes used for cimcli exit values
56
57 #define CIMCLI_RTN_CODE_OK 0   // successful completion of the command
58
59 // All of the codes up to 50 are reserved.  This is the set of error codes
60 // returned by CIM Exception and cimcli passes any such received exception
61 // codes back through cimcli completion. Therefore we start the internal
62 // error codes outside of this range
63 //
64 #define CIMCLI_RTN_CODE_PEGASUS_EXCEPTION 50
65 #define GENERAL_CLI_ERROR_CODE 51
66 #define CIMCLI_RTN_CODE_UNKNOWN_EXCEPTION 52
67 #define CIMCLI_INPUT_ERR 53
68 #define CIMCLI_CONNECTION_FAILED 54
69
70 #define CIMCLI_RTN_CODE_ERR_COMPARE_FAILED 60
71 #define CIMCLI_RTN_COUNT_TEST_FAILED 61
72
73 /////////////////////////////////////////////////////////////////////////////
74 // ************* cimcli operations ******************************************
75 // These are the operation functions executed by cimcli.  Each takes input
76 // from the opts structure and generates output from a single or set of cim
77 // operations executed against the server defined in the opts structure.
78 // These functions correspond directly to the cimcli operation definitions
79 // (also called commands) that are the first parameter of each cimcli
80 // command line definition.
81 //
82 int PEGASUS_CLI_LINKAGE enumerateClassNames(Options& opts);
83
84 int PEGASUS_CLI_LINKAGE enumerateClasses(Options& opts);
85
86 int PEGASUS_CLI_LINKAGE deleteClass(Options& opts);
87
88 int PEGASUS_CLI_LINKAGE getClass(Options& opts);
89
90 int PEGASUS_CLI_LINKAGE deleteInstance(Options& opts);
91
92 int PEGASUS_CLI_LINKAGE enumerateInstanceNames(Options& opts);
93
94 int PEGASUS_CLI_LINKAGE enumerateAllInstanceNames(Options& opts);
95
96 int PEGASUS_CLI_LINKAGE enumerateInstances(Options& opts);
97
98 int PEGASUS_CLI_LINKAGE createInstance(Options& opts);
99
100 int PEGASUS_CLI_LINKAGE testInstance(Options& opts);
101
102 int PEGASUS_CLI_LINKAGE modifyInstance(Options& opts);
103
104 int PEGASUS_CLI_LINKAGE getInstance(Options& opts);
105
106 int PEGASUS_CLI_LINKAGE getProperty(Options& opts);
107
108 int PEGASUS_CLI_LINKAGE setProperty(Options& opts);
109
110 int PEGASUS_CLI_LINKAGE setQualifier(Options& opts);
111
112 int PEGASUS_CLI_LINKAGE getQualifier(Options& opts);
113
114 int PEGASUS_CLI_LINKAGE deleteQualifier(Options& opts);
115
116 int PEGASUS_CLI_LINKAGE enumerateQualifiers(Options& opts);
117
118 int PEGASUS_CLI_LINKAGE referenceNames(Options& opts);
119
120 int PEGASUS_CLI_LINKAGE references(Options& opts);
121
122 int PEGASUS_CLI_LINKAGE associators(Options& opts);
123
124 int PEGASUS_CLI_LINKAGE associatorNames(Options& opts);
125
126 int PEGASUS_CLI_LINKAGE invokeMethod(Options& opts);
127
128 int PEGASUS_CLI_LINKAGE execQuery(Options& opts);
129
130 int PEGASUS_CLI_LINKAGE enumerateNamespaceNames(Options& opts);
131
132 int PEGASUS_CLI_LINKAGE showProfiles(Options& opts);
133
134 int PEGASUS_CLI_LINKAGE setObjectManagerStatistics(Options& opts,
135                                    Boolean newState,
136                                    Boolean& stateAfterMod);
137
138 PEGASUS_NAMESPACE_END
139
140 #endif