-
Notifications
You must be signed in to change notification settings - Fork 4
API reference
efotopoulou edited this page Jul 17, 2018
·
30 revisions
Following table shows the API endpoints of the Policy Manager.
Action | HTTP Method | Endpoint |
---|---|---|
GET a list of all runtime policies | GET |
/api/v1 |
Create a Policy | POST |
/api/v1 |
GET a policy | GET |
/api/v1/{policy_uuid} |
Update a Policy | PUT |
/api/v1 |
Delete a Policy | DELETE |
/api/v1/{policy_uuid} |
Bind a Policy to an SLA | PATCH |
/api/v1/{policy_uuid} |
Define a Policy as default | PATCH |
/api/v1/{policy_uuid} |
Enforce Policy | POST |
/api/v1/{nsr_uuid}/activation |
Deactivate Policy | POST |
/api/v1/{nsr_uuid}/deactivation |
Sample runtime policy descriptors can be found at [policy descriptor examples|https://github.com/sonata-nfv/tng-schema/tree/master/policy-descriptor/examples]
Following can be seen a rule example:
rule "highTranscodingRateRule"
when
(
$tot0 := java.lang.Double( $tot0 >=150 ) from accumulate(
$m0 := MonitoredComponent( name== "transcodingNode" && metric== "transcondingRate" ) over window:time(1m)from entry-point "MonitoringStream" ,
average( $m0.getValue() ) ) and
$tot1 := java.lang.Double( $tot1 >=3 ) from accumulate(
$m1 := MonitoredComponent( name== "transcodingNode" && metric== "queueSize" ) over window:time(1m)from entry-point "MonitoringStream" ,
average( $m1.getValue() ) ) )
then
insertLogical( new Action("pilotTranscodingService","transcodingNode",RuleActionType.COMPONENT_LIFECYCLE_MANAGEMENT,"2","infrastracture-start"));
end