这是使用Python SDK版本1.8.0.
我的远程API工作正常remote_api_shell.py,但在尝试从python脚本中访问时不起作用.我正在使用谷歌的示例代码:
from google.appengine.ext.remote_api import remote_api_stub
import getpass
def auth_func():
return (raw_input('Username:'), getpass.getpass('Password:'))
remote_api_stub.ConfigureRemoteApi(None, '/_ah/remote_api', auth_func,
'localhost:8080')
Run Code Online (Sandbox Code Playgroud)
而且我也导入fix_sys_path()从dev_appserver.py设置我sys.path正确的谷歌应用程序引擎SDK:
import dev_appserver
dev_appserver.fix_sys_path()
Run Code Online (Sandbox Code Playgroud)
除了其他路径之外,我还将以下行添加到sys.path:
'/google_appengine_1.8.0/lib/fancy_urllib'
Run Code Online (Sandbox Code Playgroud)
但是,调用上面的调用时会抛出以下错误remote_api_stub.ConfigureRemoteApi():
opener.add_handler(fancy_urllib.FancyProxyHandler())
AttributeError: 'module' object has no attribute 'FancyProxyHandler'
Run Code Online (Sandbox Code Playgroud) 我正试图通过远程api调用docker命令.
Docker远程api似乎没有'Detached mode'选项. http://docs.docker.io/en/latest/commandline/command/run/
我可以在bash中使用这个应用程序,我想通过远程api使用它. https://github.com/grigio/docker-stringer
当使用Remote API for Java访问另一个应用程序的GAE数据存储区时(如此处所示),我是否必须使用管理员密码(如示例代码所示)或者我可以使用服务帐户凭据.对远程API的调用应该来自App Engine客户端,因此非密码验证似乎是(唯一)明智的选择.
我最近将我的gcloud库从118.0.0更新到132.0.0,并且remote_api_shell立即不再有效.我经历了一些重新登录的排列,通过gcloud设置应用程序默认凭据,并使用服务帐户和环境变量.所有排列都失败,并显示相同的错误消息:
Traceback (most recent call last):
File "/Users/mbostwick/google-cloud-sdk/bin/remote_api_shell.py", line 133, in <module>
run_file(__file__, globals())
File "/Users/mbostwick/google-cloud-sdk/bin/remote_api_shell.py", line 129, in run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 160, in <module>
main(sys.argv)
File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 156, in main
oauth2=True)
File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 74, in remote_api_shell
secure=secure, app_id=appid)
File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 769, in ConfigureRemoteApiForOAuth
rpc_server_factory=rpc_server_factory)
File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 839, in ConfigureRemoteApi
app_id = GetRemoteAppIdFromServer(server, path, rtok)
File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 569, in GetRemoteAppIdFromServer
response = server.Send(path, payload=None, **urlargs)
File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/tools/appengine_rpc_httplib2.py", line 259, in Send
NeedAuth() …Run Code Online (Sandbox Code Playgroud) 我想知道是否有人有关于如何配置AppEngine remote_api的指针,以便我可以在本地调试我的代码,但使用remote_api从我的服务器获取一些数据.这样,我可以测试真实的信息.
谢谢!
使用Python,我正在尝试连接到我的AppEngine应用程序的remote_api处理程序,但我一直收到错误.我想要做的是设置remote_api存根以通过它来路由数据库调用并直接访问我的应用程序的数据存储.因此,首先,我导入remote_api库,然后调用存根模块上的ConfigureRemoteApi,并尝试使用对远程数据存储区的调用.这是一些示例代码:
from google.appengine.ext.remote_api import remote_api_stub
def test_remote_api():
# This function is called when I want to use the remote api instead of the local datastore access
remote_api_stub.ConfigureRemoteApi('myapp.appspot.com', '/_ah/remote_api', auth_func, '')
def auth_func:
# This actually returns a tuple with my credentials to skip the console input
return ('username', 'password')
Run Code Online (Sandbox Code Playgroud)
好的,现在,我已经使用remote_api_shell.py测试了我的登录信息和应用程序名称,但是我收到如下错误:
File "C:\Program Files(x86)\Google\google_appengine\google\appengine\tools\dev_appserver_blobstore.py", line 79, in GetBlobStorage
return apiproxy_stub_map.apiproxy.GetStub('blobstore').storage
AttributeError: 'RemoteStub' object has no attribute 'storage'
Run Code Online (Sandbox Code Playgroud)
然后我从应用程序中找到了404:Not Found,我知道这是错误的,因为从Web访问应用程序确实给了我结果.我需要做什么来设置remote_api_stub所以我不会收到此错误?
谢谢!
我正在尝试使用在本地系统上运行的低级Java API从独立的Java应用程序(而不是Web应用程序或Servlet)访问Google数据存储区。
remoteapi似乎是最简单的方法。但是,我需要指定一个服务器
RemoteApiOptions options = new RemoteApiOptions()
.server("your_app_id.appspot.com", 443)
.useApplicationDefaultCredential();
Run Code Online (Sandbox Code Playgroud)
如何指定服务器(...)调用以访问数据存储?我跑了
gcloud auth login
Run Code Online (Sandbox Code Playgroud)
并且我为数据存储区配置了一个项目(具有项目ID等),但没有“ app_id”,因为没有涉及任何应用。
是否有用于访问数据存储的标准服务器?还是有更好的方法从独立的Java应用程序访问数据存储区?
我的出发点是:
所以我编辑/etc/init/docker.conf并更新了2次DOCKER_OPTS变量:
DOCKER_OPTS='-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock'
然后,列出泊坞窗图像的简单测试失败:
$ service docker restart
$ curl -X GET http://10.143.0.218:4243/images/json
curl: (7) Failed to connect to 10.143.0.218 port 4243: Connection refused
Run Code Online (Sandbox Code Playgroud)
Docker版本是:
$ sudo docker version
Client:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 19:06:36 2016
OS/Arch: linux/arm
Server:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 19:06:36 2016
OS/Arch: linux/arm
Run Code Online (Sandbox Code Playgroud)