7. 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 creates, updates or removes CIM instances, classes or qualifier types in a CIM repository.

  • wbemcli

    A WBEM command line interface that provides an interactive Python environment for issuing WBEM operations to a WBEM server.

7.1. mof_compiler

The mof_compiler command is a MOF compiler. It compiles MOF files, and updates the repository of a WBEM server with the result.

The MOF compiler can also be invoked from programs via the MOF compiler API.

The MOF compiler has a pluggable interface for the CIM repository. The default implementation of that interface uses a WBEM server as its repository. The plug interface is also described in the MOF compiler API.

7.1.1. Usage

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          Remove elements (found in the MOF files) from the WBEM
                        server's namespace, instead of creating or updating
                        them
  -d, --dry-run         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
  -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

7.2. wbemcli

The wbemcli command is a WBEM client command line interface (CLI). It is implemented as an interactive shell.

The WBEM client CLI does not have an external API on its own; it is for the most part a consumer of the WBEM client library API.

7.2.1. Usage

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
  -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)

7.2.2. Global functions

The interactive shell of wbemcli provides global functions for the CIM operations, and some functions for help display and debugging.

For tooling reasons, these functions are shown as members of the ‘wbemcli’ namespace. However, they are directly available in the namespace of the wbemcli interactive shell.

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

WBEM operation: 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.ei(cn, ns=None, lo=None, di=None, iq=None, ico=None, pl=None)[source]

WBEM operation: 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.

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

    Deprecated: Server implementations for True vary; therefore it is recommended to set this parameter to False.

  • 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.

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

    Deprecated: Instance qualifiers have been deprecated in CIM. Clients cannot rely on qualifiers to be returned in this operation.

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin info for properties.

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

  • pl (iterable of string) – PropertyList: Names of properties to be included (if not otherwise excluded). 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.gi(ip, lo=None, iq=None, ico=None, pl=None)[source]

WBEM operation: 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.

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

    Deprecated: Server implementations for True vary; therefore it is recommended to set this parameter to False.

  • iq (bool) –

    IncludeQualifiers flag: Include qualifiers.

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

    Deprecated: Instance qualifiers have been deprecated in CIM. Clients cannot rely on qualifiers to be returned in this operation.

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin info for properties.

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

  • pl (iterable of string) – PropertyList: Names of properties to be included (if not otherwise excluded). 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]

WBEM operation: 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.

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

    Deprecated: Instance qualifiers have been deprecated in CIM. Clients cannot rely on qualifiers to be modified in this operation.

  • pl (iterable of string) – PropertyList: Names of properties to be modified (if not otherwise excluded). If None, all properties will be modified.
wbemcli.ci(ni, ns=None)[source]

WBEM operation: 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.

  • 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, 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]

WBEM operation: DeleteInstance

Delete 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.

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

WBEM operation: 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) –

    AssociationClass 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 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 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 CIMInstanceName or CIMClassName

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

WBEM operation: 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) –

    AssociationClass filter: Include only traversals across this assoiation 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.

    Deprecated: Instance qualifiers have been deprecated in CIM.

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

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin info for props.

    Deprecated: Server impls. vary; Server may treat as False.

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

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

For instance level use, a list of CIMInstance objects representing 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: 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 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 CIMInstance or tuple (CIMClassName, CIMClass)

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

WBEM operation: 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 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 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 CIMInstanceName or CIMClassName

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

WBEM operation: 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.

    Deprecated: Instance qualifiers have been deprecated in CIM.

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

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin info for props.

    Deprecated: Server impls. vary; Server may treat as False.

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

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

For instance level use, a list of CIMInstance objects representing 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: 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 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 CIMInstance or tuple (CIMClassName, CIMClass)

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

WBEM operation: OpenEnumerateInstances

Open an enumeration sequence to enumerate the instances of a class (including instances of its subclasses) in a namespace. Subsequent to this open response, additional instances may be pulled using the PullInstancesWithPath request. The enumeration sequence may also be closed before it is complete with the CloseEnumeration request

