文档

修改App

更新时间:

接口

modify_app

参数

所有类型的参数将被转换为包含属性信息的字典对象。

参数 类型 是否必须 描述
app_name string App 标识符
app_desc AppDescription App 的描述信息

返回值

modify_cluster 返回 ActionResponse 对象。

例子

Python源码:

  1. import time
  2. import string
  3. import random
  4. import batchcompute
  5. from batchcompute import CN_SHENZHEN as REGION
  6. from batchcompute import Client, ClientError
  7. from batchcompute.resources import (AppDescription, InputParameter, OutputParameter)
  8. ACCESS_KEY_ID = 'Your Access Key Id'
  9. ACCESS_KEY_SECRET = 'Your Access Key Secret'
  10. client = Client(REGION, ACCESS_KEY_ID, ACCESS_KEY_SECRET)
  11. def modify_app(idempotent_token=''):
  12. try:
  13. app_desc = AppDescription()
  14. app_desc.Name = 'test-copy' # or app_desc.setproperty('Name', '')
  15. app_desc.Description = 'Copy input file to output file'
  16. app_desc.CommandLine = 'cp -rf ${inputFile} ${outputFile}'
  17. app_desc.Daemonize = False
  18. app_desc.EnvVars = {'env-k3': 'env-v3', 'env-k5': 'env-v5'}
  19. #app_desc.Docker.Image = ''
  20. #app_desc.Docker.RegistryOSSPath = ''
  21. app_desc.VM.ECSImageId = 'img-centos'
  22. rsp = client.modify_app('test-copy', app_desc)
  23. print rsp
  24. return True
  25. except ClientError, e:
  26. print (e.get_status_code(), e.get_code(), e.get_requestid(), e.get_msg())
  27. return False
  28. if __name__ == '__main__':
  29. modify_app()

执行结果:

  1. {
  2. "Date": "Sat, 10 Nov 2018 08:45:06 GMT",
  3. "RequestId": "3408E344-817F-46B3-A93E-649C3BE512C8",
  4. "StatusCode": 200
  5. }
  • 本页导读 (0)
文档反馈