# Enumerate Instances CIM Operation

The `enumerateInstances` method enumerates instances of a CIM Class in the target Namespace.

NameSpace String that defines the target namespace. See NameSpace Operations for more information.

ClassName Defines name of the Class for which instance names are to be retrieved. This must be a legal class in the repository

LocalOnly If checked (true) only CIM Elements overridden within definition of class are returned. Default is true

IncludeQualifiers If checked (true), show Qualifiers for class and returned Properties, Methods, and Method Parameters.

IncludeClassOrigins If checked (TRUE), CLASSORIGIN attribute will be returned for all appropriate elements

PropertyList NOTE: NOT IMPLEMENTED Null or array of property names to filter request. See below.

## Additional Information

The `enumerateInstances` method enumerates instances of a CIM Class in the target Namespace. NameSpace The NameSpace parameter is a string that defines the target namespace. The `ClassName` input parameter defines the Class that is the basis for the enumeration.

LocalOnly If the `LocalOnly` input parameter is `true`, this specifies that, for each returned Instance, only elements (properties and qualifiers) overriden within the definition of that Instance are included. If `false`, all elements are returned. This parameter therefore effects a CIM Server-side mechanism to filter certain elements of the returned object based on whether or not they have been propagated from the parent Class (as defined by the `PROPAGATED` attribute).

IncludeQualifiers If the `IncludeQualifiers` input parameter is `true`, this specifies that all Qualifiers for each Instance (including Qualifiers on the Instance and on any returned Properties) MUST be included as `<QUALIFIER>` elements in the response. If false no `<QUALIFIER>` elements are present in each returned Instance.

IncludeClassOrigin If the `IncludeClassOrigin` input parameter is `true`, this specifies that the `CLASSORIGIN` attribute MUST be present on all appropriate elements in each returned Instance. If false, no `CLASSORIGIN` attributes are present in each returned Instance.

PropertyList If the `PropertyList` input parameter is not `NULL`, the members of the array define one or more Property names. Each returned Instance MUST NOT include elements for any Properties missing from this list. Note that if `LocalOnly` is specified as `true` (or `DeepInheritance` is specified as `false`) this acts as an additional filter on the set of Properties returned (for example, if Property `A` is included in the `PropertyList` but `LocalOnly` is set to true and `A` is not local to a returned Instance, then it will not be included in that Instance). If the `PropertyList` input parameter is an empty array this signifies that no Properties are included in each returned Instance. If the `PropertyList` input parameter is NULL this specifies that all Properties (subject to the conditions expressed by the other parameters) are included in each returned Instance. If the `PropertyList` contains duplicate elements, the Server MUST ignore the duplicates but otherwise process the request normally. If the `PropertyList` contains elements which are invalid Property names for any target Instance, the Server MUST ignore such entries but otherwise process the request normally.

## Return

If successful, the method returns zero or more named Instances that meet the required criteria. If unsuccessful, one of the following status codes MUST be returned by this method, where the first applicable error in the list (starting with the first element of the list, and working down) is the error returned. Any additional method-specific interpretation of the error in is given in parentheses.

- CIM_ERR_ACCESS_DENIED
- CIM_ERR_NOT_SUPPORTED
- CIM_ERR_INVALID_NAMESPACE
- CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized or otherwise incorrect parameters)
- CIM_ERR_INVALID_CLASS (the CIM Class that is the basis for this enumeration does not exist)
- CIM_ERR_FAILED (some other unspecified erroroccurred)

## C++ APIs as defined in CIMOperations.h

         virtual Array<InstanceDecl> enumerateInstances(
             const String& nameSpace,
             const String& className,
             Boolean localOnly = true,
             Boolean includeQualifiers = false,
             Boolean includeClassOrigin = false,
     		const Array<String>& propertyList = _getStringArray()) = 0;