Placement Rules
- class PlacementRules(api)
Bases:
FeatureBase
- create(name, conditions, device_location, certificate_location=None, rule_type='X509 Certificate', get_if_already_exists=True)
- Parameters
name (str) – Name of the placement rule.
conditions (List[str]) – A list of strings that define the conditions of the rule. Use
PlacementRuleCondition
to create the rule conditions. See Managing Placement Rules for examples.device_location (Union[config.Object, str]) – Config Object or Distinguished Name (DN) of the folder in which to place applicable devices.
certificate_location (Union[config.Object, str]) – Config Object or Distinguished Name (DN) of the folder in which to place applicable certificates.
rule_type (str) – Default is ‘X509 Certificate’. ‘SSH’ may be specified instead for SSH discovery.
get_if_already_exists (bool) – If the objects already exists, just return it as is.
- Returns
Config Object of the placement rule object.
- delete(rule)
Deletes a placement rule.
- Parameters
rule (Union[config.Object, str]) – Config Object or name of the placement rule.
- get(name, raise_error_if_not_exists=True)
- Parameters
name (str) – Name of the placement rule.
raise_error_if_not_exists (bool) – Raise an exception if the placement rule does not exist.
- Returns
Config Object of the placement rule object.
- update(rule, conditions=None, device_location=None, certificate_location=None, rule_type='X509 Certificate')
Updates a placement rule. If certain parameters are not provided, the current parameters will be rewritten to the object. In other words, only the parameters given are updated.
- Parameters
rule (Union[config.Object, str]) – Config Object or name of the placement rule.
conditions (List[str]) – A list of strings that define the conditions of the rule. Use
PlacementRuleCondition
to create the rule conditions. See Managing Placement Rules for examples.device_location (str) – Config Object or Distinguished Name (DN) of the folder in which to place applicable devices.
certificate_location (str) – Config Object or Distinguished Name (DN) of the folder in which to place applicable certificates.
rule_type (str) – Default is ‘X509 Certificate’. ‘SSH’ may be specified instead for SSH discovery.