{"action":"created","comment":{"url":"https://api.github.com/repos/brooklyncentral/clocker/pulls/comments/58684113","id":58684113,"diff_hunk":"@@ -0,0 +1,650 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements.  See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * the License.  You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.jclouds.docker.compute.options;\n+\n+import static com.google.common.base.Objects.equal;\n+\n+import java.util.List;\n+import java.util.Map;\n+\n+import com.google.common.base.Objects;\n+import com.google.common.collect.ImmutableList;\n+import com.google.common.collect.ImmutableMap;\n+\n+import org.jclouds.compute.ComputeService;\n+import org.jclouds.compute.options.TemplateOptions;\n+import org.jclouds.docker.internal.NullSafeCopies;\n+import org.jclouds.domain.LoginCredentials;\n+import org.jclouds.javax.annotation.Nullable;\n+import org.jclouds.scriptbuilder.domain.Statement;\n+\n+/**\n+ * Contains options supported by the {@link ComputeService#createNodesInGroup(String, int, TemplateOptions) createNodes}\n+ * operation on the <em>docker</em> provider.\n+ *\n+ * <h2>Usage</h2>\n+ *\n+ * The recommended way to instantiate a\n+ * DockerTemplateOptions object is to statically import {@code DockerTemplateOptions.Builder.*}\n+ * and invoke one of the static creation methods, followed by an instance mutator if needed.\n+ *\n+ * <pre>{@code import static org.jclouds.docker.compute.options.DockerTemplateOptions.Builder.*;\n+ *\n+ * ComputeService api = // get connection\n+ * templateBuilder.options(inboundPorts(22, 80, 8080, 443));\n+ * Set<? extends NodeMetadata> set = api.createNodesInGroup(tag, 2, templateBuilder.build());}</pre>\n+ */\n+public class DockerTemplateOptions extends TemplateOptions implements Cloneable {\n+\n+   protected List<String> dns = ImmutableList.of();\n+   protected String hostname;\n+   protected Integer memory;\n+   protected Integer cpuShares;\n+   protected List<String> entrypoint = ImmutableList.of();\n+   protected List<String> commands = ImmutableList.of();\n+   protected Map<String, String> volumes = ImmutableMap.of();\n+   protected List<String> env = ImmutableList.of();\n+   protected Map<Integer, Integer> portBindings = ImmutableMap.of();\n+   protected String networkMode;\n+   protected Map<String, String> extraHosts = ImmutableMap.of();\n+   protected List<String> volumesFrom = ImmutableList.of();\n+\n+   @Override\n+   public DockerTemplateOptions clone() {\n+      DockerTemplateOptions options = new DockerTemplateOptions();\n+      copyTo(options);\n+      return options;\n+   }\n+\n+   @Override\n+   public void copyTo(TemplateOptions to) {\n+      super.copyTo(to);\n+      if (to instanceof DockerTemplateOptions) {\n+         DockerTemplateOptions eTo = DockerTemplateOptions.class.cast(to);\n+         eTo.volumes(volumes);\n+         eTo.hostname(hostname);\n+         eTo.dns(dns);\n+         eTo.memory(memory);\n+         eTo.cpuShares(cpuShares);\n+         eTo.entrypoint(entrypoint);\n+         eTo.commands(commands);\n+         eTo.env(env);\n+         eTo.portBindings(portBindings);\n+         eTo.networkMode(networkMode);\n+         eTo.extraHosts(extraHosts);\n+         eTo.volumesFrom(volumesFrom);\n+      }\n+   }\n+\n+   @Override\n+   public boolean equals(Object o) {\n+      if (this == o)\n+         return true;\n+      if (o == null || getClass() != o.getClass())\n+         return false;\n+      DockerTemplateOptions that = DockerTemplateOptions.class.cast(o);\n+      return super.equals(that) && equal(this.volumes, that.volumes) &&\n+              equal(this.hostname, that.hostname) &&\n+              equal(this.dns, that.dns) &&\n+              equal(this.memory, that.memory) &&\n+              equal(this.entrypoint, that.entrypoint) &&\n+              equal(this.commands, that.commands) &&\n+              equal(this.cpuShares, that.cpuShares) &&\n+              equal(this.env, that.env) &&\n+              equal(this.portBindings, that.portBindings) &&\n+              equal(this.extraHosts, that.extraHosts) &&\n+              equal(this.volumesFrom, that.volumesFrom);\n+   }\n+\n+   @Override\n+   public int hashCode() {\n+      return Objects.hashCode(super.hashCode(), volumes, hostname, dns, memory, entrypoint, commands, cpuShares, env, portBindings, extraHosts);","path":"patches/src/main/java/org/jclouds/docker/compute/options/DockerTemplateOptions.java","position":115,"original_position":115,"commit_id":"d1626481f20b24ff92a459988ae2d18f562fb9a2","original_commit_id":"d1626481f20b24ff92a459988ae2d18f562fb9a2","user":{"login":"nakomis","id":1488244,"avatar_url":"https://avatars.githubusercontent.com/u/1488244?v=3","gravatar_id":"","url":"https://api.github.com/users/nakomis","html_url":"https://github.com/nakomis","followers_url":"https://api.github.com/users/nakomis/followers","following_url":"https://api.github.com/users/nakomis/following{/other_user}","gists_url":"https://api.github.com/users/nakomis/gists{/gist_id}","starred_url":"https://api.github.com/users/nakomis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nakomis/subscriptions","organizations_url":"https://api.github.com/users/nakomis/orgs","repos_url":"https://api.github.com/users/nakomis/repos","events_url":"https://api.github.com/users/nakomis/events{/privacy}","received_events_url":"https://api.github.com/users/nakomis/received_events","type":"User","site_admin":false},"body":"Missing `volumesFrom`","created_at":"2016-04-06T10:35:01Z","updated_at":"2016-04-06T10:35:01Z","html_url":"https://github.com/brooklyncentral/clocker/pull/272#discussion_r58684113","pull_request_url":"https://api.github.com/repos/brooklyncentral/clocker/pulls/272","_links":{"self":{"href":"https://api.github.com/repos/brooklyncentral/clocker/pulls/comments/58684113"},"html":{"href":"https://github.com/brooklyncentral/clocker/pull/272#discussion_r58684113"},"pull_request":{"href":"https://api.github.com/repos/brooklyncentral/clocker/pulls/272"}}},"pull_request":{"url":"https://api.github.com/repos/brooklyncentral/clocker/pulls/272","id":65011674,"html_url":"https://github.com/brooklyncentral/clocker/pull/272","diff_url":"https://github.com/brooklyncentral/clocker/pull/272.diff","patch_url":"https://github.com/brooklyncentral/clocker/pull/272.patch","issue_url":"https://api.github.com/repos/brooklyncentral/clocker/issues/272","number":272,"state":"open","locked":false,"title":"GroupPlacementStrategy update and various other fixes","user":{"login":"grkvlt","id":214870,"avatar_url":"https://avatars.githubusercontent.com/u/214870?v=3","gravatar_id":"","url":"https://api.github.com/users/grkvlt","html_url":"https://github.com/grkvlt","followers_url":"https://api.github.com/users/grkvlt/followers","following_url":"https://api.github.com/users/grkvlt/following{/other_user}","gists_url":"https://api.github.com/users/grkvlt/gists{/gist_id}","starred_url":"https://api.github.com/users/grkvlt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grkvlt/subscriptions","organizations_url":"https://api.github.com/users/grkvlt/orgs","repos_url":"https://api.github.com/users/grkvlt/repos","events_url":"https://api.github.com/users/grkvlt/events{/privacy}","received_events_url":"https://api.github.com/users/grkvlt/received_events","type":"User","site_admin":false},"body":"- Fix issues with `GroupPlacementStrategy` using `Monitor` mutexes\r\n- Add extra command support to `VanillaDockerApplication`\r\n- Better `docker exec` support for `useSsh: false`\r\n- Use `docker cp` instead of `scp` for  `useSsh: false`\r\n- Support `volumesFrom` container config\r\n- Copies of files for https://github.com/jclouds/jclouds-labs/pull/253","created_at":"2016-04-01T22:06:02Z","updated_at":"2016-04-06T10:35:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af6b64af43ca132aa38cf2a51a704ae7e8593a59","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/brooklyncentral/clocker/pulls/272/commits","review_comments_url":"https://api.github.com/repos/brooklyncentral/clocker/pulls/272/comments","review_comment_url":"https://api.github.com/repos/brooklyncentral/clocker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/brooklyncentral/clocker/issues/272/comments","statuses_url":"https://api.github.com/repos/brooklyncentral/clocker/statuses/d1626481f20b24ff92a459988ae2d18f562fb9a2","head":{"label":"brooklyncentral:group-placement-locking","ref":"group-placement-locking","sha":"d1626481f20b24ff92a459988ae2d18f562fb9a2","user":{"login":"brooklyncentral","id":1587357,"avatar_url":"https://avatars.githubusercontent.com/u/1587357?v=3","gravatar_id":"","url":"https://api.github.com/users/brooklyncentral","html_url":"https://github.com/brooklyncentral","followers_url":"https://api.github.com/users/brooklyncentral/followers","following_url":"https://api.github.com/users/brooklyncentral/following{/other_user}","gists_url":"https://api.github.com/users/brooklyncentral/gists{/gist_id}","starred_url":"https://api.github.com/users/brooklyncentral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brooklyncentral/subscriptions","organizations_url":"https://api.github.com/users/brooklyncentral/orgs","repos_url":"https://api.github.com/users/brooklyncentral/repos","events_url":"https://api.github.com/users/brooklyncentral/events{/privacy}","received_events_url":"https://api.github.com/users/brooklyncentral/received_events","type":"Organization","site_admin":false},"repo":{"id":17784299,"name":"clocker","full_name":"brooklyncentral/clocker","owner":{"login":"brooklyncentral","id":1587357,"avatar_url":"https://avatars.githubusercontent.com/u/1587357?v=3","gravatar_id":"","url":"https://api.github.com/users/brooklyncentral","html_url":"https://github.com/brooklyncentral","followers_url":"https://api.github.com/users/brooklyncentral/followers","following_url":"https://api.github.com/users/brooklyncentral/following{/other_user}","gists_url":"https://api.github.com/users/brooklyncentral/gists{/gist_id}","starred_url":"https://api.github.com/users/brooklyncentral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brooklyncentral/subscriptions","organizations_url":"https://api.github.com/users/brooklyncentral/orgs","repos_url":"https://api.github.com/users/brooklyncentral/repos","events_url":"https://api.github.com/users/brooklyncentral/events{/privacy}","received_events_url":"https://api.github.com/users/brooklyncentral/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/brooklyncentral/clocker","description":"Brooklyn managed Docker containers","fork":false,"url":"https://api.github.com/repos/brooklyncentral/clocker","forks_url":"https://api.github.com/repos/brooklyncentral/clocker/forks","keys_url":"https://api.github.com/repos/brooklyncentral/clocker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brooklyncentral/clocker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brooklyncentral/clocker/teams","hooks_url":"https://api.github.com/repos/brooklyncentral/clocker/hooks","issue_events_url":"https://api.github.com/repos/brooklyncentral/clocker/issues/events{/number}","events_url":"https://api.github.com/repos/brooklyncentral/clocker/events","assignees_url":"https://api.github.com/repos/brooklyncentral/clocker/assignees{/user}","branches_url":"https://api.github.com/repos/brooklyncentral/clocker/branches{/branch}","tags_url":"https://api.github.com/repos/brooklyncentral/clocker/tags","blobs_url":"https://api.github.com/repos/brooklyncentral/clocker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brooklyncentral/clocker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brooklyncentral/clocker/git/refs{/sha}","trees_url":"https://api.github.com/repos/brooklyncentral/clocker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brooklyncentral/clocker/statuses/{sha}","languages_url":"https://api.github.com/repos/brooklyncentral/clocker/languages","stargazers_url":"https://api.github.com/repos/brooklyncentral/clocker/stargazers","contributors_url":"https://api.github.com/repos/brooklyncentral/clocker/contributors","subscribers_url":"https://api.github.com/repos/brooklyncentral/clocker/subscribers","subscription_url":"https://api.github.com/repos/brooklyncentral/clocker/subscription","commits_url":"https://api.github.com/repos/brooklyncentral/clocker/commits{/sha}","git_commits_url":"https://api.github.com/repos/brooklyncentral/clocker/git/commits{/sha}","comments_url":"https://api.github.com/repos/brooklyncentral/clocker/comments{/number}","issue_comment_url":"https://api.github.com/repos/brooklyncentral/clocker/issues/comments{/number}","contents_url":"https://api.github.com/repos/brooklyncentral/clocker/contents/{+path}","compare_url":"https://api.github.com/repos/brooklyncentral/clocker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brooklyncentral/clocker/merges","archive_url":"https://api.github.com/repos/brooklyncentral/clocker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brooklyncentral/clocker/downloads","issues_url":"https://api.github.com/repos/brooklyncentral/clocker/issues{/number}","pulls_url":"https://api.github.com/repos/brooklyncentral/clocker/pulls{/number}","milestones_url":"https://api.github.com/repos/brooklyncentral/clocker/milestones{/number}","notifications_url":"https://api.github.com/repos/brooklyncentral/clocker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brooklyncentral/clocker/labels{/name}","releases_url":"https://api.github.com/repos/brooklyncentral/clocker/releases{/id}","deployments_url":"https://api.github.com/repos/brooklyncentral/clocker/deployments","created_at":"2014-03-15T20:03:57Z","updated_at":"2016-04-04T00:34:14Z","pushed_at":"2016-04-06T10:32:27Z","git_url":"git://github.com/brooklyncentral/clocker.git","ssh_url":"git@github.com:brooklyncentral/clocker.git","clone_url":"https://github.com/brooklyncentral/clocker.git","svn_url":"https://github.com/brooklyncentral/clocker","homepage":null,"size":7377,"stargazers_count":394,"watchers_count":394,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":57,"mirror_url":null,"open_issues_count":48,"forks":57,"open_issues":48,"watchers":394,"default_branch":"master"}},"base":{"label":"brooklyncentral:master","ref":"master","sha":"50dce256d0071bcc8adbeb7499f12cce918ba3e4","user":{"login":"brooklyncentral","id":1587357,"avatar_url":"https://avatars.githubusercontent.com/u/1587357?v=3","gravatar_id":"","url":"https://api.github.com/users/brooklyncentral","html_url":"https://github.com/brooklyncentral","followers_url":"https://api.github.com/users/brooklyncentral/followers","following_url":"https://api.github.com/users/brooklyncentral/following{/other_user}","gists_url":"https://api.github.com/users/brooklyncentral/gists{/gist_id}","starred_url":"https://api.github.com/users/brooklyncentral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brooklyncentral/subscriptions","organizations_url":"https://api.github.com/users/brooklyncentral/orgs","repos_url":"https://api.github.com/users/brooklyncentral/repos","events_url":"https://api.github.com/users/brooklyncentral/events{/privacy}","received_events_url":"https://api.github.com/users/brooklyncentral/received_events","type":"Organization","site_admin":false},"repo":{"id":17784299,"name":"clocker","full_name":"brooklyncentral/clocker","owner":{"login":"brooklyncentral","id":1587357,"avatar_url":"https://avatars.githubusercontent.com/u/1587357?v=3","gravatar_id":"","url":"https://api.github.com/users/brooklyncentral","html_url":"https://github.com/brooklyncentral","followers_url":"https://api.github.com/users/brooklyncentral/followers","following_url":"https://api.github.com/users/brooklyncentral/following{/other_user}","gists_url":"https://api.github.com/users/brooklyncentral/gists{/gist_id}","starred_url":"https://api.github.com/users/brooklyncentral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brooklyncentral/subscriptions","organizations_url":"https://api.github.com/users/brooklyncentral/orgs","repos_url":"https://api.github.com/users/brooklyncentral/repos","events_url":"https://api.github.com/users/brooklyncentral/events{/privacy}","received_events_url":"https://api.github.com/users/brooklyncentral/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/brooklyncentral/clocker","description":"Brooklyn managed Docker containers","fork":false,"url":"https://api.github.com/repos/brooklyncentral/clocker","forks_url":"https://api.github.com/repos/brooklyncentral/clocker/forks","keys_url":"https://api.github.com/repos/brooklyncentral/clocker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brooklyncentral/clocker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brooklyncentral/clocker/teams","hooks_url":"https://api.github.com/repos/brooklyncentral/clocker/hooks","issue_events_url":"https://api.github.com/repos/brooklyncentral/clocker/issues/events{/number}","events_url":"https://api.github.com/repos/brooklyncentral/clocker/events","assignees_url":"https://api.github.com/repos/brooklyncentral/clocker/assignees{/user}","branches_url":"https://api.github.com/repos/brooklyncentral/clocker/branches{/branch}","tags_url":"https://api.github.com/repos/brooklyncentral/clocker/tags","blobs_url":"https://api.github.com/repos/brooklyncentral/clocker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brooklyncentral/clocker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brooklyncentral/clocker/git/refs{/sha}","trees_url":"https://api.github.com/repos/brooklyncentral/clocker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brooklyncentral/clocker/statuses/{sha}","languages_url":"https://api.github.com/repos/brooklyncentral/clocker/languages","stargazers_url":"https://api.github.com/repos/brooklyncentral/clocker/stargazers","contributors_url":"https://api.github.com/repos/brooklyncentral/clocker/contributors","subscribers_url":"https://api.github.com/repos/brooklyncentral/clocker/subscribers","subscription_url":"https://api.github.com/repos/brooklyncentral/clocker/subscription","commits_url":"https://api.github.com/repos/brooklyncentral/clocker/commits{/sha}","git_commits_url":"https://api.github.com/repos/brooklyncentral/clocker/git/commits{/sha}","comments_url":"https://api.github.com/repos/brooklyncentral/clocker/comments{/number}","issue_comment_url":"https://api.github.com/repos/brooklyncentral/clocker/issues/comments{/number}","contents_url":"https://api.github.com/repos/brooklyncentral/clocker/contents/{+path}","compare_url":"https://api.github.com/repos/brooklyncentral/clocker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brooklyncentral/clocker/merges","archive_url":"https://api.github.com/repos/brooklyncentral/clocker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brooklyncentral/clocker/downloads","issues_url":"https://api.github.com/repos/brooklyncentral/clocker/issues{/number}","pulls_url":"https://api.github.com/repos/brooklyncentral/clocker/pulls{/number}","milestones_url":"https://api.github.com/repos/brooklyncentral/clocker/milestones{/number}","notifications_url":"https://api.github.com/repos/brooklyncentral/clocker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brooklyncentral/clocker/labels{/name}","releases_url":"https://api.github.com/repos/brooklyncentral/clocker/releases{/id}","deployments_url":"https://api.github.com/repos/brooklyncentral/clocker/deployments","created_at":"2014-03-15T20:03:57Z","updated_at":"2016-04-04T00:34:14Z","pushed_at":"2016-04-06T10:32:27Z","git_url":"git://github.com/brooklyncentral/clocker.git","ssh_url":"git@github.com:brooklyncentral/clocker.git","clone_url":"https://github.com/brooklyncentral/clocker.git","svn_url":"https://github.com/brooklyncentral/clocker","homepage":null,"size":7377,"stargazers_count":394,"watchers_count":394,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":57,"mirror_url":null,"open_issues_count":48,"forks":57,"open_issues":48,"watchers":394,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/brooklyncentral/clocker/pulls/272"},"html":{"href":"https://github.com/brooklyncentral/clocker/pull/272"},"issue":{"href":"https://api.github.com/repos/brooklyncentral/clocker/issues/272"},"comments":{"href":"https://api.github.com/repos/brooklyncentral/clocker/issues/272/comments"},"review_comments":{"href":"https://api.github.com/repos/brooklyncentral/clocker/pulls/272/comments"},"review_comment":{"href":"https://api.github.com/repos/brooklyncentral/clocker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/brooklyncentral/clocker/pulls/272/commits"},"statuses":{"href":"https://api.github.com/repos/brooklyncentral/clocker/statuses/d1626481f20b24ff92a459988ae2d18f562fb9a2"}}}}