Foo foo = ...; Any any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... }
GET /v1/export/pods
代码 (Code) | 消息 (Message) | 数据类型 (Datatype) |
---|---|---|
200 |
成功响应。(流式响应)(A successful response.(streaming responses)) |
|
0 |
意外错误响应。(An unexpected error response.) |
字段名称 (Field Name) | 必填 (Required) | 可空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
---|---|---|---|---|---|
代码 (code) |
整数 (Integer) |
int32 |
|||
消息 (message) |
字符串 (String) |
||||
详情 (details) |
ProtobufAny 列表 (List of ProtobufAny) |
字段名称 (Field Name) | 必填 (Required) | 可空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
---|---|---|---|---|---|
实例 (instances) |
StorageContainerInstance 列表 (List of StorageContainerInstance) |
Any
包含任意序列化的协议缓冲区消息以及描述序列化消息类型的 URL。
Protobuf 库提供支持,以实用程序函数或 Any 类型的附加生成方法的形式打包/解包 Any 值。
示例 1:在 C++ 中打包和解包消息。
Foo foo = ...; Any any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... }
示例 2:在 Java 中打包和解包消息。
Foo foo = ...; Any any = Any.pack(foo); ... if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } // or ... if (any.isSameTypeAs(Foo.getDefaultInstance())) { foo = any.unpack(Foo.getDefaultInstance()); }
Example 3: Pack and unpack a message in Python.
foo = Foo(...) any = Any() any.Pack(foo) ... if any.Is(Foo.DESCRIPTOR): any.Unpack(foo) ...
Example 4: Pack and unpack a message in Go
foo := &pb.Foo{...} any, err := anypb.New(foo) if err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(foo); err != nil { ... }
protobuf 库提供的打包方法默认使用 'type.googleapis.com/full.type.name' 作为类型 URL,解包方法只使用类型 URL 中最后一个 '/' 后面的完全限定类型名称,例如 "foo.bar.com/x/y.z" 将产生类型名称 "y.z"。
Any
值的 JSON 表示使用反序列化嵌入消息的常规表示,并添加一个包含类型 URL 的附加字段 @type
。示例
package google.profile; message Person { string first_name = 1; string last_name = 2; }
{ "@type": "type.googleapis.com/google.profile.Person", "firstName": <string>, "lastName": <string> }
如果嵌入的消息类型是众所周知的并且具有自定义 JSON 表示,则该表示将被嵌入,除了 @type
字段外,还会添加一个保存自定义 JSON 的 value
字段。示例(对于消息 [google.protobuf.Duration][])
{ "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" }
字段名称 (Field Name) | 必填 (Required) | 可空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
---|---|---|---|---|---|
@type |
字符串 (String) |
一个 URL/资源名称,唯一标识序列化协议缓冲区消息的类型。此字符串必须包含至少一个“/”字符。URL 路径的最后一部分必须表示类型的完全限定名称(如 |
ContainerInstanceID 用于唯一标识集群中的容器。
字段名称 (Field Name) | 必填 (Required) | 可空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
---|---|---|---|---|---|
instanceId |
|||||
containingPodId |
字符串 (String) |
包含此容器实例的 Pod(仅限 Kubernetes)。 |
|||
containerName |
字符串 (String) |
容器名称。 |
|||
containerIps |
|
此容器的 IP 地址。 |
|||
started |
日期 |
日期时间 |
|||
imageDigest |
字符串 (String) |
||||
finished |
日期 |
容器的完成时间(如果已完成)。 |
日期时间 |
||
exitCode |
整数 (Integer) |
容器的退出代码。仅在填充 finished 时有效。 |
int32 |
||
terminationReason |
字符串 (String) |
容器终止的原因(如果已完成)。 |
字段名称 (Field Name) | 必填 (Required) | 可空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
---|---|---|---|---|---|
containerRuntime |
UNKNOWN_CONTAINER_RUNTIME, DOCKER_CONTAINER_RUNTIME, CRIO_CONTAINER_RUNTIME, |
||||
id |
字符串 (String) |
容器的 ID,特定于给定的运行时。 |
|||
node |
字符串 (String) |
运行此容器的节点。 |
枚举值 |
---|
UNKNOWN_CONTAINER_RUNTIME |
DOCKER_CONTAINER_RUNTIME |
CRIO_CONTAINER_RUNTIME |
Pod 代表当前正在运行的 Pod 或活动部署中已删除的 Pod 的信息。
字段名称 (Field Name) | 必填 (Required) | 可空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
---|---|---|---|---|---|
id |
字符串 (String) |
||||
name |
字符串 (String) |
||||
deploymentId |
字符串 (String) |
||||
namespace |
字符串 (String) |
||||
clusterId |
字符串 (String) |
||||
liveInstances |
StorageContainerInstance 列表 (List of StorageContainerInstance) |
||||
terminatedInstances |
必须是列表的列表,以便我们可以执行搜索查询(对于不是 <string, string> 的映射不起作用)。每个容器名称都有一个存储桶(列表)。 |
||||
started |
日期 |
Kubernetes 报告 Pod 创建时间的时间。 |
日期时间 |
Stream result of v1ExportPodResponse
字段名称 (Field Name) | 必填 (Required) | 可空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
---|---|---|---|---|---|
result |
|||||
error |