{"action":"created","comment":{"url":"https://api.github.com/repos/gocd/api.go.cd/pulls/comments/69273611","id":69273611,"diff_hunk":"@@ -0,0 +1,119 @@\n+## Create an environment\n+\n+```shell\n+$ curl 'https://ci.example.com/go/api/admin/environments/' \\\n+      -u 'username:password' \\\n+      -H 'Accept: application/vnd.go.cd.v1+json' \\\n+      -H 'Content-Type: application/json' \\\n+      -X POST -d '{\n+        \"name\" : \"new_environment\",\n+        \"pipelines\" : [\n+          {\n+          \"name\" : \"up2\"\n+          }\n+        ],\n+        \"agents\" : [\n+          {\n+            \"uuid\" : \"12345678-e2f6-4c78-123456789012\"\n+          }\n+        ],\n+        \"environment_variables\" : [\n+          {\n+            \"name\" : \"username\",\n+            \"value\" : \"admin\",\n+            \"secure\" : false\n+          }\n+        ]\n+      }'\n+```\n+\n+> The above command returns JSON structured like this:\n+\n+```http\n+HTTP/1.1 200 OK\n+Content-Type: application/vnd.go.cd.v1+json; charset=utf-8\n+```\n+\n+```json\n+{\n+  \"_links\": {\n+    \"self\": {\n+      \"href\": \"https://ci.example.com/go/api/admin/environments/new_environment\"\n+    },\n+    \"doc\": {\n+      \"href\": \"http://api.go.cd/#environment_config\"\n+    },\n+    \"find\": {\n+      \"href\": \"https://ci.example.com/go/api/admin/environments/:environment_name\"\n+    }\n+  },\n+  \"name\": \"new_environment\",\n+  \"pipelines\": [\n+    {\n+      \"_links\": {\n+        \"self\": {\n+          \"href\": \"https://ci.example.com/go/api/admin/pipelines/up42\"\n+        },\n+        \"doc\": {\n+          \"href\": \"http://api.go.cd/#pipeline_config\"\n+        },\n+        \"find\": {\n+          \"href\": \"https://ci.example.com/go/api/admin/pipelines/:pipeline_name\"\n+        }\n+      },\n+      \"name\": \"up42\"\n+    }\n+  ],\n+  \"agents\": [\n+    {\n+      \"_links\": {\n+        \"self\": {\n+          \"href\": \"https://ci.example.com/go/api/agents/12345678-e2f6-4c78-123456789012\"\n+        },\n+        \"doc\": {\n+          \"href\": \"http://api.go.cd/#agents\"\n+        },\n+        \"find\": {\n+          \"href\": \"https://ci.example.com/go/api/agents/:uuid\"\n+        }\n+      },\n+      \"uuid\": \"12345678-e2f6-4c78-123456789012\"\n+    }\n+  ],\n+  \"environment_variables\": [\n+    {\n+      \"secure\": false,\n+      \"name\": \"username\",\n+      \"value\": \"admin\"\n+    },\n+    {\n+      \"secure\": true,\n+      \"name\": \"password\",\n+      \"encrypted_value\": \"LSd1TI0eLa+DjytHjj0qjA==\"\n+    }\n+  ]\n+}\n+```\n+\n+Creates an environment\n+\n+<%= available_since('16.6.0') %>\n+\n+<p class='http-request-heading'>HTTP Request</p>\n+\n+`POST /go/api/admin/environments/`\n+\n+The following properties may be specified:\n+\n+<%=\n+  describe_object nil do\n+  name                      'String',  'The environment config name'\n+  pipelines                 'Array',   'The list of pipeline names that belongs to the specified environment'\n+  agents                    'Array',   'The list of agent uuids that belongs to the specified environment'","path":"source/includes/environment_config/_30-create.md.erb","position":112,"original_position":112,"commit_id":"108f421c7292b80506e012496753405c4d902507","original_commit_id":"108f421c7292b80506e012496753405c4d902507","user":{"login":"ketan","id":10598,"avatar_url":"https://avatars.githubusercontent.com/u/10598?v=3","gravatar_id":"","url":"https://api.github.com/users/ketan","html_url":"https://github.com/ketan","followers_url":"https://api.github.com/users/ketan/followers","following_url":"https://api.github.com/users/ketan/following{/other_user}","gists_url":"https://api.github.com/users/ketan/gists{/gist_id}","starred_url":"https://api.github.com/users/ketan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketan/subscriptions","organizations_url":"https://api.github.com/users/ketan/orgs","repos_url":"https://api.github.com/users/ketan/repos","events_url":"https://api.github.com/users/ketan/events{/privacy}","received_events_url":"https://api.github.com/users/ketan/received_events","type":"User","site_admin":false},"body":"how about \"List of pipeline names/agent uuids that should be added to this environment\"?","created_at":"2016-07-01T09:33:32Z","updated_at":"2016-07-01T09:33:32Z","html_url":"https://github.com/gocd/api.go.cd/pull/83#discussion_r69273611","pull_request_url":"https://api.github.com/repos/gocd/api.go.cd/pulls/83","_links":{"self":{"href":"https://api.github.com/repos/gocd/api.go.cd/pulls/comments/69273611"},"html":{"href":"https://github.com/gocd/api.go.cd/pull/83#discussion_r69273611"},"pull_request":{"href":"https://api.github.com/repos/gocd/api.go.cd/pulls/83"}}},"pull_request":{"url":"https://api.github.com/repos/gocd/api.go.cd/pulls/83","id":71847156,"html_url":"https://github.com/gocd/api.go.cd/pull/83","diff_url":"https://github.com/gocd/api.go.cd/pull/83.diff","patch_url":"https://github.com/gocd/api.go.cd/pull/83.patch","issue_url":"https://api.github.com/repos/gocd/api.go.cd/issues/83","number":83,"state":"open","locked":false,"title":"Documentation of environments API","user":{"login":"GaneshSPatil","id":15275847,"avatar_url":"https://avatars.githubusercontent.com/u/15275847?v=3","gravatar_id":"","url":"https://api.github.com/users/GaneshSPatil","html_url":"https://github.com/GaneshSPatil","followers_url":"https://api.github.com/users/GaneshSPatil/followers","following_url":"https://api.github.com/users/GaneshSPatil/following{/other_user}","gists_url":"https://api.github.com/users/GaneshSPatil/gists{/gist_id}","starred_url":"https://api.github.com/users/GaneshSPatil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GaneshSPatil/subscriptions","organizations_url":"https://api.github.com/users/GaneshSPatil/orgs","repos_url":"https://api.github.com/users/GaneshSPatil/repos","events_url":"https://api.github.com/users/GaneshSPatil/events{/privacy}","received_events_url":"https://api.github.com/users/GaneshSPatil/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-30T02:46:58Z","updated_at":"2016-07-01T09:33:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b92fde36d674890b30a69c3a8f806262da9aa630","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/gocd/api.go.cd/pulls/83/commits","review_comments_url":"https://api.github.com/repos/gocd/api.go.cd/pulls/83/comments","review_comment_url":"https://api.github.com/repos/gocd/api.go.cd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gocd/api.go.cd/issues/83/comments","statuses_url":"https://api.github.com/repos/gocd/api.go.cd/statuses/108f421c7292b80506e012496753405c4d902507","head":{"label":"GaneshSPatil:environments-api","ref":"environments-api","sha":"108f421c7292b80506e012496753405c4d902507","user":{"login":"GaneshSPatil","id":15275847,"avatar_url":"https://avatars.githubusercontent.com/u/15275847?v=3","gravatar_id":"","url":"https://api.github.com/users/GaneshSPatil","html_url":"https://github.com/GaneshSPatil","followers_url":"https://api.github.com/users/GaneshSPatil/followers","following_url":"https://api.github.com/users/GaneshSPatil/following{/other_user}","gists_url":"https://api.github.com/users/GaneshSPatil/gists{/gist_id}","starred_url":"https://api.github.com/users/GaneshSPatil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GaneshSPatil/subscriptions","organizations_url":"https://api.github.com/users/GaneshSPatil/orgs","repos_url":"https://api.github.com/users/GaneshSPatil/repos","events_url":"https://api.github.com/users/GaneshSPatil/events{/privacy}","received_events_url":"https://api.github.com/users/GaneshSPatil/received_events","type":"User","site_admin":false},"repo":{"id":55782805,"name":"api.go.cd","full_name":"GaneshSPatil/api.go.cd","owner":{"login":"GaneshSPatil","id":15275847,"avatar_url":"https://avatars.githubusercontent.com/u/15275847?v=3","gravatar_id":"","url":"https://api.github.com/users/GaneshSPatil","html_url":"https://github.com/GaneshSPatil","followers_url":"https://api.github.com/users/GaneshSPatil/followers","following_url":"https://api.github.com/users/GaneshSPatil/following{/other_user}","gists_url":"https://api.github.com/users/GaneshSPatil/gists{/gist_id}","starred_url":"https://api.github.com/users/GaneshSPatil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GaneshSPatil/subscriptions","organizations_url":"https://api.github.com/users/GaneshSPatil/orgs","repos_url":"https://api.github.com/users/GaneshSPatil/repos","events_url":"https://api.github.com/users/GaneshSPatil/events{/privacy}","received_events_url":"https://api.github.com/users/GaneshSPatil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GaneshSPatil/api.go.cd","description":"API Documentation for Go CD","fork":true,"url":"https://api.github.com/repos/GaneshSPatil/api.go.cd","forks_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/forks","keys_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/teams","hooks_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/hooks","issue_events_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/issues/events{/number}","events_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/events","assignees_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/assignees{/user}","branches_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/branches{/branch}","tags_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/tags","blobs_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/git/refs{/sha}","trees_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/statuses/{sha}","languages_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/languages","stargazers_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/stargazers","contributors_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/contributors","subscribers_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/subscribers","subscription_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/subscription","commits_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/commits{/sha}","git_commits_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/git/commits{/sha}","comments_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/comments{/number}","issue_comment_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/issues/comments{/number}","contents_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/contents/{+path}","compare_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/merges","archive_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/downloads","issues_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/issues{/number}","pulls_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/pulls{/number}","milestones_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/milestones{/number}","notifications_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/labels{/name}","releases_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/releases{/id}","deployments_url":"https://api.github.com/repos/GaneshSPatil/api.go.cd/deployments","created_at":"2016-04-08T13:56:13Z","updated_at":"2016-04-08T13:56:15Z","pushed_at":"2016-07-01T07:13:09Z","git_url":"git://github.com/GaneshSPatil/api.go.cd.git","ssh_url":"git@github.com:GaneshSPatil/api.go.cd.git","clone_url":"https://github.com/GaneshSPatil/api.go.cd.git","svn_url":"https://github.com/GaneshSPatil/api.go.cd","homepage":"https://api.go.cd","size":1424,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gocd:master","ref":"master","sha":"973683c7d33ddbe4b29c52935d8529789b739714","user":{"login":"gocd","id":6099846,"avatar_url":"https://avatars.githubusercontent.com/u/6099846?v=3","gravatar_id":"","url":"https://api.github.com/users/gocd","html_url":"https://github.com/gocd","followers_url":"https://api.github.com/users/gocd/followers","following_url":"https://api.github.com/users/gocd/following{/other_user}","gists_url":"https://api.github.com/users/gocd/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd/subscriptions","organizations_url":"https://api.github.com/users/gocd/orgs","repos_url":"https://api.github.com/users/gocd/repos","events_url":"https://api.github.com/users/gocd/events{/privacy}","received_events_url":"https://api.github.com/users/gocd/received_events","type":"Organization","site_admin":false},"repo":{"id":36709806,"name":"api.go.cd","full_name":"gocd/api.go.cd","owner":{"login":"gocd","id":6099846,"avatar_url":"https://avatars.githubusercontent.com/u/6099846?v=3","gravatar_id":"","url":"https://api.github.com/users/gocd","html_url":"https://github.com/gocd","followers_url":"https://api.github.com/users/gocd/followers","following_url":"https://api.github.com/users/gocd/following{/other_user}","gists_url":"https://api.github.com/users/gocd/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd/subscriptions","organizations_url":"https://api.github.com/users/gocd/orgs","repos_url":"https://api.github.com/users/gocd/repos","events_url":"https://api.github.com/users/gocd/events{/privacy}","received_events_url":"https://api.github.com/users/gocd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gocd/api.go.cd","description":"API Documentation for Go CD","fork":true,"url":"https://api.github.com/repos/gocd/api.go.cd","forks_url":"https://api.github.com/repos/gocd/api.go.cd/forks","keys_url":"https://api.github.com/repos/gocd/api.go.cd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gocd/api.go.cd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gocd/api.go.cd/teams","hooks_url":"https://api.github.com/repos/gocd/api.go.cd/hooks","issue_events_url":"https://api.github.com/repos/gocd/api.go.cd/issues/events{/number}","events_url":"https://api.github.com/repos/gocd/api.go.cd/events","assignees_url":"https://api.github.com/repos/gocd/api.go.cd/assignees{/user}","branches_url":"https://api.github.com/repos/gocd/api.go.cd/branches{/branch}","tags_url":"https://api.github.com/repos/gocd/api.go.cd/tags","blobs_url":"https://api.github.com/repos/gocd/api.go.cd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gocd/api.go.cd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gocd/api.go.cd/git/refs{/sha}","trees_url":"https://api.github.com/repos/gocd/api.go.cd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gocd/api.go.cd/statuses/{sha}","languages_url":"https://api.github.com/repos/gocd/api.go.cd/languages","stargazers_url":"https://api.github.com/repos/gocd/api.go.cd/stargazers","contributors_url":"https://api.github.com/repos/gocd/api.go.cd/contributors","subscribers_url":"https://api.github.com/repos/gocd/api.go.cd/subscribers","subscription_url":"https://api.github.com/repos/gocd/api.go.cd/subscription","commits_url":"https://api.github.com/repos/gocd/api.go.cd/commits{/sha}","git_commits_url":"https://api.github.com/repos/gocd/api.go.cd/git/commits{/sha}","comments_url":"https://api.github.com/repos/gocd/api.go.cd/comments{/number}","issue_comment_url":"https://api.github.com/repos/gocd/api.go.cd/issues/comments{/number}","contents_url":"https://api.github.com/repos/gocd/api.go.cd/contents/{+path}","compare_url":"https://api.github.com/repos/gocd/api.go.cd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gocd/api.go.cd/merges","archive_url":"https://api.github.com/repos/gocd/api.go.cd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gocd/api.go.cd/downloads","issues_url":"https://api.github.com/repos/gocd/api.go.cd/issues{/number}","pulls_url":"https://api.github.com/repos/gocd/api.go.cd/pulls{/number}","milestones_url":"https://api.github.com/repos/gocd/api.go.cd/milestones{/number}","notifications_url":"https://api.github.com/repos/gocd/api.go.cd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gocd/api.go.cd/labels{/name}","releases_url":"https://api.github.com/repos/gocd/api.go.cd/releases{/id}","deployments_url":"https://api.github.com/repos/gocd/api.go.cd/deployments","created_at":"2015-06-02T05:21:35Z","updated_at":"2016-04-07T07:35:56Z","pushed_at":"2016-07-01T07:13:10Z","git_url":"git://github.com/gocd/api.go.cd.git","ssh_url":"git@github.com:gocd/api.go.cd.git","clone_url":"https://github.com/gocd/api.go.cd.git","svn_url":"https://github.com/gocd/api.go.cd","homepage":"https://api.go.cd","size":1473,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":18,"mirror_url":null,"open_issues_count":6,"forks":18,"open_issues":6,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gocd/api.go.cd/pulls/83"},"html":{"href":"https://github.com/gocd/api.go.cd/pull/83"},"issue":{"href":"https://api.github.com/repos/gocd/api.go.cd/issues/83"},"comments":{"href":"https://api.github.com/repos/gocd/api.go.cd/issues/83/comments"},"review_comments":{"href":"https://api.github.com/repos/gocd/api.go.cd/pulls/83/comments"},"review_comment":{"href":"https://api.github.com/repos/gocd/api.go.cd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gocd/api.go.cd/pulls/83/commits"},"statuses":{"href":"https://api.github.com/repos/gocd/api.go.cd/statuses/108f421c7292b80506e012496753405c4d902507"}}}}
{"actor":{"display_login":"ketan"}}