{"action":"created","comment":{"url":"https://api.github.com/repos/amplifylitco/asiaq/pulls/comments/62551927","id":62551927,"diff_hunk":"@@ -55,6 +56,16 @@ def get_parser():\n     parser_cleanup_snapshots.set_defaults(mode=\"cleanup_snapshots\")\n     parser_cleanup_snapshots.add_argument('--age', dest='days', required=False,\n                                           help='Minimum age of Snapshots to expire', type=int, default=30)\n+\n+    # clone Mode\n+    parser_clone = subparsers.add_parser(\"clone\", help=\"Create a new database from an existing database\")\n+    parser_clone.set_defaults(mode=\"clone\")\n+    parser_clone.add_argument('--env', dest='env', required=False, default=None,\n+                              help='The environment containing the RDS cluster(s)')\n+    parser_clone.add_argument('--source-db', dest='source_db', required=True,","path":"bin/disco_rds.py","position":20,"original_position":20,"commit_id":"a4fbdf9aef52e046321ce4ac7625f7943885ef17","original_commit_id":"a4fbdf9aef52e046321ce4ac7625f7943885ef17","user":{"login":"aoskotsky-amplify","id":15692902,"avatar_url":"https://avatars.githubusercontent.com/u/15692902?v=3","gravatar_id":"","url":"https://api.github.com/users/aoskotsky-amplify","html_url":"https://github.com/aoskotsky-amplify","followers_url":"https://api.github.com/users/aoskotsky-amplify/followers","following_url":"https://api.github.com/users/aoskotsky-amplify/following{/other_user}","gists_url":"https://api.github.com/users/aoskotsky-amplify/gists{/gist_id}","starred_url":"https://api.github.com/users/aoskotsky-amplify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aoskotsky-amplify/subscriptions","organizations_url":"https://api.github.com/users/aoskotsky-amplify/orgs","repos_url":"https://api.github.com/users/aoskotsky-amplify/repos","events_url":"https://api.github.com/users/aoskotsky-amplify/events{/privacy}","received_events_url":"https://api.github.com/users/aoskotsky-amplify/received_events","type":"User","site_admin":false},"body":"I wanted to leave it open to add destination-db in the future","created_at":"2016-05-09T18:49:38Z","updated_at":"2016-05-09T18:49:38Z","html_url":"https://github.com/amplifylitco/asiaq/pull/38#discussion_r62551927","pull_request_url":"https://api.github.com/repos/amplifylitco/asiaq/pulls/38","_links":{"self":{"href":"https://api.github.com/repos/amplifylitco/asiaq/pulls/comments/62551927"},"html":{"href":"https://github.com/amplifylitco/asiaq/pull/38#discussion_r62551927"},"pull_request":{"href":"https://api.github.com/repos/amplifylitco/asiaq/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/amplifylitco/asiaq/pulls/38","id":69178843,"html_url":"https://github.com/amplifylitco/asiaq/pull/38","diff_url":"https://github.com/amplifylitco/asiaq/pull/38.diff","patch_url":"https://github.com/amplifylitco/asiaq/pull/38.patch","issue_url":"https://api.github.com/repos/amplifylitco/asiaq/issues/38","number":38,"state":"open","locked":false,"title":"Add clone command to disco_rds.py","user":{"login":"aoskotsky-amplify","id":15692902,"avatar_url":"https://avatars.githubusercontent.com/u/15692902?v=3","gravatar_id":"","url":"https://api.github.com/users/aoskotsky-amplify","html_url":"https://github.com/aoskotsky-amplify","followers_url":"https://api.github.com/users/aoskotsky-amplify/followers","following_url":"https://api.github.com/users/aoskotsky-amplify/following{/other_user}","gists_url":"https://api.github.com/users/aoskotsky-amplify/gists{/gist_id}","starred_url":"https://api.github.com/users/aoskotsky-amplify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aoskotsky-amplify/subscriptions","organizations_url":"https://api.github.com/users/aoskotsky-amplify/orgs","repos_url":"https://api.github.com/users/aoskotsky-amplify/repos","events_url":"https://api.github.com/users/aoskotsky-amplify/events{/privacy}","received_events_url":"https://api.github.com/users/aoskotsky-amplify/received_events","type":"User","site_admin":false},"body":"Add a `disco_rds.py clone --env target_env --source-env source_env --source-db source_db` command\r\n\r\nThis will copy the configuration and latest snapshot to create a new database in another environment. The current use case is copying databases into sandbox environments. This could also be used for mirroring the prod and staging databases.\r\n\r\nThis only supports cloning into a different environment. In the future we can add support for creating a copy in the source's environment.\r\n\r\n**Note**: I did some minor refactoring of the master password handling. We were previously storing the master password with a key that included the environment name like `ci-foodb` but the environment is already in the S3 bucket name so its redundant and causes  problems when using sandboxes. The new approach will look for either a `ci-foodb` key or a `foodb` key for backwards compatibility. \r\n\r\n**Future work for another PR:**\r\n* Cloning from a specific snapshot other than the latest one\r\n* Displaying a list of snapshots that can be cloned\r\n* Cloning into the same environment as the source database but with a different name","created_at":"2016-05-06T16:51:54Z","updated_at":"2016-05-09T18:49:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8df8637e104b9a41e2202c689065c14d5c90881a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/amplifylitco/asiaq/pulls/38/commits","review_comments_url":"https://api.github.com/repos/amplifylitco/asiaq/pulls/38/comments","review_comment_url":"https://api.github.com/repos/amplifylitco/asiaq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amplifylitco/asiaq/issues/38/comments","statuses_url":"https://api.github.com/repos/amplifylitco/asiaq/statuses/a4fbdf9aef52e046321ce4ac7625f7943885ef17","head":{"label":"amplifylitco:add_rds_clone_functionality","ref":"add_rds_clone_functionality","sha":"a4fbdf9aef52e046321ce4ac7625f7943885ef17","user":{"login":"amplifylitco","id":15659472,"avatar_url":"https://avatars.githubusercontent.com/u/15659472?v=3","gravatar_id":"","url":"https://api.github.com/users/amplifylitco","html_url":"https://github.com/amplifylitco","followers_url":"https://api.github.com/users/amplifylitco/followers","following_url":"https://api.github.com/users/amplifylitco/following{/other_user}","gists_url":"https://api.github.com/users/amplifylitco/gists{/gist_id}","starred_url":"https://api.github.com/users/amplifylitco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplifylitco/subscriptions","organizations_url":"https://api.github.com/users/amplifylitco/orgs","repos_url":"https://api.github.com/users/amplifylitco/repos","events_url":"https://api.github.com/users/amplifylitco/events{/privacy}","received_events_url":"https://api.github.com/users/amplifylitco/received_events","type":"Organization","site_admin":false},"repo":{"id":53361236,"name":"asiaq","full_name":"amplifylitco/asiaq","owner":{"login":"amplifylitco","id":15659472,"avatar_url":"https://avatars.githubusercontent.com/u/15659472?v=3","gravatar_id":"","url":"https://api.github.com/users/amplifylitco","html_url":"https://github.com/amplifylitco","followers_url":"https://api.github.com/users/amplifylitco/followers","following_url":"https://api.github.com/users/amplifylitco/following{/other_user}","gists_url":"https://api.github.com/users/amplifylitco/gists{/gist_id}","starred_url":"https://api.github.com/users/amplifylitco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplifylitco/subscriptions","organizations_url":"https://api.github.com/users/amplifylitco/orgs","repos_url":"https://api.github.com/users/amplifylitco/repos","events_url":"https://api.github.com/users/amplifylitco/events{/privacy}","received_events_url":"https://api.github.com/users/amplifylitco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amplifylitco/asiaq","description":"","fork":false,"url":"https://api.github.com/repos/amplifylitco/asiaq","forks_url":"https://api.github.com/repos/amplifylitco/asiaq/forks","keys_url":"https://api.github.com/repos/amplifylitco/asiaq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amplifylitco/asiaq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amplifylitco/asiaq/teams","hooks_url":"https://api.github.com/repos/amplifylitco/asiaq/hooks","issue_events_url":"https://api.github.com/repos/amplifylitco/asiaq/issues/events{/number}","events_url":"https://api.github.com/repos/amplifylitco/asiaq/events","assignees_url":"https://api.github.com/repos/amplifylitco/asiaq/assignees{/user}","branches_url":"https://api.github.com/repos/amplifylitco/asiaq/branches{/branch}","tags_url":"https://api.github.com/repos/amplifylitco/asiaq/tags","blobs_url":"https://api.github.com/repos/amplifylitco/asiaq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amplifylitco/asiaq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amplifylitco/asiaq/git/refs{/sha}","trees_url":"https://api.github.com/repos/amplifylitco/asiaq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amplifylitco/asiaq/statuses/{sha}","languages_url":"https://api.github.com/repos/amplifylitco/asiaq/languages","stargazers_url":"https://api.github.com/repos/amplifylitco/asiaq/stargazers","contributors_url":"https://api.github.com/repos/amplifylitco/asiaq/contributors","subscribers_url":"https://api.github.com/repos/amplifylitco/asiaq/subscribers","subscription_url":"https://api.github.com/repos/amplifylitco/asiaq/subscription","commits_url":"https://api.github.com/repos/amplifylitco/asiaq/commits{/sha}","git_commits_url":"https://api.github.com/repos/amplifylitco/asiaq/git/commits{/sha}","comments_url":"https://api.github.com/repos/amplifylitco/asiaq/comments{/number}","issue_comment_url":"https://api.github.com/repos/amplifylitco/asiaq/issues/comments{/number}","contents_url":"https://api.github.com/repos/amplifylitco/asiaq/contents/{+path}","compare_url":"https://api.github.com/repos/amplifylitco/asiaq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amplifylitco/asiaq/merges","archive_url":"https://api.github.com/repos/amplifylitco/asiaq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amplifylitco/asiaq/downloads","issues_url":"https://api.github.com/repos/amplifylitco/asiaq/issues{/number}","pulls_url":"https://api.github.com/repos/amplifylitco/asiaq/pulls{/number}","milestones_url":"https://api.github.com/repos/amplifylitco/asiaq/milestones{/number}","notifications_url":"https://api.github.com/repos/amplifylitco/asiaq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amplifylitco/asiaq/labels{/name}","releases_url":"https://api.github.com/repos/amplifylitco/asiaq/releases{/id}","deployments_url":"https://api.github.com/repos/amplifylitco/asiaq/deployments","created_at":"2016-03-07T21:41:20Z","updated_at":"2016-04-06T06:21:13Z","pushed_at":"2016-05-09T16:48:14Z","git_url":"git://github.com/amplifylitco/asiaq.git","ssh_url":"git@github.com:amplifylitco/asiaq.git","clone_url":"https://github.com/amplifylitco/asiaq.git","svn_url":"https://github.com/amplifylitco/asiaq","homepage":null,"size":612,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":11,"forks":1,"open_issues":11,"watchers":7,"default_branch":"master"}},"base":{"label":"amplifylitco:master","ref":"master","sha":"d04d8895c79dae458ef80efc99427cf9bd7c08e0","user":{"login":"amplifylitco","id":15659472,"avatar_url":"https://avatars.githubusercontent.com/u/15659472?v=3","gravatar_id":"","url":"https://api.github.com/users/amplifylitco","html_url":"https://github.com/amplifylitco","followers_url":"https://api.github.com/users/amplifylitco/followers","following_url":"https://api.github.com/users/amplifylitco/following{/other_user}","gists_url":"https://api.github.com/users/amplifylitco/gists{/gist_id}","starred_url":"https://api.github.com/users/amplifylitco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplifylitco/subscriptions","organizations_url":"https://api.github.com/users/amplifylitco/orgs","repos_url":"https://api.github.com/users/amplifylitco/repos","events_url":"https://api.github.com/users/amplifylitco/events{/privacy}","received_events_url":"https://api.github.com/users/amplifylitco/received_events","type":"Organization","site_admin":false},"repo":{"id":53361236,"name":"asiaq","full_name":"amplifylitco/asiaq","owner":{"login":"amplifylitco","id":15659472,"avatar_url":"https://avatars.githubusercontent.com/u/15659472?v=3","gravatar_id":"","url":"https://api.github.com/users/amplifylitco","html_url":"https://github.com/amplifylitco","followers_url":"https://api.github.com/users/amplifylitco/followers","following_url":"https://api.github.com/users/amplifylitco/following{/other_user}","gists_url":"https://api.github.com/users/amplifylitco/gists{/gist_id}","starred_url":"https://api.github.com/users/amplifylitco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplifylitco/subscriptions","organizations_url":"https://api.github.com/users/amplifylitco/orgs","repos_url":"https://api.github.com/users/amplifylitco/repos","events_url":"https://api.github.com/users/amplifylitco/events{/privacy}","received_events_url":"https://api.github.com/users/amplifylitco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amplifylitco/asiaq","description":"","fork":false,"url":"https://api.github.com/repos/amplifylitco/asiaq","forks_url":"https://api.github.com/repos/amplifylitco/asiaq/forks","keys_url":"https://api.github.com/repos/amplifylitco/asiaq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amplifylitco/asiaq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amplifylitco/asiaq/teams","hooks_url":"https://api.github.com/repos/amplifylitco/asiaq/hooks","issue_events_url":"https://api.github.com/repos/amplifylitco/asiaq/issues/events{/number}","events_url":"https://api.github.com/repos/amplifylitco/asiaq/events","assignees_url":"https://api.github.com/repos/amplifylitco/asiaq/assignees{/user}","branches_url":"https://api.github.com/repos/amplifylitco/asiaq/branches{/branch}","tags_url":"https://api.github.com/repos/amplifylitco/asiaq/tags","blobs_url":"https://api.github.com/repos/amplifylitco/asiaq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amplifylitco/asiaq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amplifylitco/asiaq/git/refs{/sha}","trees_url":"https://api.github.com/repos/amplifylitco/asiaq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amplifylitco/asiaq/statuses/{sha}","languages_url":"https://api.github.com/repos/amplifylitco/asiaq/languages","stargazers_url":"https://api.github.com/repos/amplifylitco/asiaq/stargazers","contributors_url":"https://api.github.com/repos/amplifylitco/asiaq/contributors","subscribers_url":"https://api.github.com/repos/amplifylitco/asiaq/subscribers","subscription_url":"https://api.github.com/repos/amplifylitco/asiaq/subscription","commits_url":"https://api.github.com/repos/amplifylitco/asiaq/commits{/sha}","git_commits_url":"https://api.github.com/repos/amplifylitco/asiaq/git/commits{/sha}","comments_url":"https://api.github.com/repos/amplifylitco/asiaq/comments{/number}","issue_comment_url":"https://api.github.com/repos/amplifylitco/asiaq/issues/comments{/number}","contents_url":"https://api.github.com/repos/amplifylitco/asiaq/contents/{+path}","compare_url":"https://api.github.com/repos/amplifylitco/asiaq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amplifylitco/asiaq/merges","archive_url":"https://api.github.com/repos/amplifylitco/asiaq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amplifylitco/asiaq/downloads","issues_url":"https://api.github.com/repos/amplifylitco/asiaq/issues{/number}","pulls_url":"https://api.github.com/repos/amplifylitco/asiaq/pulls{/number}","milestones_url":"https://api.github.com/repos/amplifylitco/asiaq/milestones{/number}","notifications_url":"https://api.github.com/repos/amplifylitco/asiaq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amplifylitco/asiaq/labels{/name}","releases_url":"https://api.github.com/repos/amplifylitco/asiaq/releases{/id}","deployments_url":"https://api.github.com/repos/amplifylitco/asiaq/deployments","created_at":"2016-03-07T21:41:20Z","updated_at":"2016-04-06T06:21:13Z","pushed_at":"2016-05-09T16:48:14Z","git_url":"git://github.com/amplifylitco/asiaq.git","ssh_url":"git@github.com:amplifylitco/asiaq.git","clone_url":"https://github.com/amplifylitco/asiaq.git","svn_url":"https://github.com/amplifylitco/asiaq","homepage":null,"size":612,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":11,"forks":1,"open_issues":11,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amplifylitco/asiaq/pulls/38"},"html":{"href":"https://github.com/amplifylitco/asiaq/pull/38"},"issue":{"href":"https://api.github.com/repos/amplifylitco/asiaq/issues/38"},"comments":{"href":"https://api.github.com/repos/amplifylitco/asiaq/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/amplifylitco/asiaq/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/amplifylitco/asiaq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amplifylitco/asiaq/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/amplifylitco/asiaq/statuses/a4fbdf9aef52e046321ce4ac7625f7943885ef17"}}}}