summaryrefslogtreecommitdiffstats
path: root/docs/api/api.rst
diff options
context:
space:
mode:
authorrameshiyer27 <ramesh.murugan.iyer@est.tech>2022-03-24 22:36:01 +0000
committerrameshiyer27 <ramesh.murugan.iyer@est.tech>2022-03-25 14:12:29 +0000
commitffd27ead12ee81929bfdd7c3d94ad2571c6aa5d0 (patch)
tree570f20c8ae5d1b0323a0755da00b40a21bb4067b /docs/api/api.rst
parent04a06dc1f8e393fe4c3dcde88c6d184cc3cd743f (diff)
Add documentation for toscaNodeTemplate apis in onap doc
Issue-ID: POLICY-3934 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: I62338fd2306c601e758a84a090411af114382dd4
Diffstat (limited to 'docs/api/api.rst')
-rw-r--r--docs/api/api.rst30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/api/api.rst b/docs/api/api.rst
index 8b0ae3e8..5aa38853 100644
--- a/docs/api/api.rst
+++ b/docs/api/api.rst
@@ -181,6 +181,7 @@ Global API Table
"Statistics API", ":download:`link <swagger/statistics-api.json>`"
"Tosca Policy Type API", ":download:`link <swagger/policytype-api.json>`"
"Tosca Policy API", ":download:`link <swagger/policy-api.json>`"
+ "Tosca NodeTemplate API", ":download:`link <swagger/nodetemplates-api.json>`"
API Swagger
-----------
@@ -217,6 +218,35 @@ x-onap-requestid is used to track REST transactions for logging purpose, as desc
.. swaggerv2doc:: swagger/policy-api.json
+
+Creating MetadataSet for policy
+--------------------------------
+
+The policy type implementation in tosca policy can be independently persisted to the database as metadataSets via the Tosca node template Apis .
+The policy type implementation data can be excluded from the policy properties section of the tosca policy and the user can specify only the "metadataSetName" and "metadataSetVersion"
+fields under the policy "metadata" section to map a specific policy type implementation to the policy during the policy creation.
+
+The following sample tosca service template comprises a list of tosca node templates each containing a policy type implementation data in the form of metadataSet that can be persisted to the database independently using the policy node template Api.
+
+.. csv-table::
+ :header: "Tosca node template", "Payload"
+ :widths: 15,10
+
+ "sample.nodetemplates.metadatasets", `nodetemplates.metadatasets.input.tosca.yaml <https://github.com/onap/policy-models/blob/master/models-examples/src/main/resources/nodetemplates/nodetemplates.metadatasets.input.tosca.yaml>`_ `nodetemplates.metadatasets.input.tosca.json <https://github.com/onap/policy-models/blob/master/models-examples/src/main/resources/nodetemplates/nodetemplates.metadatasets.input.tosca.json>`_
+
+
+The following sample tosca policy shows the policy metadata section that maps to one of the metadataSets stored in the database prior to the policy creation.
+
+.. csv-table::
+ :header: "Tosca policy", "Payload"
+ :widths: 15,10
+
+ "apex.decisionmaker.policy", `apex.policy.decisionmaker.input.tosca.yaml <https://github.com/onap/policy-models/blob/master/models-examples/src/main/resources/policies/apex.policy.decisionmaker.input.tosca.yaml>`_
+
+The following node template Apis are introduced to handle the policy metadataSets as independent entities that can be later mapped to a tosca policy during policy creation.
+
+.. swaggerv2doc:: swagger/nodetemplates-api.json
+
When making a POST policy API call, the client must not only provide well-formed JSON/YAML,
but also must conform to the TOSCA specification. For example. the "type" field for a TOSCA
policy should strictly match the policy type name it derives.