{"action":"created","comment":{"url":"https://api.github.com/repos/target/clouddriver/pulls/comments/65937565","id":65937565,"diff_hunk":"@@ -0,0 +1,69 @@\n+/*\n+ * Copyright 2016 Target, Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\")\n+ * you may not use this file except in compliance with the License.\n+ * 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+\n+package com.netflix.spinnaker.clouddriver.openstack.domain\n+\n+import groovy.transform.AutoClone\n+import groovy.transform.Canonical\n+\n+import java.util.regex.Matcher\n+import java.util.regex.Pattern\n+\n+@AutoClone\n+@Canonical\n+class LoadBalancerPool {\n+  static final int DEFAULT_INTERAL_PORT = 8000\n+  static final String POOL_NAME_PREFIX = 'pool'\n+\n+  String id\n+  String name\n+  String derivedName\n+  LoadBalancerProtocol protocol\n+  LoadBalancerMethod method\n+  String subnetId\n+  Integer internalPort\n+  String description\n+\n+  void setName(String name) {\n+    this.name = name\n+    this.derivedName = String.format(\"%s-%s-%d\", name, POOL_NAME_PREFIX, System.currentTimeMillis())\n+  }\n+\n+  void setInternalPort(Integer port) {\n+    this.internalPort = port\n+    this.description = \"internal_port=${internalPort}\"\n+  }\n+\n+  void setDescription(String description) {\n+    this.description = description\n+    this.internalPort = convertDescriptionToPort(description, DEFAULT_INTERAL_PORT)\n+  }\n+\n+  static Integer convertDescriptionToPort(String description, int defaultPort) {\n+    Integer result = defaultPort\n+\n+    Pattern p = Pattern.compile(\"(\\\\w*)=(\\\\d*)\")","path":"clouddriver-openstack/src/main/groovy/com/netflix/spinnaker/clouddriver/openstack/domain/LoadBalancerPool.groovy","position":58,"original_position":58,"commit_id":"89408c8f9f03350dbb0a907a979668d63a936dd7","original_commit_id":"89408c8f9f03350dbb0a907a979668d63a936dd7","user":{"login":"varikin","id":14263,"avatar_url":"https://avatars.githubusercontent.com/u/14263?v=3","gravatar_id":"","url":"https://api.github.com/users/varikin","html_url":"https://github.com/varikin","followers_url":"https://api.github.com/users/varikin/followers","following_url":"https://api.github.com/users/varikin/following{/other_user}","gists_url":"https://api.github.com/users/varikin/gists{/gist_id}","starred_url":"https://api.github.com/users/varikin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varikin/subscriptions","organizations_url":"https://api.github.com/users/varikin/orgs","repos_url":"https://api.github.com/users/varikin/repos","events_url":"https://api.github.com/users/varikin/events{/privacy}","received_events_url":"https://api.github.com/users/varikin/received_events","type":"User","site_admin":false},"body":"This will look for any `word=number`, do you want it specifically looking for `internal_port`? Also, does `\\w` include `_`?","created_at":"2016-06-06T18:00:28Z","updated_at":"2016-06-06T18:00:28Z","html_url":"https://github.com/target/clouddriver/pull/6#discussion_r65937565","pull_request_url":"https://api.github.com/repos/target/clouddriver/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/target/clouddriver/pulls/comments/65937565"},"html":{"href":"https://github.com/target/clouddriver/pull/6#discussion_r65937565"},"pull_request":{"href":"https://api.github.com/repos/target/clouddriver/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/target/clouddriver/pulls/6","id":72659824,"html_url":"https://github.com/target/clouddriver/pull/6","diff_url":"https://github.com/target/clouddriver/pull/6.diff","patch_url":"https://github.com/target/clouddriver/pull/6.patch","issue_url":"https://api.github.com/repos/target/clouddriver/issues/6","number":6,"state":"open","locked":false,"title":"Finished create load balancer ... Need to incorporate error handling …","user":{"login":"derekolk","id":4722324,"avatar_url":"https://avatars.githubusercontent.com/u/4722324?v=3","gravatar_id":"","url":"https://api.github.com/users/derekolk","html_url":"https://github.com/derekolk","followers_url":"https://api.github.com/users/derekolk/followers","following_url":"https://api.github.com/users/derekolk/following{/other_user}","gists_url":"https://api.github.com/users/derekolk/gists{/gist_id}","starred_url":"https://api.github.com/users/derekolk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekolk/subscriptions","organizations_url":"https://api.github.com/users/derekolk/orgs","repos_url":"https://api.github.com/users/derekolk/repos","events_url":"https://api.github.com/users/derekolk/events{/privacy}","received_events_url":"https://api.github.com/users/derekolk/received_events","type":"User","site_admin":false},"body":"…in openstack provider.","created_at":"2016-06-06T06:05:04Z","updated_at":"2016-06-06T18:00:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ecb86ddf5f2e30a3ee61706bbddde5aba926189","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/target/clouddriver/pulls/6/commits","review_comments_url":"https://api.github.com/repos/target/clouddriver/pulls/6/comments","review_comment_url":"https://api.github.com/repos/target/clouddriver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/target/clouddriver/issues/6/comments","statuses_url":"https://api.github.com/repos/target/clouddriver/statuses/89408c8f9f03350dbb0a907a979668d63a936dd7","head":{"label":"target:feature_loadbalancing_create","ref":"feature_loadbalancing_create","sha":"89408c8f9f03350dbb0a907a979668d63a936dd7","user":{"login":"target","id":932489,"avatar_url":"https://avatars.githubusercontent.com/u/932489?v=3","gravatar_id":"","url":"https://api.github.com/users/target","html_url":"https://github.com/target","followers_url":"https://api.github.com/users/target/followers","following_url":"https://api.github.com/users/target/following{/other_user}","gists_url":"https://api.github.com/users/target/gists{/gist_id}","starred_url":"https://api.github.com/users/target/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/target/subscriptions","organizations_url":"https://api.github.com/users/target/orgs","repos_url":"https://api.github.com/users/target/repos","events_url":"https://api.github.com/users/target/events{/privacy}","received_events_url":"https://api.github.com/users/target/received_events","type":"Organization","site_admin":false},"repo":{"id":58946721,"name":"clouddriver","full_name":"target/clouddriver","owner":{"login":"target","id":932489,"avatar_url":"https://avatars.githubusercontent.com/u/932489?v=3","gravatar_id":"","url":"https://api.github.com/users/target","html_url":"https://github.com/target","followers_url":"https://api.github.com/users/target/followers","following_url":"https://api.github.com/users/target/following{/other_user}","gists_url":"https://api.github.com/users/target/gists{/gist_id}","starred_url":"https://api.github.com/users/target/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/target/subscriptions","organizations_url":"https://api.github.com/users/target/orgs","repos_url":"https://api.github.com/users/target/repos","events_url":"https://api.github.com/users/target/events{/privacy}","received_events_url":"https://api.github.com/users/target/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/target/clouddriver","description":"read and write operations across cloud providers","fork":true,"url":"https://api.github.com/repos/target/clouddriver","forks_url":"https://api.github.com/repos/target/clouddriver/forks","keys_url":"https://api.github.com/repos/target/clouddriver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/target/clouddriver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/target/clouddriver/teams","hooks_url":"https://api.github.com/repos/target/clouddriver/hooks","issue_events_url":"https://api.github.com/repos/target/clouddriver/issues/events{/number}","events_url":"https://api.github.com/repos/target/clouddriver/events","assignees_url":"https://api.github.com/repos/target/clouddriver/assignees{/user}","branches_url":"https://api.github.com/repos/target/clouddriver/branches{/branch}","tags_url":"https://api.github.com/repos/target/clouddriver/tags","blobs_url":"https://api.github.com/repos/target/clouddriver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/target/clouddriver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/target/clouddriver/git/refs{/sha}","trees_url":"https://api.github.com/repos/target/clouddriver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/target/clouddriver/statuses/{sha}","languages_url":"https://api.github.com/repos/target/clouddriver/languages","stargazers_url":"https://api.github.com/repos/target/clouddriver/stargazers","contributors_url":"https://api.github.com/repos/target/clouddriver/contributors","subscribers_url":"https://api.github.com/repos/target/clouddriver/subscribers","subscription_url":"https://api.github.com/repos/target/clouddriver/subscription","commits_url":"https://api.github.com/repos/target/clouddriver/commits{/sha}","git_commits_url":"https://api.github.com/repos/target/clouddriver/git/commits{/sha}","comments_url":"https://api.github.com/repos/target/clouddriver/comments{/number}","issue_comment_url":"https://api.github.com/repos/target/clouddriver/issues/comments{/number}","contents_url":"https://api.github.com/repos/target/clouddriver/contents/{+path}","compare_url":"https://api.github.com/repos/target/clouddriver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/target/clouddriver/merges","archive_url":"https://api.github.com/repos/target/clouddriver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/target/clouddriver/downloads","issues_url":"https://api.github.com/repos/target/clouddriver/issues{/number}","pulls_url":"https://api.github.com/repos/target/clouddriver/pulls{/number}","milestones_url":"https://api.github.com/repos/target/clouddriver/milestones{/number}","notifications_url":"https://api.github.com/repos/target/clouddriver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/target/clouddriver/labels{/name}","releases_url":"https://api.github.com/repos/target/clouddriver/releases{/id}","deployments_url":"https://api.github.com/repos/target/clouddriver/deployments","created_at":"2016-05-16T16:06:08Z","updated_at":"2016-05-16T16:06:14Z","pushed_at":"2016-06-06T16:11:54Z","git_url":"git://github.com/target/clouddriver.git","ssh_url":"git@github.com:target/clouddriver.git","clone_url":"https://github.com/target/clouddriver.git","svn_url":"https://github.com/target/clouddriver","homepage":null,"size":26589,"stargazers_count":0,"watchers_count":0,"language":"Groovy","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"target:master","ref":"master","sha":"0a87654e509c4f9353a3275ba29ef710db3e5648","user":{"login":"target","id":932489,"avatar_url":"https://avatars.githubusercontent.com/u/932489?v=3","gravatar_id":"","url":"https://api.github.com/users/target","html_url":"https://github.com/target","followers_url":"https://api.github.com/users/target/followers","following_url":"https://api.github.com/users/target/following{/other_user}","gists_url":"https://api.github.com/users/target/gists{/gist_id}","starred_url":"https://api.github.com/users/target/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/target/subscriptions","organizations_url":"https://api.github.com/users/target/orgs","repos_url":"https://api.github.com/users/target/repos","events_url":"https://api.github.com/users/target/events{/privacy}","received_events_url":"https://api.github.com/users/target/received_events","type":"Organization","site_admin":false},"repo":{"id":58946721,"name":"clouddriver","full_name":"target/clouddriver","owner":{"login":"target","id":932489,"avatar_url":"https://avatars.githubusercontent.com/u/932489?v=3","gravatar_id":"","url":"https://api.github.com/users/target","html_url":"https://github.com/target","followers_url":"https://api.github.com/users/target/followers","following_url":"https://api.github.com/users/target/following{/other_user}","gists_url":"https://api.github.com/users/target/gists{/gist_id}","starred_url":"https://api.github.com/users/target/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/target/subscriptions","organizations_url":"https://api.github.com/users/target/orgs","repos_url":"https://api.github.com/users/target/repos","events_url":"https://api.github.com/users/target/events{/privacy}","received_events_url":"https://api.github.com/users/target/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/target/clouddriver","description":"read and write operations across cloud providers","fork":true,"url":"https://api.github.com/repos/target/clouddriver","forks_url":"https://api.github.com/repos/target/clouddriver/forks","keys_url":"https://api.github.com/repos/target/clouddriver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/target/clouddriver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/target/clouddriver/teams","hooks_url":"https://api.github.com/repos/target/clouddriver/hooks","issue_events_url":"https://api.github.com/repos/target/clouddriver/issues/events{/number}","events_url":"https://api.github.com/repos/target/clouddriver/events","assignees_url":"https://api.github.com/repos/target/clouddriver/assignees{/user}","branches_url":"https://api.github.com/repos/target/clouddriver/branches{/branch}","tags_url":"https://api.github.com/repos/target/clouddriver/tags","blobs_url":"https://api.github.com/repos/target/clouddriver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/target/clouddriver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/target/clouddriver/git/refs{/sha}","trees_url":"https://api.github.com/repos/target/clouddriver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/target/clouddriver/statuses/{sha}","languages_url":"https://api.github.com/repos/target/clouddriver/languages","stargazers_url":"https://api.github.com/repos/target/clouddriver/stargazers","contributors_url":"https://api.github.com/repos/target/clouddriver/contributors","subscribers_url":"https://api.github.com/repos/target/clouddriver/subscribers","subscription_url":"https://api.github.com/repos/target/clouddriver/subscription","commits_url":"https://api.github.com/repos/target/clouddriver/commits{/sha}","git_commits_url":"https://api.github.com/repos/target/clouddriver/git/commits{/sha}","comments_url":"https://api.github.com/repos/target/clouddriver/comments{/number}","issue_comment_url":"https://api.github.com/repos/target/clouddriver/issues/comments{/number}","contents_url":"https://api.github.com/repos/target/clouddriver/contents/{+path}","compare_url":"https://api.github.com/repos/target/clouddriver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/target/clouddriver/merges","archive_url":"https://api.github.com/repos/target/clouddriver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/target/clouddriver/downloads","issues_url":"https://api.github.com/repos/target/clouddriver/issues{/number}","pulls_url":"https://api.github.com/repos/target/clouddriver/pulls{/number}","milestones_url":"https://api.github.com/repos/target/clouddriver/milestones{/number}","notifications_url":"https://api.github.com/repos/target/clouddriver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/target/clouddriver/labels{/name}","releases_url":"https://api.github.com/repos/target/clouddriver/releases{/id}","deployments_url":"https://api.github.com/repos/target/clouddriver/deployments","created_at":"2016-05-16T16:06:08Z","updated_at":"2016-05-16T16:06:14Z","pushed_at":"2016-06-06T16:11:54Z","git_url":"git://github.com/target/clouddriver.git","ssh_url":"git@github.com:target/clouddriver.git","clone_url":"https://github.com/target/clouddriver.git","svn_url":"https://github.com/target/clouddriver","homepage":null,"size":26589,"stargazers_count":0,"watchers_count":0,"language":"Groovy","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/target/clouddriver/pulls/6"},"html":{"href":"https://github.com/target/clouddriver/pull/6"},"issue":{"href":"https://api.github.com/repos/target/clouddriver/issues/6"},"comments":{"href":"https://api.github.com/repos/target/clouddriver/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/target/clouddriver/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/target/clouddriver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/target/clouddriver/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/target/clouddriver/statuses/89408c8f9f03350dbb0a907a979668d63a936dd7"}}}}
{"actor":{"display_login":"varikin"}}