Reputation: 284
I have access to a Google Cloud project with my service account in PHP and now i want to activate the Firestore DB of this project so i can use it. I know that i can set it up in the UI but is there a way to do it with the REST API / PHP SDK or any other API programmatically?
The error i get when i want to access the Firestore DB without activation:
{ "message": "The project XXXXX does not exist or it does not contain an active Cloud Datastore or Cloud Firestore database. Please visit http:\/\/console.cloud.google.com to create a project or https:\/\/console.cloud.google.com\/datastore\/setup?project=XXXXXXX to add a Cloud Datastore or Cloud Firestore database. Note that Cloud Datastore or Cloud Firestore always have an associated App Engine app and this app must not be disabled.", "code": 5, "status": "NOT_FOUND", "details": [] }
Upvotes: 0
Views: 610
Reputation: 2368
You can now use the gcloud to create a Firestore database (Alpha), instead of doing it from the Cloud Console, as mentioned in this Issue Tracker.
As the error message that you shared says, Cloud Datastore or Cloud Firestore always have an associated App Engine app and this app must not be disabled.
Create an App Engine app. Refer to the documentation for details:
gcloud app create --region=europe-west
Create a Firestore database. Refer to the documentation for details:
gcloud alpha firestore databases create --region=europe-west
Upvotes: 2