Adding Server stubs for policy-api
[policy/api.git] / main / src / main / resources / openapi / openapi.yaml
index 22e256f..5ab7e79 100644 (file)
@@ -1,23 +1,41 @@
 openapi: 3.0.1
 info:
-  title: Api Documentation
-  description: Api Documentation
-  termsOfService: urn:tos
-  contact: {}
+  title: Policy Framework Lifecycle API
+  description: The Policy Fraemwork API allows the lifecycle of policy types and policyes to be managed
+  contact:
+    name: ONAP Support
+    url: https://lists.onap.org/g/onap-discuss
+    email: onap-discuss@lists.onap.org
   license:
     name: Apache 2.0
     url: http://www.apache.org/licenses/LICENSE-2.0
-  version: "1.0"
+  version: '1.0'
+externalDocs:
+  description: Policy Framework Documentation
+  url: https://docs.onap.org/projects/onap-policy-parent/en/latest
 servers:
 - url: //localhost:30440/
 tags:
-- name: policy-api-rest-controller
-  description: Api Rest Controller
+- name: "Tosca Node Template Design"
+  description:
+    Tosca Node template Design API is publicly exposed for clients to Create/Read/Update/Delete
+    node templates which can be recognized and executable by incorporated policy engines. It is an
+    independent component running rest service that takes all node templates design API calls
+    from clients and then assign them to different API working functions.
+- name: "Policy Design"
+  description:
+    Policy Design API is publicly exposed for clients to Create/Read/Update/Delete
+    policy types, policy type implementation and policies which can be recognized
+    and executable by incorporated policy engines. It is an
+    independent component running rest service that takes all policy design API calls
+    from clients and then assign them to different API working functions. Besides
+    that, API is also exposed for clients to retrieve healthcheck status of this API
+    rest service and the statistics report including the counters of API invocation.
 paths:
-  /policy/api/v1/healthcheck:
+  /healthcheck:
     get:
       tags:
-      - HealthCheck
+      - "Policy Design"
       summary: Perform a system healthcheck
       description: Returns healthy status of the Policy API component
       operationId: getHealthCheck
@@ -126,10 +144,10 @@ paths:
       x-interface info:
         api-version: 1.0.0
         last-mod-release: Dublin
-  /policy/api/v1/nodetemplates:
+  /nodetemplates:
     get:
       tags:
-      - NodeTemplates
+      - "Tosca Node Template Design"
       summary: Retrieve all the available tosca node templates
       description: Returns all the node templates from the service template
       operationId: getAllNodeTemplates
@@ -245,7 +263,7 @@ paths:
         last-mod-release: Jakarta
     put:
       tags:
