Added description of resources on each SLA agreement when they are created
[unfold.git] / sla / slaclient / service / fed4fire / jsonparser.py
index 3dc8fca..d4a2300 100755 (executable)
@@ -69,8 +69,6 @@ def agreementinput_from_json(json_data):
     }\r
     """\r
     d = json.loads(json_data)\r
-    if "expiration_time" in d:\r
-        d["expiration_time"] = dateutil.parser.parse(d["expiration_time"])\r
 \r
     t = AgreementInput(\r
         agreement_id=d.get("agreement_id", None),\r
@@ -111,10 +109,18 @@ def _json_parse_guarantee_terms(d):
     """\r
     result = []\r
     for term in d.get("guarantees", None) or ():\r
+        gs = AgreementInput.GuaranteeTerm.GuaranteeScope(\r
+            term["scope"].get("service_name", ""),\r
+            term["scope"].get("scope", "")\r
+            )\r
+        print "*******GS****"\r
+        print gs\r
         result.append(\r
             AgreementInput.GuaranteeTerm(\r
                 metric_name=term["name"],\r
-                bounds=tuple(term["bounds"])\r
+                bounds=tuple(term["bounds"]),\r
+                guarantee_scopes=gs\r
             )\r
         )\r
-    return result
\ No newline at end of file
+\r
+    return result\r