如何使用Objectify和服务帐户凭证访问GAE数据存储? [英] How to access GAE datastore with Objectify and service account credentials?

查看:184
本文介绍了如何使用Objectify和服务帐户凭证访问GAE数据存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个GAE应用程序是否可以使用 Objectify ?如果是这样,我该如何将服务帐户凭证传递给Objectify(哪个API调用)?解析方案

这是不可能的即可。 Objectify 是位于GAE Datastore 之上的一个非常简单便捷的轻量级ORM,因此可以让开发人员远离使用JDO / JPA的大多数复杂性。



没有在文档中看到您提到的场景,因为这不是它正在解决的问题。



我怀疑你可能需要做的是创建一个Web服务,通​​过API公开你的GAE应用程序(你想要的数据)。然后让你的其他GAE应用程序调用这些服务方法来获得它所需要的数据。



或者,你可以使用一些名为 remote_api 。它允许您远程访问和操作GAE数据存储。



以下是我在发布我的答案后发现的类似问题的一些链接:

我可以访问其他Google App Engine应用程序的Datastore实体



是否可以访问其他应用程序数据以查询Google App Engine中的密钥?


Is it possible for one GAE application to access the datastore of another GAE application (both applications are hosted under the same Google account) using Objectify? If so, how can I pass service account credentials to Objectify (which API calls)?

解决方案

It is not possible. Objectify is a very simple and convenient lightweight ORM that sits on top of a GAE Datastore, thus shielding the developer from most of the complexities of using JDO/JPA.

Nowhere in the documentation have I seen the scenario you describe mentioned because that is not the problem it is trying to solve.

I suspect what you will probably need to do is create a Web Service that exposes your GAE application (whose data you want) through an API. Then have your other GAE application call those service methods to obtain the data it needs.

Alternatively, you can use something called remote_api. It allows you to access and manipulate a GAE Datastore remotely.

Below are some links I just found to similar questions after posting my answer:

Can I access Datastore entities of my other Google App Engine Applications

Can one application access other applications data querying the key in Google App Engine?

这篇关于如何使用Objectify和服务帐户凭证访问GAE数据存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