Foo foo = ...;
Any any;
any.PackFrom(foo);
...
if (any.UnpackTo(&foo)) {
...
}
GET /v1/rbac/subjects
| 名称 (Name) | 描述 (Description) | 必填 (Required) | 默认值 (Default) | 模式 (Pattern) |
|---|---|---|---|---|
查询 (query) |
- |
空 (null) |
||
分页限制 (pagination.limit) |
- |
空 (null) |
||
分页偏移量 (pagination.offset) |
- |
空 (null) |
||
分页排序字段 (pagination.sortOption.field) |
- |
空 (null) |
||
分页排序反转 (pagination.sortOption.reversed) |
- |
空 (null) |
||
分页排序聚合函数 (pagination.sortOption.aggregateBy.aggrFunc) |
- |
未设置 (UNSET) |
||
分页排序去重 (pagination.sortOption.aggregateBy.distinct) |
- |
空 (null) |
| 代码 (Code) | 消息 (Message) | 数据类型 (Datatype) |
|---|---|---|
200 |
成功响应 (A successful response.) |
|
0 |
意外错误响应 (An unexpected error response.) |
| 字段名称 (Field Name) | 必填 (Required) | 可空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
代码 (code) |
整数 (Integer) |
int32 |
|||
消息 (message) |
字符串 |
||||
详情 |
列表 ProtobufAny |
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 |
字符串 |
唯一标识序列化协议缓冲区消息类型的URL/资源名称。此字符串必须包含至少一个“/”字符。URL路径的最后一部分必须表示类型的完全限定名称(如 |
Properties of an individual k8s Role or ClusterRole. ////////////////////////////////////////
| 字段名称 (Field Name) | 必填 (Required) | 可空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
ID |
字符串 |
||||
名称 |
字符串 |
||||
命名空间 |
字符串 |
||||
集群ID |
字符串 |
||||
集群名称 |
字符串 |
||||
集群角色 |
布尔值 |
||||
标签 |
|
||||
注释 |
|
||||
创建时间 |
日期 |
日期时间 |
|||
规则 |
Properties of an individual rules that grant permissions to resources. ////////////////////////////////////////
| 字段名称 (Field Name) | 必填 (Required) | 可空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
动词 |
|
||||
API组 |
|
||||
资源 |
|
||||
非资源URL |
|
||||
资源名称 |
|
Properties of an individual subjects who are granted roles via role bindings. ////////////////////////////////////////
| 字段名称 (Field Name) | 必填 (Required) | 可空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
ID |
字符串 |
||||
种类 |
UNSET_KIND, SERVICE_ACCOUNT, USER, GROUP, |
||||
名称 |
字符串 |
||||
命名空间 |
字符串 |
||||
集群ID |
字符串 |
||||
集群名称 |
字符串 |
A list of k8s subjects (users and groups only, for service accounts, try the service account service) Next Tag: 2
| 字段名称 (Field Name) | 必填 (Required) | 可空 (Nullable) | 类型 (Type) | 描述 (Description) | 格式 (Format) |
|---|---|---|---|---|---|
主题和角色 |