接口
get_app
参数
参数名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
app_name | string | 是 | App名称 |
scope | string | 否 | 可以为Public或Private。如果为Public,那么代表查询公共App;如果为Private或者不指定,那么代表查询私有App |
返回值
get_app 方法将返回一个GetResponse
对象。
例子
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 get_app():
try:
app_name = "test-copy"
scope = 'Private'
rsp = client.get_app(app_name, scope)
print rsp
except ClientError, e:
print (e.get_status_code(), e.get_code(), e.get_requestid(), e.get_msg())
if __name__ == '__main__':
get_app()
执行结果:
{
"Name": "test-copy",
"OutputParameters": {
"outputFile": {
"Default": null,
"Type": "String",
"Description": "Output param",
"LocalPath": ""
}
},
"CreationTime": "2018-11-13 11:40:11.976941",
"InputParameters": {
"inputFile": {
"Default": "",
"Type": "String",
"Description": "Input param",
"LocalPath": ""
}
},
"Config": {
"InstanceCount": {
"Default": 1,
"Description": "Instance count",
"Overwritable": true
},
"ResourceType": {
"Default": "OnDemand",
"Description": "Resource type",
"Overwritable": true
},
"DiskType": {
"Default": "cloud_efficiency",
"Description": "Disk type",
"Overwritable": true
},
"MaxRetryCount": {
"Default": 1,
"Description": "Max retry count",
"Overwritable": true
},
"Timeout": {
"Default": 1000,
"Description": "Time out",
"Overwritable": true
},
"MinDiskSize": {
"Default": 40,
"Description": "Min Disk size",
"Overwritable": true
},
"InstanceType": {
"Default": "ecs.sn2ne.large",
"Description": "Instance type",
"Overwritable": true
}
},
"Description": "Copy input file to output file"
}
文档内容是否对您有帮助?