按照作业ID或子任务ID(数组作业)查询Serverless作业详细信息。当前仅支持传入单个作业ID或单个子任务ID。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用背景高亮的方式表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
ehpc:DescribeServerlessJobs | Read |
|
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
ClusterId | string | 是 | 集群 ID。 您可以通过调用 ListClusters 获取集群 ID。 | ehpc-hz-FYUr32**** |
JobIds | array | 是 | Serverless 作业 ID 或子任务 ID(数组作业)列表。 说明
| |
string | 是 | Serverless 作业 ID 或子任务 ID(数组作业)。 | 5 |
返回参数
示例
正常返回示例
JSON
格式
{
"TotalCount": 1,
"RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
"JobInfos": [
{
"JobId": "5",
"JobName": "testjob",
"State": "Running",
"Priority": 9,
"Queue": "comp",
"User": "testuser",
"SubmitTime": 1647423718,
"StartTime": 1647427667,
"EndTime": 1662016121,
"LastModifyTime": 1663831441000,
"IsArrayJob": false,
"ArrayProperties": {
"IndexStart": 1,
"IndexEnd": 5,
"IndexStep": 2
},
"ContainerGroups": [
{
"ContainerGroupId": "eci-bp1jrgfqqy54kg5hc****",
"ContainerGroupName": "test",
"Status": "Running",
"InstanceType": "ecs.g5.large",
"SpotStrategy": "NoSpot",
"SpotPriceLimit": 0.025,
"Cpu": 2,
"Memory": 4,
"Containers": [
{
"Args": [
"hello.py"
],
"Commands": [
"/usr/bin/python"
],
"Cpu": 2,
"CurrentState": {
"DetailStatus": "working",
"ExitCode": 0,
"FinishTime": "2018-08-02T15:00:00Z",
"Message": "Back-off 5m0s restarting failed container=test pod=test_eci-xxx(xxx)",
"Reason": "Started",
"Signal": 1,
"StartTime": "2019-12-19T12:05:02Z\n",
"State": "Terminated\n"
},
"EnvironmentVars": [
{
"Key": "PATH\n",
"Value": "/usr/bin/\n",
"ValueFrom": {
"FieldRef": {
"FieldPath": "status.podIP"
}
}
}
],
"Gpu": 1,
"Image": "HPL",
"ImagePullPolicy": "Always",
"LivenessProbe": {
"Execs": [
"[\"/bin/sh\", \"-c\", \"echo Hello world > /usr/share/message\"]\n"
],
"FailureThreshold": 3,
"HttpGet": {
"Path": "/usr/nginx/\n",
"Port": 80,
"Scheme": "HTTP"
},
"InitialDelaySeconds": 10,
"PeriodSeconds": 5,
"SuccessThreshold": 1,
"TcpSocket": {
"Host": "1.2.3.4\n",
"Port": 80
},
"TimeoutSeconds": 10
},
"Memory": 4,
"Name": "HPL",
"Ports": [
{
"Port": 8080,
"Protocol": "TCP"
}
],
"PreviousState": {
"DetailStatus": "working",
"ExitCode": 0,
"FinishTime": "2018-08-02T15:00:00Z",
"Message": "Back-off 5m0s restarting failed container=test pod=test_eci-xxx(xxx)",
"Reason": "Completed",
"Signal": 1,
"StartTime": "2018-08-02T15:00:00Z",
"State": "Terminated"
},
"ReadinessProbe": {
"Execs": [
"[\n \"/bin/sh\",\n \"-c\",\n \"echo Hello world > /usr/share/message\"\n]"
],
"FailureThreshold": 3,
"HttpGet": {
"Path": "/usr/local",
"Port": 8080,
"Scheme": "HTTP"
},
"InitialDelaySeconds": 10,
"PeriodSeconds": 5,
"SuccessThreshold": 1,
"TcpSocket": {
"Host": "1.2.3.4",
"Port": 8888
},
"TimeoutSeconds": 1
},
"Ready": true,
"RestartCount": 5,
"SecurityContext": {
"Capability": {
"Adds": [
"NET_ADMIN"
]
},
"ReadOnlyRootFilesystem": true,
"RunAsUser": 1558
},
"Stdin": true,
"StdinOnce": true,
"Tty": false,
"VolumeMounts": [
{
"MountPath": "/usr/share/",
"MountPropagation": "None",
"Name": "test-empty",
"ReadOnly": false,
"SubPath": "/usr/sub"
}
],
"WorkingDir": "/usr/local/nginx"
}
],
"Volumes": [
{
"ConfigFileVolumeConfigFileToPaths": [
{
"Content": "hello world",
"Path": "/usr/bin/"
}
],
"DiskVolumeDiskId": "d-xxxx",
"DiskVolumeFsType": "xfs",
"EmptyDirVolumeMedium": "Memory",
"EmptyDirVolumeSizeLimit": "256Mi",
"FlexVolumeDriver": "flexvolume",
"FlexVolumeFsType": "ntfs",
"FlexVolumeOptions": "[nolock,tcp,noresvport]",
"NFSVolumePath": "/eci",
"NFSVolumeReadOnly": false,
"NFSVolumeServer": "0eafxxxxx-xxxxx.cn-hangzhou.nas.aliyuncs.com",
"Name": "test-empty",
"Type": "EmptyDirVolume"
}
],
"Events": [
{
"Count": 20,
"FirstTimestamp": "2018-08-02T15:00:00Z",
"LastTimestamp": "2018-08-02T15:00:00Z\n",
"Message": "Started container",
"Name": "test-xxx",
"Reason": "Created",
"Type": "Normal"
}
],
"CreationTime": "2018-08-02T15:00:00Z",
"SucceededTime": "2019-12-11T04:33:42Z",
"ExpiredTime": "2018-08-02T15:00:00Z",
"FailedTime": "2018-08-02T15:00:00Z",
"Discount": 9,
"DnsConfig": {
"NameServers": [
"[10.2.*.*]"
],
"Options": [
{
"Name": "name",
"Value": "value"
}
],
"Searches": [
"svc.local.kubenetes"
]
},
"EciSecurityContext": {
"Sysctls": [
{
"Name": "kernel.msgmax",
"Value": "65536"
}
]
},
"EniInstanceId": "eni-bp14rzqi6fd8satm****",
"EphemeralStorage": 20,
"HostAliases": [
{
"Hostnames": [
"['hehe.com', 'haha.com']"
],
"Ip": "192.0.XX.XX"
}
],
"InitContainers": [
{
"Args": [
"['hello world']"
],
"Command": [
"[/bin/sh echo]"
],
"Cpu": 1,
"CurrentState": {
"DetailStatus": "working",
"ExitCode": 0,
"FinishTime": "2018-08-02T15:00:00Z",
"Message": "Created container",
"Reason": "Started",
"Signal": 1,
"StartTime": "2018-08-02T15:00:00Z",
"State": "Running"
},
"EnvironmentVars": [
{
"Key": "PATH",
"Value": "/usr/local/bin",
"ValueFrom": {
"FieldRef": {
"FieldPath": "status.podIP"
}
}
}
],
"Gpu": 1,
"Image": "nginx",
"ImagePullPolicy": "Always",
"Memory": 2,
"Name": "Init-xxx",
"Ports": [
{
"Port": 8888,
"Protocol": "TCP"
}
],
"PreviousState": {
"DetailStatus": "working",
"ExitCode": 0,
"FinishTime": "2019-12-24T05:35:44Z",
"Message": "Started container",
"Reason": "completed",
"Signal": 1,
"StartTime": "2019-12-24T05:35:44Z",
"State": "Terminated"
},
"Ready": true,
"RestartCount": 5,
"SecurityContext": {
"Capability": {
"Adds": [
"NET_ADMIN"
]
},
"ReadOnlyRootFilesystem": true,
"RunAsUser": 1557
},
"VolumeMounts": [
{
"MountPath": "/usr/share/",
"MountPropagation": "None",
"Name": "test-empty",
"ReadOnly": false
}
],
"WorkingDir": "/usr/test"
}
],
"InternetIp": "192.0.XX.XX",
"IntranetIp": "172.16.XX.XX",
"Ipv6Address": "2001:XXXX:4:4:4:4:4:4",
"RamRoleName": "ram:PassRole",
"RegionId": "cn-hangzhou",
"ResourceGroupId": "rg-aekzh43v*****",
"RestartPolicy": "Never",
"SecurityGroupId": "sg-bp12ujq5zpxuyjfo3o8r",
"Tags": [
{
"Key": "name",
"Value": "test-xh"
}
],
"TenantEniInstanceId": "i-xxx",
"TenantEniIp": "10.10.XX.XX",
"TenantSecurityGroupId": "sg-xxx",
"TenantVSwitchId": "vsw-xxx",
"VSwitchId": "vsw-bp1vzjjflab6wvjox****",
"VpcId": "vpc-1vzjjflab6wvjox****",
"ZoneId": "cn-hangzhou-h"
}
]
}
]
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidParams | The specified parameter %s is invalid. | 无效的参数:%s |
400 | NotEnabled | You have not enabled this service | 您的账户还未开通此服务 |
404 | ClusterNotFound | The specified cluster does not exist. | 指定的集群不存在,请您检查该参数是否正确。 |
404 | ManagerNotFound | The manager nodes do not exist or their status is abnormal. | 管理节点不存在或状态异常。 |
406 | EcsError | An error occurred while calling the ECS API operation. | ECS API调用出错 |
406 | DbError | A database service error occurred. | 数据库请求失败 |
406 | RedisError | A Redis service error occurred. | Redis请求失败 |
406 | AliyunError | An Alibaba Cloud product error occurred. | 阿里云产品错误 |
406 | AgentError | The agent service request failed: %s | 代理请求失败 |
407 | NotAuthorized | You are not authorized by RAM for this request. | 此请求未获得RAM授权 |
500 | UnknownError | An unknown error occurred. | 未知错误 |
503 | ServiceUnavailable | The request has failed due to a temporary failure of the server | 请求失败,服务暂时不可用 |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2023-07-21 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||||||||
| ||||||||||||||||||
2023-07-17 | OpenAPI 错误码发生变更、OpenAPI 返回结构发生变更 | 看变更集 | ||||||||||||||||
|