You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2016/08/02 16:45:11 UTC

[5/5] mesos git commit: Made the JSON snippets complete in the Scheduler HTTP API doc.

Made the JSON snippets complete in the Scheduler HTTP API doc.

Review: https://reviews.apache.org/r/50626/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/74e95984
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/74e95984
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/74e95984

Branch: refs/heads/master
Commit: 74e9598482b4c02f9e7ddf63ad5db6ddf08cccf2
Parents: f9b0558
Author: Abhishek Dasgupta <a1...@linux.vnet.ibm.com>
Authored: Tue Aug 2 09:37:13 2016 -0700
Committer: Anand Mazumdar <an...@apache.org>
Committed: Tue Aug 2 09:37:13 2016 -0700

----------------------------------------------------------------------
 docs/scheduler-http-api.md | 86 ++++++++++++++++++++++++++++++++---------
 1 file changed, 67 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/74e95984/docs/scheduler-http-api.md
----------------------------------------------------------------------
diff --git a/docs/scheduler-http-api.md b/docs/scheduler-http-api.md
index 4be9612..504872e 100644
--- a/docs/scheduler-http-api.md
+++ b/docs/scheduler-http-api.md
@@ -42,8 +42,8 @@ For example, a stream may look like:
 
 ```
 128\n
-{"type": "SUBSCRIBED","subscribed": {"framework_id": {"value":"12220-3440-12532-2345"},...}104\n
-{"framework_id": {"value": "12220-3440-12532-2345"},...{"value" : "12220-3440-12532-O12"},}208\n
+{"type": "SUBSCRIBED","subscribed": {"framework_id": {"value":"12220-3440-12532-2345"},"heartbeat_interval_seconds":15.0}20\n
+{"type":"HEARTBEAT"}675\n
 ...
 ```
 
@@ -152,15 +152,48 @@ Content-Type: application/json
 Mesos-Stream-Id: 130ae4e3-6b13-4ef4-baa9-9f2e85c3e9af
 
 {
-  "framework_id"	: {"value" : "12220-3440-12532-2345"},
-  "type"			: "ACCEPT",
-  "accept"			: {
-    "offer_ids"		: [
-                       {"value" : "12220-3440-12532-O12"},
-                       {"value" : "12220-3440-12532-O12"}
-                      ],
-    "operations"	: [ {"type" : "LAUNCH", "launch" : {...}} ],
-    "filters"		: {...}
+  "framework_id"   : {"value" : "12220-3440-12532-2345"},
+  "type"           : "ACCEPT",
+  "accept"         : {
+    "offer_ids"    : [
+                      {"value" : "12220-3440-12532-O12"}
+                     ],
+     "operations"  : [
+                      {
+                       "type"         : "LAUNCH",
+                       "launch"       : {
+                         "task_infos" : [
+                                         {
+                                          "name"        : "My Task",
+                                          "task_id"     : {"value" : "12220-3440-12532-my-task"},
+                                          "agent_id"    : {"value" : "12220-3440-12532-S1233"},
+                                          "executor"    : {
+                                            "command"     : {
+                                              "shell"     : true,
+                                              "value"     : "sleep 1000"
+                                            },
+                                            "executor_id" : {"value" : "12214-23523-my-executor"}
+                                          },
+                                          "resources"   : [
+                                                           {
+                                                            "name"  : "cpus",
+						            "role"  : "*",
+						            "type"  : "SCALAR",
+						            "scalar": {"value": 1.0}
+					                   },
+                                                           {
+						            "name"  : "mem",
+						            "role"  : "*",
+						            "type"  : "SCALAR",
+						            "scalar": {"value": 128.0}
+					                   }
+                                                          ]
+                                         }
+                                        ]
+                       }
+                      }
+                     ],
+     "filters"     : {"refuse_seconds" : 5.0}
   }
 }
 
@@ -188,7 +221,7 @@ Mesos-Stream-Id: 130ae4e3-6b13-4ef4-baa9-9f2e85c3e9af
                    {"value" : "12220-3440-12532-O12"},
                    {"value" : "12220-3440-12532-O13"}
                   ],
-    "filters"	: {...}
+    "filters"	: {"refuse_seconds" : 5.0}
   }
 }
 
@@ -396,13 +429,28 @@ OFFERS Event (JSON)
   "type"	: "OFFERS",
   "offers"	: [
     {
-      "offer_id":{"value": "12214-23523-O235235"},
-      "framework_id":{"value": "12124-235325-32425"},
-      "agent_id":{"value": "12325-23523-S23523"},
-      "hostname":"agent.host",
-      "resources":[...],
-      "attributes":[...],
-      "executor_ids":[]
+      "offer_id"     : {"value": "12214-23523-O235235"},
+      "framework_id" : {"value": "12124-235325-32425"},
+      "agent_id"     : {"value": "12325-23523-S23523"},
+      "hostname"     : "agent.host",
+      "resources"    : [
+                        {
+                         "name"   : "cpus",
+                         "type"   : "SCALAR",
+                         "scalar" : {"value" : 2},
+                         "role"   : "*"
+                        }
+                       ],
+      "attributes"   : [
+                        {
+                         "name"   : "os",
+                         "type"   : "TEXT",
+                         "text"   : {"value" : "ubuntu16.04"}
+                        }
+                       ],
+      "executor_ids" : [
+                        {"value" : "12214-23523-my-executor"}
+                       ]
     }
   ]
 }