更新时间:2018-11-18 12:15
list_apps
属性 | 类型 | 是否必须 | 描述 |
---|---|---|---|
scope | string | 否 | App的类型。 可选值: “Public” 和 “Private”。 |
next_marker | string | 否 | 下一页起始资源标识符, 最后一页该值为空。 |
max_item_count | int | 否 | 实际返回最大资源数量。默认值50,最大值100。 |
list_apps 方法返回一个 ListResponse
对象。
Python源码:
import time
import batchcompute
from batchcompute import CN_SHENZHEN as REGION
from batchcompute import Client, ClientError
ACCESS_KEY_ID = 'Your Access Key Id'
ACCESS_KEY_SECRET = 'Your Access Key Secret'
client = Client(REGION, ACCESS_KEY_ID, ACCESS_KEY_SECRET)
def list_apps():
try:
marker = ''
max_item = 2
app_cnt = 0
scope = 'Private'
while 1:
response = client.list_apps(scope, marker, max_item)
marker = response.NextMarker
app_cnt += len(response.Items)
for app in response.Items:
print app.Name
if marker.strip() == '':
break
print 'Total apps: ', app_cnt
except ClientError, e:
print (e.get_status_code(), e.get_code(), e.get_requestid(), e.get_msg())
if __name__ == '__main__':
list_apps()
执行结果:
echo
JavaSdkApp
PythonSdkTest
test
test-copy
test_1
Total apps: 6
在文档使用中是否遇到以下问题
更多建议
匿名提交