3(2005-06-09)

πŸ“¦
version 2.2.9~rc1 Β· 2 versions
, in centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

✨ 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 β€” the CMPIObjectPath object 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 not NULL, the members of that array define one or more Property names. so it's a lil guest list.
  • rc β€” the CMPI return status. heads up: it's suppressed when NULL. so if you pass NULL you 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_LocalOnly
  • CMPI_FLAG_IncludeQualifiers
  • CMPI_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 a CMPIConstClass object and sets a successful status code in rc. we love a double win ✨
  • when it's unsuccessful: it returns NULL and sets the rc argument 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 πŸ‘‘

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 πŸ’–πŸŽ€πŸ¦‹