API S3P documentation
[policy/parent.git] / docs / pap / pap.rst
index b2c98ef..f46d1c7 100644 (file)
@@ -117,8 +117,10 @@ PAP supports the operations listed in the following table, via its REST API:
    "Deployment update", "Deploy/undeploy one or more policies in specified PdpGroups"
    "Deploy policy", "Deploys one or more policies to the PDPs"
    "Undeploy policy", "Undeploys a policy from the PDPs"
+   "Policy Status", "Queries the status of all policies"
    "Policy deployment status", "Queries the status of all deployed policies"
    "PDP statistics", "Queries the statistics of PDPs"
+   "Policy Audit", "Queries the audit records of policies"
 
 1.2 DMaaP API
 -------------
@@ -146,7 +148,7 @@ Here is a sample notification:
 2 PAP REST API Swagger
 ======================
 
-It is worth noting that we use basic authorization for access with user name and password set to *healthcheck* and
+It is worth noting that we use basic authorization for access with user name and password set to *policyadmin* and
 *zb!XztG34*, respectively.
 
 For every call, the client is encouraged to insert a uuid-type *requestID* as parameter. It is helpful for tracking each
@@ -227,6 +229,12 @@ request will be ignored.
 This can also be used to update a PDP Group, but supported policy types cannot be updated during the update operation.
 So, "policies" and "supportedPolicyTypes" properties in the request will be ignored if provided during the PDP Group update operation.
 
+The "desiredInstanceCount" specifies the minimum number of PDPs of the given
+type that should be registered with PAP.  Currently, this is just used for
+health check purposes; if the number of PDPs registered with PAP drops below
+the given value, then PAP will return an "unhealthy" indicator if a
+"Consolidated Health Check" is performed.
+
 .. note::
   If a subgroup is to be deleted from a PDP Group, then the policies must be removed from
   the subgroup first.
@@ -276,6 +284,11 @@ Here is a sample request:
 .. 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
@@ -295,6 +308,11 @@ Here is a sample request:
 .. 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
@@ -308,6 +326,26 @@ This operation allows policies to be undeployed from PDP groups.
 .. 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
@@ -326,21 +364,43 @@ Here is a sample response:
 
 This operation allows the PDP statistics to be retrieved for all registered PDPs.
 The result can be filtered based on PDP group, PDP subgroup & PDP instance.
+Along with record count, start time & end time as query parameters.
 
 Here is a sample response:
 
 .. literalinclude:: response/pdp-statistics-pap-resp.json
     :language: json
 
+:download:`Download Policy Audit PAP API Swagger  <swagger/policy-audit-pap.json>`
+
+.. swaggerv2doc:: swagger/policy-audit-pap.json
+
+This operation allows the audit records of policies to be listed together.
+The result can be filtered based on pdp group name, policy name & version.
+Along with record count, start time & end time as query parameters.
+
+Here is a sample response:
+
+.. literalinclude:: response/policy-audit-pap-resp.json
+    :language: json
 
-3 Future Features
+3 Configuration
 =================
 
-3.1 Disable policies in PDP
-===========================
+The *PolicyAdministration* component (PAP) is initialized using a configuration file: `papParameters.yaml
+<https://github.com/onap/policy-pap/blob/master/packages/policy-pap-tarball/src/main/resources/etc/papParameters.yaml>`_
+
+The configuration file is a YAML file containing the relevant fields for configuring the REST server, Database and DMaaP connectivity and so on.
 
-This operation will allow disabling individual policies running in PDP engine. It is mainly beneficial
-in scenarios where network operators/administrators want to disable a particular policy in PDP engine
-for a period of time due to a failure in the system or for scheduled maintenance.
+3.1 Disable collection of PDP Statistics
+========================================
+
+This configuration is to inform PAP to not save the PDP statistics in the database.
+
+In *papParameters.yaml*, add or change the property savePdpStatisticsInDb to false.
+
+.. note::
+  By default, if the property is not present, it will be considered as false and
+  PDP statistics will not be saved in the database.
 
 End of Document