Foo foo = ...;
Any any;
any.PackFrom(foo);
...
if (any.UnpackTo(&foo)) {
...
}
POST /v1/networkpolicies/simulate/{clusterId}
| 代码 (Code) | 消息 (Message) | 数据类型 (Datatype) |
|---|---|---|
200 |
成功的响应。(A successful response.) |
|
0 |
意外的错误响应。(An unexpected error response.) |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
端口 (port) |
长整型 (Long) |
int64 |
|||
L4协议 (l4protocol) |
L4_PROTOCOL_UNKNOWN, L4_PROTOCOL_TCP, L4_PROTOCOL_UDP, L4_PROTOCOL_ICMP, L4_PROTOCOL_RAW, L4_PROTOCOL_SCTP, L4_PROTOCOL_ANY, |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
代码 (code) |
整型 (Integer) |
int32 |
|||
消息 (message) |
字符串 (String) |
||||
详情 (details) |
ProtobufAny 列表 |
更新central/networkgraph/aggregator/aggregator.go中的normalizeDupNameExtSrcs(...),每当此消息更新时。(Update normalizeDupNameExtSrcs(…) in central/networkgraph/aggregator/aggregator.go whenever this message is updated.)
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
名称 |
字符串 (String) |
||||
CIDR |
字符串 (String) |
||||
默认值 |
布尔值 |
|
|||
已发现 |
布尔值 |
|
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 表示,则该表示将被嵌入,并添加一个字段 value,该字段除了 @type 字段外还包含自定义 JSON。示例(对于消息 [google.protobuf.Duration][])
{
"@type": "type.googleapis.com/google.protobuf.Duration",
"value": "1.212s"
}
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
@type |
字符串 (String) |
唯一标识序列化协议缓冲区消息类型的 URL/资源名称。此字符串必须包含至少一个“/”字符。URL 路径的最后一部分必须表示类型的完全限定名称(如 |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
CIDR |
字符串 (String) |
||||
例外 |
|
| 枚举值 |
|---|
L4_PROTOCOL_UNKNOWN |
L4_PROTOCOL_TCP |
L4_PROTOCOL_UDP |
L4_PROTOCOL_ICMP |
L4_PROTOCOL_RAW |
L4_PROTOCOL_SCTP |
L4_PROTOCOL_ANY |
Label selector components are joined with logical AND, see https://kubernetes.ac.cn/docs/concepts/overview/working-with-objects/labels/
下一个可用标签:3
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
匹配标签 |
|
这实际上是一个oneof,但由于向后兼容性限制,我们无法将其设为oneof。 |
|||
要求 |
Next available tag: 4
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
键 |
字符串 (String) |
||||
操作符 |
UNKNOWN、IN、NOT_IN、EXISTS、NOT_EXISTS、 |
||||
值 |
|
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
类型 |
UNKNOWN_TYPE、DEPLOYMENT、INTERNET、LISTEN_ENDPOINT、EXTERNAL_SOURCE、INTERNAL_ENTITIES、 |
||||
ID |
字符串 (String) |
||||
部署 |
|||||
外部来源 |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
名称 |
字符串 (String) |
||||
命名空间 |
字符串 (String) |
||||
集群 |
字符串 (String) |
||||
监听端口 |
INTERNAL_ENTITIES:INTERNAL_ENTITIES 用于将所有内部实体分组到单个网络图节点下
| 枚举值 |
|---|
UNKNOWN_TYPE |
DEPLOYMENT |
INTERNET |
LISTEN_ENDPOINT |
EXTERNAL_SOURCE |
INTERNAL_ENTITIES |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
ID |
字符串 (String) |
||||
名称 |
字符串 (String) |
||||
集群ID (clusterId) |
字符串 (String) |
||||
集群名称 |
字符串 (String) |
||||
命名空间 |
字符串 (String) |
||||
标签 |
|
||||
注释 |
|
||||
规范 |
|||||
YAML |
字符串 (String) |
||||
API版本 |
字符串 (String) |
||||
创建时间 |
日期 |
日期时间 |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
端口 |
|||||
目标 |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
端口 |
|||||
来源 |
Next available tag: 3
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
应用YAML |
字符串 (String) |
||||
要删除的 |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
Pod选择器 |
|||||
命名空间选择器 |
|||||
IP块 |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
协议 |
UNSET_PROTOCOL、TCP_PROTOCOL、UDP_PROTOCOL、SCTP_PROTOCOL、 |
||||
端口 (port) |
整型 (Integer) |
int32 |
|||
端口名称 |
字符串 (String) |
Next available tag: 3
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
命名空间 |
字符串 (String) |
||||
名称 |
字符串 (String) |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
Pod选择器 |
|||||
入口 |
|||||
出口 |
|||||
策略类型 |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
端口 (port) |
长整型 (Long) |
int64 |
|||
协议 |
L4_PROTOCOL_UNKNOWN, L4_PROTOCOL_TCP, L4_PROTOCOL_UDP, L4_PROTOCOL_ICMP, L4_PROTOCOL_RAW, L4_PROTOCOL_SCTP, L4_PROTOCOL_ANY, |
||||
上次活跃时间戳 |
日期 |
日期时间 |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
属性 |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
纪元 |
长整型 (Long) |
int64 |
|||
节点 |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
已弃用NodeDiffs |
|||||
nodeDiffs |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
实体 |
|||||
互联网访问 |
布尔值 |
||||
策略ID |
|
||||
非隔离入口 |
布尔值 |
||||
非隔离出口 |
布尔值 |
||||
查询匹配 |
布尔值 |
||||
出边 |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
策略ID |
|
||||
已弃用OutEdges |
|||||
出边 |
|||||
非隔离入口 |
布尔值 |
||||
非隔离出口 |
布尔值 |
| 字段名称 (Field Name) | 必填 (Required) | 可为空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
策略 |
|||||
状态 |
无效、不变、已修改、已添加、已删除 |
||||
旧策略 |