8. WBEM utility commands

The pywbem package provides a number of WBEM utility commands. They are all implemented as pure-Python scripts.

These commands are installed into the Python script directory and should therefore automatically be available in the command search path.

The following commands are provided:

  • mof_compiler

    A MOF compiler that takes MOF files as input and updates the CIM repository of a WBEM server with the result.

  • wbemcli

    A WBEM client in the form of a shell that provides an interactive Python environment for issuing WBEM operations to a WBEM server.

8.1. mof_compiler

The mof_compiler command compiles MOF files and updates the CIM repository of a WBEM server with the result.

If the compiler fails, any changes made to the CIM repository in the WBEM server as part of the current compilation are rolled back. A limitation is that changes to qualifier declarations are not yet rolled back (see issue #990).

The compiler provides a dry-run mode that simulates the compilation but does not change the CIM repository in the WBEM server.

Here is the help text of the command:

usage: mof_compiler [options] moffile ...

Compile MOF files, and update a namespace in a WBEM server with the result.

Positional arguments:
  moffile               Path name of the MOF file to be compiled.
                        Can be specified multiple times.

Server related options:
  Specify the WBEM server and namespace the MOF compiler works against, for
  looking up existing elements, and for applying the MOF compilation results
  to.

  -s url, --server url  Host name or URL of the WBEM server (required),
                        in this format:
                            [scheme://]host[:port]
                        - scheme: Defines the protocol to use:
                            - "https" for HTTPS protocol
                            - "http" for HTTP protocol
                          Default: "https".
                        - host: Defines host name as follows:
                             - short or fully qualified DNS hostname
                             - literal IPV4 address(dotted)
                             - literal IPV6 address (RFC 3986) with zone
                               identifier extensions(RFC 6874)
                               supporting "-" or %25 for the delimiter
                        - port: Defines the WBEM server port to be used.
                          Defaults:
                             - 5988, when using HTTP
                             - 5989, whenusing HTTPS
  -n namespace, --namespace namespace
                        Namespace in the WBEM server.
                        Default: root/cimv2

Connection security related options:
  Specify user name and password or certificates and keys

  -u user, --user user  User name for authenticating with the WBEM server.
                        Default: No user name.
  -p password, --password password
                        Password for authenticating with the WBEM server.
                        Default: Will be prompted for, if user name
                        specified.
  -nvc, --no-verify-cert
                        Client will not verify certificate returned by the
                        WBEM server (see cacerts). This bypasses the client-
                        side verification of the server identity, but allows
                        encrypted communication with a server for which the
                        client does not have certificates.
  --cacerts cacerts     File or directory containing certificates that will be
                        matched against a certificate received from the WBEM
                        server. Set the --no-verify-cert option to bypass
                        client verification of the WBEM server certificate.
                        Default: Searches for matching certificates in the
                        following system directories:
                        /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
                        /etc/ssl/certs
                        /etc/ssl/certificates
  --certfile certfile   Client certificate file for authenticating with the
                        WBEM server. If option specified the client attempts
                        to execute mutual authentication.
                        Default: Simple authentication.
  --keyfile keyfile     Client private key file for authenticating with the
                        WBEM server. Not required if private key is part of the
                        certfile option. Not allowed if no certfile option.
                        Default: No client key file. Client private key should
                        then be part  of the certfile

Action related options:
  Specify actions against the WBEM server's namespace. Default:
  Create/update elements.

  -r, --remove          Removal mode: Remove elements (found in the MOF files)
                        from the WBEM server's namespace, instead of creating
                        or updating them
  -d, --dry-run         Dry-run mode: Don't actually modify the WBEM server's
                        namespace, just check MOF syntax. Connection to WBEM
                        server is still required to check qualifiers.

General options:
  -I dir, --include dir
                        Path name of a MOF include directory. Can be specified
                        multiple times.
  -v, --verbose         Print more messages while processing
  -V, --version         Display pywbem version and exit.
  -h, --help            Show this help message and exit

Example: mof_compiler CIM_Schema_2.45.mof -s https://localhost -n root/cimv2
-u sheldon -p p42

8.2. wbemcli

The wbemcli command is a WBEM client in the form of a shell that provides an interactive Python environment for issuing WBEM operations to a WBEM server.

See Python functions in wbemcli for details on the Python functions available in that environment.

Here is the help text of the command:

usage: wbemcli [options] server

Provide an interactive shell for issuing operations against a WBEM server.

wbemcli executes the WBEMConnection as part of initialization so the user can
input requests as soon as the interactive shell is started.

Use h() in thenteractive shell for help for wbemcli methods and variables.

Positional arguments:
  server                Host name or url of the WBEM server in this format:
                            [{scheme}://]{host}[:{port}]
                        - scheme: Defines the protocol to use;
                            - "https" for HTTPs protocol
                            - "http" for HTTP protocol.
                          Default: "https".
                        - host: Defines host name as follows:
                             - short or fully qualified DNS hostname,
                             - literal IPV4 address(dotted)
                             - literal IPV6 address (RFC 3986) with zone
                               identifier extensions(RFC 6874)
                               supporting "-" or %25 for the delimiter.
                        - port: Defines the WBEM server port to be used
                          Defaults:
                             - HTTP  - 5988
                             - HTTPS - 5989

Server related options:
  Specify the WBEM server namespace and timeout

  -n namespace, --namespace namespace
                        Default namespace in the WBEM server for operation
                        requests when namespace option not supplied with
                        operation request.
                        Default: root/cimv2
  -t timeout, --timeout timeout
                        Timeout of the completion of WBEM Server operation
                        in seconds(integer between 0 and 300).
                        Default: No timeout

Connection security related options:
  Specify user name and password or certificates and keys

  -u user, --user user  User name for authenticating with the WBEM server.
                        Default: No user name.
  -p password, --password password
                        Password for authenticating with the WBEM server.
                        Default: Will be prompted for, if user name
                        specified.
  -nvc, --no-verify-cert
                        Client will not verify certificate returned by the
                        WBEM server (see cacerts). This bypasses the client-
                        side verification of the server identity, but allows
                        encrypted communication with a server for which the
                        client does not have certificates.
  --cacerts cacerts     File or directory containing certificates that will be
                        matched against a certificate received from the WBEM
                        server. Set the --no-verify-cert option to bypass
                        client verification of the WBEM server certificate.
                        Default: Searches for matching certificates in the
                        following system directories:
                        /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
                        /etc/ssl/certs
                        /etc/ssl/certificates
  --certfile certfile   Client certificate file for authenticating with the
                        WBEM server. If option specified the client attempts
                        to execute mutual authentication.
                        Default: Simple authentication.
  --keyfile keyfile     Client private key file for authenticating with the
                        WBEM server. Not required if private key is part of the
                        certfile option. Not allowed if no certfile option.
                        Default: No client key file. Client private key should
                        then be part  of the certfile

General options:
  -s [scripts [scripts ...]], --scripts [scripts [scripts ...]]
                        Execute the python code defined by the script before the
                        user gets control. This argument may be repeated to load
                        multiple scripts or multiple scripts may be listed for a
                        single use of the option. Scripts are executed after the
                        WBEMConnection call
  -v, --verbose         Print more messages while processing
  -V, --version         Display pywbem version and exit.
  --statistics          Enable gathering of statistics on operations.
  --mock-server [file name [file name ...]]
                        Activate pywbem_mock in place of a live WBEMConnection and
                        compile/build the files defined (".mof" suffix or "py" suffix.
                        MOF files are compiled and python files are executed assuming
                        that they include mock_pywbem methods that add objects to the
                        repository.
  -l log_spec[,logspec], --log log_spec[,logspec]
                        Log_spec defines characteristics of the various named
                        loggers. It is the form:
                         COMP=[DEST[:DETAIL]] where:
                           COMP:   Logger component name:[api|http|all].
                                   (Default=all)
                           DEST:   Destination for component:[file|stderr].
                                   (Default=file)
                           DETAIL: Detail Level to log: [all|paths|summary] or
                                   an integer that defines the maximum length of
                                   of each log record.
                                   (Default=all)
  -h, --help            Show this help message and exit

Examples:
  wbemcli https://localhost:15345 -n vendor -u sheldon -p penny
          - (https localhost, port=15345, namespace=vendor user=sheldon
         password=penny)

  wbemcli http://[2001:db8::1234-eth0] -(http port 5988 ipv6, zone id eth0)

8.2.1. Python functions in wbemcli

The interactive shell of wbemcli provides Python functions for the WBEM operations, and some functions for help display and debugging:

Function WBEM operation
ei() EnumerateInstances
ein() EnumerateInstanceNames
gi() GetInstance
mi() ModifyInstance
ci() CreateInstance
di() DeleteInstance
a() Associators
an() AssociatorNames
r() References
rn() ReferenceNames
im() InvokeMethod
eqy() ExecQuery
iei() IterEnumerateInstances (pywbem only)
ieip() IterEnumerateInstancePaths (pywbem only)
iai() IterAssociatorInstances (pywbem only)
iaip() IterAssociatorInstancePaths (pywbem only)
iri() IterReferenceInstances (pywbem only)
irip() IterReferenceInstancePaths (pywbem only)
iqi() IterQueryInstances (pywbem only)
oei() OpenEnumerateInstances
oeip() OpenEnumerateInstancePaths
oai() OpenAssociatorInstances
oaip() OpenAssociatorInstancePaths
ori() OpenReferenceInstances
orip() OpenReferenceInstancePaths
oqi() OpenQueryInstances
piwp() PullInstancesWithPath
pip() PullInstancePaths
pi() PullInstances
ce() CloseEnumeration
ec() EnumerateClasses
ecn() EnumerateClassNames
gc() GetClass
mc() ModifyClass
cc() CreateClass
dc() DeleteClass
eq() EnumerateQualifiers
gq() GetQualifier
sq() SetQualifier
dq() DeleteQualifier
h() Print help text for interactive environment
pdb() Run a statement under the PDB debugger
pp() Alias for pprint()

The interactive Python environment of the wbemcli command has wbemcli as its current Python namespace, so the functions shown below can directly be invoked (e.g. ei(...)).

wbemcli.build_mock_repository(conn_, file_path_list, verbose)[source]

Build the mock repository from the file_path list and fake connection instance. This allows both mof files and python files to be used to build the repository.

If verbose is True, it displays the respository after it is build as mof.

wbemcli.ei(cn, ns=None, lo=None, di=None, iq=None, ico=None, pl=None)[source]

This function is a wrapper for EnumerateInstances().

Enumerate the instances of a class (including instances of its subclasses) in a namespace.

Parameters:
  • cn (string or CIMClassName) –

    Name of the class to be enumerated (case independent).

    If specified as a CIMClassName object, its host attribute will be ignored.

  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    If None, defaults to the namespace of the cn parameter if specified as a CIMClassName, or to the default namespace of the connection.

  • lo (bool) –

    LocalOnly flag: Exclude inherited properties.

    None will cause the server default of True to be used.

    Deprecated in DSP0200: WBEM server implementations for True may vary; this parameter should be set to False by the caller.

  • di (bool) –

    DeepInheritance flag: Include properties added by subclasses.

    If None, this parameter will not be sent to the server, and the server default of True will be used.

  • iq (bool) –

    IncludeQualifiers flag: Include qualifiers.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: Clients cannot rely on qualifiers to be returned in this operation.

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin information for the properties in the retrieved instances.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: WBEM servers may either implement this parameter as specified, or may treat any specified value as False.

  • pl (string or iterable of string) – PropertyList: Names of properties to be included (if not otherwise excluded). An empty iterable indicates to include no properties. If None, all properties will be included.
Returns:

The instances, with their path attribute being a CIMInstanceName object with its attributes set as follows:

  • classname: Name of the creation class of the instance.
  • keybindings: Keybindings of the instance.
  • namespace: Name of the CIM namespace containing the instance.
  • host: None, indicating the WBEM server is unspecified.

Return type:

list of CIMInstance

wbemcli.ein(cn, ns=None)[source]

This function is a wrapper for EnumerateInstanceNames().

Enumerate the instance paths of instances of a class (including instances of its subclasses) in a namespace.

Parameters:
  • cn (string or CIMClassName) –

    Name of the class to be enumerated (case independent).

    If specified as a CIMClassName object, its host attribute will be ignored.

  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    If None, defaults to the namespace of the cn parameter if specified as a CIMClassName, or to the default namespace of the connection.

Returns:

The instance paths, with their attributes set as follows:

  • classname: Name of the creation class of the instance.
  • keybindings: Keybindings of the instance.
  • namespace: Name of the CIM namespace containing the instance.
  • host: None, indicating the WBEM server is unspecified.

Return type:

list of CIMInstanceName

wbemcli.gi(ip, lo=None, iq=None, ico=None, pl=None)[source]

This function is a wrapper for GetInstance().

Retrieve an instance.

Parameters:
  • ip (CIMInstanceName) –

    Instance path.

    If this object does not specify a namespace, the default namespace of the connection is used.

    Its host attribute will be ignored.

  • lo (bool) –

    LocalOnly flag: Exclude inherited properties.

    None will cause the server default of True to be used.

    Deprecated in DSP0200: WBEM server implementations for True may vary; this parameter should be set to False by the caller.

  • iq (bool) –

    IncludeQualifiers flag: Include qualifiers.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: Clients cannot rely on qualifiers to be returned in this operation.

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin information for the properties in the retrieved instance.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: WBEM servers may either implement this parameter as specified, or may treat any specified value as False.

  • pl (string or iterable of string) – PropertyList: Names of properties to be included (if not otherwise excluded). An empty iterable indicates to include no properties. If None, all properties will be included.
Returns:

The instance, with its path attribute being a CIMInstanceName object with its attributes set as follows:

  • classname: Name of the creation class of the instance.
  • keybindings: Keybindings of the instance.
  • namespace: Name of the CIM namespace containing the instance.
  • host: None, indicating the WBEM server is unspecified.

Return type:

CIMInstance

wbemcli.mi(mi, iq=None, pl=None)[source]

This function is a wrapper for ModifyInstance().

Modify the property values of an instance.

Parameters:
  • mi (CIMInstance) –

    Modified instance, also indicating its instance path.

    The properties defined in this object specify the new property values for the instance to be modified. Missing properties (relative to the class declaration) and properties provided with a value of None will be set to NULL.

  • iq (bool) –

    IncludeQualifiers flag: Modify instance qualifiers as specified in the instance.

    None will cause the server default of True to be used.

    Deprecated in DSP0200: Clients cannot rely on qualifiers to be modified by this operation.

  • pl (string or iterable of string) – PropertyList: Names of properties to be modified. An empty iterable indicates to modify no properties. If None, all properties exposed by the instance will be modified.
wbemcli.ci(ni, ns=None)[source]

This function is a wrapper for CreateInstance().

Create an instance in a namespace.

Parameters:
  • ni (CIMInstance) –

    New instance.

    Its classname attribute specifies the creation class. Its properties attribute specifies initial property values. Its path attribute is ignored, except for providing a default namespace.

    Instance-level qualifiers have been deprecated in CIM, so any qualifier values specified using the qualifiers attribute of this object will be ignored.

  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    If None, defaults to the namespace in the path attribute of the ni parameter, or to the default namespace of the connection.

Returns:

The instance path of the new instance, with its attributes set as follows:

  • classname: Name of the creation class of the instance.
  • keybindings: Keybindings of the instance.
  • namespace: Name of the CIM namespace containing the instance.
  • host: None, indicating the WBEM server is unspecified.

Return type:

CIMInstanceName

wbemcli.di(ip)[source]

This function is a wrapper for DeleteInstance().

Delete an instance.

Parameters:ip (CIMInstanceName) –

Instance path of the instance to be deleted.

If this object does not specify a namespace, the default namespace of the connection is used. Its host attribute will be ignored.

wbemcli.a(op, ac=None, rc=None, r=None, rr=None, iq=None, ico=None, pl=None)[source]

This function is a wrapper for Associators().

Instance-level use: Retrieve the instances associated to a source instance.

Class-level use: Retrieve the classes associated to a source class.

Parameters:
  • op (CIMClassName) – Source instance path; select instance-level use.
  • op – Source class path; select class-level use.
  • ac (string) –

    AssocClass filter: Include only traversals across this association class.

    None means this filter is not applied.

  • rc (string) –

    ResultClass filter: Include only traversals to this associated (result) class.

    None means this filter is not applied.

  • r (string) –

    Role filter: Include only traversals from this role (= reference name) in source object.

    None means this filter is not applied.

  • rr (string) –

    ResultRole filter: Include only traversals to this role (= reference name) in associated (=result) objects.

    None means this filter is not applied.

  • iq (bool) –

    IncludeQualifiers flag: Include qualifiers.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: Clients cannot rely on qualifiers to be returned in this operation.

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin information for the properties in the retrieved instances or for the properties and methods in the retrieved classes.

    None will cause the server default of False to be used.

    Deprecated in DSP0200 for instance-level use: WBEM servers may either implement this parameter as specified, or may treat any specified value as False.

  • pl (string or iterable of string) – PropertyList: Names of properties to be included (if not otherwise excluded). An empty iterable indicates to include no properties. If None, all properties will be included.
Returns:

  • For instance-level use, a list of CIMInstance objects representing the retrieved instances, with their path attribute being a CIMInstanceName object with its attributes set as follows:
    • classname: Name of the creation class of the instance.
    • keybindings: Keybindings of the instance.
    • namespace: Name of the CIM namespace containing the instance.
    • host: Host and optionally port of the WBEM server containing the CIM namespace, or None if the server did not return host information.
  • For class-level use, a list of tuple (classpath, class) representing the retrieved classes, with the following (unnamed) tuple items:
    • classpath (CIMClassName): Class path with its attributes set as follows:
      • classname: Name of the class.
      • namespace: Name of the CIM namespace containing the class.
      • host: Host and optionally port of the WBEM server containing the CIM namespace, or None if the server did not return host information.
    • class (CIMClass): The representation of the class.

Return type:

list of result objects

wbemcli.an(op, ac=None, rc=None, r=None, rr=None)[source]

This function is a wrapper for AssociatorNames().

Instance-level use: Retrieve the instance paths of the instances associated to a source instance.

Class-level use: Retrieve the class paths of the classes associated to a source class.

Parameters:
  • op (CIMClassName) – Source instance path; select instance-level use.
  • op – Source class path; select class-level use.
  • ac (string) –

    AssocClass filter: Include only traversals across this association class.

    None means this filter is not applied.

  • rc (string) –

    ResultClass filter: Include only traversals to this associated (result) class.

    None means this filter is not applied.

  • r (string) –

    Role filter: Include only traversals from this role (= reference name) in source object.

    None means this filter is not applied.

  • rr (string) –

    ResultRole filter: Include only traversals to this role (= reference name) in associated (=result) objects.

    None means this filter is not applied.

Returns:

  • For instance-level use, a list of CIMInstanceName objects representing the retrieved instance paths, with their attributes set as follows:
    • classname: Name of the creation class of the instance.
    • keybindings: Keybindings of the instance.
    • namespace: Name of the CIM namespace containing the instance.
    • host: Host and optionally port of the WBEM server containing the CIM namespace, or None if the server did not return host information.
  • For class-level use, a list of CIMClassName objects representing the retrieved class paths, with their attributes set as follows:
    • classname: Name of the class.
    • namespace: Name of the CIM namespace containing the class.
    • host: Host and optionally port of the WBEM server containing the CIM namespace, or None if the server did not return host information.

Return type:

list of result objects

wbemcli.r(op, rc=None, r=None, iq=None, ico=None, pl=None)[source]

This function is a wrapper for References().

Instance-level use: Retrieve the association instances referencing a source instance.

Class-level use: Retrieve the association classes referencing a source class.

Parameters:
  • op (CIMClassName) – Source instance path; select instance-level use.
  • op – Source class path; select class-level use.
  • rc (string) –

    ResultClass filter: Include only traversals across this association (result) class.

    None means this filter is not applied.

  • r (string) –

    Role filter: Include only traversals from this role (= reference name) in source object.

    None means this filter is not applied.

  • iq (bool) –

    IncludeQualifiers flag: Include qualifiers.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: Clients cannot rely on qualifiers to be returned in this operation.

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin information for the properties in the retrieved instances or for the properties and methods in the retrieved classes.

    None will cause the server default of False to be used.

    Deprecated in DSP0200 for instance-level use: WBEM servers may either implement this parameter as specified, or may treat any specified value as False.

  • pl (string or iterable of string) – PropertyList: Names of properties to be included (if not otherwise excluded). An empty iterable indicates to include no properties. If None, all properties will be included.
Returns:

  • For instance-level use, a list of CIMInstance objects representing the retrieved instances, with their path attribute being a CIMInstanceName object with its attributes set as follows:
    • classname: Name of the creation class of the instance.
    • keybindings: Keybindings of the instance.
    • namespace: Name of the CIM namespace containing the instance.
    • host: Host and optionally port of the WBEM server containing the CIM namespace, or None if the server did not return host information.
  • For class-level use, a list of tuple (classpath, class) representing the retrieved classes, with the following (unnamed) tuple items:
    • classpath (CIMClassName): Class path with its attributes set as follows:
      • classname: Name of the class.
      • namespace: Name of the CIM namespace containing the class.
      • host: Host and optionally port of the WBEM server containing the CIM namespace, or None if the server did not return host information.
    • class (CIMClass): The representation of the class.

Return type:

list of result objects

wbemcli.rn(op, rc=None, r=None)[source]

This function is a wrapper for ReferenceNames().

Instance-level use: Retrieve the instance paths of the association instances referencing a source instance.

Class-level use: Retrieve the class paths of the association classes referencing a source class.

Parameters:
  • op (CIMClassName) – Source instance path; select instance-level use.
  • op – Source class path; select class-level use.
  • rc (string) –

    ResultClass filter: Include only traversals across this association (result) class.

    None means this filter is not applied.

  • r (string) –

    Role filter: Include only traversals from this role (= reference name) in source object.

    None means this filter is not applied.

Returns:

  • For instance-level use, a list of CIMInstanceName objects representing the retrieved instance paths, with their attributes set as follows:
    • classname: Name of the creation class of the instance.
    • keybindings: Keybindings of the instance.
    • namespace: Name of the CIM namespace containing the instance.
    • host: Host and optionally port of the WBEM server containing the CIM namespace, or None if the server did not return host information.
  • For class-level use, a list of CIMClassName objects representing the retrieved class paths, with their attributes set as follows:
    • classname: Name of the class.
    • namespace: Name of the CIM namespace containing the class.
    • host: Host and optionally port of the WBEM server containing the CIM namespace, or None if the server did not return host information.

Return type:

list of result objects

wbemcli.im(mn, op, params, **kwparams)[source]

This function is a wrapper for InvokeMethod().

Invoke a method on a target instance or on a target class.

The methods that can be invoked are static and non-static methods defined in a class (also known as extrinsic methods). Static methods can be invoked on instances and on classes. Non-static methods can be invoked only on instances.

Parameters:
  • mn (string) – Method name.
  • op (CIMClassName) – Target instance path.
  • op – Target class path.
  • params (iterable) –

    Input parameters for the method.

    Each item in the iterable is a single parameter value and can be any of:

    • CIMParameter representing a parameter value. The name, value, type and embedded_object attributes of this object are used.
    • tuple of name, value, with:
  • **kwparams (named/keyword arguments) –

    Input parameters for the method.

Returns:

Return type:

tuple(rv, out), with these tuple items

wbemcli.eqy(ql, qs, ns=None)[source]

New in pywbem 0.12

This function is a wrapper for ExecQuery().

Execute a query in a namespace.

Parameters:
  • ql (string) – Name of the query language used in the qs parameter, e.g. “DMTF:CQL” for CIM Query Language, and “WQL” for WBEM Query Language. Because this is not a filter query, “DMTF:FQL” is not a valid query language for this request.
  • qs (string) – Query string in the query language specified in the ql parameter.
  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    If None, defaults to the default namespace of the connection.

Returns:

A list of CIMInstance objects that represents the query result.

These instances have their path attribute set to identify their creation class and the target namespace of the query, but they are not addressable instances.

wbemcli.iei(cn, ns=None, lo=None, di=None, iq=None, ico=None, pl=None, fl=None, fs=None, ot=None, coe=None, moc=1000)[source]

New in pywbem 0.10 as experimental and finalized in 0.12.

This function is a wrapper for IterEnumerateInstances().

Enumerate the instances of a class (including instances of its subclasses) in a namespace, using the corresponding pull operations if supported by the WBEM server or otherwise the corresponding traditional operation, and using the Python generator idiom to return the result.

This method is an alternative to using the pull operations directly, that frees the user of having to know whether the WBEM server supports pull operations.

Parameters:
  • cn (string or CIMClassName) –

    Name of the class to be enumerated (case independent).

    If specified as a CIMClassName object, its host attribute will be ignored.

  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    If None, defaults to the namespace of the cn parameter if specified as a CIMClassName, or to the default namespace of the connection.

  • lo (bool) –

    LocalOnly flag: Exclude inherited properties.

    None will cause the server default of True to be used.

    Deprecated in DSP0200: WBEM server implementations for True may vary; this parameter should be set to False by the caller.

  • di (bool) –

    DeepInheritance flag: Include properties added by subclasses.

    None will cause the server default of True to be used.

  • iq (bool) –

    IncludeQualifiers flag: Include qualifiers.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: Clients cannot rely on qualifiers to be included.

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin information for the properties in the retrieved instances.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: WBEM servers may either implement this parameter as specified, or may treat any specified value as False.

  • pl (string or iterable of string) – PropertyList: Names of properties to be included (if not otherwise excluded). An empty iterable indicates to include no properties. If None, all properties will be included.
  • fl (string) –

    Filter query language to be used for the filter defined in the fs parameter. The DMTF-defined Filter Query Language (see DSP0212) is specified as “DMTF:FQL”.

    None means that no such filtering is peformed.

  • fs (string) –

    Filter to apply to objects to be returned. Based on filter query language defined by fl parameter.

    None means that no such filtering is peformed.

  • ot (Uint32) –

    Operation timeout in seconds. This is the minimum time the WBEM server must keep the enumeration session open between requests on that session.

    A value of 0 indicates that the server should never time out.

    The server may reject the proposed value.

    None will cause the server to use its default timeout.

  • coe (bool) –

    Continue on error flag.

    None will cause the server to use its default of False.

  • moc (Uint32) –

    Maximum number of instances the WBEM server may return for each of the open and pull requests issued during the iterations over the returned generator object.

    Zero and None are not allowed.

Returns:

A generator object that iterates the resulting CIM instances. These instances include an instance path that has its host and namespace components set.

Return type:

generator iterating CIMInstance

wbemcli.ieip(cn, ns=None, fl=None, fs=None, ot=None, coe=None, moc=1000)[source]

New in pywbem 0.10 as experimental and finalized in 0.12.

This function is a wrapper for IterEnumerateInstancePaths().

Enumerate the instance paths of instances of a class (including instances of its subclasses) in a namespace, using the corresponding pull operations if supported by the WBEM server or otherwise the corresponding traditional operation, and using the Python generator idiom to return the result.

This method is an alternative to using the pull operations directly, that frees the user of having to know whether the WBEM server supports pull operations.

Parameters:
  • cn (string or CIMClassName) –

    Name of the class to be enumerated (case independent).

    If specified as a CIMClassName object, its host attribute will be ignored.

  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    If None, defaults to the namespace of the cn parameter if specified as a CIMClassName, or to the default namespace of the connection.

  • fl (string) –

    Filter query language to be used for the filter defined in the fs parameter. The DMTF-defined Filter Query Language (see DSP0212) is specified as “DMTF:FQL”.

    None means that no such filtering is peformed.

  • fs (string) –

    Filter to apply to objects to be returned. Based on filter query language defined by fl parameter.

    None means that no such filtering is peformed.

  • ot (Uint32) –

    Operation timeout in seconds. This is the minimum time the WBEM server must keep the enumeration session open between requests on that session.

    A value of 0 indicates that the server should never time out.

    The server may reject the proposed value.

    None will cause the server to use its default timeout.

  • coe (bool) –

    Continue on error flag.

    None will cause the server to use its default of False.

  • moc (Uint32) –

    Maximum number of instances the WBEM server may return for each of the open and pull requests issued during the iterations over the returned generator object.

    Zero and None are not allowed.

Returns:

A generator object that iterates the resulting CIM instance paths. These instance paths have their host and namespace components set.

Return type:

generator iterating CIMInstanceName

wbemcli.iai(ip, ac=None, rc=None, r=None, rr=None, iq=None, ico=None, pl=None, fl=None, fs=None, ot=None, coe=None, moc=1000)[source]

New in pywbem 0.10 as experimental and finalized in 0.12.

This function is a wrapper for IterAssociatorInstances().

Retrieve the instances associated to a source instance, using the corresponding pull operations if supported by the WBEM server or otherwise the corresponding traditional operation, and using the Python generator idiom to return the result.

This method is an alternative to using the pull operations directly, that frees the user of having to know whether the WBEM server supports pull operations.

Parameters:
  • ip (CIMInstanceName) – Source instance path.
  • ac (string) –

    AssocClass filter: Include only traversals across this association class.

    None means this filter is not applied.

  • rc (string) –

    ResultClass filter: Include only traversals to this associated (result) class.

    None means this filter is not applied.

  • r (string) –

    Role filter: Include only traversals from this role (= reference name) in source object.

    None means this filter is not applied.

  • rr (string) –

    ResultRole filter: Include only traversals to this role (= reference name) in associated (=result) objects.

    None means this filter is not applied.

  • iq (bool) –

    IncludeQualifiers flag: Include qualifiers.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: Clients cannot rely on qualifiers to be included.

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin information for the properties in the retrieved instances.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: WBEM servers may either implement this parameter as specified, or may treat any specified value as False.

  • pl (string or iterable of string) – PropertyList: Names of properties to be included (if not otherwise excluded). An empty iterable indicates to include no properties. If None, all properties will be included.
  • fl (string) –

    Filter query language to be used for the filter defined in the fs parameter. The DMTF-defined Filter Query Language (see DSP0212) is specified as “DMTF:FQL”.

    None means that no such filtering is peformed.

  • fs (string) –

    Filter to apply to objects to be returned. Based on filter query language defined by fl parameter.

    None means that no such filtering is peformed.

  • ot (Uint32) –

    Operation timeout in seconds. This is the minimum time the WBEM server must keep the enumeration session open between requests on that session.

    A value of 0 indicates that the server should never time out.

    The server may reject the proposed value.

    None will cause the server to use its default timeout.

  • coe (bool) –

    Continue on error flag.

    None will cause the server to use its default of False.

  • moc (Uint32) –

    Maximum number of instances the WBEM server may return for each of the open and pull requests issued during the iterations over the returned generator object.

    Zero and None are not allowed.

Returns:

A generator object that iterates the resulting CIM instances. These instances include an instance path that has its host and namespace components set.

Return type:

generator iterating CIMInstance

wbemcli.iaip(ip, ac=None, rc=None, r=None, rr=None, fl=None, fs=None, ot=None, coe=None, moc=1000)[source]

New in pywbem 0.10 as experimental and finalized in 0.12.

This function is a wrapper for IterAssociatorInstancePaths().

Retrieve the instance paths of the instances associated to a source instance, using the corresponding pull operations if supported by the WBEM server or otherwise the corresponding traditional operation, and using the Python generator idiom to return the result.

This method is an alternative to using the pull operations directly, that frees the user of having to know whether the WBEM server supports pull operations.

Parameters:
  • ip (CIMInstanceName) – Source instance path.
  • ac (string) –

    AssocClass filter: Include only traversals across this association class.

    None means this filter is not applied.

  • rc (string) –

    ResultClass filter: Include only traversals to this associated (result) class.

    None means this filter is not applied.

  • r (string) –

    Role filter: Include only traversals from this role (= reference name) in source object.

    None means this filter is not applied.

  • rr (string) –

    ResultRole filter: Include only traversals to this role (= reference name) in associated (=result) objects.

    None means this filter is not applied.

  • fl (string) –

    Filter query language to be used for the filter defined in the fs parameter. The DMTF-defined Filter Query Language (see DSP0212) is specified as “DMTF:FQL”.

    None means that no such filtering is peformed.

  • fs (string) –

    Filter to apply to objects to be returned. Based on filter query language defined by fl parameter.

    None means that no such filtering is peformed.

  • ot (Uint32) –

    Operation timeout in seconds. This is the minimum time the WBEM server must keep the enumeration session open between requests on that session.

    A value of 0 indicates that the server should never time out.

    The server may reject the proposed value.

    None will cause the server to use its default timeout.

  • coe (bool) –

    Continue on error flag.

    None will cause the server to use its default of False.

  • moc (Uint32) –

    Maximum number of instances the WBEM server may return for each of the open and pull requests issued during the iterations over the returned generator object.

    Zero and None are not allowed.

Returns:

A generator object that iterates the resulting CIM instance paths. These instance paths have their host and namespace components set.

Return type:

generator iterating CIMInstanceName

wbemcli.iri(ip, rc=None, r=None, iq=None, ico=None, pl=None, fl=None, fs=None, ot=None, coe=None, moc=1000)[source]

New in pywbem 0.10 as experimental and finalized in 0.12.

This function is a wrapper for IterReferenceInstances().

Retrieve the association instances that reference a source instance, using the corresponding pull operations if supported by the WBEM server or otherwise the corresponding traditional operation, and using the Python generator idiom to return the result.

This method is an alternative to using the pull operations directly, that frees the user of having to know whether the WBEM server supports pull operations.

Parameters:
  • ip (CIMInstanceName) – Source instance path.
  • rc (string) –

    ResultClass filter: Include only traversals across this association (result) class.

    None means this filter is not applied.

  • r (string) –

    Role filter: Include only traversals from this role (= reference name) in source object.

    None means this filter is not applied.

  • iq (bool) –

    IncludeQualifiers flag: Include qualifiers.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: Clients cannot rely on qualifiers to be included.

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin information for the properties in the retrieved instances.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: WBEM servers may either implement this parameter as specified, or may treat any specified value as False.

  • pl (string or iterable of string) – PropertyList: Names of properties to be included (if not otherwise excluded). An empty iterable indicates to include no properties. If None, all properties will be included.
  • fl (string) –

    Filter query language to be used for the filter defined in the fs parameter. The DMTF-defined Filter Query Language (see DSP0212) is specified as “DMTF:FQL”.

    None means that no such filtering is peformed.

  • fs (string) –

    Filter to apply to objects to be returned. Based on filter query language defined by fl parameter.

    None means that no such filtering is peformed.

  • ot (Uint32) –

    Operation timeout in seconds. This is the minimum time the WBEM server must keep the enumeration session open between requests on that session.

    A value of 0 indicates that the server should never time out.

    The server may reject the proposed value.

    None will cause the server to use its default timeout.

  • coe (bool) –

    Continue on error flag.

    None will cause the server to use its default of False.

  • moc (Uint32) –

    Maximum number of instances the WBEM server may return for each of the open and pull requests issued during the iterations over the returned generator object.

    Zero and None are not allowed.

Returns:

A generator object that iterates the resulting CIM instances. These instances include an instance path that has its host and namespace components set.

Return type:

generator iterating CIMInstance

wbemcli.irip(ip, rc=None, r=None, fl=None, fs=None, ot=None, coe=None, moc=1000)[source]

New in pywbem 0.10 as experimental and finalized in 0.12.

This function is a wrapper for IterReferenceInstancePaths().

Retrieve the instance paths of the association instances that reference a source instance, using the corresponding pull operations if supported by the WBEM server or otherwise the corresponding traditional operation, and using the Python generator idiom to return the result.

This method is an alternative to using the pull operations directly, that frees the user of having to know whether the WBEM server supports pull operations.

Parameters:
  • ip (CIMInstanceName) – Source instance path.
  • rc (string) –

    ResultClass filter: Include only traversals across this association (result) class.

    None means this filter is not applied.

  • r (string) –

    Role filter: Include only traversals from this role (= reference name) in source object.

    None means this filter is not applied.

  • fl (string) –

    Filter query language to be used for the filter defined in the fs parameter. The DMTF-defined Filter Query Language (see DSP0212) is specified as “DMTF:FQL”.

    None means that no such filtering is peformed.

  • fs (string) –

    Filter to apply to objects to be returned. Based on filter query language defined by fl parameter.

    None means that no such filtering is peformed.

  • ot (Uint32) –

    Operation timeout in seconds. This is the minimum time the WBEM server must keep the enumeration session open between requests on that session.

    A value of 0 indicates that the server should never time out.

    The server may reject the proposed value.

    None will cause the server to use its default timeout.

  • coe (bool) –

    Continue on error flag.

    None will cause the server to use its default of False.

  • moc (Uint32) –

    Maximum number of instances the WBEM server may return for each of the open and pull requests issued during the iterations over the returned generator object.

    Zero and None are not allowed.

Returns:

A generator object that iterates the resulting CIM instance paths. These instance paths have their host and namespace components set.

Return type:

generator iterating CIMInstanceName

wbemcli.iqi(ql, qs, ns=None, rc=None, ot=None, coe=None, moc=1000)[source]

New in pywbem 0.10 as experimental and finalized in 0.12.

This function is a wrapper for IterQueryInstances().

Execute a query in a namespace, using the corresponding pull operations if supported by the WBEM server or otherwise the corresponding traditional operation, and using the Python generator idiom to return the result.

This method is an alternative to using the pull operations directly, that frees the user of having to know whether the WBEM server supports pull operations.

Other than the other i…() functions, this function does not return a generator object directly, but as a property of the returned object.

Parameters:
  • ql (string) – Name of the query language used in the qs parameter, e.g. “DMTF:CQL” for CIM Query Language, and “WQL” for WBEM Query Language. Because this is not a filter query, “DMTF:FQL” is not a valid query language for this request.
  • qs (string) – Query string in the query language specified in the ql parameter.
  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    If None, defaults to the default namespace of the connection.

  • rc (bool) –

    Controls whether a class definition describing the properties of the returned instances will be returned.

    None will cause the server to use its default of False.

  • ot (Uint32) –

    Operation timeout in seconds. This is the minimum time the WBEM server must keep the enumeration session open between requests on that session.

    A value of 0 indicates that the server should never time out.

    The server may reject the proposed value.

    None will cause the server to use its default timeout.

  • coe (bool) –

    Continue on error flag.

    None will cause the server to use its default of False.

  • moc (Uint32) –

    Maximum number of instances the WBEM server may return for each of the open and pull requests issued during the iterations over the returned generator object.

    Zero and None are not allowed.

Returns:

An object with the following properties:

  • query_result_class (CIMClass):

    The query result class, if requested via the rc parameter.

    None, if a query result class was not requested.

  • generator (generator iterating CIMInstance):

    A generator object that iterates the CIM instances representing the query result. These instances do not have an instance path set.

Return type:

IterQueryInstancesReturn

wbemcli.oei(cn, ns=None, lo=None, di=None, iq=None, ico=None, pl=None, fl=None, fs=None, ot=None, coe=None, moc=None)[source]

This function is a wrapper for OpenEnumerateInstances().

Open an enumeration session to enumerate the instances of a class (including instances of its subclasses) in a namespace.

Use the piwp() function to retrieve the next set of instances or the ce() function to close the enumeration session before it is complete.

Parameters:
  • cn (string or CIMClassName) –

    Name of the class to be enumerated (case independent).

    If specified as a CIMClassName object, its host attribute will be ignored.

  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    If None, defaults to the namespace of the cn parameter if specified as a CIMClassName, or to the default namespace of the connection.

  • lo (bool) –

    LocalOnly flag: Exclude inherited properties.

    None will cause the server default of True to be used.

    Deprecated in DSP0200: WBEM server implementations for True may vary; this parameter should be set to False by the caller.

  • di (bool) –

    DeepInheritance flag: Include properties added by subclasses.

    None will cause the server default of True to be used.

  • iq (bool) –

    IncludeQualifiers flag: Include qualifiers.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: Clients cannot rely on qualifiers to be returned in this operation.

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin information for the properties in the retrieved instances.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: WBEM servers may either implement this parameter as specified, or may treat any specified value as False.

  • pl (string or iterable of string) – PropertyList: Names of properties to be included (if not otherwise excluded). An empty iterable indicates to include no properties. If None, all properties will be included.
  • fl (string) –

    Filter query language to be used for the filter defined in the fs parameter. The DMTF-defined Filter Query Language (see DSP0212) is specified as “DMTF:FQL”.

    None means that no such filtering is peformed.

  • fs (string) –

    Filter to apply to objects to be returned. Based on filter query language defined by fl parameter.

    None means that no such filtering is peformed.

  • ot (Uint32) –

    Operation timeout in seconds. This is the minimum time the WBEM server must keep the enumeration session open between requests on that session.

    A value of 0 indicates that the server should never time out.

    The server may reject the proposed value.

    None will cause the server to use its default timeout.

  • coe (bool) –

    Continue on error flag.

    None will cause the server to use its default of False.

  • moc (Uint32) –

    Maximum number of objects to return for this operation.

    None will cause the server to use its default of 0.

Returns:

A namedtuple() object containing the following named items:

  • instances (list of CIMInstance): The retrieved instances.
  • eos (bool): True if the enumeration session is exhausted after this operation. Otherwise eos is False and the context item is the context object for the next operation on the enumeration session.
  • context (tuple() of server_context, namespace): A context object identifying the open enumeration session, including its current enumeration state, and the namespace. This object must be supplied with the next pull or close operation for this enumeration session.

wbemcli.oeip(cn, ns=None, fl=None, fs=None, ot=None, coe=None, moc=None)[source]

This function is a wrapper for OpenEnumerateInstancePaths().

Open an enumeration session to enumerate the instance paths of instances of a class (including instances of its subclasses) in a namespace.

Use the pip() function to retrieve the next set of instance paths or the ce() function to close the enumeration session before it is complete.

Parameters:
  • cn (string or CIMClassName) –

    Name of the class to be enumerated (case independent).

    If specified as a CIMClassName object, its host attribute will be ignored.

  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    If None, defaults to the namespace of the cn parameter if specified as a CIMClassName, or to the default namespace of the connection.

  • fl (string) –

    Filter query language to be used for the filter defined in the fs parameter. The DMTF-defined Filter Query Language (see DSP0212) is specified as “DMTF:FQL”.

    None means that no such filtering is peformed.

  • fs (string) –

    Filter to apply to objects to be returned. Based on filter query language defined by fl parameter.

    None means that no such filtering is peformed.

  • ot (Uint32) –

    Operation timeout in seconds. This is the minimum time the WBEM server must keep the enumeration session open between requests on that session.

    A value of 0 indicates that the server should never time out.

    The server may reject the proposed value.

    None will cause the server to use its default timeout.

  • coe (bool) –

    Continue on error flag.

    None will cause the server to use its default of False.

  • moc (Uint32) –

    Maximum number of objects to return for this operation.

    None will cause the server to use its default of 0.

Returns:

A namedtuple() object containing the following named items:

  • paths (list of CIMInstanceName): The retrieved instance paths.
  • eos (bool): True if the enumeration session is exhausted after this operation. Otherwise eos is False and the context item is the context object for the next operation on the enumeration session.
  • context (tuple() of server_context, namespace): A context object identifying the open enumeration session, including its current enumeration state, and the namespace. This object must be supplied with the next pull or close operation for this enumeration session.

wbemcli.oai(ip, ac=None, rc=None, r=None, rr=None, iq=None, ico=None, pl=None, fl=None, fs=None, ot=None, coe=None, moc=None)[source]

This function is a wrapper for OpenAssociatorInstances().

Open an enumeration session to retrieve the instances associated to a source instance.

Use the piwp() function to retrieve the next set of instances or the ce() function to close the enumeration session before it is complete.

Parameters:
  • ip (CIMInstanceName) – Source instance path.
  • ac (string) –

    AssocClass filter: Include only traversals across this association class.

    None means this filter is not applied.

  • rc (string) –

    ResultClass filter: Include only traversals to this associated (result) class.

    None means this filter is not applied.

  • r (string) –

    Role filter: Include only traversals from this role (= reference name) in source object.

    None means this filter is not applied.

  • rr (string) –

    ResultRole filter: Include only traversals to this role (= reference name) in associated (=result) objects.

    None means this filter is not applied.

  • iq (bool) –

    IncludeQualifiers flag: Include qualifiers.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: Clients cannot rely on qualifiers to be returned in this operation.

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin information for the properties in the retrieved instances.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: WBEM servers may either implement this parameter as specified, or may treat any specified value as False.

  • pl (string or iterable of string) – PropertyList: Names of properties to be included (if not otherwise excluded). An empty iterable indicates to include no properties. If None, all properties will be included.
  • fl (string) –

    Filter query language to be used for the filter defined in the fs parameter. The DMTF-defined Filter Query Language (see DSP0212) is specified as “DMTF:FQL”.

    None means that no such filtering is peformed.

  • fs (string) –

    Filter to apply to objects to be returned. Based on filter query language defined by fl parameter.

    None means that no such filtering is peformed.

  • ot (Uint32) –

    Operation timeout in seconds. This is the minimum time the WBEM server must keep the enumeration session open between requests on that session.

    A value of 0 indicates that the server should never time out.

    The server may reject the proposed value.

    None will cause the server to use its default timeout.

  • coe (bool) –

    Continue on error flag.

    None will cause the server to use its default of False.

  • moc (Uint32) –

    Maximum number of objects to return for this operation.

    None will cause the server to use its default of 0.

Returns:

A namedtuple() object containing the following named items:

  • instances (list of CIMInstance): The retrieved instances.
  • eos (bool): True if the enumeration session is exhausted after this operation. Otherwise eos is False and the context item is the context object for the next operation on the enumeration session.
  • context (tuple() of server_context, namespace): A context object identifying the open enumeration session, including its current enumeration state, and the namespace. This object must be supplied with the next pull or close operation for this enumeration session.

wbemcli.oaip(ip, ac=None, rc=None, r=None, rr=None, fl=None, fs=None, ot=None, coe=None, moc=None)[source]

This function is a wrapper for OpenAssociatorInstancePaths().

Open an enumeration session to retrieve the instance paths of the instances associated to a source instance.

Use the pip() function to retrieve the next set of instance paths or the ce() function to close the enumeration session before it is complete.

Parameters:
  • ip (CIMInstanceName) – Source instance path.
  • ac (string) –

    AssocClass filter: Include only traversals across this association class.

    None means this filter is not applied.

  • rc (string) –

    ResultClass filter: Include only traversals to this associated (result) class.

    None means this filter is not applied.

  • r (string) –

    Role filter: Include only traversals from this role (= reference name) in source object.

    None means this filter is not applied.

  • rr (string) –

    ResultRole filter: Include only traversals to this role (= reference name) in associated (=result) objects.

    None means this filter is not applied.

  • fl (string) –

    Filter query language to be used for the filter defined in the fs parameter. The DMTF-defined Filter Query Language (see DSP0212) is specified as “DMTF:FQL”.

    None means that no such filtering is peformed.

  • fs (string) –

    Filter to apply to objects to be returned. Based on filter query language defined by fl parameter.

    None means that no such filtering is peformed.

  • ot (Uint32) –

    Operation timeout in seconds. This is the minimum time the WBEM server must keep the enumeration session open between requests on that session.

    A value of 0 indicates that the server should never time out.

    The server may reject the proposed value.

    None will cause the server to use its default timeout.

  • coe (bool) –

    Continue on error flag.

    None will cause the server to use its default of False.

  • moc (Uint32) –

    Maximum number of objects to return for this operation.

    None will cause the server to use its default of 0.

Returns:

A namedtuple() object containing the following named items:

  • paths (list of CIMInstanceName): The retrieved instance paths.
  • eos (bool): True if the enumeration session is exhausted after this operation. Otherwise eos is False and the context item is the context object for the next operation on the enumeration session.
  • context (tuple() of server_context, namespace): A context object identifying the open enumeration session, including its current enumeration state, and the namespace. This object must be supplied with the next pull or close operation for this enumeration session.

wbemcli.ori(ip, rc=None, r=None, iq=None, ico=None, pl=None, fl=None, fs=None, ot=None, coe=None, moc=None)[source]

This function is a wrapper for OpenReferenceInstances().

Open an enumeration session to retrieve the association instances that reference a source instance.

Use the piwp() function to retrieve the next set of instances or the ce() function to close the enumeration session before it is complete.

Parameters:
  • ip (CIMInstanceName) – Source instance path.
  • rc (string) –

    ResultClass filter: Include only traversals across this association (result) class.

    None means this filter is not applied.

  • r (string) –

    Role filter: Include only traversals from this role (= reference name) in source object.

    None means this filter is not applied.

  • iq (bool) –

    IncludeQualifiers flag: Include qualifiers.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: Clients cannot rely on qualifiers to be returned in this operation.

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin information for the properties in the retrieved instances.

    None will cause the server default of False to be used.

    Deprecated in DSP0200: WBEM servers may either implement this parameter as specified, or may treat any specified value as False.

  • pl (string or iterable of string) – PropertyList: Names of properties to be included (if not otherwise excluded). An empty iterable indicates to include no properties. If None, all properties will be included.
  • fl (string) –

    Filter query language to be used for the filter defined in the fs parameter. The DMTF-defined Filter Query Language (see DSP0212) is specified as “DMTF:FQL”.

    None means that no such filtering is peformed.

  • fs (string) –

    Filter to apply to objects to be returned. Based on filter query language defined by fl parameter.

    None means that no such filtering is peformed.

  • ot (Uint32) –

    Operation timeout in seconds. This is the minimum time the WBEM server must keep the enumeration session open between requests on that session.

    A value of 0 indicates that the server should never time out.

    The server may reject the proposed value.

    None will cause the server to use its default timeout.

  • coe (bool) –

    Continue on error flag.

    None will cause the server to use its default of False.

  • moc (Uint32) –

    Maximum number of objects to return for this operation.

    None will cause the server to use its default of 0.

Returns:

A namedtuple() object containing the following named items:

  • instances (list of CIMInstance): The retrieved instances.
  • eos (bool): True if the enumeration session is exhausted after this operation. Otherwise eos is False and the context item is the context object for the next operation on the enumeration session.
  • context (tuple() of server_context, namespace): A context object identifying the open enumeration session, including its current enumeration state, and the namespace. This object must be supplied with the next pull or close operation for this enumeration session.

wbemcli.orip(ip, rc=None, r=None, fl=None, fs=None, ot=None, coe=None, moc=None)[source]

This function is a wrapper for OpenReferenceInstancePaths().

Open an enumeration session to retrieve the instance paths of the association instances that reference a source instance.

Use the pip() function to retrieve the next set of instance paths or the ce() function to close the enumeration session before it is complete.

Parameters:
  • ip (CIMInstanceName) – Source instance path.
  • rc (string) –

    ResultClass filter: Include only traversals across this association (result) class.

    None means this filter is not applied.

  • r (string) –

    Role filter: Include only traversals from this role (= reference name) in source object.

    None means this filter is not applied.

  • fl (string) –

    Filter query language to be used for the filter defined in the fs parameter. The DMTF-defined Filter Query Language (see DSP0212) is specified as “DMTF:FQL”.

    None means that no such filtering is peformed.

  • fs (string) –

    Filter to apply to objects to be returned. Based on filter query language defined by fl parameter.

    None means that no such filtering is peformed.

  • ot (Uint32) –

    Operation timeout in seconds. This is the minimum time the WBEM server must keep the enumeration session open between requests on that session.

    A value of 0 indicates that the server should never time out.

    The server may reject the proposed value.

    None will cause the server to use its default timeout.

  • coe (bool) –

    Continue on error flag.

    None will cause the server to use its default of False.

  • moc (Uint32) –

    Maximum number of objects to return for this operation.

    None will cause the server to use its default of 0.

Returns:

A namedtuple() object containing the following named items:

  • paths (list of CIMInstanceName): The retrieved instance paths.
  • eos (bool): True if the enumeration session is exhausted after this operation. Otherwise eos is False and the context item is the context object for the next operation on the enumeration session.
  • context (tuple() of server_context, namespace): A context object identifying the open enumeration session, including its current enumeration state, and the namespace. This object must be supplied with the next pull or close operation for this enumeration session.

wbemcli.oqi(ql, qs, ns=None, rc=None, ot=None, coe=None, moc=None)[source]

This function is a wrapper for OpenQueryInstances().

Open an enumeration session to execute a query in a namespace and to retrieve the instances representing the query result.

Use the pi() function to retrieve the next set of instances or the ce() function to close the enumeration session before it is complete.

Parameters:
  • ql (string) – Filter query language to be used for the filter defined in the q parameter, e.g. “DMTF:CQL” for CIM Query Language, and “WQL” for WBEM Query Language. Because this is not a filter query, “DMTF:FQL” is not a valid query language for this request.
  • qs (string) – Filter to apply to objects to be returned. Based on filter query language defined by the ql parameter.
  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    If None, defaults to the default namespace of the connection.

  • rc (bool) –

    Controls whether a class definition describing the properties of the returned instances will be returned.

    None will cause the server to use its default of False.

  • ot (Uint32) –

    Operation timeout in seconds. This is the minimum time the WBEM server must keep the enumeration session open between requests on that session.

    A value of 0 indicates that the server should never time out.

    The server may reject the proposed value.

    None will cause the server to use its default timeout.

  • coe (bool) –

    Continue on error flag.

    None will cause the server to use its default of False.

  • moc (Uint32) –

    Maximum number of objects to return for this operation.

    None will cause the server to use its default of 0.

Returns:

A namedtuple() object containing the following named items:

  • instances (list of CIMInstance): The retrieved instances.
  • eos (bool): True if the enumeration session is exhausted after this operation. Otherwise eos is False and the context item is the context object for the next operation on the enumeration session.
  • context (tuple() of server_context, namespace): A context object identifying the open enumeration session, including its current enumeration state, and the namespace. This object must be supplied with the next pull or close operation for this enumeration session.
  • query_result_class (CIMClass): Result class definition describing the properties of the returned instances if requested, or otherwise None.

wbemcli.piwp(ec, moc)[source]

This function is a wrapper for PullInstancesWithPath().

Retrieve the next set of instances from an open enumeration session. The retrieved instances include their instance paths.

This operation can only be used on enumeration sessions that have been opened by one of the following functions:

Parameters:
  • ec (tuple() of server_context, namespace) – A context object identifying the open enumeration session, including its current enumeration state, and the namespace. This object must have been returned by the previous open or pull operation for this enumeration session.
  • moc (Uint32) –

    Maximum number of objects to return for this operation.

    None is not allowed.

Returns:

A namedtuple() object containing the following named items:

  • instances (list of CIMInstance): The retrieved instances.
  • eos (bool): True if the enumeration session is exhausted after this operation. Otherwise eos is False and the context item is the context object for the next operation on the enumeration session.
  • context (tuple() of server_context, namespace): A context object identifying the open enumeration session, including its current enumeration state, and the namespace. This object must be supplied with the next pull or close operation for this enumeration session.

wbemcli.pip(ec, moc)[source]

This function is a wrapper for PullInstancePaths().

Retrieve the next set of instance paths from an open enumeration session.

This operation can only be used on enumeration sessions that have been opened by one of the following functions:

Parameters:
  • ec (tuple() of server_context, namespace) – A context object identifying the open enumeration session, including its current enumeration state, and the namespace. This object must have been returned by the previous open or pull operation for this enumeration session.
  • moc (Uint32) –

    Maximum number of objects to return for this operation.

    None is not allowed.

Returns:

A namedtuple() object containing the following named items:

  • paths (list of CIMInstanceName): The retrieved instance paths.
  • eos (bool): True if the enumeration session is exhausted after this operation. Otherwise eos is False and the context item is the context object for the next operation on the enumeration session.
  • context (tuple() of server_context, namespace): A context object identifying the open enumeration session, including its current enumeration state, and the namespace. This object must be supplied with the next pull or close operation for this enumeration session.

wbemcli.pi(ec, moc)[source]

This function is a wrapper for PullInstances().

Retrieve the next set of instances from an open enumeration session. The retrieved instances do not include an instance path.

This operation can only be used on enumeration sessions that have been opened by one of the following functions:

Parameters:
  • ec (tuple() of server_context, namespace) – A context object identifying the open enumeration session, including its current enumeration state, and the namespace. This object must have been returned by the previous open or pull operation for this enumeration session.
  • moc (Uint32) –

    Maximum number of objects to return for this operation.

    None is not allowed.

Returns:

A namedtuple() object containing the following named items:

  • instances (list of CIMInstance): The retrieved instances.
  • eos (bool): True if the enumeration session is exhausted after this operation. Otherwise eos is False and the context item is the context object for the next operation on the enumeration session.
  • context (tuple() of server_context, namespace): A context object identifying the open enumeration session, including its current enumeration state, and the namespace. This object must be supplied with the next pull or close operation for this enumeration session.

wbemcli.ce(ec)[source]

This function is a wrapper for CloseEnumeration().

Close an open enumeration session, causing an early termination of an incomplete enumeration session.

The enumeration session must still be open when this operation is performed.

Parameters:ec (tuple() of server_context, namespace) – A context object identifying the open enumeration session, including its current enumeration state, and the namespace. This object must have been returned by the previous open or pull operation for this enumeration session.
wbemcli.ec(ns=None, cn=None, di=None, lo=None, iq=None, ico=None)[source]

This function is a wrapper for EnumerateClasses().

Enumerate the subclasses of a class, or the top-level classes in a namespace.

Parameters:
  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    If None, defaults to the namespace of the cn parameter if specified as a CIMClassName, or to the default namespace of the connection.

  • cn (string or CIMClassName) –

    Name of the class whose subclasses are to be enumerated (case independent).

    None will enumerate the top-level classes.

    If specified as a CIMClassName object, its host attribute will be ignored.

  • di (bool) –

    DeepInheritance flag: Include also indirect subclasses.

    None will cause the server default of False to be used.

  • lo (bool) –

    LocalOnly flag: Exclude inherited properties.

    None will cause the server default of True to be used.

  • iq (bool) –

    IncludeQualifiers flag: Include qualifiers.

    None will cause the server default of True to be used.

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin information for properties and methods in the retrieved class.

    None will cause the server default of False to be used.

Returns:

The enumerated classes.

Return type:

list of CIMClass

wbemcli.ecn(ns=None, cn=None, di=None)[source]

This function is a wrapper for EnumerateClassNames().

Enumerate the names of subclasses of a class, or of the top-level classes in a namespace.

Parameters:
  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    If None, defaults to the namespace of the cn parameter if specified as a CIMClassName, or to the default namespace of the connection.

  • cn (string or CIMClassName) –

    Name of the class whose subclasses are to be enumerated (case independent).

    None will enumerate the top-level classes.

    If specified as a CIMClassName object, its host attribute will be ignored.

  • di (bool) –

    DeepInheritance flag: Include also indirect subclasses.

    None will cause the server default of False to be used.

Returns:

The enumerated class names.

Return type:

list of unicode string

wbemcli.gc(cn, ns=None, lo=None, iq=None, ico=None, pl=None)[source]

This function is a wrapper for GetClass().

Retrieve a class.

Parameters:
  • cn (string or CIMClassName) –

    Name of the class to be retrieved (case independent).

    If specified as a CIMClassName object, its host attribute will be ignored.

  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    If None, defaults to the namespace of the cn parameter if specified as a CIMClassName, or to the default namespace of the connection.

  • lo (bool) –

    LocalOnly flag: Exclude inherited properties.

    None will cause the server default of True to be used.

  • iq (bool) –

    IncludeQualifiers flag: Include qualifiers.

    None will cause the server default of True to be used.

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin information for properties and methods in the retrieved class.

    None will cause the server default of False to be used.

  • pl (string or iterable of string) – PropertyList: Names of properties to be included (if not otherwise excluded). An empty iterable indicates to include no properties. If None, all properties will be included.
Returns:

The retrieved class.

Return type:

CIMClass

wbemcli.mc(mc, ns=None)[source]

This function is a wrapper for ModifyClass().

Modify a class.

Parameters:
  • mc (CIMClass) – Modified class.
  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    None will use the default namespace of the connection.

wbemcli.cc(nc, ns=None)[source]

This function is a wrapper for CreateClass().

Create a class in a namespace.

Parameters:
  • nc (CIMClass) – New class.
  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    None will use the default namespace of the connection.

wbemcli.dc(cn, ns=None)[source]

This function is a wrapper for DeleteClass().

Delete a class.

Parameters:
  • cn (string or CIMClassName) –

    Name of the class to be deleted (case independent).

    If specified as a CIMClassName object, its host attribute will be ignored.

  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    If None, defaults to the namespace of the cn parameter if specified as a CIMClassName, or to the default namespace of the connection.

wbemcli.eq(ns=None)[source]

This function is a wrapper for EnumerateQualifiers().

Enumerate qualifier types (= declarations) in a namespace.

Parameters:ns (string) –

Name of the CIM namespace to be used (case independent).

None will use the default namespace of the connection.

Returns:The enumerated qualifier types.
Return type:list of CIMQualifierDeclaration
wbemcli.gq(qn, ns=None)[source]

This function is a wrapper for GetQualifier().

Retrieve a qualifier type (= declaration).

Parameters:
  • qn (string) – Qualifier name (case independent).
  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    None will use the default namespace of the connection.

Returns:

The retrieved qualifier type.

Return type:

CIMQualifierDeclaration

wbemcli.sq(qd, ns=None)[source]

This function is a wrapper for SetQualifier().

Create or modify a qualifier type (= declaration) in a namespace.

Parameters:
  • qd (CIMQualifierDeclaration) – Qualifier type.
  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    None will use the default namespace of the connection.

wbemcli.dq(qn, ns=None)[source]

This function is a wrapper for DeleteQualifier().

Delete a qualifier type (= declaration).

Parameters:
  • qn (string) – Qualifier name (case independent).
  • ns (string) –

    Name of the CIM namespace to be used (case independent).

    None will use the default namespace of the connection.

wbemcli.h()[source]

Print help text for interactive environment.

wbemcli.pdb(stmt)[source]

Run the statement under the PDB debugger.