Objects
- class Objects(api)
Bases:
FeatureBase- clear(obj, attributes)
Clears attributes from an object.
- Parameters:
obj (Union[config.Object, str]) – Config Object or Distinguished Name (DN) of the object.
attributes (Union[dict, list[str]]) –
Two types are supported:
listof attribute names to be cleared entirely.dictwhose keys are attribute names and whose values are the values to be cleared from the attribute. If the attribute is left empty it is cleared.
- exists(object_dn=None)
- Parameters:
object_dn (str) – The Distinguished Name (DN) of the object.
- Returns:
Trueifobject_dnexist, elseFalse.- Return type:
bool
- find_policy(obj, class_name, attribute_name)
Find the folder that defines the policy attribute of the
class_nameon a given object.- Parameters:
obj (Union[config.Object, str]) – Config Object or Distinguished Name (DN) of the object.
class_name (str) – TPP class name of the object.
attribute_name (str) – Name of the attribute.
- Returns:
A
tupleofA Distinguished Name (DN) of the folder implementing the policy.
A list of attribute values.
Trueif the policy value is locked, elseFalse.
- Return type:
Tuple[str, list[str], bool]
- get(object_dn=None, object_guid=None, raise_error_if_not_exists=True)
One of
object_dnorobject_guidis required.- Parameters:
object_dn (str) – Distinguished Name (DN) of the object.
object_guid (str) – GUID of the object.
raise_error_if_not_exists (bool) – If
Trueraise an exception if the object doesn’t exist.
- Returns:
Config Object of the object.
- read(obj, attribute_name, include_policy_values=False, timeout=10)
- Parameters:
obj (Union[config.Object, str]) – Config Object or Distinguished Name (DN) of the object.
attribute_name (str) – The attribute name.
include_policy_values (bool) – If
True, the effective value(s) are returned. Otherwise only values explicitly assigned to the object are returned.timeout (int) – Read timeout in seconds.
- Returns:
An
AttributeValueobject with these propertiesvalues (list[str]) - List of attribute values.
locked (bool) -
Trueif the value is locked by policy.
- read_all(obj)
- Parameters:
obj (Union[config.Object, str]) – Config Object or Distinguished Name (DN) of the object.
- Returns:
List of
NameValueswhere thename is the attribute name.
values is the list of attribute values.
- rename(obj, new_object_dn)
Note
This method can be used to rename objects and move their location.
- Parameters:
obj (Union[config.Object, str]) – Config Object or Distinguished Name (DN) of the object.
new_object_dn (str) – Distinguished Name (DN) of the new object.
- update(obj, attributes)
Updates attributes on an object. If the attribute is locked TPP will simply ignore the request.
- Parameters:
obj (Union[config.Object, str]) – Config Object or Distinguished Name (DN) of the object.
attributes (dict) – A dictionary of attribute name/value pairs where the name is the attribute name and the value is the attribute value.
- wait_for(obj, attribute_name, attribute_value, include_policy_values=False, timeout=10)
Waits for the
attribute_nameto have theattribute_valueon the object within the timeout period. ATimeoutErroris raised if theattribute_namedoes not have theattribute_value.- Parameters:
obj (Union[config.Object, str]) – Config Object or Distinguished Name (DN) of the object.
attribute_name (str) – The name of the attribute.
attribute_value (str) – The expected value to the
attribute_name.include_policy_values (bool) – If
True, the effective value(s) are returned. Otherwise only values explicitly assigned to the object are returned.timeout (int) – Timeout period in seconds.
- Returns:
An
AttributeValueobject with these propertiesvalues (list[str]) - List of attribute values.
locked (bool) -
Trueif the value is locked by policy.
- write(obj, attributes)
Writes new attributes on an object. If the attribute is locked TPP will simply ignore the request.
- Parameters:
obj (Union[config.Object, str]) – Config Object or Distinguished Name (DN) of the object.
attributes (dict) – A dictionary of attribute name/value pairs where the name is the attribute name and the value is the attribute value.