-
Story
-
Resolution: Done
-
Medium
-
None
-
None
As a ONAP developer, I would like to create a simplified REST API for creating policies.
The current API expects policy type id & policy type version to be part of the URI.
For example: to create policy we have to do this:
private Response createPolicy(final ToscaServiceTemplate toscaServiceTemplate) throws PolicyForwardingException
{ *final* String policyType = toscaServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).entrySet() .iterator().next().getValue().getType(); *final* String policyTypeVersion = toscaServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).entrySet() .iterator().next().getValue().getTypeVersion(); *return* invokeHttpClient(Entity._entity_(toscaServiceTemplate, MediaType.*_APPLICATION_JSON_*), "/policy/api/v1/policytypes/" + policyType + "/versions/" + policyTypeVersion + "/policies", "API"); }
Whereas the URI should be something simple like “policy/api/v1/policies” with a POST input body.
1.
|
Update api documentation to reflect the addition of new policy creation endpoint | Closed | cgao | |
2.
|
Update csit to reflect tha addition of new api endpoint | Closed | cgao | |
3.
|
Update S3P to reflect addition of new API endpoint | Closed | cgao |