全部产品
存储与CDN 数据库 安全 应用服务 数加·人工智能 数加·大数据基础服务 互联网中间件 视频服务 开发者工具 解决方案 物联网 钉钉智能硬件
批量计算

获取作业描述

更新时间:2017-11-02 14:02:37

GetJobDescription

描述

获取作业描述。类型不一样返回的内容也不一样,目前有2中类型:DAG和App。

请求语法

  1. GET /jobs/{Id}?description

属性说明

属性名称 类型 是否必须 描述
Id string 作业标识符。

返回信息

成功返回

返回200状态码以及Job的资源描述。

DAG类型作业描述样例

  1. {
  2. "Id": "job-0000000058184218000008150000000D",
  3. "Name": "testJob",
  4. "Description": "BatchCompute demo job",
  5. "JobFailOnInstanceFail": true,
  6. "Priority": 1,
  7. "Type": "DAG",
  8. "AutoRelease": false,
  9. "Notification": {
  10. "Topic": {
  11. "Name": "test-topic",
  12. "Endpoint": "http://[UserId].mns.[Region].aliyuncs.com/",
  13. "Events": [
  14. "OnJobWaiting",
  15. "OnJobRunning",
  16. "OnJobStopped",
  17. "OnJobFinished",
  18. "OnJobFailed",
  19. "OnTaskWaiting",
  20. "OnTaskRunning",
  21. "OnTaskStopped",
  22. "OnTaskFinished",
  23. "OnTaskFailed",
  24. "OnInstanceWaiting",
  25. "OnInstanceRunning",
  26. "OnInstanceStopped",
  27. "OnInstanceFinished",
  28. "OnInstanceFailed",
  29. "OnPriorityChange" // 以上job相关事件
  30. ]
  31. }
  32. },
  33. "DAG": {
  34. "Dependencies": {},
  35. "Tasks": {
  36. "taskA": {
  37. "AutoCluster": {
  38. "Configs": {
  39. "Disks": {
  40. "DataDisk": {
  41. "MountPoint": "/home/mydisk/",
  42. "Size": 0,
  43. "Type": "ephemeral"
  44. },
  45. "SystemDisk": {
  46. "Size": 40,
  47. "Type": "ephemeral"
  48. }
  49. },
  50. "Mounts": {
  51. "Entries": [
  52. {
  53. "Destination": "/home/admin/mount-dest",
  54. "Source": "oss://your-bucket/mount-source",
  55. "WriteSupport": true
  56. }
  57. ],
  58. "Locale": "GBK",
  59. "Lock": false,
  60. "NAS": {
  61. "AccessGroup": [
  62. "group1",
  63. "group2"
  64. ],
  65. "FileSystem": [
  66. "filesystem1",
  67. "filesystem2"
  68. ]
  69. },
  70. "OSS": {
  71. "AccessKeyId": "",
  72. "AccessKeySecret": "",
  73. "AccessSecurityToken": ""
  74. }
  75. },
  76. "Networks": {
  77. "Classic": {
  78. "AllowIpAddress": [],
  79. "AllowIpAddressEgress": [],
  80. "AllowSecurityGroup": [],
  81. "AllowSecurityGroupEgress": []
  82. },
  83. "VPC": {
  84. "CidrBlock": "10.0.0.0/8",
  85. }
  86. }
  87. },
  88. "ECSImageId": "",
  89. "ImageId": "img-ubuntu",
  90. "InstanceType": "bcs.a2.large",
  91. "ResourceType": "OnDemand",
  92. "SpotStrategy": "SpotAsPriceGo",
  93. "SpotPriceLimit": 0.0,
  94. "UserData": {}
  95. },
  96. "ClusterId": "",
  97. "InputMapping": {
  98. "oss://bucket/tmp/": "/home/mount1/"
  99. },
  100. "InstanceCount": 1,
  101. "LogMapping": {},
  102. "MaxRetryCount": 0,
  103. "OutputMapping": {
  104. "/home/mount1": "oss://bucket/tmp/"
  105. },
  106. "Mounts": {
  107. "Entries": [
  108. {
  109. "Destination": "/home/admin/mount-dest",
  110. "Source": "oss://your-bucket/mount-source",
  111. "WriteSupport": true
  112. }
  113. ],
  114. "Locale": "GBK",
  115. "Lock": false,
  116. "NAS": {
  117. "AccessGroup": [
  118. "group1",
  119. "group2"
  120. ],
  121. "FileSystem": [
  122. "filesystem1",
  123. "filesystem2"
  124. ]
  125. },
  126. "OSS": {
  127. "AccessKeyId": "",
  128. "AccessKeySecret": "",
  129. "AccessSecurityToken": ""
  130. }
  131. },
  132. "Parameters": {
  133. "Command": {
  134. "CommandLine": "python worker.py",
  135. "EnvVars": {},
  136. "PackagePath": "oss://bucket/tests/worker.tar.gz"
  137. },
  138. "InputMappingConfig": {
  139. "Locale": "GBK",
  140. "Lock": false
  141. },
  142. "StderrRedirectPath": "oss://bucket/tests/logs/",
  143. "StdoutRedirectPath": "oss://bucket/tests/logs/"
  144. },
  145. "Timeout": 172800,
  146. "WriteSupport": true
  147. }
  148. }
  149. }
  150. }

参数含义具体可参考CreateJob接口参数说明。

App类型作业描述样例:

  1. {
  2. "Name": "job_name",
  3. "Description": "job description",
  4. "Type": "App",
  5. "App": {
  6. "AppName": "myapp",
  7. "Inputs": {
  8. "inputFile": "oss://bucket/a"
  9. },
  10. "Outputs": {
  11. "outputFile": "oss://bucket/b"
  12. },
  13. "Config": {
  14. "ResourceType": "OnDemand",
  15. "InstanceType": "ecs.s3.large",
  16. "InstanceCount": 3,
  17. "MinDiskSize": 40,
  18. "DiskType": "cloud_efficiency",
  19. "MaxRetryCount": 0,
  20. "Timeout": 100000,
  21. "ReserveOnFail": false
  22. },
  23. "Logging": {
  24. "StdoutPath": "oss://bucket/logging/",
  25. "StderrPath": "oss://bucket/logging/"
  26. }
  27. }
  28. }

参数含义具体可参考CreateJob接口参数说明。

错误信息

状态码 错误码 错误信息 语义
404 InvalidResource.NotFound Specified resource is not found. 用户请求的资源不存在。
本文导读目录