{"action":"created","comment":{"url":"https://api.github.com/repos/aws/amazon-ecs-cli/pulls/comments/208759599","pull_request_review_id":144637056,"id":208759599,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODc1OTU5OQ==","diff_hunk":"@@ -0,0 +1,135 @@\n+// Copyright 2015-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\"). You may\n+// not use this file except in compliance with the License. A copy of the\n+// License is located at\n+//\n+//\thttp://aws.amazon.com/apache2.0/\n+//\n+// or in the \"license\" file accompanying this file. This file is distributed\n+// on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n+// express or implied. See the License for the specific language governing\n+// permissions and limitations under the License.\n+\n+// Package route53 contains functions for working with the route53 APIs\n+// that back ECS Service Discovery\n+package route53\n+\n+import (\n+\t\"github.com/aws/amazon-ecs-cli/ecs-cli/modules/clients\"\n+\t\"github.com/aws/amazon-ecs-cli/ecs-cli/modules/config\"\n+\t\"github.com/aws/aws-sdk-go/aws\"\n+\t\"github.com/aws/aws-sdk-go/service/route53\"\n+\t\"github.com/aws/aws-sdk-go/service/servicediscovery\"\n+)\n+\n+// FindPrivateNamespace returns the ID(s) of the private namespace with the given name and vpc\n+func FindPrivateNamespace(name, vpc string, config *config.CommandConfig) (*string, error) {\n+\tregion := aws.StringValue(config.Session.Config.Region)\n+\tvar nameMatch []*string\n+\tr53Client := newRoute53Client(config)\n+\tsdClient := newSDClient(config)","path":"ecs-cli/modules/clients/aws/route53/servicediscovery_client.go","position":null,"original_position":31,"commit_id":"1dde95f71a153d7950f33afaef1481e546718288","original_commit_id":"b0437ab9324e7039404213d6bb095f770c8d79b2","user":{"login":"SoManyHs","id":29964746,"node_id":"MDQ6VXNlcjI5OTY0NzQ2","avatar_url":"https://avatars0.githubusercontent.com/u/29964746?v=4","gravatar_id":"","url":"https://api.github.com/users/SoManyHs","html_url":"https://github.com/SoManyHs","followers_url":"https://api.github.com/users/SoManyHs/followers","following_url":"https://api.github.com/users/SoManyHs/following{/other_user}","gists_url":"https://api.github.com/users/SoManyHs/gists{/gist_id}","starred_url":"https://api.github.com/users/SoManyHs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SoManyHs/subscriptions","organizations_url":"https://api.github.com/users/SoManyHs/orgs","repos_url":"https://api.github.com/users/SoManyHs/repos","events_url":"https://api.github.com/users/SoManyHs/events{/privacy}","received_events_url":"https://api.github.com/users/SoManyHs/received_events","type":"User","site_admin":false},"body":"I agree that the a *customer* of the CLI should not care about implementation details of client instantiation etc; I disagree that the consumer of the package shouldn't care about anything but the public API because it's an internal package, and so the ones using the package are the maintainers. This all has already been addressed in aithal's [comment](https://github.com/aws/amazon-ecs-cli/pull/565/commits/b0437ab9324e7039404213d6bb095f770c8d79b2#r208594610), but just thought I'd add my two cents.","created_at":"2018-08-08T22:46:37Z","updated_at":"2018-08-08T22:46:38Z","html_url":"https://github.com/aws/amazon-ecs-cli/pull/565#discussion_r208759599","pull_request_url":"https://api.github.com/repos/aws/amazon-ecs-cli/pulls/565","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/aws/amazon-ecs-cli/pulls/comments/208759599"},"html":{"href":"https://github.com/aws/amazon-ecs-cli/pull/565#discussion_r208759599"},"pull_request":{"href":"https://api.github.com/repos/aws/amazon-ecs-cli/pulls/565"}},"in_reply_to_id":208128647},"pull_request":{"url":"https://api.github.com/repos/aws/amazon-ecs-cli/pulls/565","id":202707928,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyNzA3OTI4","html_url":"https://github.com/aws/amazon-ecs-cli/pull/565","diff_url":"https://github.com/aws/amazon-ecs-cli/pull/565.diff","patch_url":"https://github.com/aws/amazon-ecs-cli/pull/565.patch","issue_url":"https://api.github.com/repos/aws/amazon-ecs-cli/issues/565","number":565,"state":"open","locked":false,"title":"Service Discovery: Find an existing namespace by name","user":{"login":"PettitWesley","id":29443996,"node_id":"MDQ6VXNlcjI5NDQzOTk2","avatar_url":"https://avatars0.githubusercontent.com/u/29443996?v=4","gravatar_id":"","url":"https://api.github.com/users/PettitWesley","html_url":"https://github.com/PettitWesley","followers_url":"https://api.github.com/users/PettitWesley/followers","following_url":"https://api.github.com/users/PettitWesley/following{/other_user}","gists_url":"https://api.github.com/users/PettitWesley/gists{/gist_id}","starred_url":"https://api.github.com/users/PettitWesley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PettitWesley/subscriptions","organizations_url":"https://api.github.com/users/PettitWesley/orgs","repos_url":"https://api.github.com/users/PettitWesley/repos","events_url":"https://api.github.com/users/PettitWesley/events{/privacy}","received_events_url":"https://api.github.com/users/PettitWesley/received_events","type":"User","site_admin":false},"body":"*Description of changes:*\r\nThe ECS CLI service discovery implementation will need to be able to find the ID of an existing namespace given its name and vpc. This PR represents all of the route53 API functionality that will be used; all actual resource management will be done through CloudFormation.\r\n\r\nBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.\r\n","created_at":"2018-07-19T23:14:38Z","updated_at":"2018-08-08T22:46:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"260b13e6417a130df4a3f5b2a2a0a36747ace078","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aws/amazon-ecs-cli/pulls/565/commits","review_comments_url":"https://api.github.com/repos/aws/amazon-ecs-cli/pulls/565/comments","review_comment_url":"https://api.github.com/repos/aws/amazon-ecs-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aws/amazon-ecs-cli/issues/565/comments","statuses_url":"https://api.github.com/repos/aws/amazon-ecs-cli/statuses/1dde95f71a153d7950f33afaef1481e546718288","head":{"label":"PettitWesley:findorcreatenamespace","ref":"findorcreatenamespace","sha":"1dde95f71a153d7950f33afaef1481e546718288","user":{"login":"PettitWesley","id":29443996,"node_id":"MDQ6VXNlcjI5NDQzOTk2","avatar_url":"https://avatars0.githubusercontent.com/u/29443996?v=4","gravatar_id":"","url":"https://api.github.com/users/PettitWesley","html_url":"https://github.com/PettitWesley","followers_url":"https://api.github.com/users/PettitWesley/followers","following_url":"https://api.github.com/users/PettitWesley/following{/other_user}","gists_url":"https://api.github.com/users/PettitWesley/gists{/gist_id}","starred_url":"https://api.github.com/users/PettitWesley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PettitWesley/subscriptions","organizations_url":"https://api.github.com/users/PettitWesley/orgs","repos_url":"https://api.github.com/users/PettitWesley/repos","events_url":"https://api.github.com/users/PettitWesley/events{/privacy}","received_events_url":"https://api.github.com/users/PettitWesley/received_events","type":"User","site_admin":false},"repo":{"id":94467880,"node_id":"MDEwOlJlcG9zaXRvcnk5NDQ2Nzg4MA==","name":"amazon-ecs-cli","full_name":"PettitWesley/amazon-ecs-cli","owner":{"login":"PettitWesley","id":29443996,"node_id":"MDQ6VXNlcjI5NDQzOTk2","avatar_url":"https://avatars0.githubusercontent.com/u/29443996?v=4","gravatar_id":"","url":"https://api.github.com/users/PettitWesley","html_url":"https://github.com/PettitWesley","followers_url":"https://api.github.com/users/PettitWesley/followers","following_url":"https://api.github.com/users/PettitWesley/following{/other_user}","gists_url":"https://api.github.com/users/PettitWesley/gists{/gist_id}","starred_url":"https://api.github.com/users/PettitWesley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PettitWesley/subscriptions","organizations_url":"https://api.github.com/users/PettitWesley/orgs","repos_url":"https://api.github.com/users/PettitWesley/repos","events_url":"https://api.github.com/users/PettitWesley/events{/privacy}","received_events_url":"https://api.github.com/users/PettitWesley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PettitWesley/amazon-ecs-cli","description":"A custom Amazon ECS CLI that eases up the cluster setup process, enables users to run their applications locally or on ECS using the same Docker Compose file format and familiar Compose commands. ","fork":true,"url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli","forks_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/forks","keys_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/teams","hooks_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/hooks","issue_events_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/issues/events{/number}","events_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/events","assignees_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/assignees{/user}","branches_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/branches{/branch}","tags_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/tags","blobs_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/languages","stargazers_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/stargazers","contributors_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/contributors","subscribers_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/subscribers","subscription_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/subscription","commits_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/contents/{+path}","compare_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/merges","archive_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/downloads","issues_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/issues{/number}","pulls_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/labels{/name}","releases_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/releases{/id}","deployments_url":"https://api.github.com/repos/PettitWesley/amazon-ecs-cli/deployments","created_at":"2017-06-15T18:30:50Z","updated_at":"2017-06-15T18:30:52Z","pushed_at":"2018-08-08T06:11:53Z","git_url":"git://github.com/PettitWesley/amazon-ecs-cli.git","ssh_url":"git@github.com:PettitWesley/amazon-ecs-cli.git","clone_url":"https://github.com/PettitWesley/amazon-ecs-cli.git","svn_url":"https://github.com/PettitWesley/amazon-ecs-cli","homepage":null,"size":11127,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"aws:servicediscovery","ref":"servicediscovery","sha":"87b53e8fdd654bf209658eaaa688a5061022e325","user":{"login":"aws","id":2232217,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzIyMTc=","avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"repo":{"id":43446846,"node_id":"MDEwOlJlcG9zaXRvcnk0MzQ0Njg0Ng==","name":"amazon-ecs-cli","full_name":"aws/amazon-ecs-cli","owner":{"login":"aws","id":2232217,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzIyMTc=","avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aws/amazon-ecs-cli","description":"A custom Amazon ECS CLI that eases up the cluster setup process, enables users to run their applications locally or on ECS using the same Docker Compose file format and familiar Compose commands. ","fork":false,"url":"https://api.github.com/repos/aws/amazon-ecs-cli","forks_url":"https://api.github.com/repos/aws/amazon-ecs-cli/forks","keys_url":"https://api.github.com/repos/aws/amazon-ecs-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aws/amazon-ecs-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aws/amazon-ecs-cli/teams","hooks_url":"https://api.github.com/repos/aws/amazon-ecs-cli/hooks","issue_events_url":"https://api.github.com/repos/aws/amazon-ecs-cli/issues/events{/number}","events_url":"https://api.github.com/repos/aws/amazon-ecs-cli/events","assignees_url":"https://api.github.com/repos/aws/amazon-ecs-cli/assignees{/user}","branches_url":"https://api.github.com/repos/aws/amazon-ecs-cli/branches{/branch}","tags_url":"https://api.github.com/repos/aws/amazon-ecs-cli/tags","blobs_url":"https://api.github.com/repos/aws/amazon-ecs-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aws/amazon-ecs-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aws/amazon-ecs-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/aws/amazon-ecs-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aws/amazon-ecs-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/aws/amazon-ecs-cli/languages","stargazers_url":"https://api.github.com/repos/aws/amazon-ecs-cli/stargazers","contributors_url":"https://api.github.com/repos/aws/amazon-ecs-cli/contributors","subscribers_url":"https://api.github.com/repos/aws/amazon-ecs-cli/subscribers","subscription_url":"https://api.github.com/repos/aws/amazon-ecs-cli/subscription","commits_url":"https://api.github.com/repos/aws/amazon-ecs-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/aws/amazon-ecs-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/aws/amazon-ecs-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/aws/amazon-ecs-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/aws/amazon-ecs-cli/contents/{+path}","compare_url":"https://api.github.com/repos/aws/amazon-ecs-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aws/amazon-ecs-cli/merges","archive_url":"https://api.github.com/repos/aws/amazon-ecs-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aws/amazon-ecs-cli/downloads","issues_url":"https://api.github.com/repos/aws/amazon-ecs-cli/issues{/number}","pulls_url":"https://api.github.com/repos/aws/amazon-ecs-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/aws/amazon-ecs-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/aws/amazon-ecs-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aws/amazon-ecs-cli/labels{/name}","releases_url":"https://api.github.com/repos/aws/amazon-ecs-cli/releases{/id}","deployments_url":"https://api.github.com/repos/aws/amazon-ecs-cli/deployments","created_at":"2015-09-30T17:11:40Z","updated_at":"2018-08-08T07:08:17Z","pushed_at":"2018-08-08T18:37:36Z","git_url":"git://github.com/aws/amazon-ecs-cli.git","ssh_url":"git@github.com:aws/amazon-ecs-cli.git","clone_url":"https://github.com/aws/amazon-ecs-cli.git","svn_url":"https://github.com/aws/amazon-ecs-cli","homepage":null,"size":10831,"stargazers_count":958,"watchers_count":958,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":164,"mirror_url":null,"archived":false,"open_issues_count":56,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":164,"open_issues":56,"watchers":958,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aws/amazon-ecs-cli/pulls/565"},"html":{"href":"https://github.com/aws/amazon-ecs-cli/pull/565"},"issue":{"href":"https://api.github.com/repos/aws/amazon-ecs-cli/issues/565"},"comments":{"href":"https://api.github.com/repos/aws/amazon-ecs-cli/issues/565/comments"},"review_comments":{"href":"https://api.github.com/repos/aws/amazon-ecs-cli/pulls/565/comments"},"review_comment":{"href":"https://api.github.com/repos/aws/amazon-ecs-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aws/amazon-ecs-cli/pulls/565/commits"},"statuses":{"href":"https://api.github.com/repos/aws/amazon-ecs-cli/statuses/1dde95f71a153d7950f33afaef1481e546718288"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"SoManyHs"}}