Re: question on CBEnumInstances
Marek Szermutzky <[email protected]>
| Newsgroups | gmane.network.open-pegasus.general |
|---|---|
| Message-ID | <OF2C088891.2BD932F9-ONC12577C8.003A1D3E-C12577C8.003B5F7E@de.ibm.com> |
Hi! On the function, inline static CMPIEnumeration *CBEnumInstances( const CMPIBroker * mb, const CMPIContext * ctx, const CMPIObjectPath * op, const char **properties, CMPIStatus * rc) the input parameter "properties" may hold a property list, meaning you can filter all instances to only return with the properties named in "properties". Today the CMPI interface does not allow to filter for certain instances based on a property value on CBEnumInstances(). What you could do instead to achieve your target is to execute a query using the CMPIStatus (*execQuery) (CMPIInstanceMI*,const CMPIContext*,const CMPIResult*,const CMPIObjectPath*,const char*,const char*); or its corresponding macro version: /** Query the enumeration of instances of the class (and subclasses) defined by <op> using <query> expression. @param mb Broker this pointer. @param ctx Context object @param op ObjectPath containing namespace and classname components. @param query Query expression @param lang Query Language @param rc Output: Service return status (suppressed when NULL). @return Resulting eumeration of Instances. */ inline static CMPIEnumeration *CBExecQuery( const CMPIBroker * mb, const CMPIContext * ctx, const CMPIObjectPath * op, const char *query, const char *lang, CMPIStatus * rc); The most performant way for this to work would be if the provider implementing the class you want to query does support queries natively and is capable to execute on queries. Mit freundlichen Grüßen / Kind regards Marek Szermutzky Software Engineer / OpenPegasus Maintainer (PMC) and z/OS PlatformRep. IBM Systems &Technology Group, Systems Software Development / z/OS Capacity Management and Support ------------------------------------------------------------------------------------------------------------------------------------------- IBM Deutschland Schoenaicher Str. 220 71032 Boeblingen Phone: +49-7031-16-5182 E-Mail: [email protected] ------------------------------------------------------------------------------------------------------------------------------------------- IBM Deutschland Research & Development GmbH / Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294 From: kamal jeera <[email protected]> To: [email protected] Date: 25.10.2010 19:56 Subject: Re: question on CBEnumInstances ---------- forgot to add that, the reason I want to that is..... the class that I am trying to do enumerateIntstance has tons of instances, and it is taking lot of time to to go through all of those and chose the one I want. It would be nice if CBEnumInstances can filter out the results. On Mon, Oct 25, 2010 at 10:50 AM, kamal jeera <[email protected] > wrote: Hi All, I have a question on CBEnumInstances. inline static CMPIEnumeration *CBEnumInstances( const CMPIBroker * mb, const CMPIContext * ctx, const CMPIObjectPath * op, const char **properties, CMPIStatus * rc) I am trying to enumerate instances of a class. I would like to filter my results based on certain property value, how can I do that? Lets for example I would like to filter results from CBEnumInstances to just show the instances of class which has property has GatheringType = 3 I am not sure if can specify value for const char **properties. thanks, Hemanth