{"action":"created","comment":{"url":"https://api.github.com/repos/Yelp/chronos/pulls/comments/75345209","id":75345209,"diff_hunk":"@@ -0,0 +1,83 @@\n+package org.apache.mesos.chronos.scheduler.api\n+\n+import java.util.logging.Logger\n+\n+import scala.util.Try\n+\n+import com.google.inject.Inject\n+import javax.ws.rs._\n+import javax.ws.rs.core.{Response, MediaType}\n+import mesosphere.mesos.util.FrameworkIdUtil\n+import org.apache.curator.framework.recipes.leader.LeaderLatch\n+import org.apache.mesos.Protos.FrameworkID\n+import org.apache.mesos.chronos.scheduler.config.SchedulerConfiguration\n+\n+@Path(PathConstants.infoPath)\n+class InfoResource @Inject()(\n+  val schedulerConfiguration: SchedulerConfiguration,\n+  val frameworkIdUtil: FrameworkIdUtil,\n+  val leaderLatch: LeaderLatch\n+) {\n+  private val log = Logger.getLogger(getClass.getName)\n+\n+  @GET\n+  @Produces(Array(MediaType.APPLICATION_JSON))\n+  def info(): Response = {\n+\n+    import mesosphere.util.BackToTheFuture.Implicits.defaultTimeout\n+    import scala.concurrent.ExecutionContext.Implicits.global\n+    val frameworkId = frameworkIdUtil.fetch\n+\n+    val chronosConfiguration = Map(\n+        \"user\" -> schedulerConfiguration.user(),\n+        \"failover_timeout\" -> schedulerConfiguration.failoverTimeoutSeconds(),\n+        \"scheduler_horizon\" -> schedulerConfiguration.scheduleHorizonSeconds(),\n+        \"cluster_name\" -> schedulerConfiguration.clusterName.get.getOrElse(\"None\"),\n+        \"hostname\" -> schedulerConfiguration.hostname(),\n+        \"leader_max_idle_time\" -> schedulerConfiguration.leaderMaxIdleTimeMs(),\n+        \"min_revive_offers_interval\" -> schedulerConfiguration.minReviveOffersInterval(),\n+        \"decline_offer_duration\" -> schedulerConfiguration.declineOfferDuration.get.getOrElse(\"None\"),\n+        \"reconciliation_interval\" -> schedulerConfiguration.reconciliationInterval(),\n+        \"default_task_epsilon\" -> schedulerConfiguration.taskEpsilon.get.getOrElse(\"defaultTaskEpsilon\"),\n+        \"failure_retry_delay\" -> schedulerConfiguration.failureRetryDelayMs(),\n+        \"disable_after_failures\" -> schedulerConfiguration.disableAfterFailures(),\n+        \"task_epsilon\" -> schedulerConfiguration.taskEpsilon(),\n+        \"reconciliation_interval\" -> schedulerConfiguration.reconciliationInterval()\n+    )\n+    val mesosConfig = Map(\n+        \"master\" -> schedulerConfiguration.master(),\n+        \"mesos_task_mem\" -> schedulerConfiguration.mesosTaskMem(),\n+        \"mesos_task_cpu\" -> schedulerConfiguration.mesosTaskCpu(),\n+        \"mesos_task_disk\" -> schedulerConfiguration.mesosTaskDisk(),\n+        \"mesos_checkpoint\" -> schedulerConfiguration.mesosCheckpoint(),\n+        \"mesos_role\" -> schedulerConfiguration.mesosRole(),\n+        \"mesos_framework_name\" -> schedulerConfiguration.mesosFrameworkName(),\n+        \"mesos_authentication_principal\" -> schedulerConfiguration.mesosAuthenticationPrincipal.get.getOrElse(\"None\")\n+    )\n+\n+    val mailConfig = Map(\n+      \"mail_server\" -> schedulerConfiguration.mailServer.get.getOrElse(\"None\"),\n+      \"mail_user\" -> schedulerConfiguration.mailUser.get.getOrElse(\"None\"),\n+      \"mail_from\" -> schedulerConfiguration.mailFrom.get.getOrElse(\"None\"),\n+      \"mail_ssl_on\" -> schedulerConfiguration.mailFrom.get.getOrElse(\"None\")","path":"src/main/scala/org/apache/mesos/chronos/scheduler/api/InfoResource.scala","position":62,"original_position":62,"commit_id":"4f2faf096908cd2ffb479febe2ce55656c03e1f1","original_commit_id":"4f2faf096908cd2ffb479febe2ce55656c03e1f1","user":{"login":"tub","id":159623,"avatar_url":"https://avatars.githubusercontent.com/u/159623?v=3","gravatar_id":"","url":"https://api.github.com/users/tub","html_url":"https://github.com/tub","followers_url":"https://api.github.com/users/tub/followers","following_url":"https://api.github.com/users/tub/following{/other_user}","gists_url":"https://api.github.com/users/tub/gists{/gist_id}","starred_url":"https://api.github.com/users/tub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tub/subscriptions","organizations_url":"https://api.github.com/users/tub/orgs","repos_url":"https://api.github.com/users/tub/repos","events_url":"https://api.github.com/users/tub/events{/privacy}","received_events_url":"https://api.github.com/users/tub/received_events","type":"User","site_admin":false},"body":"mailFrom?","created_at":"2016-08-18T16:50:51Z","updated_at":"2016-08-18T16:50:51Z","html_url":"https://github.com/Yelp/chronos/pull/25#discussion_r75345209","pull_request_url":"https://api.github.com/repos/Yelp/chronos/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/Yelp/chronos/pulls/comments/75345209"},"html":{"href":"https://github.com/Yelp/chronos/pull/25#discussion_r75345209"},"pull_request":{"href":"https://api.github.com/repos/Yelp/chronos/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/Yelp/chronos/pulls/25","id":81699995,"html_url":"https://github.com/Yelp/chronos/pull/25","diff_url":"https://github.com/Yelp/chronos/pull/25.diff","patch_url":"https://github.com/Yelp/chronos/pull/25.patch","issue_url":"https://api.github.com/repos/Yelp/chronos/issues/25","number":25,"state":"open","locked":false,"title":"add an 'info' endpoint to the api akin to marathon's","user":{"login":"Rob-Johnson","id":1389671,"avatar_url":"https://avatars.githubusercontent.com/u/1389671?v=3","gravatar_id":"","url":"https://api.github.com/users/Rob-Johnson","html_url":"https://github.com/Rob-Johnson","followers_url":"https://api.github.com/users/Rob-Johnson/followers","following_url":"https://api.github.com/users/Rob-Johnson/following{/other_user}","gists_url":"https://api.github.com/users/Rob-Johnson/gists{/gist_id}","starred_url":"https://api.github.com/users/Rob-Johnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rob-Johnson/subscriptions","organizations_url":"https://api.github.com/users/Rob-Johnson/orgs","repos_url":"https://api.github.com/users/Rob-Johnson/repos","events_url":"https://api.github.com/users/Rob-Johnson/events{/privacy}","received_events_url":"https://api.github.com/users/Rob-Johnson/received_events","type":"User","site_admin":false},"body":"up for early review and suggestions on what other info we might want here.\r\n\r\n@tub @solarkennedy thoughts?\r\n\r\n```\r\nrobj@robj-yelp-mb:~/workspace/chronos info-api % curl http://0.0.0.0:8081/info | jq .\r\n{\r\n  \"schedulerConfiguration\": {\r\n    \"defaultTaskEpsilon\": 60,\r\n    \"hostname\": \"b905ec02e1ac\",\r\n    \"schedulerHorizonSeconds\": 60,\r\n    \"master\": \"zk://zookeeper:2181/mesos-testcluster\",\r\n    \"failoverTimeoutSeconds\": 604800,\r\n    \"declineOfferDuration\": \"None\",\r\n    \"minReviveOffersInterval\": 5000,\r\n    \"reconciliationInterval\": 600,\r\n    \"leaderMaxIdleTime\": 5000,\r\n    \"clusterName\": \"None\",\r\n    \"user\": \"root\"\r\n  },\r\n  \"mail_config\": {\r\n    \"mail_user\": \"None\",\r\n    \"mail_from\": \"None\",\r\n    \"mail_ssl_on\": \"None\",\r\n    \"mail_server\": \"None\",\r\n    \"mail_password\": \"None\"\r\n  },\r\n  \"frameworkId\": \"058f572c-9040-46f6-a86a-f8b37acabdeb-0000\",\r\n  \"version\": \"2.5.0-yelp14-SNAPSHOT\",\r\n  \"zookeeper_config\": {\r\n    \"zookeeperTimeout\": 10000,\r\n    \"zookeeperPath\": \"/chronos\"\r\n  }\r\n}\r\n```","created_at":"2016-08-17T19:16:58Z","updated_at":"2016-08-18T16:50:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7f80c580732f99f3e7e9364ee174e16cacd588f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Yelp/chronos/pulls/25/commits","review_comments_url":"https://api.github.com/repos/Yelp/chronos/pulls/25/comments","review_comment_url":"https://api.github.com/repos/Yelp/chronos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Yelp/chronos/issues/25/comments","statuses_url":"https://api.github.com/repos/Yelp/chronos/statuses/4f2faf096908cd2ffb479febe2ce55656c03e1f1","head":{"label":"Yelp:info-api","ref":"info-api","sha":"4f2faf096908cd2ffb479febe2ce55656c03e1f1","user":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":60867990,"name":"chronos","full_name":"Yelp/chronos","owner":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/chronos","description":"Fault tolerant job scheduler for Mesos which handles dependencies and ISO8601 based schedules","fork":true,"url":"https://api.github.com/repos/Yelp/chronos","forks_url":"https://api.github.com/repos/Yelp/chronos/forks","keys_url":"https://api.github.com/repos/Yelp/chronos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/chronos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/chronos/teams","hooks_url":"https://api.github.com/repos/Yelp/chronos/hooks","issue_events_url":"https://api.github.com/repos/Yelp/chronos/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/chronos/events","assignees_url":"https://api.github.com/repos/Yelp/chronos/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/chronos/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/chronos/tags","blobs_url":"https://api.github.com/repos/Yelp/chronos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/chronos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/chronos/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/chronos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/chronos/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/chronos/languages","stargazers_url":"https://api.github.com/repos/Yelp/chronos/stargazers","contributors_url":"https://api.github.com/repos/Yelp/chronos/contributors","subscribers_url":"https://api.github.com/repos/Yelp/chronos/subscribers","subscription_url":"https://api.github.com/repos/Yelp/chronos/subscription","commits_url":"https://api.github.com/repos/Yelp/chronos/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/chronos/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/chronos/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/chronos/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/chronos/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/chronos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/chronos/merges","archive_url":"https://api.github.com/repos/Yelp/chronos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/chronos/downloads","issues_url":"https://api.github.com/repos/Yelp/chronos/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/chronos/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/chronos/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/chronos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/chronos/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/chronos/releases{/id}","deployments_url":"https://api.github.com/repos/Yelp/chronos/deployments","created_at":"2016-06-10T18:14:15Z","updated_at":"2016-07-12T10:32:45Z","pushed_at":"2016-08-18T16:50:41Z","git_url":"git://github.com/Yelp/chronos.git","ssh_url":"git@github.com:Yelp/chronos.git","clone_url":"https://github.com/Yelp/chronos.git","svn_url":"https://github.com/Yelp/chronos","homepage":"http://mesos.github.io/chronos/","size":6449,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"Yelp:service-api-from-root","ref":"service-api-from-root","sha":"469410f72d39e32128654c43a00c97ba6250cef9","user":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":60867990,"name":"chronos","full_name":"Yelp/chronos","owner":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/chronos","description":"Fault tolerant job scheduler for Mesos which handles dependencies and ISO8601 based schedules","fork":true,"url":"https://api.github.com/repos/Yelp/chronos","forks_url":"https://api.github.com/repos/Yelp/chronos/forks","keys_url":"https://api.github.com/repos/Yelp/chronos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/chronos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/chronos/teams","hooks_url":"https://api.github.com/repos/Yelp/chronos/hooks","issue_events_url":"https://api.github.com/repos/Yelp/chronos/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/chronos/events","assignees_url":"https://api.github.com/repos/Yelp/chronos/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/chronos/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/chronos/tags","blobs_url":"https://api.github.com/repos/Yelp/chronos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/chronos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/chronos/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/chronos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/chronos/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/chronos/languages","stargazers_url":"https://api.github.com/repos/Yelp/chronos/stargazers","contributors_url":"https://api.github.com/repos/Yelp/chronos/contributors","subscribers_url":"https://api.github.com/repos/Yelp/chronos/subscribers","subscription_url":"https://api.github.com/repos/Yelp/chronos/subscription","commits_url":"https://api.github.com/repos/Yelp/chronos/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/chronos/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/chronos/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/chronos/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/chronos/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/chronos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/chronos/merges","archive_url":"https://api.github.com/repos/Yelp/chronos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/chronos/downloads","issues_url":"https://api.github.com/repos/Yelp/chronos/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/chronos/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/chronos/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/chronos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/chronos/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/chronos/releases{/id}","deployments_url":"https://api.github.com/repos/Yelp/chronos/deployments","created_at":"2016-06-10T18:14:15Z","updated_at":"2016-07-12T10:32:45Z","pushed_at":"2016-08-18T16:50:41Z","git_url":"git://github.com/Yelp/chronos.git","ssh_url":"git@github.com:Yelp/chronos.git","clone_url":"https://github.com/Yelp/chronos.git","svn_url":"https://github.com/Yelp/chronos","homepage":"http://mesos.github.io/chronos/","size":6449,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Yelp/chronos/pulls/25"},"html":{"href":"https://github.com/Yelp/chronos/pull/25"},"issue":{"href":"https://api.github.com/repos/Yelp/chronos/issues/25"},"comments":{"href":"https://api.github.com/repos/Yelp/chronos/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/Yelp/chronos/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/Yelp/chronos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Yelp/chronos/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/Yelp/chronos/statuses/4f2faf096908cd2ffb479febe2ce55656c03e1f1"}}}}
{"actor":{"display_login":"tub"}}