version 1.5, 2004/10/13 14:45:26
|
version 1.7, 2005/08/04 19:11:51
|
|
|
CMPI Providers in a nutshell |
Common Management Programming Interface (CMPI) Providers in a nutshell |
============================ | ============================ |
| |
Viktor Mihajlovski <mihajlov@de.ibm.com> |
Aug 1st, 2005 |
Nov 14th 2003 |
|
| |
Pegasus 2.4 *NEWS* |
Pegasus 2.5 *NEWS* |
------------------ | ------------------ |
| |
The CMPI header files are being standardized and will be (possibly by the |
The CMPI macro header files (cmpimacs.h) shipped is OpenPegasus specific. This |
time you read this) frozen. However, since the OpenPegasus 2.4 release is |
will change once OpenGroup releases a specification with the macro definitions. |
anticipated prior to the anticipated freezing of the CMPI standard, |
|
the OpenPegasus 2.4 release will not provide the CMPI header files as |
The CMPI Function Table (cmpift.h) file and CMPI Data Types (cmpidt.h) file are |
part of the OpenPegasus 2.4 SDK. |
composed from the CMPI v1.0 specification + Technical Corrigenda and are |
|
binary compatible with the "historical implementations" and the 1.0 specification |
|
augmented with the Technical Corrigenda. |
| |
They can be found within CVS and the source tarball. Visit |
|
http://cvs.opengroup.org/cgi-bin/viewcvs.cgi/pegasus/src/Pegasus/Provider/CMPI/ to view the CMPI header files. |
|
| |
Build CMPI from sources | Build CMPI from sources |
----------------------- | ----------------------- |
|
|
The Common Manageability Programming Interface (CMPI) has been integrated into | The Common Manageability Programming Interface (CMPI) has been integrated into |
Pegasus as a pluggable provider manager. | Pegasus as a pluggable provider manager. |
| |
CMPI must be enabled during Pegasus build. |
CMPI is by default enabled on Linux. For other platforms it must be enabled |
|
during Pegasus build. |
|
|
For CMPI enablement, set the following environment variables prior to make: | For CMPI enablement, set the following environment variables prior to make: |
| |
PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER=1 | PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER=1 |
|
|
The packages prefixed by the string sblim-cmpi contain CMPI providers for | The packages prefixed by the string sblim-cmpi contain CMPI providers for |
various classes. See http://www-124.ibm.com/developerworks/projects/sblim . | various classes. See http://www-124.ibm.com/developerworks/projects/sblim . |
| |
|
Using CMPI with threads |
|
----------------------- |
|
|
|
CMPI provides API functions for low-level thread, mutex and conditional constructs. |
|
Hence you can compile your provider without needing to link to pthread or other |
|
threading library. |
|
|
|
However, the developer is responsible for memory management of these constructs and |
|
as well of exiting the threads before the cleanup function is exited. If this is not |
|
done, the thread will be forcefully terminated. This can have the nasty consequence of |
|
hanging CIMServer, or bringing down the CIMServer, or just the Out-of-Process Provider |
|
Agent if you run OpenPegasus with 'run-as-requester' configuration flag turned on. |
|
Please refer to the Admin Guide or the readme files for more details about this flag. |
|
|
|
Using CQL with CMPI |
|
------------------- |
|
|
|
To use CQL support for indications and exec query you will have to use |
|
the Pegasus/Provider/CMPI/cmpi_cql.h header file with one new function. |
|
You also you need to define PEGASUS_USE_EXPERIMENTAL in your |
|
code to take advantage of these CQL utility functions. The reason is that |
|
the CMPI standard 1.0 is unclear on one thing: |
|
|
|
- CMNewSelectExp. One of arguments passed is a 'projection' array. The |
|
spec does not explain exactly what in such array. Implementation of |
|
CMPI that also implemented WQL put a string representation of the |
|
properties, as "SystemName", "Hostname", etc. But that is not neccesarily |
|
the case with CQL, where you can have chained identifiers such as |
|
"CIM_OperatingSystem::SystemName". In other words, the CMPI standard |
|
needs to clarify this and to make the existing providers backward |
|
supported, this utility function - CMPI_CQL_NewSelectExp is provided |
|
until the CMPI standard comes up with a conclusion on this. |
|
|
|
When the CMPI provides a resolution on these issues, this utility |
|
interface will be gone and unsupported. |
|
|
|
Questions and Answers: |
|
Q1: Is the CMPI Specification really ambiguous or does it |
|
just not support CQL? If it's ambiguous should it be fixed |
|
before it goes final? |
|
|
|
A1:. Page 96 of the CMPI review spec states (line 2899-2901): The *projection output argument is |
|
a pointer to a CMPIArray structure of CMPIString entries containing projection specification. |
|
It shall be set to NULL if no projection is defined.. To clarify any ambigiuity, an e-mail to the |
|
CMPI review group was sent, which would add the following: The projection specification is query |
|
language specific. Hence the entries format of the projection output array CMPIString might be |
|
different depending on the query language. Be sure to check the lang argument for the query language your |
|
provider will support. . To guard the provider from DMTF's CQL possible ways it can be represented in |
|
a string format, and since the CQL is experimental, the CMNewSelectExp will NOT support CQL. |
|
The CMPI_CQL_NewSelect will support both CQL and WQL. |
|
|
|
|
|
AQ:What happens if an existing Provider is passed a CQL |
|
statement and issues a newSelectExp call? Does it return |
|
an error? |
|
|
|
A2: The error code CMPI_RC_ERR_QUERY_LANGUAGE_NOT_SUPPORTED would be set. |
|
|
|
|
|
Q3: Both CMNewSelectExp and CMPI_CQL_NewSelectExp return a |
|
CMPISelectExp. Is there anyway to determine whether the |
|
CMPISelectExp represents a CQL or WQL expression? |
|
|
|
A3:Not from the scope of the CMPISelectExp structure. Please note that the routine |
|
that would exercise the CMPISelectExp has a char *lang passed in as argument. |
|
This char *lang* can be used to easily determine what query language is used. |
|
|
|
|
| |
Registering CMPI providers with Pegasus | Registering CMPI providers with Pegasus |
--------------------------------------- | --------------------------------------- |