Update api swagger docs to reflect application/yaml support 88/95788/2
authorChenfei Gao <cgao@research.att.com>
Tue, 17 Sep 2019 02:35:47 +0000 (22:35 -0400)
committerPamela Dragosh <pdragosh@research.att.com>
Tue, 15 Oct 2019 16:08:56 +0000 (16:08 +0000)
Issue-ID: POLICY-2102
Change-Id: I46c9146d7c35edd1dfdc75b1efc82e89a1b726ef
Signed-off-by: Chenfei Gao <cgao@research.att.com>
docs/api/api.rst
docs/api/swagger/guard-policy-api.json
docs/api/swagger/healthcheck-api.json
docs/api/swagger/operational-policy-api.json
docs/api/swagger/policy-api.json
docs/api/swagger/policytype-api.json
docs/api/swagger/statistics-api.json

index fc0f106..ecaf415 100644 (file)
@@ -125,7 +125,7 @@ x-onap-requestid is used to track REST transactions for logging purpose, as desc
 .. swaggerv2doc:: swagger/policy-api.json
 
 It is worth noting that in POST policy API, client needs to provide a policy payload encoded in well-formed TOSCA Service Template, and 
-in the JSON payload, "type" field value should strictly match the policy type name embedded in the API path (case sensitive). 
+in the JSON/YAML payload, "type" field value should strictly match the policy type name embedded in the API path (case sensitive). 
 Otherwise, it will complain the policy type does not exist. Please check out the sample policies in above policy table.
 
 .. swaggerv2doc:: swagger/guard-policy-api.json
index 7bb6c99..87b4508 100644 (file)
@@ -12,7 +12,7 @@
         "summary" : "Retrieve the latest version of a particular guard policy",
         "description" : "Returns the latest version of the specified guard policy",
         "operationId" : "getLatestVersionOfGuardPolicy",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyId",
           "in" : "path",
@@ -84,7 +84,7 @@
         "summary" : "Retrieve deployed versions of a particular guard policy in pdp groups",
         "description" : "Returns deployed versions of a specified guard policy in pdp groups",
         "operationId" : "getDeployedVersionsOfGuardPolicy",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyId",
           "in" : "path",
         "summary" : "Retrieve one version of a particular guard policy",
         "description" : "Returns a particular version of a specified guard policy",
         "operationId" : "getSpecificVersionOfGuardPolicy",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyId",
           "in" : "path",
         "summary" : "Delete a particular version of a guard policy",
         "description" : "Delete a particular version of a guard policy. It must follow one rule. Rule: the version that has been deployed in PDP group(s) cannot be deleted",
         "operationId" : "deleteSpecificVersionOfGuardPolicy",
