查询服务事件日志 - ShowServiceEvents
功能介绍
查询服务事件日志,包含服务的操作记录及部署过程中的关键动作、部署失败原因。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权,具体权限要求请参见权限和授权项。
- 如果使用身份策略授权,需具备如下身份策略权限。
授权项
访问级别
资源类型(*为必须)
条件键
别名
依赖的授权项
modelarts:service:getEvents
Read
service *
g:ResourceTag/<tag-key>
-
-
URI
GET /v1/{project_id}/services/{service_id}/events
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
project_id | 是 | String | 用户项目ID。获取方法请参见获取项目ID和名称。 |
service_id | 是 | String | 服务ID。 |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
event_type | 否 | String | 事件类型,枚举值如下: |
event_info | 否 | String | 事件信息,仅支持英文信息过滤,不支持`(){}';,[]<>/?!¥…&()【】‘;:”“’。,、? |
start_time | 否 | Number | 过滤事件发生时间的起始时间,默认不过滤。 |
end_time | 否 | Number | 过滤事件发生时间的截止时间,默认不过滤。 |
offset | 否 | Integer | 分页列表的起始页,默认为0。 |
limit | 否 | Integer | 指定每一页返回的最大条目数,默认为1000。 |
sort_by | 否 | String | 指定排序字段,默认为occur_time(事件产生时间)。 |
order | 否 | String | 排序方式,枚举值如下: |
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-Auth-Token | 是 | String | 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
service_name | String | 服务名称。 |
total_count | Integer | 不分页的情况下符合查询条件的事件总数量。 |
service_id | String | 服务ID。 |
count | Integer | 当前查询结果的事件数量。 |
events | Array of Events objects | 服务的事件日志。 |
请求示例
GET https://{endpoint}/v1/{project_id}/services/{service_id}/events 响应示例
状态码:200
服务事件日志。
{
"service_name" : "service-07085",
"total_count" : 9,
"service_id" : "35de3ca9-1bca-4ae7-9cb0-914f30fa7d3e",
"count" : 9,
"events" : [ {
"event_type" : "normal",
"event_info" : "start to deploy service",
"occur_time" : 1562597251764
}, {
"event_type" : "normal",
"event_info" : "building image for model [TF 3.0.0]",
"occur_time" : 1562597251788
}, {
"event_type" : "normal",
"event_info" : "model (TF 3.0.0) build image success",
"occur_time" : 1562597251805
}, {
"event_type" : "normal",
"event_info" : "preparing environment",
"occur_time" : 1562597255744
}, {
"event_type" : "normal",
"event_info" : "[TF 3.0.0] prepare environment success",
"occur_time" : 1562597275915
}, {
"event_type" : "normal",
"event_info" : "[TF 3.0.0] schedule resource success",
"occur_time" : 1562597275921
}, {
"event_type" : "normal",
"event_info" : "[TF 3.0.0] pulling model image",
"occur_time" : 1562597275928
}, {
"event_type" : "normal",
"event_info" : "[TF 3.0.0] pull image success",
"occur_time" : 1562597332570
}, {
"event_type" : "normal",
"event_info" : "[TF 3.0.0] starting model",
"occur_time" : 1562597332582
} ]
} 状态码
状态码 | 描述 |
|---|---|
200 | 服务事件日志。 |
错误码
请参见错误码。

