3(2005-06-09)
β¨ CMCIClientFT.getClass() β¨
okay so bestie, this is from the 3 manual, dated 2005-06-09, and it's the glow-up guide to pulling a class out of your CIMOM. sit down, hydrate, let's go π«Ά
πΈ NAME πΈ
CMCIClientFT.getClass() β get a class, but as a reference. that's it. that's the whole job. iconic π
π SYNOPSIS π
#include <cmci.h>
CMPIConstClass*
CMCIClientFT.getClass(CMCIClient*cl,
CMPIObjectPath*op,
CMPIFlagsflags,
char**properties,
CMPIStatus*rc);
like yes, the include goes first, always, no skips π§
π DESCRIPTION π
so basically: you're getting a Class, and you're using op as your reference point. the content of the class structure that comes back to you? that's controllable β you get to shape it with the flags parameter. main character energy, honestly π
let's do the argument roll call:
clβ the client object pointer. your connection babe, your entry point.opβ theCMPIObjectPathobject pointer. this lil guy is holding the namespace and the classname components. that's where the class actually lives.flagsβ the flags that affect what ends up inside the returned class structure. yes it matters, yes you should care.propertiesβ the properties array. if it's notNULL, the members of that array define one or more Property names. so it's a lil guest list.rcβ theCMPI return status. heads up: it's suppressed whenNULL. so if you passNULLyou just don't get the status. your choice bestie π
and about that flags argument β it's a bit mask, so it can hold combinations of these:
CMPI_FLAG_LocalOnlyCMPI_FLAG_IncludeQualifiersCMPI_FLAG_IncludeClassOrigin
mixing and matching? encouraged. it's giving build-your-own-adventure π
now the properties array β it defines what properties should be returned for the class. so:
- if this argument is not
NULL, only the class properties in the list come back. strictly the list. no extras, no crumbs. - if it's
NULL, all class properties come back. the whole menu π
β RETURN VALUE β
- when it's successful:
CMCIClientFT.getClass()returns a pointer to aCMPIConstClassobject and sets a successful status code inrc. we love a double win β¨ - when it's unsuccessful: it returns
NULLand sets thercargument with the error code and the corresponding error string. so like, the sad path still tells you what went wrong π
π ERRORS π
nothing listed here. this section is literally empty, it's giving silence, it's giving void π«₯ the error info shows up in rc instead (see above, bestie).
π¦ EXAMPLES π¦
here's the vibe in actual code:
CMCIClient *cc;
CMPIObjectPath * objectpath;
CMPIInstance * instance;
CMPIEnumeration * enumeration;
CMPIClass *class;
CMPIStatus status;
/* Setup a conncetion to the CIMOM */
cc = cmciConnect("localhost", NULL, NULL, NULL, NULL, NULL);
objectpath = newCMPIObjectPath("root/cimv2", "Linux_ComputerSystem",
NULL);
class = cc->ft->getClass(cc, objectpath, 0, NULL, &status);
if (!status.rc) { fprintf(stderr, "operation error code %d
description %s0, status.rc, status.msg->hdl);
abort();
}
so you spin up the connection to the CIMOM, build your objectpath pointing at root/cimv2 and Linux_ComputerSystem, then call getClass with flags 0, no property filter (NULL), and a &status to catch the tea. and if status.rc isn't happy, you print the error code and description and abort(). dramatic but valid π
ngl, this code is copied exactly as it lives in the original page β typos, odd wrapping, all of it. we do not touch the artifacts, we respect them π«Ά
π§ CONFORMING TO π§
also empty. no standards named here. it's giving minimalist π
π SEE ALSO π
Common Manageability Programming Interface (CMPI) - OpenGroupCMCIClient(3)CMPIConstClass(3)CMPIObjectPath(3)CMPIFlags(3)CMPIStatus(3)
go read those next, iykyk πβ¨
and that's the whole page, no cap. this came from the SFCBroker Client Library, sfcc, and it's the 3(2005-06-09) situation β so like, dated 2005-06-09, manual section 3. periodt. bye bestie, go get your class πππ¦
π¦ where this page comes from
- centos-stream 10: sblim-sfcc 2.2.8-28.el10 Β· EPL-1.0
- centos-stream 9: sblim-sfcc 2.2.8-18.el9 Β· EPL-1.0
- centos-stream 9: sblim-sfcc 2.2.8-18.el9 Β· EPL-1.0
- fedora 43: sblim-sfcc 2.2.8-29.fc43 Β· EPL-1.0
- fedora 43: sblim-sfcc 2.2.8-29.fc43 Β· EPL-1.0
- fedora 44: sblim-sfcc 2.2.8-30.fc44 Β· EPL-1.0
- fedora 44: sblim-sfcc 2.2.8-30.fc44 Β· EPL-1.0
- nixos 26.05: sblim-sfcc 2.2.8-unstable-2023-06-26
- nixpkgs unstable: sblim-sfcc 2.2.8-unstable-2023-06-26
- opensuse-leap 16.0: sblim-sfcc-devel 2.2.9~rc1-bp160.1.13 Β· EPL-1.0
- opensuse-leap 16.0: sblim-sfcc-devel 2.2.9~rc1-bp160.1.13 Β· EPL-1.0
- opensuse-leap 16.0: sblim-sfcc-devel 2.2.9~rc1-bp160.1.13 Β· EPL-1.0
- opensuse-leap 16.0: sblim-sfcc-devel 2.2.9~rc1-bp160.1.13 Β· EPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms