Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when creating indexes for flexible Cloud Datastore: Unexpected attribute 'indexes' for object of type AppInfoExternal

When I access to the Cloud Datastore web management, there are no indexes listed under the "Indexes" section and I would like to define explicitly some indexes in order to run advanced queries. I have a yaml file that looks like:


indexes:
- kind: order
  ancestor: no
  properties:
  - name: email
  - name: name
  - name: ownerId
  - name: status
  - name: updated_at
  - name: created_at
    direction: desc

And I run the following command to create the indexes:

gcloud preview datastore create-indexes indexes.yaml

and this is the error message that I'm getting:

"Unexpected attribute 'indexes' for object of type AppInfoExternal"

Has anybody come across the same issue? Any ideas?

Regards, Jose

like image 212
Jose Miguel Bataller Avatar asked Jun 08 '16 07:06

Jose Miguel Bataller


1 Answers

Unfortunately the create-indexes command is a little brittle: it requires that the index.yaml file that you provide is named index.yaml and not indexes.yaml. Otherwise, it will try and parse it as a different type of configuration.

Try renaming your index file to index.yaml then calling the command again.

like image 146
Patrick Costello Avatar answered Sep 23 '22 21:09

Patrick Costello