onapsdk.clamp package¶
Submodules¶
onapsdk.clamp.clamp_element module¶
Clamp module.
-
class
onapsdk.clamp.clamp_element.
Clamp
¶ Bases:
onapsdk.onap_service.OnapService
Mother Class of all CLAMP elements.
-
classmethod
check_loop_template
(service)¶ Return loop template name if exists.
- Parameters
service (Service) – the distributed sdc service with tca blueprint artifact
- Raises
ResourceNotFound – Template not found.
- Return type
- Returns
if required template exists in CLAMP or not
-
classmethod
check_policies
(policy_name, req_policies=30)¶ Ensure that a policy is stored in CLAMP.
-
classmethod
onapsdk.clamp.loop_instance module¶
Control Loop module.
-
class
onapsdk.clamp.loop_instance.
LoopInstance
(template, name, details)¶ Bases:
onapsdk.clamp.clamp_element.Clamp
Control Loop instantiation class.
-
act_on_loop_policy
(func)¶ Act on loop’s policy.
- Parameters
func (function) – function of action to be done (submit, stop, restart)
- Returns
failed or done
- Return type
action state
-
add_op_policy_config
(func, **kwargs)¶ Add operational policy configuration.
Add operation policy configuration using payload data.
- Parameters
func (function) – policy configuration function in (add_drools_conf, add_minmax_config, add_frequency_limiter)
- Return type
-
add_operational_policy
(policy_type, policy_version)¶ Add operational policy to the loop instance.
- Parameters
- Raises
ParameterError – Corrupt response or a key in a dictionary not found. It will also be raised when the response contains more operational policies than there are currently.
- Return type
-
deploy_microservice_to_dcae
()¶ Execute the deploy operation on the loop instance.
- Return type
- Returns
loop deploy on DCAE status (True, False)
-
extract_operational_policy_name
(policy_type)¶ Return operational policy name for a closed loop and a given policy.
- Parameters
policy_type (str) – the policy acronym.
- Raises
ParameterError – Couldn’t load the operational policy name.
- Return type
- Returns
Operational policy name in the loop details after adding a policy.
-
property
loop_schema
¶ Return and lazy load the details schema.
- Return type
- Returns
schema to be respected to accede to loop details
-
operational_policies
= ''¶
-
remove_operational_policy
(policy_type, policy_version)¶ Remove operational policy from the loop instance.
-
restart
()¶ Redeploy policies to policy engine.
-
stop
()¶ Undeploy Policies from policy engine.
-
submit
()¶ Submit policies to policy engine.
-
update_microservice_policy
()¶ Update microservice policy configuration.
Update microservice policy configuration using payload data.
- Return type
-
Module contents¶
ONAP SDK CLAMP package.