{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2539","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2539/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2539/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2539/events","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-python/issues/2539","id":182752697,"number":2539,"title":"Python Code to Create New Google Project","user":{"login":"naveensinghal","id":10431849,"avatar_url":"https://avatars.githubusercontent.com/u/10431849?v=3","gravatar_id":"","url":"https://api.github.com/users/naveensinghal","html_url":"https://github.com/naveensinghal","followers_url":"https://api.github.com/users/naveensinghal/followers","following_url":"https://api.github.com/users/naveensinghal/following{/other_user}","gists_url":"https://api.github.com/users/naveensinghal/gists{/gist_id}","starred_url":"https://api.github.com/users/naveensinghal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naveensinghal/subscriptions","organizations_url":"https://api.github.com/users/naveensinghal/orgs","repos_url":"https://api.github.com/users/naveensinghal/repos","events_url":"https://api.github.com/users/naveensinghal/events{/privacy}","received_events_url":"https://api.github.com/users/naveensinghal/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/labels/question","name":"question","color":"cc317c"},{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/labels/resource%20manager","name":"resource manager","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-13T10:28:59Z","updated_at":"2016-10-13T15:20:34Z","closed_at":null,"body":"Hi @daspecster \r\n\r\nI am trying to create a new Project using the below Code. \r\nCan you please suggest the correction required for making this code work ?\r\n```\r\nfrom google.cloud import resource_manager\r\nclient = resource_manager.Client()\r\n\r\nfor project in client.list_projects():\r\n    print(\"%s, %s\" % (project.project_id, project.status))    # Works Fine\r\n\r\nproject = client.new_project('testProjectXXXXXXXXX')\r\nproject.create()          # Fails\r\n```\r\n\r\nGetting this as Error:\r\n```\r\nForbidden: 403 The caller does not have permission (POST https://cloudresourcemanager.googleapis.com/v1beta1/projects)\r\n```\r\n\r\nIs there any work around for this ? \r\n\r\n\r\nThanks,"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/comments/253545488","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-python/issues/2539#issuecomment-253545488","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2539","id":253545488,"user":{"login":"naveensinghal","id":10431849,"avatar_url":"https://avatars.githubusercontent.com/u/10431849?v=3","gravatar_id":"","url":"https://api.github.com/users/naveensinghal","html_url":"https://github.com/naveensinghal","followers_url":"https://api.github.com/users/naveensinghal/followers","following_url":"https://api.github.com/users/naveensinghal/following{/other_user}","gists_url":"https://api.github.com/users/naveensinghal/gists{/gist_id}","starred_url":"https://api.github.com/users/naveensinghal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naveensinghal/subscriptions","organizations_url":"https://api.github.com/users/naveensinghal/orgs","repos_url":"https://api.github.com/users/naveensinghal/repos","events_url":"https://api.github.com/users/naveensinghal/events{/privacy}","received_events_url":"https://api.github.com/users/naveensinghal/received_events","type":"User","site_admin":false},"created_at":"2016-10-13T15:20:34Z","updated_at":"2016-10-13T15:20:34Z","body":"Yes, I think that this might be the issue. But How can I create a project using python code then ?\r\n\r\nI am currently trying to run this python code from my local system(Credentials: User Account). And its not working. And I am quite sure, this code won't work from GCE VM(Credentials: Service Account) too. But I need this code to work from both Local & GCE VM.\r\n\r\nAny work-around ? \r\n(`gcloud auth login` with User Credentials might not be a good idea on GCE VM)"}}
{"actor":{"display_login":"naveensinghal"}}