-      - NodeTemplates
+      - "Tosca Node Template Design"
       summary: Updates one or more new node templates
       description: Client should provide TOSCA body of the updated node templates in an instance of
         [ToscaServiceTemplate](https://github.com/onap/policy-models/blob/master/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaServiceTemplate.java)
@@ -262,14 +280,10 @@ paths:
         content:
           application/json:
             schema:
-              type: array
-              items:
-                $ref: '#/components/schemas/ToscaNodeTemplate'
+              $ref: '#/components/schemas/ToscaServiceTemplate'
           application/yaml:
             schema:
-              type: array
-              items:
-                $ref: '#/components/schemas/ToscaNodeTemplate'
+              $ref: '#/components/schemas/ToscaServiceTemplate'
         required: true
       responses:
         200:
@@ -430,7 +444,7 @@ paths:
       x-codegen-request-body-name: body
     post:
       tags:
-      - NodeTemplates
+      - "Tosca Node Template Design"
       summary: Create one or more new node templates
       description: Client should provide TOSCA body of the new node templates
       operationId: createToscaNodeTemplates
@@ -609,10 +623,10 @@ paths:
         api-version: 1.0.0
         last-mod-release: Jakarta
       x-codegen-request-body-name: body
-  /policy/api/v1/nodetemplates/{name}/versions/{version}:
+  /nodetemplates/{name}/versions/{version}:
     get:
       tags:
-      - NodeTemplates
+      - "Tosca Node Template Design"
       summary: Retrieve one version of a tosca node template
       description: Returns a particular version of a node template
       operationId: getSpecificVersionOfNodeTemplate
@@ -739,7 +753,7 @@ paths:
         last-mod-release: Jakarta
     delete:
       tags:
-      - NodeTemplates
+      - "Tosca Node Template Design"
       summary: Updates one or more new node templates
       description: Client should provide TOSCA body of the updated node templates
       operationId: deleteToscaNodeTemplates
@@ -911,10 +925,10 @@ paths:
       x-interface info:
         api-version: 1.0.0
         last-mod-release: Jakarta
-  /policy/api/v1/policies:
+  /policies:
     get:
       tags:
-      - PolicyInstances
+      - "Policy Design"
       summary: Retrieve all versions of available policies
       description: Returns all version of available policies
       operationId: getPolicies
@@ -924,11 +938,7 @@ paths:
         description: Fetch mode for policies, BARE for bare  policies (default), REFERENCED
           for fully referenced policies
         schema:
-          type: string
-          default: BARE
-          enum:
-          - BARE
-          - REFERENCED
+          $ref: '#/components/schemas/PolicyFetchMode'
       - name: X-ONAP-RequestID
         in: header
         description: RequestID for http transaction
@@ -1035,7 +1045,7 @@ paths:
         last-mod-release: Guilin
     post:
       tags:
-      - PolicyInstances
+      - "Policy Design"
       summary: Create one or more new policies
       description: Client should provide TOSCA body of the new polic(ies)
       operationId: createPolicies
@@ -1214,10 +1224,10 @@ paths:
         api-version: 1.0.0
         last-mod-release: El Alto
       x-codegen-request-body-name: body
-  /policy/api/v1/policies/{policyId}/versions/{policyVersion}:
+  /policies/{policyId}/versions/{policyVersion}:
     get:
       tags:
-      - PolicyInstances
+      - "Policy Design"
       summary: Retrieve specific version of a specified policy
       description: Returns a particular version of specified policy
       operationId: getSpecificPolicy
@@ -1227,11 +1237,7 @@ paths:
         description: Fetch mode for policies, BARE for bare  policies (default), REFERENCED
           for fully referenced policies
         schema:
-          type: string
-          default: BARE
-          enum:
-          - BARE
-          - REFERENCED
+          $ref: '#/components/schemas/PolicyFetchMode'
       - name: policyId
         in: path
         description: Name of policy
@@ -1350,7 +1356,7 @@ paths:
         last-mod-release: Guilin
     delete:
       tags:
-      - PolicyInstances
+      - "Policy Design"
       summary: Delete a particular version of a policy
       description: 'Rule: the version that has been deployed in PDP group(s) cannot
         be deleted'
@@ -1506,10 +1512,10 @@ paths:
       x-interface info:
         api-version: 1.0.0
         last-mod-release: Guilin
-  /policy/api/v1/policytypes:
+  /policytypes:
     get:
       tags:
-      - PolicyTypes
+      - "Policy Design"
       summary: Retrieve existing policy types
       description: Returns a list of existing policy types stored in Policy Framework
       operationId: getAllPolicyTypes
@@ -1620,7 +1626,7 @@ paths:
         last-mod-release: Dublin
     post:
       tags:
-      - PolicyTypes
+      - "Policy Design"
       summary: Create a new policy type
       description: Client should provide TOSCA body of the new policy type
       operationId: createPolicyType
@@ -1799,10 +1805,10 @@ paths:
         api-version: 1.0.0
         last-mod-release: Dublin
       x-codegen-request-body-name: body
-  /policy/api/v1/policytypes/{policyTypeId}:
+  /policytypes/{policyTypeId}:
     get:
       tags:
-      - PolicyTypes
+      - "Policy Design"
       summary: Retrieve all available versions of a policy type
       description: Returns a list of all available versions for the specified policy
         type
@@ -1918,10 +1924,10 @@ paths:
       x-interface info:
         api-version: 1.0.0
         last-mod-release: Dublin
-  /policy/api/v1/policytypes/{policyTypeId}/versions/latest:
+  /policytypes/{policyTypeId}/versions/latest:
     get:
       tags:
-      - PolicyTypes
+      - "Policy Design"
       summary: Retrieve latest version of a policy type
       description: Returns latest version for the specified policy type
       operationId: getLatestVersionOfPolicyType
@@ -2036,10 +2042,10 @@ paths:
       x-interface info:
         api-version: 1.0.0
         last-mod-release: Dublin
-  /policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies:
+  /policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies:
     get:
       tags:
-      - PolicyInstances
+      - "Policy Design"
       summary: Retrieve all versions of a policy created for a particular policy type
         version
       description: Returns a list of all versions of specified policy created for
@@ -2051,11 +2057,7 @@ paths:
         description: Fetch mode for policies, BARE for bare policies (default), REFERENCED
           for fully referenced policies
         schema:
-          type: string
-          default: BARE
-          enum:
-          - BARE
-          - REFERENCED
+          $ref: '#/components/schemas/PolicyFetchMode'
       - name: policyTypeId
         in: path
         description: ID of policy type
@@ -2174,7 +2176,7 @@ paths:
         last-mod-release: Dublin
     post:
       tags:
-      - PolicyInstances
+      - "Policy Design"
       summary: Create a new policy for a policy type version
       description: Client should provide TOSCA body of the new policy
       operationId: createPolicy
@@ -2365,10 +2367,10 @@ paths:
         api-version: 1.0.0
         last-mod-release: Dublin
       x-codegen-request-body-name: body
-  /policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}:
+  /policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}:
     get:
       tags:
