Doc updates for PAP Deployment API changes
Change-Id: I23b8778c599a0fd3cc659f677018d866a68a2489
Issue-ID: POLICY-2526
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
diff --git a/docs/pap/pap.rst b/docs/pap/pap.rst
index 288a72a..5329d8f 100644
--- a/docs/pap/pap.rst
+++ b/docs/pap/pap.rst
@@ -282,6 +282,11 @@
.. literalinclude:: request/deployment-batch-pap-req.json
:language: json
+Here is a sample response:
+
+.. literalinclude:: response/deployment-pap-resp.json
+ :language: json
+
:download:`Download Deploy PAP API Swagger <swagger/policy-deploy-pap.json>`
.. swaggerv2doc:: swagger/policy-deploy-pap.json
@@ -301,6 +306,11 @@
.. literalinclude:: request/policy-deploy-pap-req.json
:language: json
+Here is a sample response:
+
+.. literalinclude:: response/deployment-pap-resp.json
+ :language: json
+
:download:`Download Undeploy PAP API Swagger <swagger/policy-undeploy-pap.json>`
.. swaggerv2doc:: swagger/policy-undeploy-pap.json
@@ -314,6 +324,26 @@
.. note::
Due to current limitations, a fully qualified policy version must always be specified.
+Here is a sample response:
+
+.. literalinclude:: response/deployment-pap-resp.json
+ :language: json
+
+:download:`Download Policy Status PAP API Swagger <swagger/policy-status-pap.json>`
+
+.. swaggerv2doc:: swagger/policy-status-pap.json
+
+This operation allows the status of all policies that are deployed or undeployed to be listed together.
+The result can be filtered based on pdp group name, policy name & version.
+
+.. note::
+ When a policy is successfully undeployed, it will no longer appear in the policy status response.
+
+Here is a sample response:
+
+.. literalinclude:: response/policy-status-pap-resp.json
+ :language: json
+
:download:`Download Deployed Policy PAP API Swagger <swagger/deployed-policy-pap.json>`
.. swaggerv2doc:: swagger/deployed-policy-pap.json
diff --git a/docs/pap/response/deployment-pap-resp.json b/docs/pap/response/deployment-pap-resp.json
new file mode 100644
index 0000000..59b7d22
--- /dev/null
+++ b/docs/pap/response/deployment-pap-resp.json
@@ -0,0 +1,4 @@
+{
+ "message": "Use the policy status url to fetch the latest status. Kindly note that when a policy is successfully undeployed, it will no longer appear in policy status response.",
+ "uri": "/policy/pap/v1/policies/status"
+}
diff --git a/docs/pap/response/policy-status-pap-resp.json b/docs/pap/response/policy-status-pap-resp.json
new file mode 100644
index 0000000..97c3b59
--- /dev/null
+++ b/docs/pap/response/policy-status-pap-resp.json
@@ -0,0 +1,32 @@
+[
+ {
+ "pdpGroup": "defaultGroup",
+ "pdpType": "apex",
+ "pdpId": "policy-apex-pdp-0",
+ "policy": {
+ "name": "onap.policies.apex.Controlloop",
+ "version": "1.0.0"
+ },
+ "policyType": {
+ "name": "onap.policies.native.Apex",
+ "version": "1.0.0"
+ },
+ "deploy": true,
+ "state": "SUCCESS"
+ },
+ {
+ "pdpGroup": "defaultGroup",
+ "pdpType": "drools",
+ "pdpId": "policy-drools-pdp-0",
+ "policy": {
+ "name": "OPERATIONAL_vFW_CDS_Service_v2_0_Drools_1_0_0_6SN",
+ "version": "1.0.0"
+ },
+ "policyType": {
+ "name": "onap.policies.controlloop.operational.common.Drools",
+ "version": "1.0.0"
+ },
+ "deploy": true,
+ "state": "SUCCESS"
+ }
+]
diff --git a/docs/pap/swagger/deployments-batch-pap.json b/docs/pap/swagger/deployments-batch-pap.json
index 29d9694..768dae9 100644
--- a/docs/pap/swagger/deployments-batch-pap.json
+++ b/docs/pap/swagger/deployments-batch-pap.json
@@ -32,8 +32,8 @@
}
} ],
"responses" : {
- "200" : {
- "description" : "successful operation",
+ "202" : {
+ "description" : "operation accepted",
"headers" : {
"X-MinorVersion" : {
"type" : "string",
@@ -147,4 +147,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/docs/pap/swagger/policy-deploy-pap.json b/docs/pap/swagger/policy-deploy-pap.json
index 0fc1a9e..d003af8 100644
--- a/docs/pap/swagger/policy-deploy-pap.json
+++ b/docs/pap/swagger/policy-deploy-pap.json
@@ -32,8 +32,8 @@
}
} ],
"responses" : {
- "200" : {
- "description" : "successful operation",
+ "202" : {
+ "description" : "operation accepted",
"headers" : {
"X-MinorVersion" : {
"type" : "string",
diff --git a/docs/pap/swagger/policy-status-pap.json b/docs/pap/swagger/policy-status-pap.json
new file mode 100644
index 0000000..b7e4ae6
--- /dev/null
+++ b/docs/pap/swagger/policy-status-pap.json
@@ -0,0 +1,402 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "title": "The APIs listed here are used to fetch status of policies in PdpGroups",
+ "version": "v1"
+ },
+ "basePath": "/",
+ "tags": [
+ {
+ "name": "Pdp Policy Status"
+ }
+ ],
+ "schemes": [
+ "http",
+ "https"
+ ],
+ "consumes": [
+ "application/json",
+ "application/yaml"
+ ],
+ "produces": [
+ "application/json",
+ "application/yaml"
+ ],
+ "paths": {
+ "/policy/pap/v1/policies/status": {
+ "get": {
+ "tags": [
+ "Status of policies in all PdpGroups"
+ ],
+ "summary": "Queries status of policies in all PdpGroups",
+ "description": "Queries status of policies in all PdpGroups, returning status of policies in all the PDPs belonging to all PdpGroups",
+ "operationId": "queryAllPolicies",
+ "produces": [
+ "application/json",
+ "application/yaml"
+ ],
+ "parameters": [
+ {
+ "name": "X-ONAP-RequestID",
+ "in": "header",
+ "description": "RequestID for http transaction",
+ "required": false,
+ "type": "string",
+ "format": "uuid"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "headers": {
+ "X-MinorVersion": {
+ "type": "string",
+ "description": "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
+ },
+ "X-PatchVersion": {
+ "type": "string",
+ "description": "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
+ },
+ "X-LatestVersion": {
+ "type": "string",
+ "description": "Used only to communicate an API's latest version"
+ },
+ "X-ONAP-RequestID": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Used to track REST transactions for logging purpose"
+ }
+ },
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PdpPolicyStatus"
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication Error"
+ },
+ "403": {
+ "description": "Authorization Error"
+ },
+ "500": {
+ "description": "Internal Server Error"
+ }
+ },
+ "security": [
+ {
+ "basicAuth": []
+ }
+ ],
+ "x-interface info": {
+ "api-version": "1.0.0",
+ "last-mod-release": "Honolulu"
+ }
+ }
+ },
+ "/policy/pap/v1/policies/status/{pdpGroupName}": {
+ "get": {
+ "tags": [
+ "Status of policies in a PdpGroup"
+ ],
+ "summary": "Queries status of policies in a specific PdpGroup",
+ "description": "Queries status of policies in a specific PdpGroup, returning status of policies in all the PDPs belonging to the PdpGroup",
+ "operationId": "queryAllPoliciesInPdpGroup",
+ "produces": [
+ "application/json",
+ "application/yaml"
+ ],
+ "parameters": [
+ {
+ "name": "pdpGroupName",
+ "in": "path",
+ "description": "Name of the PdpGroup",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "X-ONAP-RequestID",
+ "in": "header",
+ "description": "RequestID for http transaction",
+ "required": false,
+ "type": "string",
+ "format": "uuid"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "headers": {
+ "X-MinorVersion": {
+ "type": "string",
+ "description": "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
+ },
+ "X-PatchVersion": {
+ "type": "string",
+ "description": "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
+ },
+ "X-LatestVersion": {
+ "type": "string",
+ "description": "Used only to communicate an API's latest version"
+ },
+ "X-ONAP-RequestID": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Used to track REST transactions for logging purpose"
+ }
+ },
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PdpPolicyStatus"
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication Error"
+ },
+ "403": {
+ "description": "Authorization Error"
+ },
+ "500": {
+ "description": "Internal Server Error"
+ }
+ },
+ "security": [
+ {
+ "basicAuth": []
+ }
+ ],
+ "x-interface info": {
+ "api-version": "1.0.0",
+ "last-mod-release": "Honolulu"
+ }
+ }
+ },
+ "/policy/pap/v1/policies/status/{pdpGroupName}/{policyName}": {
+ "get": {
+ "tags": [
+ "Status of all versions of a policy in a PdpGroup"
+ ],
+ "summary": "Queries status of all versions of a specific policy in a specific PdpGroup",
+ "description": "Queries status of all versions of a specific policy in a specific PdpGroup, returning status of all versions of the policy in the PDPs belonging to the PdpGroup",
+ "operationId": "queryAllVersionPolicy",
+ "produces": [
+ "application/json",
+ "application/yaml"
+ ],
+ "parameters": [
+ {
+ "name": "pdpGroupName",
+ "in": "path",
+ "description": "Name of the PdpGroup",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "policyName",
+ "in": "path",
+ "description": "Name of the Policy",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "X-ONAP-RequestID",
+ "in": "header",
+ "description": "RequestID for http transaction",
+ "required": false,
+ "type": "string",
+ "format": "uuid"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "headers": {
+ "X-MinorVersion": {
+ "type": "string",
+ "description": "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
+ },
+ "X-PatchVersion": {
+ "type": "string",
+ "description": "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
+ },
+ "X-LatestVersion": {
+ "type": "string",
+ "description": "Used only to communicate an API's latest version"
+ },
+ "X-ONAP-RequestID": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Used to track REST transactions for logging purpose"
+ }
+ },
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PdpPolicyStatus"
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication Error"
+ },
+ "403": {
+ "description": "Authorization Error"
+ },
+ "500": {
+ "description": "Internal Server Error"
+ }
+ },
+ "security": [
+ {
+ "basicAuth": []
+ }
+ ],
+ "x-interface info": {
+ "api-version": "1.0.0",
+ "last-mod-release": "Honolulu"
+ }
+ }
+ },
+ "/policy/pap/v1/policies/status/{pdpGroupName}/{policyName}/{policyVersion}": {
+ "get": {
+ "tags": [
+ "Status of a version of a policy in a PdpGroup"
+ ],
+ "summary": "Queries status of a specific version of a specific policy in a specific PdpGroup",
+ "description": "Queries status of a specific version of a specific policy in a specific PdpGroup, returning status of the policy in the PDPs belonging to the PdpGroup",
+ "operationId": "querySpecificVersionPolicy",
+ "produces": [
+ "application/json",
+ "application/yaml"
+ ],
+ "parameters": [
+ {
+ "name": "pdpGroupName",
+ "in": "path",
+ "description": "Name of the PdpGroup",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "policyName",
+ "in": "path",
+ "description": "Name of the Policy",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "policyVersion",
+ "in": "path",
+ "description": "Version of the Policy",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "X-ONAP-RequestID",
+ "in": "header",
+ "description": "RequestID for http transaction",
+ "required": false,
+ "type": "string",
+ "format": "uuid"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "headers": {
+ "X-MinorVersion": {
+ "type": "string",
+ "description": "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
+ },
+ "X-PatchVersion": {
+ "type": "string",
+ "description": "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
+ },
+ "X-LatestVersion": {
+ "type": "string",
+ "description": "Used only to communicate an API's latest version"
+ },
+ "X-ONAP-RequestID": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Used to track REST transactions for logging purpose"
+ }
+ },
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PdpPolicyStatus"
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication Error"
+ },
+ "403": {
+ "description": "Authorization Error"
+ },
+ "500": {
+ "description": "Internal Server Error"
+ }
+ },
+ "security": [
+ {
+ "basicAuth": []
+ }
+ ],
+ "x-interface info": {
+ "api-version": "1.0.0",
+ "last-mod-release": "Honolulu"
+ }
+ }
+ },
+ },
+ "securityDefinitions": {
+ "basicAuth": {
+ "description": "",
+ "type": "basic"
+ }
+ },
+ "definitions": {
+ "PdpPolicyStatus": {
+ "type": "object",
+ "properties": {
+ "pdpGroup": {
+ "type": "string"
+ },
+ "pdpType": {
+ "type": "string"
+ },
+ "pdpId": {
+ "type": "string"
+ },
+ "policy": {
+ "$ref": "#/definitions/ToscaConceptIdentifier"
+ },
+ "policyType": {
+ "$ref": "#/definitions/ToscaConceptIdentifier"
+ },
+ "deploy": {
+ "type": "boolean"
+ },
+ "state": {
+ "type": "string"
+ }
+ }
+ },
+ "ToscaConceptIdentifier": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string"
+ }
+ }
+ }
+ }
+}
diff --git a/docs/pap/swagger/policy-undeploy-pap.json b/docs/pap/swagger/policy-undeploy-pap.json
index 7ba6614..de79366 100644
--- a/docs/pap/swagger/policy-undeploy-pap.json
+++ b/docs/pap/swagger/policy-undeploy-pap.json
@@ -30,8 +30,8 @@
"type" : "string"
} ],
"responses" : {
- "200" : {
- "description" : "successful operation",
+ "202" : {
+ "description" : "operation accepted",
"headers" : {
"X-MinorVersion" : {
"type" : "string",
@@ -102,8 +102,8 @@
"type" : "string"
} ],
"responses" : {
- "200" : {
- "description" : "successful operation",
+ "202" : {
+ "description" : "operation accepted",
"headers" : {
"X-MinorVersion" : {
"type" : "string",