You have found an error in your App Engine application caused by missing Cloud Datastore indexes. You have created a YAML file with the required indexes and want to deploy these new indexes to Cloud Datastore. What should you do?
A.
Point gcloud datastore create-indexes to your configuration file
B.
Upload the configuration file to App Engine's default Cloud Storage bucket, and have App Engine detect the new indexes
C.
In the GCP Console, use Datastore Admin to delete the current indexes and upload the new configuration file
D.
Create an HTTP request to the built-in python module to send the index configuration file to your application
A is incorrect because the command is actually gcloud datastore indexes create. (https://cloud.google.com/sdk/gcloud/reference/datastore/indexes/create).
It might have changed recently - I was able to find documentation mentioning "datastore create-indexes":
https://cloud.google.com/appengine/docs/standard/python/datastore/indexes
To deploy new Cloud Datastore indexes using the YAML file you created, you should use the `gcloud` command-line tool. Specifically, the correct option is:
**A. Point gcloud datastore create-indexes to your configuration file**
Here’s how you can do it:
1. **Ensure you have the `gcloud` CLI installed**: You need the Google Cloud SDK installed and set up on your local machine. If you haven't done this yet, follow the [installation guide](https://cloud.google.com/sdk/docs/install).
2. **Navigate to the directory containing your `index.yaml` file**: This file contains the definitions of the indexes you want to deploy.
3. **Run the following command**:
```bash
gcloud datastore indexes create index.yaml
```
This command will deploy the indexes defined in the `index.yaml` file to Cloud Datastore.
A. Point gcloud datastore create-indexes to your configuration file.
To deploy new indexes to Cloud Datastore, you can use the gcloud datastore create-indexes command and point it to the YAML configuration file containing the required indexes. This command will create the new indexes in Cloud Datastore for your application.
Option B is not correct because App Engine does not automatically detect and create indexes from uploaded configuration files in Cloud Storage.
Option C is also not correct because deleting current indexes in Datastore Admin is not necessary to upload new indexes.
Option D is not correct because there is no built-in Python module that can send the index configuration file to your application
To deploy new indexes to Cloud Datastore, you should use the gcloud datastore create-indexes command and point it to your configuration file. The correct option is therefore A: Point gcloud datastore create-indexes to your configuration file.
Here's the general format of the gcloud datastore create-indexes command:
Copy code
gcloud datastore create-indexes [FILE]
Where [FILE] is the path to your configuration file. The configuration file should be in YAML format and contain a list of indexes that you want to create.
For example:
Copy code
gcloud datastore create-indexes index.yaml
This command will create the indexes specified in the index.yaml file in Cloud Datastore.
A is incorrect.
There is no correct answer, in fact. In 2022, the gcloud parameter "create-index" doesn't exist anymore. However, that was in 2017*. Today, the right CLI command** should be gcloud datastore "indexes create".
Evidences:
* https://stackoverflow.com/questions/43041126/how-to-create-datastore-composite-indexes-with-just-cloud-functions)
** https://cloud.google.com/sdk/gcloud/reference/datastore/indexes/create
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
jcmoranp
Highly Voted 5 years agonitinz
3 years, 8 months agotartar
4 years, 3 months agokumarp6
4 years agoEroc
Highly Voted 5 years agobogd
3 years, 9 months agosim7243
Most Recent 1 week, 5 days agojames2033
5 months, 4 weeks agothewalker
1 year agojlambdan
1 year, 8 months agoMestreCholas
1 year, 8 months agoomermahgoub
1 year, 11 months agomegumin
2 years agoMahmoud_E
2 years, 1 month agoAzureDP900
2 years, 1 month agominmin2020
2 years, 1 month agoAMEJack
2 years, 1 month agoNajmuddoja
2 years, 1 month agoholerina
2 years, 2 months ago[Removed]
2 years, 7 months agovincy2202
2 years, 11 months ago