1

这是我非常基本的代码:

def get_role_permission

query = RallyAPI::RallyQuery.new()
query.type = "userpermission"
query.fetch="Role"
query.page_size=20
query.limit=20

result = @rally.find(query)

#result = build_query("UserPermisson","Role,User","","(Role= \"Viewer\")")

if(result.length!=0)
  puts "Got some result"

else
  puts "No result"
end

end

此函数返回:

`send_request': RallyAPI - An issue occurred (HTTP-507) on request - https://rally1.rallydev.com/slm/webservice/1.37/userpermission.js. (StandardError)
Response was: <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 507 Insufficient Storage</title>
</head>
<body><h2>HTTP ERROR 507</h2>
<p>Problem accessing /slm/webservice/1.37/userpermission.js. Reason:
<pre>    Insufficient Storage</pre></p><hr /><i><small>Powered by Jetty://</small></i>      <br/>                                                
</body>
</html>

以前有人遇到过这样的错误吗?我假设我的查询是正确的,并且我没有查询任何受限属性。

4

1 回答 1

0

您可以缩小查询范围,例如过滤掉一些角色

query.query_string = "(Role != \"Viewer\")"

这是我测试了十几次以查看是否得到 507 的代码:

@rally = RallyAPI::RallyRestJson.new(config)

query = RallyAPI::RallyQuery.new()
query.type = :userpermission
query.fetch = "Role"
#query.limit = 1000
query.workspace = {"_ref" => "https://rally1.rallydev.com/slm/webservice/v2.0/workspace/1111.js" } #optional

query.query_string = "(Role != \"Viewer\")"
result = @rally.find(query)
count = 0
if(result.length!=0)
    puts "Got some result"
    result.each do |r|
        puts "#{r.Role}..." 
            count += 1
    end
    puts count
else
  puts "No result"
end
于 2013-10-16T15:47:34.297 回答