-      - PolicyInstances
+      - "Policy Design"
       summary: Retrieve all version details of a policy created for a particular policy
         type version
       description: Returns a list of all version details of the specified policy
@@ -2379,11 +2381,7 @@ paths:
         description: Fetch mode for policies, BARE for bare policies (default), REFERENCED
           for fully referenced policies
         schema:
-          type: string
-          default: BARE
-          enum:
-          - BARE
-          - REFERENCED
+          $ref: '#/components/schemas/PolicyFetchMode'
       - name: policyId
         in: path
         description: ID of policy
@@ -2506,10 +2504,10 @@ paths:
       x-interface info:
         api-version: 1.0.0
         last-mod-release: Dublin
-  /policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/latest:
+  /policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/latest:
     get:
       tags:
-      - PolicyInstances
+      - "Policy Design"
       summary: Retrieve the latest version of a particular policy
       description: Returns the latest version of specified policy
       operationId: getLatestVersionOfPolicy
@@ -2519,11 +2517,7 @@ paths:
         description: Fetch mode for policies, TERSE for bare policies (default), REFERENCED
           for fully referenced policies
         schema:
-          type: string
-          default: BARE
-          enum:
-          - BARE
-          - REFERENCED
+          $ref: '#/components/schemas/PolicyFetchMode'
       - name: policyId
         in: path
         description: ID of policy
@@ -2646,10 +2640,10 @@ paths:
       x-interface info:
         api-version: 1.0.0
         last-mod-release: Dublin
-  /policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/{policyVersion}:
+  /policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/{policyVersion}:
     get:
       tags:
-      - PolicyInstances
+      - "Policy Design"
       summary: Retrieve one version of a policy created for a particular policy type
         version
       description: Returns a particular version of specified policy created for the
@@ -2661,11 +2655,7 @@ paths:
         description: Fetch mode for policies, BARE for bare policies  (default), REFERENCED
           for fully referenced policies
         schema:
-          type: string
-          default: BARE
-          enum:
-          - BARE
-          - REFERENCED
+          $ref: '#/components/schemas/PolicyFetchMode'
       - name: policyId
         in: path
         description: ID of policy
@@ -2796,18 +2786,12 @@ paths:
         last-mod-release: Dublin
     delete:
       tags:
-      - PolicyInstances
+      - "Policy Design"
       summary: Delete a particular version of a policy
       description: 'Rule: the version that has been deployed in PDP group(s) cannot
         be deleted'
       operationId: deleteSpecificVersionOfPolicy
       parameters:
-      - name: policyId
-        in: path
-        description: ID of policy
-        required: true
-        schema:
-          type: string
       - name: policyTypeId
         in: path
         description: PolicyType ID
@@ -2820,6 +2804,12 @@ paths:
         required: true
         schema:
           type: string
+      - name: policyId
+        in: path
+        description: ID of policy
+        required: true
+        schema:
+          type: string
       - name: policyVersion
         in: path
         description: Version of policy
@@ -2964,10 +2954,10 @@ paths:
       x-interface info:
         api-version: 1.0.0
         last-mod-release: Dublin
-  /policy/api/v1/policytypes/{policyTypeId}/versions/{versionId}:
+  /policytypes/{policyTypeId}/versions/{versionId}:
     get:
       tags:
-      - PolicyTypes
+      - "Policy Design"
       summary: Retrieve one particular version of a policy type
       description: Returns a particular version for the specified policy type
       operationId: getSpecificVersionOfPolicyType
@@ -3090,7 +3080,7 @@ paths:
         last-mod-release: Dublin
     delete:
       tags:
-      - PolicyTypes
+      - "Policy Design"
       summary: Delete one version of a policy type
       description: 'Rule 1: pre-defined policy types cannot be deleted;Rule 2: policy
         types that are in use (parameterized by a TOSCA policy) cannot be deleted.The
@@ -3247,10 +3237,10 @@ paths:
       x-interface info:
         api-version: 1.0.0
         last-mod-release: Dublin
-  /policy/api/v1/statistics:
+  /statistics:
     get:
       tags:
-      - Statistics
+      - "Policy Design"
       summary: Retrieve current statistics
       description: Returns current statistics including the counters of API invocation
       operationId: getStatistics
@@ -3377,3 +3367,6 @@ components:
     StatisticsReport:
       title: StatisticsReport
       type: object
+    PolicyFetchMode:
+      title: PolicyFetchMode
+      type: object
\ No newline at end of file