I'm trying to create Google cloud project using ResourceManager API python client but not success.
Here's what I have tried:
- Setup gcloud
- RUN gcloud beta auth application-default login to setup credentials
- also setup service account
- Enable resource manager api from GCP console.
Here's my python code: From views.py
from google.cloud import resource_manager
...
# GCP Client
client = resource_manager.Client()
# List down all gcp projects
for project in client.list_projects():
print(project)
# Create a new project
client.new_project(project_id='test-123', name='api')
it list down all of my GCP projects but new project doesn't created on my gcp console.
Also it doesn't return any error.
Help me, please!
Thanks in advance!