文档

获取作业描述

更新时间:

GetJobDescription

描述

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

请求语法

GET /jobs/{Id}?description

属性说明

属性名称

类型

是否必须

描述

Id

string

作业标识符。

返回信息

成功返回

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

DAG类型作业描述样例

{
  "Id": "job-0000000058184218000008150000000D",
  "Name": "testJob",
  "Description": "BatchCompute demo job",
  "JobFailOnInstanceFail": true,
  "Priority": 1,
  "Type": "DAG",
  "AutoRelease": false,
  "Notification": {
        "Topic": {
            "Name": "test-topic",
            "Endpoint": "http://[UserId].mns.[Region].aliyuncs.com/",
            "Events": [
                    "OnJobWaiting",
                    "OnJobRunning",
                    "OnJobStopped",
                    "OnJobFinished",
                    "OnJobFailed",
                    "OnTaskWaiting",
                    "OnTaskRunning",
                    "OnTaskStopped",
                    "OnTaskFinished",
                    "OnTaskFailed",
                    "OnInstanceWaiting",
                    "OnInstanceRunning",
                    "OnInstanceStopped",
                    "OnInstanceFinished",
                    "OnInstanceFailed",
                    "OnPriorityChange" // 以上job相关事件
                ]
        }
    },
  "DAG": {
    "Dependencies": {},
    "Tasks": {
      "taskA": {
        "AutoCluster": {
          "Configs": {
            "Disks": {
              "DataDisk": {
                "MountPoint": "/home/mydisk/",
                "Size": 0,
                "Type": "ephemeral"
              },
              "SystemDisk": {
                "Size": 40,
                "Type": "ephemeral"
              }
            },
            "Mounts": {
               "Entries": [
                   {
                       "Destination": "/home/admin/mount-dest",
                       "Source": "oss://your-bucket/mount-source",
                       "WriteSupport": false
                    }
                ],
                "Locale": "GBK",
                "Lock": false,
                "NAS": {
                    "AccessGroup": [
                        "group1",
                        "group2"
                    ],
                    "FileSystem": [
                        "filesystem1",
                        "filesystem2"
                    ]
                },
                "OSS": {
                    "AccessKeyId": "",
                    "AccessKeySecret": "",
                    "AccessSecurityToken": ""
                }
             },
             "Networks": {
                 "Classic": {
                     "AllowIpAddress": [],
                     "AllowIpAddressEgress": [],
                     "AllowSecurityGroup": [],
                     "AllowSecurityGroupEgress": []
                 },
                 "VPC": {
                    "CidrBlock": "10.0.0.0/8",
                 }
             }
          },
          "ECSImageId": "",
          "ImageId": "img-ubuntu",
          "InstanceType": "bcs.a2.large",
          "ResourceType": "OnDemand",
          "SpotStrategy": "SpotAsPriceGo",
          "SpotPriceLimit": 0.0,
          "UserData": {}
        },
        "ClusterId": "",
        "InputMapping": {
          "oss://bucket/tmp/": "/home/mount1/"
        },
        "InstanceCount": 1,
        "LogMapping": {},
        "MaxRetryCount": 0,
        "OutputMapping": {
          "/home/mount1": "oss://bucket/tmp/"
        },
        "Mounts": {
            "Entries": [
                {
                    "Destination": "/home/admin/mount-dest",
                    "Source": "oss://your-bucket/mount-source",
                    "WriteSupport": false
                }
            ],
            "Locale": "GBK",
            "Lock": false,
            "NAS": {
            "AccessGroup": [
                "group1",
                "group2"
            ],
            "FileSystem": [
                "filesystem1",
                "filesystem2"
            ]
            },
            "OSS": {
                "AccessKeyId": "",
                "AccessKeySecret": "",
                "AccessSecurityToken": ""
            }
        },
        "Parameters": {
          "Command": {
            "CommandLine": "python worker.py",
            "EnvVars": {},
            "PackagePath": "oss://bucket/tests/worker.tar.gz"
          },
          "InputMappingConfig": {
            "Locale": "GBK",
            "Lock": false
          },
          "StderrRedirectPath": "oss://bucket/tests/logs/",
          "StdoutRedirectPath": "oss://bucket/tests/logs/"
        },
        "Timeout": 172800,
      }
    }
  }
}

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

App类型作业描述样例:

{
    "Name": "job_name",
    "Description": "job description",
    "Type": "App",
    "App": {
        "AppName": "myapp",
        "Inputs": {
            "inputFile": "oss://bucket/a"
        },
        "Outputs": {
            "outputFile": "oss://bucket/b"
        },
        "Config": {
            "ResourceType": "OnDemand",
            "InstanceType": "ecs.s3.large",
            "InstanceCount": 3,
            "MinDiskSize": 40,
            "DiskType": "cloud_efficiency",
            "MaxRetryCount": 0,
            "Timeout": 100000,
            "ReserveOnFail": false
        },
        "Logging": {
            "StdoutPath": "oss://bucket/logging/",
            "StderrPath": "oss://bucket/logging/"
        }
    }
}

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

错误信息

状态码

错误码

错误信息

语义

404

InvalidResource.NotFound

Specified resource is not found.

用户请求的资源不存在。

  • 本页导读 (0)