How do I access my AppEngine DataStore entities from my Compute Engine VM?

前端 未结 4 1184
借酒劲吻你
借酒劲吻你 2021-01-14 00:19

My app is running on App Engine, but I would like to access its NDB DataStore entities from my Compute Engine VM to do some processing and write the results back to the App

4条回答
  •  醉话见心
    2021-01-14 01:11

    David's solution requires you to use App Engine instance time to make requests, but you can bypass it and make requests directly to Datastore from Compute Engine instance. There is a pretty good tutorial about how to do this. But its not so pretty like ndb.

    >>> import googledatastore as datastore
    >>> datastore.set_options(dataset='project-id')
    >>> req = datastore.BeginTransactionRequest()
    >>> datastore.begin_transaction(req)
    
    

提交回复
热议问题