Add links to new API documentation
[nonrtric.git] / docs / policy-agent-api.rst
index e3354e4..4792bef 100644 (file)
@@ -1,5 +1,6 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2020 Nordix
 
 .. |nbsp| unicode:: 0xA0
    :trim:
@@ -115,7 +116,7 @@ PUT
           Service created.
 
     400:
-          Something went wrong with the service registration.
+          The ServiceRegistrationInfo is not accepted.
 
   **Examples:**
 
@@ -243,8 +244,8 @@ DELETE
 /services/keepalive
 ~~~~~~~~~~~~~~~~~~~
 
-POST
-++++
+PUT
++++
 
   Heart beat from a service.
 
@@ -268,7 +269,7 @@ POST
 
     Call: ::
 
-      curl -X POST "http://localhost:8081/services/keepalive?name=existing"
+      curl -X PUT "http://localhost:8081/services/keepalive?name=existing"
 
     Result:
       200: ::
@@ -277,7 +278,7 @@ POST
 
     Call: ::
 
-      curl -X POST "http://localhost:8081/services/keepalive?name=nonexistent"
+      curl -X PUT "http://localhost:8081/services/keepalive?name=nonexistent"
 
     Result:
        404: ::
@@ -634,12 +635,12 @@ GET
   Returns a policy configuration.
 
   **URL path:**
-    /policy?instance=<name-of-policy>
+    /policy?id=<policy-id>
 
   **Parameters:**
 
-    instance: (*Required*)
-      The ID/name of the policy instance.
+    id: (*Required*)
+      The ID of the policy instance.
 
   **Responses:**
 
@@ -647,7 +648,7 @@ GET
           JSON object containing policy information. ::
 
             {
-              "id": "string",                  (ID/name of policy)
+              "id": "string",                  (ID of policy)
               "json": "object",                (JSON with policy data speified by the type)
               "ownerServiceName": "string",    (Name of the service that created the policy)
               "ric": "string",                 (Name of the Near |nbh| RT |nbsp| RIC where the policy resides)
@@ -662,7 +663,7 @@ GET
 
     Call: ::
 
-      curl -X GET "http://localhost:8081/policy?instance=Policy 1"
+      curl -X GET "http://localhost:8081/policy?id=Policy 1"
 
     Result:
       200: ::
@@ -696,7 +697,7 @@ GET
 
     Call: ::
 
-      curl -X GET "http://localhost:8081/policy?instance=nonexistent"
+      curl -X GET "http://localhost:8081/policy?id=nonexistent"
 
     Result:
        404: ::
@@ -710,12 +711,12 @@ PUT
   "*Keep Alive Interval*" registered.
 
   **URL path:**
-    /policy?instance=<name-of-policy>&ric=<name-of-ric>&service=<name-of-service>&type=<name-of-policy-type>
+    /policy?id=<policy-id>&ric=<name-of-ric>&service=<name-of-service>&type=<name-of-policy-type>
 
   **Parameters:**
 
-    instance: (*Required*)
-      The ID/name of the policy instance.
+    id: (*Required*)
+      The ID of the policy instance.
 
     ric: (*Required*)
       The name of the Near |nbh| RT |nbsp| RIC where the policy will be created.
@@ -741,13 +742,13 @@ PUT
           Near |nbh| RT |nbsp| RIC or policy type is not found.
 
     423:
-          Near |nbh| RT |nbsp| RIC is locked.
+          Near |nbh| RT |nbsp| RIC is not operational.
 
   **Examples:**
 
     Call: ::
 
-      curl -X PUT "http://localhost:8081/policy?instance=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
+      curl -X PUT "http://localhost:8081/policy?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
         -H  "Content-Type: application/json"
         -d "{
               \"scope\": {
@@ -779,12 +780,12 @@ DELETE
   "*Keep Alive Interval*" registered.
 
   **URL path:**
-    /policy?instance=<name-of-policy>
+    /policy?id=<policy-id>
 
   **Parameters:**
 
-    instance: (*Required*)
-      The ID/name of the policy instance.
+    id: (*Required*)
+      The ID of the policy instance.
 
   **Responses:**
 
@@ -794,11 +795,14 @@ DELETE
     404:
           Policy is not found.
 
+    423:
+          Near |nbh| RT |nbsp| RIC is not operational.
+
   **Examples:**
 
     Call: ::
 
-      curl -X DELETE "http://localhost:8081/policy?instance=Policy 1"
+      curl -X DELETE "http://localhost:8081/policy?id=Policy 1"
 
     Result:
       204
@@ -866,12 +870,12 @@ GET
   Returns the status of a policy.
 
   **URL path:**
-    /policy_status?instance=<name-of-policy>
+    /policy_status?id=<policy-id>
 
   **Parameters:**
 
-    instance: (*Required*)
-      The ID/name of the policy.
+    id: (*Required*)
+      The ID of the policy.
 
   **Responses:**
 
@@ -904,7 +908,7 @@ GET
 
   **Parameters:**
 
-    managedElementId: (*Optional*)
+    managedElementId: (*Required*)
       The ID of the Managed Element.
 
   **Responses:**
@@ -962,7 +966,8 @@ GET
                 "policyTypes": [
                   "string"
                 ],
-                "ricName": "string"
+                "ricName": "string",
+                "state": "string"
               }
             ]
 
@@ -989,7 +994,8 @@ GET
               "Example_QoETarget_1.0.0",
               "ERIC_QoSNudging_0.2.0"
             ],
-            "ricName": "Ric 1"
+            "ricName": "Ric 1",
+            "state": "AVAILABLE"
           },
             .
             .
@@ -1001,7 +1007,8 @@ GET
             "policyTypes": [
               "STD_PolicyModelUnconstrained_0.2.0"
             ],
-            "ricName": "Ric X"
+            "ricName": "Ric X",
+            "state": "UNAVAILABLE"
           }
         ]