This operation returns a named tuple containing any instances returned and status of the enumeration sequence.

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.

    Deprecated: Server impls for True vary; Set to False.

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

  • 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.

    Deprecated: Instance qualifiers have been deprecated in CIM.

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

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin info for props.

    Deprecated: Server may treat as False.

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

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

    Filter query language to be used for the filter defined in the fi parameter.

    None means that no such filtering is peformed.

  • fq (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 (integer) –

    Operation timeout in seconds. This is the minimum time the server must keep the enumerate session open between this open request and the next request.

    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 (integer) –

    Maximum number of objects to return for this operation.

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

Returns:

instances (list of CIMInstance):

The result set of instances in response to this request.

eos (bool):

True if this response is the complete response to this request and there are no more instances to return. Otherwise eos is False and the context item will define the context for the next operation.

context (string):

A context string that must be supplied with any subsequent pull or close operation on this enumeration sequence.

Return type:

Named tuple, containing the following named items

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

WBEM operation: OpenEnumerateInstancePaths

Open an enumeration sequence to enumerate the instances of a class (including instances of its subclasses) in a namespace. Subsequent to this open response, additional instances may be pulled using the PullInstancesWithPath request. The enumeration sequence may also be closed before it is complete with the CloseEnumeration request

This operation returns a named tuple containing any instances returned and status of the enumeration sequence.

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.

    Deprecated: Server impls for True vary; Set to False.

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

  • fl (string) –

    Filter query language to be used for the filter defined in the fi parameter.

    None means that no such filtering is peformed.

  • fq (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 (integer) –

    Operation timeout in seconds. This is the minimum time the server must keep the enumerate session open between this open request and the next request.

    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 (integer) –

    Maximum number of objects to return for this operation.

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

Returns:

paths (list of CIMInstanceName):

The result set of instance paths in response to this request.

eos (bool):

True if this response is the complete response to this request and there are no more instances to return. Otherwise eos is False and the context item will define the context for the next operation.

context (string):

A context string that must be supplied with any subsequent pull or close operation on this enumeration sequence.

Return type:

Named tuple, containing the following named items

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

WBEM operation: OpenReferenceInstances

Open an enumeration sequence to enumerate the association instances of an instance in a namespace. Subsequent to this open response, additional instances may be pulled using the PullInstancesWithPath request. The enumeration sequence may also be closed before it is complete with the CloseEnumeration request.

This operation returns a named tuple containing any instances returned and status of the enumeration sequence.

Parameters:
  • op (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.

    Deprecated: Instance qualifiers have been deprecated in CIM.

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

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin info for props.

    Deprecated: Server impls. vary; Server may treat as False.

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

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

    Filter query language to be used for the filter defined in the fi parameter.

    None means that no such filtering is peformed.

  • fq (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 (integer) –

    Operation timeout in seconds. This is the minimum time the server must keep the enumerate session open between this open request and the next request.

    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 (integer) –

    Maximum number of objects to return for this operation.

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

Returns:

instances (list of CIMInstance):

The result set of instances in response to this request.

eos (bool):

True if this response is the complete response to this request and there are no more instances to return. Otherwise eos is False and the context item will define the context for the next operation.

context (string):

A context string that must be supplied with any subsequent pull or close operation on this enumeration sequence.

Return type:

Named tuple, containing the following named items

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

WBEM operation: OpenReferenceInstancePaths

Open an enumeration sequence to enumerate the association instance paths of an instance in a namespace. Subsequent to this open response, additional instances may be pulled using the PullInstancesWithPath request. The enumeration sequence may also be closed before it is complete with the CloseEnumeration request.

This operation returns a named tuple containing any instances returned and status of the enumeration sequence.

Parameters:
  • op (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 fi parameter.

    None means that no such filtering is peformed.

  • fq (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 (integer) –

    Operation timeout in seconds. This is the minimum time the server must keep the enumerate session open between this open request and the next request.

    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 (integer) –

    Maximum number of objects to return for this operation.

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

Returns:

paths (list of CIMInstanceName):

The result set of instance paths in response to this request.

eos (bool):

True if this response is the complete response to this request and there are no more instances to return. Otherwise eos is False and the context item will define the context for the next operation.

context (string):

A context string that must be supplied with any subsequent pull or close operation on this enumeration sequence.

Return type:

Named tuple, containing the following named items

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

WBEM operation: OpenAssociatorInstances

Open an enumeration sequence to enumerate the associated instances of an instance in a namespace. Subsequent to this open response, additional instances may be pulled using the PullInstancesWithPath request. The enumeration sequence may also be closed before it is complete with the CloseEnumeration request.

This operation returns a named tuple containing any instances returned and status of the enumeration sequence.

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

    AssociationClass 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.

    Deprecated: Instance qualifiers have been deprecated in CIM.

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

  • ico (bool) –

    IncludeClassOrigin flag: Include class origin info for props.

    Deprecated: Server impls. vary; Server may treat as False.

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

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

    Filter query language to be used for the filter defined in the fi parameter.

    None means that no such filtering is peformed.

  • fq (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 (integer) –

    Operation timeout in seconds. This is the minimum time the server must keep the enumerate session open between this open request and the next request.

    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 (integer) –

    Maximum number of objects to return for this operation.

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

Returns:

instances (list of CIMInstance):

The result set of instances in response to this request.

eos (bool):

True if this response is the complete response to this request and there are no more instances to return. Otherwise eos is False and the context item will define the context for the next operation.

context (string):

A context string that must be supplied with any subsequent pull or close operation on this enumeration sequence.

Return type:

Named tuple, containing the following named items

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

WBEM operation: OpenAssociatorInstancePaths

Open an enumeration sequence to enumerate the associated instance paths of an instance in a namespace. Subsequent to this open response, additional instances may be pulled using the PullInstancesWithPath request. The enumeration sequence may also be closed before it is complete with the CloseEnumeration request.

This operation returns a named tuple containing any instances returned and status of the enumeration sequence.

Parameters:
  • op (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 fi parameter.

    None means that no such filtering is peformed.

  • fq (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 (integer) –

    Operation timeout in seconds. This is the minimum time the server must keep the enumerate session open between this open request and the next request.

    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 (integer) –

    Maximum number of objects to return for this operation.

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

Returns:

paths (list of CIMInstanceName):

The result set of instance paths in response to this request.

eos (bool):

True if this response is the complete response to this request and there are no more instances to return. Otherwise eos is False and the context item will define the context for the next operation.

context (string):

A context string that must be supplied with any subsequent pull or close operation on this enumeration sequence.

Return type:

Named tuple, containing the following named items

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

WBEM operation: OpenQueryInstances

Open an enumeration sequence to execute a query fi using the query language fl. If this operation returns eos == False, the PullInstances operation is used to request additional instances.

This operation returns a named tuple containing any instances returned and status of the enumeration sequence.

Parameters:
  • ql (string) – Filter query language to be used for the filter defined in the qi parameter. This must be a query language such as CQL or WQL but NOT FQL.
  • qi (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 result class definition describing the returned instances will be returned.

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

  • ot (integer) –

    Operation timeout in seconds. This is the minimum time the server must keep the enumerate session open between this open request and the next request.

    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 (integer) –

    Maximum number of objects to return for this operation.

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

Returns:

instances (list of CIMInstance):

The result set of instances in response to this request.

eos (bool):

True if this response is the complete response to this request and there are no more instances to return. Otherwise eos is False and the context item will define the context for the next operation.

context (string):

A context string that must be supplied with any subsequent pull or close operation on this enumeration sequence.

query_result_class (CIMClass):

Result class definition describing the returned instances, or None.

Return type:

Named tuple, containing the following named items

wbemcli.piwp(ec, moc)[source]

WBEM operation: PullInstancesWithPath

Pull instances from the server as part of an already opened enumeration sequence. This operation can be used as the sequence continuation for OpenEnumerateInstancePaths, OpenAssociatorPaths and OpenReferencePaths.

Parameters:
  • ec (string) – Enumeration context from previous operation response for this enumeration session.
  • moc (integer) – Maximum number of objects to return for this operation.
Returns:

instances (list of CIMInstance):

The result set of instances in response to this request.

eos (bool):

True if this response is the complete response to this request and there are no more instances to return. Otherwise eos is False and the context item will define the context for the next operation.

context (string):

A context string that must be supplied with any subsequent pull or close operation on this enumeration sequence.

Return type:

Named tuple, containing the following named items

wbemcli.pip(ec, moc)[source]

WBEM operation: PullInstancePaths

Pull instance paths from the server as part of an already opened enumeration sequence. This operation can be used as the sequence continuation for OpenEnumeratePaths, OpenAssociatorPaths and OpenReferencePaths.

Parameters:
  • ec (string) – Enumeration context from previous operation response for this enumeration session.
  • moc (integer) – Maximum number of objects to return for this operation.
Returns:

paths (list of CIMInstanceName):

The result set of instance paths in response to this request.

eos (bool):

True if this response is the complete response to this request and there are no more instances to return. Otherwise eos is False and the context item will define the context for the next operation.

context (string):

A context string that must be supplied with any subsequent pull or close operation on this enumeration sequence.

Return type:

Named tuple, containing the following named items

wbemcli.pi(ec, moc)[source]

WBEM operation: PullInstances

Pull instances from the server as part of an already opened enumeration sequence. This operation can be used as the sequence continuation for OpenQueryInstances.

Parameters:
  • ec (string) – Enumeration context from previous operation response for this enumeration session.
  • moc (integer) – Maximum number of objects to return for this operation.
Returns:

instances (list of CIMInstance):

The result set of instances in response to this request. The path attribute is None.

eos (bool):

True if this response is the complete response to this request and there are no more instances to return. Otherwise eos is False and the context item will define the context for the next operation.

context (string):

A context string that must be supplied with any subsequent pull or close operation on this enumeration sequence.

Return type:

Named tuple, containing the following named items

wbemcli.ce(ec)[source]

WBEM operation: CloseEnumeration

Close an existing open enumeration context early. Once the sequence is complete, the eos flag is set in the last response. Any time before this, the sequence may be closed early with this operation.

Parameters:ec (string) – Enumeration context from previous operation response for this enumeration session.
wbemcli.im(mn, op, *params, **kwparams)[source]

WBEM operation: InvokeMethod

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

Parameters:
  • mn (string) – Method name.
  • op (CIMClassName) – Target instance path.
  • op – Target class path.
  • *params (named args) – Input parameters for the method.
  • **kwparams (keyword args) – Input parameters for the method.
Returns:

Method return value, dict with output parameters.

Return type:

tuple(rv, out)

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

WBEM operation: 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 string

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

WBEM operation: 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 info for props.

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

Returns:

The enumerated classes.

Return type:

list of CIMClass

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

WBEM operation: 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 info for props.

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

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

The retrieved class.

Return type:

CIMClass

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

WBEM operation: 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]

WBEM operation: 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]

WBEM operation: 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]

WBEM operation: 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]

WBEM operation: 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]

WBEM operation: 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]

WBEM operation: 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.