Foo foo = ...; Any any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... }
GET /v1/report/configurations
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
code |
整数 |
int32 |
|||
message |
字符串 |
||||
details |
ProtobufAny 列表 |
Any
包含任意序列化的protocol buffer消息以及描述序列化消息类型的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 |
字符串 |
一个 URL/资源名称,唯一标识序列化协议缓冲区消息的类型。此字符串必须包含至少一个“/”字符。URL 路径的最后一部分必须表示类型的完全限定名(例如, |
Sunday = 0, Monday = 1, .... Saturday = 6
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
天 |
|
int32 |
任何重复字段的每个元素都是一个单独的规则。规则由逻辑 OR 连接:如果存在允许资源x
的规则,则x
位于访问范围内。
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
includedClusters |
|
||||
includedNamespaces |
|||||
clusterLabelSelectors |
|||||
namespaceLabelSelectors |
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
notifierId |
字符串 |
||||
mailingLists |
|
||||
customSubject |
字符串 |
||||
customBody |
字符串 |
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
id |
字符串 |
||||
name |
字符串 |
||||
description |
字符串 |
||||
type |
VULNERABILITY, |
||||
vulnReportFilters |
|||||
scopeId |
字符串 |
||||
emailConfig |
|||||
schedule |
|||||
lastRunStatus |
|||||
lastSuccessfulRunTime |
日期 |
日期时间 |
|||
resourceScope |
|||||
notifiers |
|||||
creator |
|||||
version |
整数 |
int32 |
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
reportStatus |
SUCCESS, FAILURE, |
||||
lastRunTime |
日期 |
日期时间 |
|||
errorMsg |
字符串 |
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
intervalType |
UNSET, DAILY, WEEKLY, MONTHLY, |
||||
小时 |
整数 |
int32 |
|||
分钟 |
整数 |
int32 |
|||
weekly |
|||||
daysOfWeek |
|||||
daysOfMonth |
Next available tag: 4
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
key |
字符串 |
||||
op |
UNKNOWN, IN, NOT_IN, EXISTS, NOT_EXISTS, |
||||
values |
|
字段名称 | 必填 | 可为空 | 类型 | 描述 | 格式 |
---|---|---|---|---|---|
fixability |
BOTH, FIXABLE, NOT_FIXABLE, |
||||
sinceLastReport |
布尔值 |
||||
severities |
|||||
imageTypes |
|||||
allVuln |
布尔值 |
||||
sinceLastSentScheduledReport |
布尔值 |
||||
sinceStartDate |
日期 |
日期时间 |
|||
accessScopeRules |
|||||
includeNvdCvss |
布尔值 |
枚举值 |
---|
UNKNOWN_VULNERABILITY_SEVERITY |
LOW_VULNERABILITY_SEVERITY |
MODERATE_VULNERABILITY_SEVERITY |
IMPORTANT_VULNERABILITY_SEVERITY |
CRITICAL_VULNERABILITY_SEVERITY |