【发布时间】:2021-01-13 04:44:05
【问题描述】:
我添加了几个月的 Google Datastore 索引很少。今天我又加了一个。几分钟后,我发现这不是我必须创建的正确索引。
我称之为:
$ gcloud datastore indexes list
---
ancestor: NONE
indexId: XXX1
kind: ThisIsKindName
projectId: GCP-PROJ-ID
properties:
- direction: ASCENDING
name: QueueName
- direction: ASCENDING
name: ExecutionLength
state: READY
---
ancestor: NONE
indexId: XXX2
kind: ThisIsKindName
projectId: GCP-PROJ-ID
properties:
- direction: ASCENDING
name: labels.application
- direction: DESCENDING
name: ExecutionLength
state: READY
---
...
并定位到要移除的索引(ID=XXX2)。
我找到了cleanup 命令描述,但我不清楚。此函数要求提供index.yaml 文件。
应该在这个文件中找到什么?
- 要保留的索引列表。此文件中不存在的所有索引都将被删除。
- 要删除的索引列表。
如果您的答案是 1(要保留的索引列表) - 我如何从现有索引生成 yaml 文件?它是必需的,因为我在本地没有那些索引定义。需要类似的东西:
gcloud datastore indexes list --export=yaml
【问题讨论】:
标签: google-cloud-platform google-cloud-datastore