接口
modify_app
参数
所有类型的参数将被转换为包含属性信息的字典对象。
参数 | 类型 | 是否必须 | 描述 |
---|---|---|---|
app_name | string | 是 | App 标识符 |
app_desc | AppDescription | 是 | App 的描述信息 |
返回值
modify_cluster 返回 ActionResponse
对象。
例子
Python源码:
import time
import string
import random
import batchcompute
from batchcompute import CN_SHENZHEN as REGION
from batchcompute import Client, ClientError
from batchcompute.resources import (AppDescription, InputParameter, OutputParameter)
ACCESS_KEY_ID = 'Your Access Key Id'
ACCESS_KEY_SECRET = 'Your Access Key Secret'
client = Client(REGION, ACCESS_KEY_ID, ACCESS_KEY_SECRET)
def modify_app(idempotent_token=''):
try:
app_desc = AppDescription()
app_desc.Name = 'test-copy' # or app_desc.setproperty('Name', '')
app_desc.Description = 'Copy input file to output file'
app_desc.CommandLine = 'cp -rf ${inputFile} ${outputFile}'
app_desc.Daemonize = False
app_desc.EnvVars = {'env-k3': 'env-v3', 'env-k5': 'env-v5'}
#app_desc.Docker.Image = ''
#app_desc.Docker.RegistryOSSPath = ''
app_desc.VM.ECSImageId = 'img-centos'
rsp = client.modify_app('test-copy', app_desc)
print rsp
return True
except ClientError, e:
print (e.get_status_code(), e.get_code(), e.get_requestid(), e.get_msg())
return False
if __name__ == '__main__':
modify_app()
执行结果:
{
"Date": "Sat, 10 Nov 2018 08:45:06 GMT",
"RequestId": "3408E344-817F-46B3-A93E-649C3BE512C8",
"StatusCode": 200
}
文档内容是否对您有帮助?