Importing Entities Into Local GCP Datastore Emulator

后端 未结 2 1504
广开言路
广开言路 2020-12-21 12:12

I was able to export entities into a storage bucket without much difficulty with this command:

gcloud datastore export --kinds=\"KIND1,KIND2\" --namespaces=\         


        
2条回答
  •  旧时难觅i
    2020-12-21 12:34

    The Datastore Emulator now supports import and export:

    Import:

    curl -X POST localhost:8081/v1/projects/[PROJECT_ID]:import \
    -H 'Content-Type: application/json' \
    -d '{"input_url":"[ENTITY_EXPORT_FILES]"}'
    

    Export:

    curl -X POST localhost:8081/v1/projects/[PROJECT_ID]:export \
    -H 'Content-Type: application/json' \
    -d '{"output_url_prefix":"EXPORT_DIRECTORY"}'
    

    https://cloud.google.com/datastore/docs/tools/emulator-export-import

提交回复
热议问题