文档

获取App信息

更新时间:

接口

get_app

参数

参数名称 类型 是否必须 描述
app_name string App名称
scope string 可以为Public或Private。如果为Public,那么代表查询公共App;如果为Private或者不指定,那么代表查询私有App

返回值

get_app 方法将返回一个GetResponse 对象。

例子

Python源码:

  1. import time
  2. import batchcompute
  3. from batchcompute import CN_SHENZHEN as REGION
  4. from batchcompute import Client, ClientError
  5. ACCESS_KEY_ID = 'Your Access Key Id'
  6. ACCESS_KEY_SECRET = 'Your Access Key Secret'
  7. client = Client(REGION, ACCESS_KEY_ID, ACCESS_KEY_SECRET)
  8. def get_app():
  9. try:
  10. app_name = "test-copy"
  11. scope = 'Private'
  12. rsp = client.get_app(app_name, scope)
  13. print rsp
  14. except ClientError, e:
  15. print (e.get_status_code(), e.get_code(), e.get_requestid(), e.get_msg())
  16. if __name__ == '__main__':
  17. get_app()

执行结果:

  1. {
  2. "Name": "test-copy",
  3. "OutputParameters": {
  4. "outputFile": {
  5. "Default": null,
  6. "Type": "String",
  7. "Description": "Output param",
  8. "LocalPath": ""
  9. }
  10. },
  11. "CreationTime": "2018-11-13 11:40:11.976941",
  12. "InputParameters": {
  13. "inputFile": {
  14. "Default": "",
  15. "Type": "String",
  16. "Description": "Input param",
  17. "LocalPath": ""
  18. }
  19. },
  20. "Config": {
  21. "InstanceCount": {
  22. "Default": 1,
  23. "Description": "Instance count",
  24. "Overwritable": true
  25. },
  26. "ResourceType": {
  27. "Default": "OnDemand",
  28. "Description": "Resource type",
  29. "Overwritable": true
  30. },
  31. "DiskType": {
  32. "Default": "cloud_efficiency",
  33. "Description": "Disk type",
  34. "Overwritable": true
  35. },
  36. "MaxRetryCount": {
  37. "Default": 1,
  38. "Description": "Max retry count",
  39. "Overwritable": true
  40. },
  41. "Timeout": {
  42. "Default": 1000,
  43. "Description": "Time out",
  44. "Overwritable": true
  45. },
  46. "MinDiskSize": {
  47. "Default": 40,
  48. "Description": "Min Disk size",
  49. "Overwritable": true
  50. },
  51. "InstanceType": {
  52. "Default": "ecs.sn2ne.large",
  53. "Description": "Instance type",
  54. "Overwritable": true
  55. }
  56. },
  57. "Description": "Copy input file to output file"
  58. }
  • 本页导读 (0)
文档反馈