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:
list
of attribute names to be cleared entirely.dict
whose 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
True
ifobject_dn
exist, elseFalse
.- Return type
bool
- find_policy(obj, class_name, attribute_name)
Find the folder that defines the policy attribute of the
class_name
on 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
tuple
ofA Distinguished Name (DN) of the folder implementing the policy.
A list of attribute values.
True
if 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_dn
orobject_guid
is 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
True
raise 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
AttributeValue
object with these propertiesvalues (List[str]) - List of attribute values.
locked (bool) -
True
if 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
NameValues
where 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_name
to have theattribute_value
on the object within the timeout period. ATimeoutError
is raised if theattribute_name
does 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
AttributeValue
object with these propertiesvalues (List[str]) - List of attribute values.
locked (bool) -
True
if 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.