获取一个任务的详细配置和运行时信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用背景高亮的方式表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
paidlc:GetJob | get |
|
| 无 |
请求语法
GET /api/v1/jobs/{JobId}
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
JobId | string | 是 | 任务 ID。如何获取任务 ID,请参见 ListJobs 。 | dlc******* |
NeedDetail | boolean | 否 | 是否返回作业详情信息,默认为 true | true |
返回参数
示例
正常返回示例
JSON
格式
{
"JobId": "dlc*******",
"JobType": "TFJob",
"DisplayName": "tf-mnist-test",
"UserId": "12*********",
"Status": "Stopped",
"WorkspaceId": "268",
"WorkspaceName": "dlc-workspace",
"ResourceId": "r******",
"ResourceLevel": "L0",
"ReasonCode": "JobStoppedByUser",
"ReasonMessage": "Job is stopped by user.",
"JobSpecs": [
{
"Type": "Worker",
"Image": "registry-vpc.cn-hangzhou.aliyuncs.com/cloud-dsw/tensorflow:1.12PAI-gpu-py36-cu101-ubuntu18.04",
"ImageConfig": {
"DockerRegistry": "docker****registry.com",
"Username": " username",
"Password": "password",
"Auth": ""
},
"PodCount": 1,
"EcsSpec": "ecs.c6.large",
"ExtraPodSpec": {
"SideCarContainers": [
{
"Name": "data-init",
"Image": "registry.cn-hangzhou.aliyuncs.com/pai-dlc/curl:v1.0.0",
"Command": [
"curl www.aliyun.com"
],
"Args": [
""
],
"WorkingDir": "/root",
"Env": [
{
"Name": "ENABLE_DEBUG",
"Value": "true"
}
],
"Resources": {
"Limits": {
"key": "{'cpu': '1', 'memory': '1000Mi'}"
},
"Requests": {
"key": "{'cpu': '1', 'memory': '1000Mi'}"
}
}
}
],
"InitContainers": [
{
"Name": "data-init",
"Image": "registry.cn-hangzhou.aliyuncs.com/pai-dlc/curl:v1.0.0",
"Command": [
"curl www.aliyun.com"
],
"Args": [
""
],
"WorkingDir": "/root",
"Env": [
{
"Name": "ENABLE_DEBUG",
"Value": "true"
}
],
"Resources": {
"Limits": {
"key": "{'cpu': '1', 'memory': '1000Mi'}"
},
"Requests": {
"key": "{'cpu': '1', 'memory': '1000Mi'}"
}
}
}
],
"PodLabels": {
"key": ""
},
"PodAnnotations": {
"key": ""
},
"SharedVolumeMountPaths": [
"/root/share/"
],
"Lifecycle": {
"PreStop": {
"Exec": {
"Command": [
""
]
}
},
"PostStart": {
"Exec": {
"Command": [
""
]
}
}
}
},
"ResourceConfig": {
"CPU": "10",
"GPU": "3",
"Memory": "10Gi",
"SharedMemory": "5Gi",
"GPUType": "Tesla-V100-16G"
},
"UseSpotInstance": false,
"SpotSpec": {
"SpotStrategy": "",
"SpotDiscountLimit": 0
},
"AssignNodeSpec": {
"EnableAssignNode": true,
"NodeNames": "lingjxxxxxxxx",
"AntiAffinityNodeNames": "lingjxxxxxxxx"
}
}
],
"UserCommand": "python /root/code/mnist.py",
"DataSources": [
{
"DataSourceId": "d*******",
"MountPath": "/mnt/data/",
"Uri": "oss://bucket.oss-cn-hangzhou-internal.aliyuncs.com/path/"
}
],
"CodeSource": {
"CodeSourceId": "code******",
"Branch": "master",
"Commit": "44da109b59f8596152987eaa8f3b2487xxxxxx",
"MountPath": "/mnt/data"
},
"ThirdpartyLibs": [
"numpy==1.16.1"
],
"ThirdpartyLibDir": "/root/code/",
"Envs": {
"key": "ENABLE_DEBUG_MODE"
},
"GmtCreateTime": "2021-01-12T14:35:01Z",
"GmtSubmittedTime": "2021-01-12T14:36:01Z",
"GmtRunningTime": "2021-01-12T14:36:21Z",
"GmtSuccessedTime": "2021-01-12T15:36:08Z",
"GmtStoppedTime": "2021-01-12T15:36:08Z",
"GmtFailedTime": "2021-01-12T15:36:08Z",
"GmtFinishTime": "2021-01-12T15:36:08Z",
"Duration": 3602,
"Pods": [
{
"Type": "Worker",
"PodId": "Worker",
"PodUid": "fe846462-af2c-4521-bd6f-96787a57591d",
"Status": "Running",
"Ip": "10.0.1.2",
"GmtCreateTime": "2021-01-12T14:36:01Z",
"GmtStartTime": "2021-01-12T14:36:01Z",
"GmtFinishTime": "2021-01-12T15:36:05Z",
"HistoryPods": [
{
"Type": "Worker",
"PodId": "Worker",
"PodUid": "fe846462-af2c-4521-bd6f-96787a57591d",
"Status": "Failed",
"Ip": "10.0.1.3",
"GmtCreateTime": "2021-01-12T14:36:01Z",
"GmtStartTime": "2021-01-12T14:36:01Z",
"GmtFinishTime": "2021-01-12T14:36:01Z",
"SubStatus": "Normal",
"ResourceType": "Normal"
}
],
"SubStatus": "Normal",
"ResourceType": "Normal"
}
],
"RequestId": "473469C7-AA6F-4DC5-B3DB-xxxxxxxx",
"Settings": {
"BusinessUserId": "16****",
"Caller": "SilkFlow",
"Tags": {
"key": ""
},
"PipelineId": "pid-123456",
"EnableTideResource": true,
"EnableErrorMonitoringInAIMaster": false,
"ErrorMonitoringArgs": "--enable-log-hang-detection true",
"EnableRDMA": true,
"EnableOssAppend": true,
"OversoldType": "AcceptQuotaOverSold",
"AdvancedSettings": {
"test": "test",
"test2": 1
},
"Driver": "535.54.03",
"EnableSanityCheck": true,
"SanityCheckArgs": "--sanity-check-timing=AfterJobFaultTolerant --sanity-check-timeout-ops=MarkJobFai",
"JobReservedMinutes": 30,
"JobReservedPolicy": "Always"
},
"ClusterId": "a*****",
"ElasticSpec": {
"EnableElasticTraining": true,
"MinParallelism": 1,
"MaxParallelism": 8,
"AIMasterType": "",
"AIMasterDockerImage": "",
"EnablePsJobElasticWorker": true,
"EnableAIMaster": true,
"EnablePsResourceEstimate": true,
"EnablePsJobElasticPS": true,
"PSMinParallelism": 4,
"PSMaxParallelism": 10,
"ElasticStrategy": "",
"EnableEDP": true,
"EDPMaxParallelism": 16,
"EDPMinParallelism": 8
},
"EnabledDebugger": false,
"Priority": 1,
"SubStatus": "Restarting",
"RestartTimes": "0/10",
"StatusHistory": [
{
"Status": "",
"StartTime": "",
"EndTime": "",
"ReasonCode": "",
"ReasonMessage": ""
}
],
"TenantId": "GAR***W134",
"ResourceType": "ECS",
"CredentialConfig": {
"EnableCredentialInject": true,
"AliyunEnvRoleKey": "",
"CredentialConfigItems": [
{
"Key": "",
"Type": "",
"Roles": [
{
"RoleArn": "",
"RoleType": "",
"AssumeRoleFor": "",
"Policy": "",
"AssumeUserInfo": {
"SecurityToken": "",
"AccessKeyId": "",
"Type": "",
"Id": ""
}
}
]
}
]
}
}
错误码
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|---|---|
2024-07-09 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2024-01-24 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2024-01-05 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2024-01-03 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2023-12-08 | OpenAPI 返回结构发生变更 | 查看变更详情 |