{"action":"created","comment":{"url":"https://api.github.com/repos/cloudera/director-google-plugin/pulls/comments/38698772","id":38698772,"diff_hunk":"@@ -0,0 +1,608 @@\n+/*\n+ * Copyright (c) 2015 Google, 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.cloudera.director.google.sql;\n+\n+import static com.cloudera.director.google.sql.GoogleCloudSQLInstanceTemplateConfigurationProperty.MASTER_USERNAME;\n+import static com.cloudera.director.google.sql.GoogleCloudSQLInstanceTemplateConfigurationProperty.MASTER_USER_PASSWORD;\n+import static com.cloudera.director.google.sql.GoogleCloudSQLInstanceTemplateConfigurationProperty.PREFERRED_LOCATION;\n+import static com.cloudera.director.google.sql.GoogleCloudSQLInstanceTemplateConfigurationProperty.TIER;\n+import static com.cloudera.director.google.sql.GoogleCloudSQLProviderConfigurationProperty.REGION_SQL;\n+import static com.cloudera.director.spi.v1.model.InstanceTemplate.InstanceTemplateConfigurationPropertyToken.INSTANCE_NAME_PREFIX;\n+\n+import com.cloudera.director.google.internal.GoogleCredentials;\n+import com.cloudera.director.spi.v1.database.DatabaseType;\n+import com.cloudera.director.spi.v1.database.util.AbstractDatabaseServerInstance;\n+import com.cloudera.director.spi.v1.database.util.AbstractDatabaseServerProvider;\n+import com.cloudera.director.spi.v1.database.util.SimpleDatabaseServerProviderMetadata;\n+import com.cloudera.director.spi.v1.model.ConfigurationProperty;\n+import com.cloudera.director.spi.v1.model.ConfigurationValidator;\n+import com.cloudera.director.spi.v1.model.Configured;\n+import com.cloudera.director.spi.v1.model.InstanceState;\n+import com.cloudera.director.spi.v1.model.InstanceStatus;\n+import com.cloudera.director.spi.v1.model.LocalizationContext;\n+import com.cloudera.director.spi.v1.model.Resource;\n+import com.cloudera.director.spi.v1.model.util.CompositeConfigurationValidator;\n+import com.cloudera.director.spi.v1.model.exception.InvalidCredentialsException;\n+import com.cloudera.director.spi.v1.model.exception.PluginExceptionCondition;\n+import com.cloudera.director.spi.v1.model.exception.PluginExceptionConditionAccumulator;\n+import com.cloudera.director.spi.v1.model.exception.PluginExceptionDetails;\n+import com.cloudera.director.spi.v1.model.exception.TransientProviderException;\n+import com.cloudera.director.spi.v1.model.exception.UnrecoverableProviderException;\n+import com.cloudera.director.spi.v1.model.util.SimpleInstanceState;\n+import com.cloudera.director.spi.v1.model.util.SimpleResourceTemplate;\n+import com.cloudera.director.spi.v1.provider.ResourceProviderMetadata;\n+import com.cloudera.director.spi.v1.util.ConfigurationPropertiesUtil;\n+import com.google.api.client.googleapis.json.GoogleJsonResponseException;\n+import com.google.api.services.sqladmin.model.AclEntry;\n+import com.google.api.services.sqladmin.model.DatabaseInstance;\n+import com.google.api.services.sqladmin.model.IpConfiguration;\n+import com.google.api.services.sqladmin.model.LocationPreference;\n+import com.google.api.services.sqladmin.model.Operation;\n+import com.google.api.services.sqladmin.model.OperationError;\n+import com.google.api.services.sqladmin.model.OperationErrors;\n+import com.google.api.services.sqladmin.model.Settings;\n+import com.google.api.services.sqladmin.model.User;\n+import com.google.api.services.sqladmin.SQLAdmin;\n+import com.typesafe.config.Config;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import java.io.IOException;\n+import java.util.ArrayList;\n+import java.util.Arrays;\n+import java.util.Collection;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.HashSet;\n+import java.util.regex.Pattern;\n+\n+public class GoogleCloudSQLProvider","path":"provider/src/main/java/com/cloudera/director/google/sql/GoogleCloudSQLProvider.java","position":74,"original_position":74,"commit_id":"19c22233fdcf84578b0063ea82814d529ef78b16","original_commit_id":"65244b926959bc71c57b00ff6281ccab0ecce5e2","user":{"login":"jadair-cloudera","id":11339493,"avatar_url":"https://avatars.githubusercontent.com/u/11339493?v=3","gravatar_id":"","url":"https://api.github.com/users/jadair-cloudera","html_url":"https://github.com/jadair-cloudera","followers_url":"https://api.github.com/users/jadair-cloudera/followers","following_url":"https://api.github.com/users/jadair-cloudera/following{/other_user}","gists_url":"https://api.github.com/users/jadair-cloudera/gists{/gist_id}","starred_url":"https://api.github.com/users/jadair-cloudera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadair-cloudera/subscriptions","organizations_url":"https://api.github.com/users/jadair-cloudera/orgs","repos_url":"https://api.github.com/users/jadair-cloudera/repos","events_url":"https://api.github.com/users/jadair-cloudera/events{/privacy}","received_events_url":"https://api.github.com/users/jadair-cloudera/received_events","type":"User","site_admin":false},"body":"Javadoc.","created_at":"2015-09-03T21:27:08Z","updated_at":"2015-09-03T21:27:09Z","html_url":"https://github.com/cloudera/director-google-plugin/pull/100#discussion_r38698772","pull_request_url":"https://api.github.com/repos/cloudera/director-google-plugin/pulls/100","_links":{"self":{"href":"https://api.github.com/repos/cloudera/director-google-plugin/pulls/comments/38698772"},"html":{"href":"https://github.com/cloudera/director-google-plugin/pull/100#discussion_r38698772"},"pull_request":{"href":"https://api.github.com/repos/cloudera/director-google-plugin/pulls/100"}}},"pull_request":{"url":"https://api.github.com/repos/cloudera/director-google-plugin/pulls/100","id":43900913,"html_url":"https://github.com/cloudera/director-google-plugin/pull/100","diff_url":"https://github.com/cloudera/director-google-plugin/pull/100.diff","patch_url":"https://github.com/cloudera/director-google-plugin/pull/100.patch","issue_url":"https://api.github.com/repos/cloudera/director-google-plugin/issues/100","number":100,"state":"open","locked":false,"title":"Add first pass of Google Cloud SQL integration.","user":{"login":"kl3n1nz","id":13105644,"avatar_url":"https://avatars.githubusercontent.com/u/13105644?v=3","gravatar_id":"","url":"https://api.github.com/users/kl3n1nz","html_url":"https://github.com/kl3n1nz","followers_url":"https://api.github.com/users/kl3n1nz/followers","following_url":"https://api.github.com/users/kl3n1nz/following{/other_user}","gists_url":"https://api.github.com/users/kl3n1nz/gists{/gist_id}","starred_url":"https://api.github.com/users/kl3n1nz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kl3n1nz/subscriptions","organizations_url":"https://api.github.com/users/kl3n1nz/orgs","repos_url":"https://api.github.com/users/kl3n1nz/repos","events_url":"https://api.github.com/users/kl3n1nz/events{/privacy}","received_events_url":"https://api.github.com/users/kl3n1nz/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-01T17:03:43Z","updated_at":"2015-09-03T21:27:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"47a388dc2010c9d4769d06c6e4ae15f369cd9faa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cloudera/director-google-plugin/pulls/100/commits","review_comments_url":"https://api.github.com/repos/cloudera/director-google-plugin/pulls/100/comments","review_comment_url":"https://api.github.com/repos/cloudera/director-google-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudera/director-google-plugin/issues/100/comments","statuses_url":"https://api.github.com/repos/cloudera/director-google-plugin/statuses/19c22233fdcf84578b0063ea82814d529ef78b16","head":{"label":"kl3n1nz:google-sql-squashed","ref":"google-sql-squashed","sha":"19c22233fdcf84578b0063ea82814d529ef78b16","user":{"login":"kl3n1nz","id":13105644,"avatar_url":"https://avatars.githubusercontent.com/u/13105644?v=3","gravatar_id":"","url":"https://api.github.com/users/kl3n1nz","html_url":"https://github.com/kl3n1nz","followers_url":"https://api.github.com/users/kl3n1nz/followers","following_url":"https://api.github.com/users/kl3n1nz/following{/other_user}","gists_url":"https://api.github.com/users/kl3n1nz/gists{/gist_id}","starred_url":"https://api.github.com/users/kl3n1nz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kl3n1nz/subscriptions","organizations_url":"https://api.github.com/users/kl3n1nz/orgs","repos_url":"https://api.github.com/users/kl3n1nz/repos","events_url":"https://api.github.com/users/kl3n1nz/events{/privacy}","received_events_url":"https://api.github.com/users/kl3n1nz/received_events","type":"User","site_admin":false},"repo":{"id":40658491,"name":"director-google-plugin","full_name":"kl3n1nz/director-google-plugin","owner":{"login":"kl3n1nz","id":13105644,"avatar_url":"https://avatars.githubusercontent.com/u/13105644?v=3","gravatar_id":"","url":"https://api.github.com/users/kl3n1nz","html_url":"https://github.com/kl3n1nz","followers_url":"https://api.github.com/users/kl3n1nz/followers","following_url":"https://api.github.com/users/kl3n1nz/following{/other_user}","gists_url":"https://api.github.com/users/kl3n1nz/gists{/gist_id}","starred_url":"https://api.github.com/users/kl3n1nz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kl3n1nz/subscriptions","organizations_url":"https://api.github.com/users/kl3n1nz/orgs","repos_url":"https://api.github.com/users/kl3n1nz/repos","events_url":"https://api.github.com/users/kl3n1nz/events{/privacy}","received_events_url":"https://api.github.com/users/kl3n1nz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kl3n1nz/director-google-plugin","description":"Cloudera Director - Google Cloud Platform integration","fork":true,"url":"https://api.github.com/repos/kl3n1nz/director-google-plugin","forks_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/forks","keys_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/teams","hooks_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/hooks","issue_events_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/events","assignees_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/tags","blobs_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/languages","stargazers_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/stargazers","contributors_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/contributors","subscribers_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/subscribers","subscription_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/subscription","commits_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/merges","archive_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/downloads","issues_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/labels{/name}","releases_url":"https://api.github.com/repos/kl3n1nz/director-google-plugin/releases{/id}","created_at":"2015-08-13T12:50:11Z","updated_at":"2015-08-13T12:50:12Z","pushed_at":"2015-09-02T21:34:45Z","git_url":"git://github.com/kl3n1nz/director-google-plugin.git","ssh_url":"git@github.com:kl3n1nz/director-google-plugin.git","clone_url":"https://github.com/kl3n1nz/director-google-plugin.git","svn_url":"https://github.com/kl3n1nz/director-google-plugin","homepage":null,"size":589,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"cloudera:master","ref":"master","sha":"2f3af0b609267dc951b22083b9ab97fcb4fd61f4","user":{"login":"cloudera","id":87383,"avatar_url":"https://avatars.githubusercontent.com/u/87383?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudera","html_url":"https://github.com/cloudera","followers_url":"https://api.github.com/users/cloudera/followers","following_url":"https://api.github.com/users/cloudera/following{/other_user}","gists_url":"https://api.github.com/users/cloudera/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudera/subscriptions","organizations_url":"https://api.github.com/users/cloudera/orgs","repos_url":"https://api.github.com/users/cloudera/repos","events_url":"https://api.github.com/users/cloudera/events{/privacy}","received_events_url":"https://api.github.com/users/cloudera/received_events","type":"Organization","site_admin":false},"repo":{"id":30982881,"name":"director-google-plugin","full_name":"cloudera/director-google-plugin","owner":{"login":"cloudera","id":87383,"avatar_url":"https://avatars.githubusercontent.com/u/87383?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudera","html_url":"https://github.com/cloudera","followers_url":"https://api.github.com/users/cloudera/followers","following_url":"https://api.github.com/users/cloudera/following{/other_user}","gists_url":"https://api.github.com/users/cloudera/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudera/subscriptions","organizations_url":"https://api.github.com/users/cloudera/orgs","repos_url":"https://api.github.com/users/cloudera/repos","events_url":"https://api.github.com/users/cloudera/events{/privacy}","received_events_url":"https://api.github.com/users/cloudera/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudera/director-google-plugin","description":"Cloudera Director - Google Cloud Platform integration","fork":false,"url":"https://api.github.com/repos/cloudera/director-google-plugin","forks_url":"https://api.github.com/repos/cloudera/director-google-plugin/forks","keys_url":"https://api.github.com/repos/cloudera/director-google-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudera/director-google-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudera/director-google-plugin/teams","hooks_url":"https://api.github.com/repos/cloudera/director-google-plugin/hooks","issue_events_url":"https://api.github.com/repos/cloudera/director-google-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/cloudera/director-google-plugin/events","assignees_url":"https://api.github.com/repos/cloudera/director-google-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/cloudera/director-google-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/cloudera/director-google-plugin/tags","blobs_url":"https://api.github.com/repos/cloudera/director-google-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudera/director-google-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudera/director-google-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudera/director-google-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudera/director-google-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudera/director-google-plugin/languages","stargazers_url":"https://api.github.com/repos/cloudera/director-google-plugin/stargazers","contributors_url":"https://api.github.com/repos/cloudera/director-google-plugin/contributors","subscribers_url":"https://api.github.com/repos/cloudera/director-google-plugin/subscribers","subscription_url":"https://api.github.com/repos/cloudera/director-google-plugin/subscription","commits_url":"https://api.github.com/repos/cloudera/director-google-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudera/director-google-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudera/director-google-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudera/director-google-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudera/director-google-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/cloudera/director-google-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudera/director-google-plugin/merges","archive_url":"https://api.github.com/repos/cloudera/director-google-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudera/director-google-plugin/downloads","issues_url":"https://api.github.com/repos/cloudera/director-google-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/cloudera/director-google-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudera/director-google-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudera/director-google-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudera/director-google-plugin/labels{/name}","releases_url":"https://api.github.com/repos/cloudera/director-google-plugin/releases{/id}","created_at":"2015-02-18T19:39:24Z","updated_at":"2015-08-13T05:46:08Z","pushed_at":"2015-09-02T21:34:46Z","git_url":"git://github.com/cloudera/director-google-plugin.git","ssh_url":"git@github.com:cloudera/director-google-plugin.git","clone_url":"https://github.com/cloudera/director-google-plugin.git","svn_url":"https://github.com/cloudera/director-google-plugin","homepage":null,"size":1267,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudera/director-google-plugin/pulls/100"},"html":{"href":"https://github.com/cloudera/director-google-plugin/pull/100"},"issue":{"href":"https://api.github.com/repos/cloudera/director-google-plugin/issues/100"},"comments":{"href":"https://api.github.com/repos/cloudera/director-google-plugin/issues/100/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudera/director-google-plugin/pulls/100/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudera/director-google-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudera/director-google-plugin/pulls/100/commits"},"statuses":{"href":"https://api.github.com/repos/cloudera/director-google-plugin/statuses/19c22233fdcf84578b0063ea82814d529ef78b16"}}}}