-        "consumes" : [ "application/json" ],
-        "produces" : [ "application/json" ],
+        "consumes" : [ "application/json", "application/yaml" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyId",
           "in" : "path",
         "summary" : "Create a new guard policy",
         "description" : "Create a new guard policy. Client should provide entity body of the new guard policy",
         "operationId" : "createGuardPolicy",
-        "consumes" : [ "application/json" ],
-        "produces" : [ "application/json" ],
+        "consumes" : [ "application/json", "application/yaml" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "X-ONAP-RequestID",
           "in" : "header",
index 6605ee5..fefd595 100644 (file)
@@ -12,7 +12,7 @@
         "summary" : "Perform a system healthcheck",
         "description" : "Returns healthy status of the Policy API component",
         "operationId" : "getHealthCheck",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [{
           "name" : "X-ONAP-RequestID",
           "in" : "header",
index 0306f73..63d36df 100644 (file)
@@ -12,7 +12,7 @@
         "summary" : "Retrieve the latest version of a particular operational policy",
         "description" : "Returns the latest version of the specified operational policy",
         "operationId" : "getLatestVersionOfOperationalPolicy",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyId",
           "in" : "path",
@@ -81,7 +81,7 @@
         "summary" : "Retrieve deployed versions of a particular operational policy in pdp groups",
         "description" : "Returns deployed versions of a specified operational policy in pdp groups",
         "operationId" : "getDeployedVersionsOfOperationalPolicy",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyId",
           "in" : "path",
         "summary" : "Retrieve one version of a particular operational policy",
         "description" : "Returns a particular version of a specified operational policy",
         "operationId" : "getSpecificVersionOfOperationalPolicy",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyId",
           "in" : "path",
         "summary" : "Delete a particular version of a specified operational policy",
         "description" : "Delete a particular version of an operational policy. It must follow one rule. Rule: the version that has been deployed in PDP group(s) cannot be deleted",
         "operationId" : "deleteSpecificVersionOfOperationalPolicy",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyId",
           "in" : "path",
         "summary" : "Create a new operational policy",
         "description" : "Create a new operational policy. Client should provide entity body of the new operational policy",
         "operationId" : "createOperationalPolicy",
-        "consumes" : [ "application/json" ],
-        "produces" : [ "application/json" ],
+        "consumes" : [ "application/json", "application/yaml" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "X-ONAP-RequestID",
           "in" : "header",
index 17c5d50..c95c960 100644 (file)
@@ -12,7 +12,7 @@
         "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 the specified policy type version",
         "operationId" : "getAllPolicies",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyTypeId",
           "in" : "path",
@@ -85,8 +85,8 @@
         "summary" : "Create a new policy for a policy type version",
         "description" : "Create a new policy for a policy type. Client should provide TOSCA body of the new policy",
         "operationId" : "createPolicy",
-        "consumes" : [ "application/json" ],
-        "produces" : [ "application/json" ],
+        "consumes" : [ "application/json", "application/yaml" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyTypeId",
           "in" : "path",
         "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",
         "operationId" : "getAllVersionsOfPolicy",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyTypeId",
           "in" : "path",
         "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 specified policy type version",
         "operationId" : "getSpecificVersionOfPolicy",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyTypeId",
           "in" : "path",
         "summary" : "Delete a particular version of a policy",
         "description" : "Delete a particular version of a policy. It must follow one rule. Rule: the version that has been deployed in PDP group(s) cannot be deleted",
         "operationId" : "deleteSpecificVersionOfPolicy",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyTypeId",
           "in" : "path",
         "summary" : "Retrieve the latest version of a particular policy",
         "description" : "Returns the latest version of specified policy",
         "operationId" : "getLatestVersionOfPolicy",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyTypeId",
           "in" : "path",
         "summary" : "Retrieve deployed versions of a particular policy in pdp groups",
         "description" : "Returns deployed versions of specified policy in pdp groups",
         "operationId" : "getDeployedVersionsOfPolicy",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyTypeId",
           "in" : "path",
index 2215164..5f2de04 100644 (file)
@@ -12,7 +12,7 @@
         "summary" : "Retrieve existing policy types",
         "description" : "Returns a list of existing policy types stored in Policy Framework",
         "operationId" : "getAllPolicyTypes",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "X-ONAP-RequestID",
           "in" : "header",
@@ -70,8 +70,8 @@
         "summary" : "Create a new policy type",
         "description" : "Create a new policy type. Client should provide TOSCA body of the new policy type",
         "operationId" : "createPolicyType",
-        "consumes" : [ "application/json" ],
-        "produces" : [ "application/json" ],
+        "consumes" : [ "application/json", "application/yaml" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "in" : "body",
           "name" : "body",
         "summary" : "Retrieve all available versions of a policy type",
         "description" : "Returns a list of all available versions for the specified policy type",
         "operationId" : "getAllVersionsOfPolicyType",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyTypeId",
           "in" : "path",
         "summary" : "Retrieve one particular version of a policy type",
         "description" : "Returns a particular version for the specified policy type",
         "operationId" : "getSpecificVersionOfPolicyType",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyTypeId",
           "in" : "path",
         "summary" : "Delete one version of a policy type",
         "description" : "Delete one version of a policy type. It must follow two rules. 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 parameterizing TOSCA policies must be deleted first.",
         "operationId" : "deleteSpecificVersionOfPolicyType",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyTypeId",
           "in" : "path",
         "summary" : "Retrieve latest version of a policy type",
         "description" : "Returns latest version for the specified policy type",
         "operationId" : "getLatestVersionOfPolicyType",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "policyTypeId",
           "in" : "path",
index a55f03c..f41900c 100644 (file)
@@ -12,7 +12,7 @@
         "summary" : "Retrieve current statistics",
         "description" : "Returns current statistics including the counters of API invocation",
         "operationId" : "getStatistics",
-        "produces" : [ "application/json" ],
+        "produces" : [ "application/json", "application/yaml" ],
         "parameters" : [ {
           "name" : "X-ONAP-RequestID",
           "in" : "header",