查看Event
更新时间:2025-08-05
接口描述
查询Event。 |
请求结构
Plain Text
1GET /api/v1/{namespace}/events/{name} HTTP/1.1
2Host: bec.bdcloudapi.com
3Content-Type: application/json; charset=utf-8
4Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
表1 Path参数描述
| 参数 | 类型 | 参数位置 | 描述 | 是否必须 |
|---|---|---|---|---|
| name | String | URI参数 | Name of the event. | 必须 |
| namespace | String | URI参数 | Object name and auth scope, such as for teams and projects. | 必须 |
表2 Query参数描述
| 参数 | 类型 | 描述 | 是否必须 |
|---|---|---|---|
| pretty | String | If 'true', then the output is pretty printed. | 非必须 |
| exact | String | Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. | 非必须 |
| export | String | Should this value be exported. Export strips fields that a user cannot specify. | 非必须 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
响应参数的详细描述请参见 数据结构 表
错误码
请参照前文的网关错误码和平台错误码。
请求示例
Plain Text
1GET /api/v1/namespaces/test-namespace/events/test-event HTTP/1.1
2Host: bec.bdcloudapi.com
3Content-Type: application/json; charset=utf-8
4Authorization: bce-auth-v1/318857a8f08b11e9845ca7e54775a0c2/2019-10-17T03:07:21Z/1800/host/212eef8cfe1ac94be56c4afedb9360bba621ef646c3c8288971d36801d70501a
响应示例
Plain Text
1{
2 "action": null,
3 "apiVersion": "v1",
4 "count": 40,
5 "eventTime": null,
6 "firstTimestamp": 1575459917000,
7 "involvedObject": {
8 "apiVersion": "v1",
9 "fieldPath": "spec.containers{container01}",
10 "kind": "Pod",
11 "name": "sts-qu1snv22-6-u-0",
12 "namespace": "bec-user-ns-rgzafffd",
13 "resourceVersion": "48984304",
14 "uid": "7fbb3977-168b-11ea-8ba8-6c92bfc7bdb6"
15 },
16 "kind": "Event",
17 "lastTimestamp": 1575602799000,
18 "message": "Created container",
19 "metadata": {
20 "annotations": null,
21 "clusterName": null,
22 "creationTimestamp": 1575602799000,
23 "deletionGracePeriodSeconds": null,
24 "deletionTimestamp": null,
25 "finalizers": null,
26 "generateName": null,
27 "generation": null,
28 "initializers": null,
29 "labels": null,
30 "name": "sts-qu1snv22-6-u-0.15dd28729beca239",
31 "namespace": "bec-user-ns-rgzafffd",
32 "ownerReferences": null,
33 "resourceVersion": "48984430",
34 "selfLink": "/api/v1/namespaces/test-namespace/events/test-event",
35 "uid": "3760689a-17d8-11ea-8ba8-6c92bfc7bdb6"
36 },
37 "reason": "Created",
38 "related": null,
39 "reportingComponent": "",
40 "reportingInstance": "",
41 "series": null,
42 "source": {
43 "component": "kubelet",
44 "host": "101.206.161.137"
45 },
46 "type": "Normal"
47}
