All Products
Search
Document Center

GetJobDescription

Last Updated: May 14, 2018

Description

Obtains description of a job. The response varies with the type of job description. Currently, two types of description are supported: DAG and App.

Request syntax

  1. GET /jobs/{Id}?description

Attribute description

Attribute Type Required Description
Id string Yes ID of a job.

Response

Success

The 200 status code and the following job resource information are returned:

Example of DAG job

  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" // The preceding events are related to the 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. }

For specific parameter meanings, see the interface parameter description in CreateJob.

Example of App job

  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. }

For specific parameter meanings, see the interface parameter description in CreateJob.

Error codes

Error code Error message Status code Syntax
InvalidResource.NotFound Specified resource is not found. 404 The user requested resource does not exist.