{"action":"created","comment":{"url":"https://api.github.com/repos/hashicorp/terraform/pulls/comments/43556491","id":43556491,"diff_hunk":"@@ -0,0 +1,100 @@\n+package google\n+\n+import (\n+\t\"fmt\"\n+\t\"log\"\n+\n+\t\"github.com/hashicorp/terraform/helper/schema\"\n+\t\"google.golang.org/api/compute/v1\"\n+\t\"google.golang.org/api/googleapi\"\n+)\n+\n+func resourceComputeGlobalAddress() *schema.Resource {\n+\treturn &schema.Resource{\n+\t\tCreate: resourceComputeGlobalAddressCreate,\n+\t\tRead:   resourceComputeGlobalAddressRead,\n+\t\tDelete: resourceComputeGlobalAddressDelete,\n+\n+\t\tSchema: map[string]*schema.Schema{\n+\t\t\t\"name\": &schema.Schema{\n+\t\t\t\tType:     schema.TypeString,\n+\t\t\t\tRequired: true,\n+\t\t\t\tForceNew: true,\n+\t\t\t},\n+\n+\t\t\t\"address\": &schema.Schema{\n+\t\t\t\tType:     schema.TypeString,\n+\t\t\t\tComputed: true,\n+\t\t\t},\n+\n+\t\t\t\"self_link\": &schema.Schema{\n+\t\t\t\tType:     schema.TypeString,\n+\t\t\t\tComputed: true,\n+\t\t\t},\n+\t\t},\n+\t}\n+}\n+\n+func resourceComputeGlobalAddressCreate(d *schema.ResourceData, meta interface{}) error {\n+\tconfig := meta.(*Config)\n+\n+\t// Build the address parameter\n+\taddr := &compute.Address{Name: d.Get(\"name\").(string)}\n+\top, err := config.clientCompute.GlobalAddresses.Insert(\n+\t\tconfig.Project, addr).Do()\n+\tif err != nil {\n+\t\treturn fmt.Errorf(\"Error creating address: %s\", err)\n+\t}\n+\n+\t// It probably maybe worked, so store the ID now\n+\td.SetId(addr.Name)\n+\n+\terr = computeOperationWaitGlobal(config, op, \"Creating Global Address\")\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\n+\treturn resourceComputeGlobalAddressRead(d, meta)\n+}\n+\n+func resourceComputeGlobalAddressRead(d *schema.ResourceData, meta interface{}) error {\n+\tconfig := meta.(*Config)\n+\n+\taddr, err := config.clientCompute.GlobalAddresses.Get(\n+\t\tconfig.Project, d.Id()).Do()\n+\tif err != nil {\n+\t\tif gerr, ok := err.(*googleapi.Error); ok && gerr.Code == 404 {\n+\t\t\t// The resource doesn't exist anymore\n+\t\t\td.SetId(\"\")\n+\n+\t\t\treturn nil\n+\t\t}\n+\n+\t\treturn fmt.Errorf(\"Error reading address: %s\", err)\n+\t}\n+\n+\td.Set(\"address\", addr.Address)\n+\td.Set(\"self_link\", addr.SelfLink)\n+\n+\treturn nil\n+}\n+\n+func resourceComputeGlobalAddressDelete(d *schema.ResourceData, meta interface{}) error {\n+\tconfig := meta.(*Config)\n+\n+\t// Delete the address\n+\tlog.Printf(\"[DEBUG] address delete request\")\n+\top, err := config.clientCompute.GlobalAddresses.Delete(\n+\t\tconfig.Project, d.Id()).Do()\n+\tif err != nil {\n+\t\treturn fmt.Errorf(\"Error deleting address: %s\", err)\n+\t}\n+\n+\terr = computeOperationWaitGlobal(config, op, \"Deletingg Global Address\")","path":"builtin/providers/google/resource_compute_global_address.go","position":93,"original_position":93,"commit_id":"f3276720391717ceb4e98138f1efdf444d93681e","original_commit_id":"f3276720391717ceb4e98138f1efdf444d93681e","user":{"login":"sparkprime","id":168158,"avatar_url":"https://avatars.githubusercontent.com/u/168158?v=3","gravatar_id":"","url":"https://api.github.com/users/sparkprime","html_url":"https://github.com/sparkprime","followers_url":"https://api.github.com/users/sparkprime/followers","following_url":"https://api.github.com/users/sparkprime/following{/other_user}","gists_url":"https://api.github.com/users/sparkprime/gists{/gist_id}","starred_url":"https://api.github.com/users/sparkprime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparkprime/subscriptions","organizations_url":"https://api.github.com/users/sparkprime/orgs","repos_url":"https://api.github.com/users/sparkprime/repos","events_url":"https://api.github.com/users/sparkprime/events{/privacy}","received_events_url":"https://api.github.com/users/sparkprime/received_events","type":"User","site_admin":false},"body":"deletingg","created_at":"2015-10-30T21:52:40Z","updated_at":"2015-10-30T21:52:40Z","html_url":"https://github.com/hashicorp/terraform/pull/3701#discussion_r43556491","pull_request_url":"https://api.github.com/repos/hashicorp/terraform/pulls/3701","_links":{"self":{"href":"https://api.github.com/repos/hashicorp/terraform/pulls/comments/43556491"},"html":{"href":"https://github.com/hashicorp/terraform/pull/3701#discussion_r43556491"},"pull_request":{"href":"https://api.github.com/repos/hashicorp/terraform/pulls/3701"}}},"pull_request":{"url":"https://api.github.com/repos/hashicorp/terraform/pulls/3701","id":49317249,"html_url":"https://github.com/hashicorp/terraform/pull/3701","diff_url":"https://github.com/hashicorp/terraform/pull/3701.diff","patch_url":"https://github.com/hashicorp/terraform/pull/3701.patch","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/3701","number":3701,"state":"open","locked":false,"title":"provider/google: global address + tests & documentation","user":{"login":"lwander","id":4874941,"avatar_url":"https://avatars.githubusercontent.com/u/4874941?v=3","gravatar_id":"","url":"https://api.github.com/users/lwander","html_url":"https://github.com/lwander","followers_url":"https://api.github.com/users/lwander/followers","following_url":"https://api.github.com/users/lwander/following{/other_user}","gists_url":"https://api.github.com/users/lwander/gists{/gist_id}","starred_url":"https://api.github.com/users/lwander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwander/subscriptions","organizations_url":"https://api.github.com/users/lwander/orgs","repos_url":"https://api.github.com/users/lwander/repos","events_url":"https://api.github.com/users/lwander/events{/privacy}","received_events_url":"https://api.github.com/users/lwander/received_events","type":"User","site_admin":false},"body":"Implements global address GCE resource. ","created_at":"2015-10-30T20:15:45Z","updated_at":"2015-10-30T21:52:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76fd5826d4f35981017a513d518853b02283c4c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hashicorp/terraform/pulls/3701/commits","review_comments_url":"https://api.github.com/repos/hashicorp/terraform/pulls/3701/comments","review_comment_url":"https://api.github.com/repos/hashicorp/terraform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/3701/comments","statuses_url":"https://api.github.com/repos/hashicorp/terraform/statuses/f3276720391717ceb4e98138f1efdf444d93681e","head":{"label":"lwander:f-gcp-global-address","ref":"f-gcp-global-address","sha":"f3276720391717ceb4e98138f1efdf444d93681e","user":{"login":"lwander","id":4874941,"avatar_url":"https://avatars.githubusercontent.com/u/4874941?v=3","gravatar_id":"","url":"https://api.github.com/users/lwander","html_url":"https://github.com/lwander","followers_url":"https://api.github.com/users/lwander/followers","following_url":"https://api.github.com/users/lwander/following{/other_user}","gists_url":"https://api.github.com/users/lwander/gists{/gist_id}","starred_url":"https://api.github.com/users/lwander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwander/subscriptions","organizations_url":"https://api.github.com/users/lwander/orgs","repos_url":"https://api.github.com/users/lwander/repos","events_url":"https://api.github.com/users/lwander/events{/privacy}","received_events_url":"https://api.github.com/users/lwander/received_events","type":"User","site_admin":false},"repo":{"id":44557957,"name":"terraform","full_name":"lwander/terraform","owner":{"login":"lwander","id":4874941,"avatar_url":"https://avatars.githubusercontent.com/u/4874941?v=3","gravatar_id":"","url":"https://api.github.com/users/lwander","html_url":"https://github.com/lwander","followers_url":"https://api.github.com/users/lwander/followers","following_url":"https://api.github.com/users/lwander/following{/other_user}","gists_url":"https://api.github.com/users/lwander/gists{/gist_id}","starred_url":"https://api.github.com/users/lwander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwander/subscriptions","organizations_url":"https://api.github.com/users/lwander/orgs","repos_url":"https://api.github.com/users/lwander/repos","events_url":"https://api.github.com/users/lwander/events{/privacy}","received_events_url":"https://api.github.com/users/lwander/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lwander/terraform","description":"Terraform is a tool for building, changing, and combining infrastructure safely and efficiently.","fork":true,"url":"https://api.github.com/repos/lwander/terraform","forks_url":"https://api.github.com/repos/lwander/terraform/forks","keys_url":"https://api.github.com/repos/lwander/terraform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lwander/terraform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lwander/terraform/teams","hooks_url":"https://api.github.com/repos/lwander/terraform/hooks","issue_events_url":"https://api.github.com/repos/lwander/terraform/issues/events{/number}","events_url":"https://api.github.com/repos/lwander/terraform/events","assignees_url":"https://api.github.com/repos/lwander/terraform/assignees{/user}","branches_url":"https://api.github.com/repos/lwander/terraform/branches{/branch}","tags_url":"https://api.github.com/repos/lwander/terraform/tags","blobs_url":"https://api.github.com/repos/lwander/terraform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lwander/terraform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lwander/terraform/git/refs{/sha}","trees_url":"https://api.github.com/repos/lwander/terraform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lwander/terraform/statuses/{sha}","languages_url":"https://api.github.com/repos/lwander/terraform/languages","stargazers_url":"https://api.github.com/repos/lwander/terraform/stargazers","contributors_url":"https://api.github.com/repos/lwander/terraform/contributors","subscribers_url":"https://api.github.com/repos/lwander/terraform/subscribers","subscription_url":"https://api.github.com/repos/lwander/terraform/subscription","commits_url":"https://api.github.com/repos/lwander/terraform/commits{/sha}","git_commits_url":"https://api.github.com/repos/lwander/terraform/git/commits{/sha}","comments_url":"https://api.github.com/repos/lwander/terraform/comments{/number}","issue_comment_url":"https://api.github.com/repos/lwander/terraform/issues/comments{/number}","contents_url":"https://api.github.com/repos/lwander/terraform/contents/{+path}","compare_url":"https://api.github.com/repos/lwander/terraform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lwander/terraform/merges","archive_url":"https://api.github.com/repos/lwander/terraform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lwander/terraform/downloads","issues_url":"https://api.github.com/repos/lwander/terraform/issues{/number}","pulls_url":"https://api.github.com/repos/lwander/terraform/pulls{/number}","milestones_url":"https://api.github.com/repos/lwander/terraform/milestones{/number}","notifications_url":"https://api.github.com/repos/lwander/terraform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lwander/terraform/labels{/name}","releases_url":"https://api.github.com/repos/lwander/terraform/releases{/id}","created_at":"2015-10-19T19:19:32Z","updated_at":"2015-10-19T19:19:37Z","pushed_at":"2015-10-30T21:49:58Z","git_url":"git://github.com/lwander/terraform.git","ssh_url":"git@github.com:lwander/terraform.git","clone_url":"https://github.com/lwander/terraform.git","svn_url":"https://github.com/lwander/terraform","homepage":"http://www.terraform.io","size":30299,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"hashicorp:master","ref":"master","sha":"a8c5c4b6fdc09ea84d287640179afff415d0c8f9","user":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"repo":{"id":17728164,"name":"terraform","full_name":"hashicorp/terraform","owner":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hashicorp/terraform","description":"Terraform is a tool for building, changing, and combining infrastructure safely and efficiently.","fork":false,"url":"https://api.github.com/repos/hashicorp/terraform","forks_url":"https://api.github.com/repos/hashicorp/terraform/forks","keys_url":"https://api.github.com/repos/hashicorp/terraform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/terraform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/terraform/teams","hooks_url":"https://api.github.com/repos/hashicorp/terraform/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/terraform/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/terraform/events","assignees_url":"https://api.github.com/repos/hashicorp/terraform/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/terraform/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/terraform/tags","blobs_url":"https://api.github.com/repos/hashicorp/terraform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/terraform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/terraform/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/terraform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/terraform/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/terraform/languages","stargazers_url":"https://api.github.com/repos/hashicorp/terraform/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/terraform/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/terraform/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/terraform/subscription","commits_url":"https://api.github.com/repos/hashicorp/terraform/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/terraform/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/terraform/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/terraform/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/terraform/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/terraform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/terraform/merges","archive_url":"https://api.github.com/repos/hashicorp/terraform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/terraform/downloads","issues_url":"https://api.github.com/repos/hashicorp/terraform/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/terraform/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/terraform/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/terraform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/terraform/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/terraform/releases{/id}","created_at":"2014-03-13T22:25:48Z","updated_at":"2015-10-30T18:19:51Z","pushed_at":"2015-10-30T21:49:59Z","git_url":"git://github.com/hashicorp/terraform.git","ssh_url":"git@github.com:hashicorp/terraform.git","clone_url":"https://github.com/hashicorp/terraform.git","svn_url":"https://github.com/hashicorp/terraform","homepage":"http://www.terraform.io","size":57314,"stargazers_count":3314,"watchers_count":3314,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":772,"mirror_url":null,"open_issues_count":728,"forks":772,"open_issues":728,"watchers":3314,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/terraform/pulls/3701"},"html":{"href":"https://github.com/hashicorp/terraform/pull/3701"},"issue":{"href":"https://api.github.com/repos/hashicorp/terraform/issues/3701"},"comments":{"href":"https://api.github.com/repos/hashicorp/terraform/issues/3701/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/terraform/pulls/3701/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/terraform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/terraform/pulls/3701/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/terraform/statuses/f3276720391717ceb4e98138f1efdf444d93681e"}}}}