7

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

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130

1 Answers1

10

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.

Patrick Costello
  • 3,616
  • 17
  • 22