Repository: mesos
Updated Branches:
  refs/heads/master 46e0f2612 -> 0d53c395c


Added examples for documentation on master/slave state.json.

We are working on a more standardized way of representing (and thus
more easily documenting) our internal JSON objects. Until we have
this, there is no point in trying to exhaustively document the
state.json (or any other JSON) endpoints. Including an example and
noting that it is not exhaustive is better than it was before though.

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


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

Branch: refs/heads/master
Commit: c520f614ef85af1df2430527dd88133eed9acc42
Parents: 46e0f26
Author: Kevin Klues <[email protected]>
Authored: Tue Feb 16 16:32:20 2016 -0800
Committer: Vinod Kone <[email protected]>
Committed: Tue Feb 16 16:32:20 2016 -0800

----------------------------------------------------------------------
 src/master/http.cpp | 72 ++++++++++++++++++++++++++++++++++++++-
 src/slave/http.cpp  | 88 +++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 158 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c520f614/src/master/http.cpp
----------------------------------------------------------------------
diff --git a/src/master/http.cpp b/src/master/http.cpp
index 7395828..248e3d4 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -1299,7 +1299,77 @@ string Master::Http::STATE_HELP()
         "Information about state of master."),
     DESCRIPTION(
         "This endpoint shows information about the frameworks, tasks,",
-        "executors and slaves running in the cluster as a JSON object."));
+        "executors and slaves running in the cluster as a JSON object.",
+        "",
+        "Example (**Note**: this is not exhaustive):",
+        "",
+        "```",
+        "{",
+        "    \"version\" : \"0.28.0\",",
+        "    \"git_sha\" : \"9d5889b5a265849886a533965f4aefefd1fbd103\",",
+        "    \"git_branch\" : \"refs/heads/master\",",
+        "    \"git_tag\" : \"0.28.0\",",
+        "    \"build_date\" : \"2016-02-15 10:00:28\",",
+        "    \"build_time\" : 1455559228,",
+        "    \"build_user\" : \"mesos-user\",",
+        "    \"start_time\" : 1455643643.42422,",
+        "    \"elected_time\" : 1455643643.43457,",
+        "    \"id\" : \"b5eac2c5-609b-4ca1-a352-61941702fc9e\",",
+        "    \"pid\" : \"[email protected]:5050\",",
+        "    \"hostname\" : \"localhost\",",
+        "    \"activated_slaves\" : 0,",
+        "    \"deactivated_slaves\" : 0,",
+        "    \"cluster\" : \"test-cluster\",",
+        "    \"leader\" : \"[email protected]:5050\",",
+        "    \"log_dir\" : \"/var/log\",",
+        "    \"external_log_file\" : \"mesos.log\",",
+        "    \"flags\" : {",
+        "         \"framework_sorter\" : \"drf\",",
+        "         \"authenticate\" : \"false\",",
+        "         \"logbufsecs\" : \"0\",",
+        "         \"initialize_driver_logging\" : \"true\",",
+        "         \"work_dir\" : \"/var/lib/mesos\",",
+        "         \"http_authenticators\" : \"basic\",",
+        "         \"authorizers\" : \"local\",",
+        "         \"slave_reregister_timeout\" : \"10mins\",",
+        "         \"logging_level\" : \"INFO\",",
+        "         \"help\" : \"false\",",
+        "         \"root_submissions\" : \"true\",",
+        "         \"ip\" : \"127.0.0.1\",",
+        "         \"user_sorter\" : \"drf\",",
+        "         \"version\" : \"false\",",
+        "         \"max_slave_ping_timeouts\" : \"5\",",
+        "         \"slave_ping_timeout\" : \"15secs\",",
+        "         \"registry_store_timeout\" : \"20secs\",",
+        "         \"max_completed_frameworks\" : \"50\",",
+        "         \"quiet\" : \"false\",",
+        "         \"allocator\" : \"HierarchicalDRF\",",
+        "         \"hostname_lookup\" : \"true\",",
+        "         \"authenticators\" : \"crammd5\",",
+        "         \"max_completed_tasks_per_framework\" : \"1000\",",
+        "         \"registry\" : \"replicated_log\",",
+        "         \"registry_strict\" : \"false\",",
+        "         \"log_auto_initialize\" : \"true\",",
+        "         \"authenticate_slaves\" : \"false\",",
+        "         \"registry_fetch_timeout\" : \"1mins\",",
+        "         \"allocation_interval\" : \"1secs\",",
+        "         \"authenticate_http\" : \"false\",",
+        "         \"port\" : \"5050\",",
+        "         \"zk_session_timeout\" : \"10secs\",",
+        "         \"recovery_slave_removal_limit\" : \"100%\",",
+        "         \"webui_dir\" : \"/path/to/mesos/build/../src/webui\",",
+        "         \"cluster\" : \"mycluster\",",
+        "         \"leader\" : \"[email protected]:5050\",",
+        "         \"log_dir\" : \"/var/log\",",
+        "         \"external_log_file\" : \"mesos.log\"",
+        "    },",
+        "    \"slaves\" : [],",
+        "    \"frameworks\" : [],",
+        "    \"completed_frameworks\" : [],",
+        "    \"orphan_tasks\" : [],",
+        "    \"unregistered_frameworks\" : []",
+        "}",
+        "```"));
 }
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/c520f614/src/slave/http.cpp
----------------------------------------------------------------------
diff --git a/src/slave/http.cpp b/src/slave/http.cpp
index 523e8dc..a18085e 100644
--- a/src/slave/http.cpp
+++ b/src/slave/http.cpp
@@ -393,7 +393,93 @@ string Slave::Http::STATE_HELP() {
         "Information about state of the Slave."),
     DESCRIPTION(
         "This endpoint shows information about the frameworks, executors",
-        "and the slave's master as a JSON object."));
+        "and the slave's master as a JSON object.",
+        "",
+        "Example (**Note**: this is not exhaustive):",
+        "",
+        "```",
+        "{",
+        "    \"version\" : \"0.28.0\",",
+        "    \"git_sha\" : \"9d5889b5a265849886a533965f4aefefd1fbd103\",",
+        "    \"git_branch\" : \"refs/heads/master\",",
+        "    \"git_tag\" : \"0.28.0\",",
+        "    \"build_date\" : \"2016-02-15 10:00:28\"",
+        "    \"build_time\" : 1455559228,",
+        "    \"build_user\" : \"mesos-user\",",
+        "    \"start_time\" : 1455647422.88396,",
+        "    \"id\" : \"e2c38084-f6ea-496f-bce3-b6e07cea5e01-S0\",",
+        "    \"pid\" : \"slave(1)@127.0.1.1:5051\",",
+        "    \"hostname\" : \"localhost\",",
+        "    \"resources\" : {",
+        "         \"ports\" : \"[31000-32000]\",",
+        "         \"mem\" : 127816,",
+        "         \"disk\" : 804211,",
+        "         \"cpus\" : 32",
+        "    },",
+        "    \"attributes\" : {},",
+        "    \"master_hostname\" : \"localhost\",",
+        "    \"log_dir\" : \"/var/log\",",
+        "    \"external_log_file\" : \"mesos.log\",",
+        "    \"frameworks\" : [],",
+        "    \"completed_frameworks\" : [],",
+        "    \"flags\" : {",
+        "         \"gc_disk_headroom\" : \"0.1\",",
+        "         \"isolation\" : \"posix/cpu,posix/mem\",",
+        "         \"containerizers\" : \"mesos\",",
+        "         \"docker_socket\" : \"/var/run/docker.sock\",",
+        "         \"gc_delay\" : \"1weeks\",",
+        "         \"docker_remove_delay\" : \"6hrs\",",
+        "         \"port\" : \"5051\",",
+        "         \"systemd_runtime_directory\" : \"/run/systemd/system\",",
+        "         \"initialize_driver_logging\" : \"true\",",
+        "         \"cgroups_root\" : \"mesos\",",
+        "         \"fetcher_cache_size\" : \"2GB\",",
+        "         \"cgroups_hierarchy\" : \"/sys/fs/cgroup\",",
+        "         \"qos_correction_interval_min\" : \"0ns\",",
+        "         \"cgroups_cpu_enable_pids_and_tids_count\" : \"false\",",
+        "         \"sandbox_directory\" : \"/mnt/mesos/sandbox\",",
+        "         \"docker\" : \"docker\",",
+        "         \"help\" : \"false\",",
+        "         \"docker_stop_timeout\" : \"0ns\",",
+        "         \"master\" : \"127.0.0.1:5050\",",
+        "         \"logbufsecs\" : \"0\",",
+        "         \"docker_registry\" : \"https://registry-1.docker.io\",";,
+        "         \"frameworks_home\" : \"\",",
+        "         \"cgroups_enable_cfs\" : \"false\",",
+        "         \"perf_interval\" : \"1mins\",",
+        "         \"docker_kill_orphans\" : \"true\",",
+        "         \"switch_user\" : \"true\",",
+        "         \"logging_level\" : \"INFO\",",
+        "         \"hadoop_home\" : \"\",",
+        "         \"strict\" : \"true\",",
+        "         \"executor_registration_timeout\" : \"1mins\",",
+        "         \"recovery_timeout\" : \"15mins\",",
+        "         \"revocable_cpu_low_priority\" : \"true\",",
+        "         \"docker_store_dir\" : \"/tmp/mesos/store/docker\",",
+        "         \"image_provisioner_backend\" : \"copy\",",
+        "         \"authenticatee\" : \"crammd5\",",
+        "         \"quiet\" : \"false\",",
+        "         \"executor_shutdown_grace_period\" : \"5secs\",",
+        "         \"fetcher_cache_dir\" : \"/tmp/mesos/fetch\",",
+        "         \"default_role\" : \"*\",",
+        "         \"work_dir\" : \"/tmp/mesos\",",
+        "         \"launcher_dir\" : \"/path/to/mesos/build/src\",",
+        "         \"registration_backoff_factor\" : \"1secs\",",
+        "         \"docker_auth_server\" : \"https://auth.docker.io\",";,
+        "         \"oversubscribed_resources_interval\" : \"15secs\",",
+        "         \"enforce_container_disk_quota\" : \"false\",",
+        "         \"container_disk_watch_interval\" : \"15secs\",",
+        "         \"disk_watch_interval\" : \"1mins\",",
+        "         \"docker_puller_timeout\" : \"60\",",
+        "         \"cgroups_limit_swap\" : \"false\",",
+        "         \"hostname_lookup\" : \"true\",",
+        "         \"perf_duration\" : \"10secs\",",
+        "         \"appc_store_dir\" : \"/tmp/mesos/store/appc\",",
+        "         \"recover\" : \"reconnect\",",
+        "         \"version\" : \"false\"",
+        "    },",
+        "}",
+        "```"));
 }
 
 

Reply via email to