__init__(self,
name,
value,
type=None,
class_origin=None,
array_size=None,
propagated=None,
is_array=None,
reference_class=None,
qualifiers=None,
embedded_object=None)
(Constructor)
| source code
|
Initialize the CIMProperty object.
This function infers optional arguments that are not specified (for
example, it infers type from the Python type of value and other
information). If the specified arguments are inconsistent, an
exception is raised. If an optional argument is needed for some reason,
an exception is raised.
Examples:
- CIMProperty("MyString", "abc")
-> a string property
- CIMProperty("MyNum", 42, "uint8")
-> a uint8 property
- CIMProperty("MyNum", Uint8(42))
-> a uint8 property
- CIMProperty("MyNumArray", [1,2,3], "uint8")
-> a uint8 array property
- CIMProperty("MyRef", CIMInstanceName(...))
-> a reference property
- CIMProperty("MyEmbObj", CIMClass(...))
-> an embedded object property containing a class
CIMProperty("MyEmbObj", CIMInstance(...),
embedded_object='object')
-> an embedded object property containing an instance
- CIMProperty("MyEmbInst", CIMInstance(...))
-> an embedded instance property
- CIMProperty("MyString", None, "string")
-> a string property that is Null
- CIMProperty("MyNum", None, "uint8")
-> a uint8 property that is Null
- CIMProperty("MyRef", None, reference_class="MyClass")
-> a reference property that is Null
- CIMProperty("MyEmbObj", None, embedded_object='object')
-> an embedded object property that is Null
- CIMProperty("MyEmbInst", None, embedded_object='instance')
-> an embedded instance property that is Null
- Parameters:
name (Unicode string or UTF-8 encoded byte string) - Name of the property. Must not be None .
value - Value of the property (interpreted as actual value when the
property object is used in an instance, and as default value when
it is used in a class).
For valid types for CIM values, see cim_types.
type (Unicode string or UTF-8 encoded byte string) - Name of the CIM type of the property (e.g. 'uint8' ).
None means that the argument is unspecified, causing the
corresponding instance variable to be inferred. An exception is
raised if it cannot be inferred.
class_origin (Unicode string or UTF-8 encoded byte string) - The CIM class origin of the property (the name
of the most derived class that defines or overrides the property in
the class hierarchy of the class owning the property).
None means that class origin information is not available.
array_size (int ) - The size of the array property, for fixed-size arrays.
None means that the array property has variable size.
propagated (Unicode string or UTF-8 encoded byte string) - The CIM propagated attribute of the property (the effective value
of the Propagated qualifier of the property, which is a string
that specifies the name of the source property from which the
property value should be propagated).
None means that propagation information is not available.
is_array (bool ) - A boolean indicating whether the property is an array (True ) or a
scalar (False ).
None means that the argument is unspecified, causing the
corresponding instance variable to be inferred from the value
parameter, and if that is None it defaults to False (scalar).
reference_class (Unicode string or UTF-8 encoded byte string) - The name of the referenced class, for reference properties.
None means that the argument is unspecified, causing the
corresponding instance variable to be inferred. An exception is
raised if it cannot be inferred.
qualifiers (dict or NocaseDict) - A dictionary specifying CIM qualifier values.
The dictionary keys must be the qualifier names. The dictionary
values must be CIMQualifier objects specifying the qualifier
values.
None means that there are no qualifier values. In all cases,
the qualifiers instance variable will be a NocaseDict object.
embedded_object (Unicode string or UTF-8 encoded byte string) - A string value indicating the kind of
embedded object represented by the property value. The following
values are defined for this argument:
'instance' : The property is declared with the
EmbeddedInstance qualifier, indicating that the property
value is an embedded instance of a known class name (or Null).
'object' : The property is declared with the
EmbeddedObject qualifier, indicating that the property
value is an embedded object (instance or class) of which the
class name is not known (or Null).
None means that the argument is unspecified, causing the
corresponding instance variable to be inferred. An exception is
raised if it cannot be inferred.
- Raises:
- Overrides:
object.__init__
|