Foo foo = ...; Any any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... }
GET /v1/networkbaseline/{id}
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
port |
长整型 |
int64 |
|||
l4protocol |
L4_PROTOCOL_UNKNOWN, L4_PROTOCOL_TCP, L4_PROTOCOL_UDP, L4_PROTOCOL_ICMP, L4_PROTOCOL_RAW, L4_PROTOCOL_SCTP, L4_PROTOCOL_ANY, |
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
code |
整数 |
int32 |
|||
message |
字符串 |
||||
details |
ProtobufAny 列表 |
更新 central/networkgraph/aggregator/aggregator.go
中的 normalizeDupNameExtSrcs(…) 方法,以适应此消息的更新。
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
name |
字符串 |
||||
cidr |
字符串 |
||||
default |
布尔型 |
|
|||
discovered |
布尔型 |
|
Any
包含任意序列化protobuf消息以及描述序列化消息类型的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" }
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
@type |
字符串 |
唯一标识序列化protobuf消息类型的URL/资源名称。此字符串必须至少包含一个“/”字符。URL路径的最后一部分必须表示类型的全限定名称(如 |
枚举值 |
---|
L4_PROTOCOL_UNKNOWN |
L4_PROTOCOL_TCP |
L4_PROTOCOL_UDP |
L4_PROTOCOL_ICMP |
L4_PROTOCOL_RAW |
L4_PROTOCOL_SCTP |
L4_PROTOCOL_ANY |
NetworkBaseline represents a network baseline of a deployment. It contains all the baseline peers and their respective connections. next available tag: 8
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
deploymentId |
字符串 |
这是基线的ID。 |
|||
clusterId |
字符串 |
||||
namespace |
字符串 |
||||
peers |
|||||
forbiddenPeers |
永远不会添加到基线的对等点列表。目前,这包含用户手动删除的对等点。这用于确保我们不会在再次看到流量时将其添加回来。 |
||||
observationPeriodEnd |
日期 |
日期时间 |
|||
locked |
布尔型 |
||||
deploymentName |
字符串 |
NetworkBaselineConnectionProperties represents information about a baseline connection next available tag: 4
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
ingress |
布尔型 |
||||
port |
长整型 |
int64 |
|||
protocol |
L4_PROTOCOL_UNKNOWN, L4_PROTOCOL_TCP, L4_PROTOCOL_UDP, L4_PROTOCOL_ICMP, L4_PROTOCOL_RAW, L4_PROTOCOL_SCTP, L4_PROTOCOL_ANY, |
NetworkBaselinePeer represents a baseline peer. next available tag: 3
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
entity |
|||||
properties |
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
type |
UNKNOWN_TYPE, DEPLOYMENT, INTERNET, LISTEN_ENDPOINT, EXTERNAL_SOURCE, INTERNAL_ENTITIES, |
||||
id |
字符串 |
||||
deployment |
|||||
externalSource |
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
name |
字符串 |
||||
namespace |
字符串 |
||||
cluster |
字符串 |
||||
listenPorts |