我们使用Google Python API创建帐户.从2012年8月11日太平洋标准时间下午1点开始,我们开始收到这些间歇性错误消息:
errorCode="1301" invalidInput="loginname" reason="EntityDoesNotExist"
Run Code Online (Sandbox Code Playgroud)
当我们检查Google信息中心时,该帐户实际上已创建,但由于Google发回的错误消息,我们的其余帐户创建任务未完成.
有没有其他人注意到这个问题和/或知道为什么会发生这种情况?
我们的帐户配置代码非常强大,在11/8之前创建了超过50,000个帐户.
这是代码片段:
r = client.CreateUser(act.localpart, family_name, given_name, password, suspended='false', quota_limit=25600, password_hash_function="SHA-1",change_password=None )
Run Code Online (Sandbox Code Playgroud)
这是完整的追溯:
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/cherrypy/_cphttptools.py", line 105, in _run
self.main()
File "/usr/lib/python2.4/site-packages/cherrypy/_cphttptools.py", line 254, in main
body = page_handler(*virtual_path, **self.params)
File "<string>", line 3, in create_accountgmail
File "/usr/lib/python2.4/site-packages/turbogears/controllers.py", line 348, i expose
output = database.run_with_transaction(
File "<string>", line 5, in run_with_transaction
File "/usr/lib/python2.4/site-packages/turbogears/database.py", line 376, in s _rwt
retval = dispatch_exception(e, args, kw)
File "/usr/lib/python2.4/site-packages/turbogears/database.py", line 357, …Run Code Online (Sandbox Code Playgroud) 我已经构建了Google数据API Objective-C客户端库,并将其链接并与我的应用程序(包括GTMOAuth2)一起使用,并可以将数据拉回来.我需要使用Provisioning API(仍然只支持XML),因此我在自己的应用程序中构建了我需要的附加功能.我想我终于想出了所有这些是如何工作的,我非常接近阅读自定义元素,但我遗漏了一些东西.
我子类GDataServiceGoogle,GDataEntryBase以及GDataFeedBase和我得到正确的数据备份.我从一个简单直接的元素类型开始:quota.在Users Feed中,quota元素如下所示:
<apps:quota limit="2048"/>
Run Code Online (Sandbox Code Playgroud)
所以,我添加了以下值构造:
@interface GDataQuotaProperty : GDataValueConstruct <GDataExtension>
+ (NSString *)extensionElementURI;
+ (NSString *)extensionElementPrefix;
+ (NSString *)extensionElementLocalName;
@end
@implementation GDataQuotaProperty
+ (NSString *)extensionElementURI { return kGDataNamespaceGApps; }
+ (NSString *)extensionElementPrefix { return kGDataNamespaceGAppsPrefix; }
+ (NSString *)extensionElementLocalName { return @"quota"; }
@end
Run Code Online (Sandbox Code Playgroud)
我已经将以下方法添加到我的GDataEntryBase子类中:
- (GDataQuotaProperty *)quota;
- (void)setQuota:(GDataQuotaProperty *)val;
Run Code Online (Sandbox Code Playgroud)
实施如下:
- (GDataQuotaProperty *)quota {
return [self objectForExtensionClass:[GDataQuotaProperty class]];
} …Run Code Online (Sandbox Code Playgroud) objective-c google-data-api xcode4.3 google-provisioning-api
我正在使用(alpha)Ruby google-api-client与我们组织的Google Apps实例的各种服务进行交互.
我想发现配置服务 API,使用服务帐户验证用户身份,并更新其密码.
至今...
require 'google/api_client'
class GoogleProvisioningConnection
def initialize(user_email=nil)
@client = Google::APIClient.new
@provisioning = @client.discovered_api('???', 'v2') # what's it called? user?
key_file_name = 'mykey-privatekey.p12'
key = Google::APIClient::PKCS12.load_key(key_file_name, 'notasecret')
asserter = Google::APIClient::JWTAsserter.new(
'...@developer.gserviceaccount.com',
'???', # which url allows me access to their user?
key)
@client.authorization = asserter.authorize(user_email)
end
end
Run Code Online (Sandbox Code Playgroud)
使用哪个字符串@client.discovered_api来获取配置API?
当使用JWT断言器时,应该请求哪个服务URL?
谢谢
ruby google-api google-apps google-provisioning-api google-api-ruby-client