...
Table of Contents | ||||
---|---|---|---|---|
|
...
Intentions and requirements
...
- Design of the new API on PAP/PDP is in progress
- Only a subset of the new PAP/PDP API is designed and is in the draft status.
- The new API changes the following aspects (everything)
- url
- request structures are totally redesigned. New field names, new placements, many fields are removed, no obvious mapping between the old and the new fields.
- response structures are totally redesigned. New field names, new placements, many fields are removed, no obvious mapping between the old and the new fields.
- the structure of the policy config that contains the actual policy is changed to match the policy-model.
The impact to DCAE-Controller is MAJOR and the PDP API design is far from being usable
...
replacement of (POST /getConfig)
with the new Policy Decision API - Getting Policy Decisions (POST /decision/v1/) for a single policy_id
The current version of /decision/v1/
only provides a single policy request-response for the single policy_id
(= onap.vfirewall.tca):
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
http:{url}:{port}/decision/v1/ POST Content-Type: application/yaml Accepts: application/json subject: DCAE action: configure resource: policy_id: onap.vfirewall.tca # # Return Output # HTTP/1.1 200 OK Content-Type: application/json { "onap.vfirewall.tca": { "type": "onap.policy.monitoring.cdap.tca.hi.lo.app", "properties": { "domain": "measurementsForVfScaling",... }}} |
Getting multiple policies and varying number of policies with the new PDP API - is not provided
This feature is heavily used by and needed to DCAE-Controller because it has to go from multiple policies in PDP to multiple policies attached to multiple components in DCAE in as few http queries as possible
...
Comparison with the POST /getConfig
policy_id
is the new field in PDP API that was not used before. DCAE-Controller had to introduce thepolicy_id
term to identify the single policy regardless of its version. No complaints here- only a single string value is provided in the new PDP API for the
policy_id
- the old PDP API had a way to use the regular expression in the
policyName
field to request multiple policies at a time.- This feature of the regular expression matching is heavily used by DCAE-Controller to send a single or as few requests to PDP as possible when querying for the latest policies that are attached to the components in DCAE
- the old PDP API had a way to use the regular expression in the
- response contains a dictionary from
policy_id
value to the config structure that contains the actual policy instance. No header information is provided in the response that affects- it is not obvious from looking at the response to explain what is the key and what is the value in the dictionary.
- it is not clear what the response would look like if no policy is found for the policy_id.
- Preferably we would need to avoid relying on the absence of data in response to identify the absence of the record since the absence might be caused by other reasons as well like database not available at all or any other error conditions, etc.
- no
policyVersion
is provided in response header for thepolicy_id
.- The
policyVersion
is used by many places in DCAE-Controller to figure out- whether the policy is changed in PDP
- whether the wave of changes has to be propagated through the DCAE-Controller,
- whether the policy record has to be updated in consul-kv
- whether the component needs to be push-notified about the update.
- whether the policy is changed in PDP
- Not having the
policyVersion
in the response makes it unclear how
- The
- there are no fields that were provided before that were used for matching of the policy to the policy-filter(s) optionally attached to the DCAE component. The policy-filter currently is a copy-paste of the /getConfig request.
- Therefore using the new PDP API as it is design at the moment will break all the behavior of DCAE-Controller and the components
...
It seems that all the chain of platform components (policy-handler, deployment-handler, policy-plugin, onap-dcae-dcaepolicy-lib) in DCAE-Controller will have to be heavily changed to accommodate the new node types and use the new PDP API along with the old PDP API.
Besides, each service component will have to be changed as well to consume the new policy structures.
...
Open issues
- It is not clear on whether and how the web-socket API is changing
- the web-socket API contains the policyName, policyVersion, as well as the matchingConditions used for matching to the policy-filters
- it is not clear how the policy-update notification can be matched to the new PDP API
...