×

GET /v1/deploymentswithrisk/{id}

GetDeploymentWithRisk 返回部署及其给定 ID 的风险。

描述

参数

路径参数

名称 描述 必填 默认值 模式

id

内容类型

  • application/json

响应

表 1. HTTP 响应代码
代码 消息 数据类型

200

成功的响应。

V1GetDeploymentWithRiskResponse

0

意外的错误响应。

GooglerpcStatus

示例

常用对象引用

ContainerConfigEnvironmentConfig

字段名称 必填 可空 类型 描述 格式

key

字符串

value

字符串

envVarSource

EnvironmentConfigEnvVarSource

UNSET, RAW, SECRET_KEY, CONFIG_MAP_KEY, FIELD, RESOURCE_FIELD, UNKNOWN,

EnvironmentConfigEnvVarSource

For any update to EnvVarSource, please also update 'ui/src/messages/common.js'
枚举值

UNSET

RAW

SECRET_KEY

CONFIG_MAP_KEY

FIELD

RESOURCE_FIELD

UNKNOWN

GooglerpcStatus

字段名称 必填 可空 类型 描述 格式

code

整数

int32

message

字符串

details

ProtobufAny 列表

PortConfigExposureInfo

字段名称 必填 可空 类型 描述 格式

level

PortConfigExposureLevel

UNSET, EXTERNAL, NODE, INTERNAL, HOST, ROUTE,

serviceName

字符串

serviceId

字符串

serviceClusterIp

字符串

servicePort

整数

int32

nodePort

整数

int32

externalIps

string 列表

externalHostnames

string 列表

PortConfigExposureLevel

枚举值

UNSET

EXTERNAL

NODE

INTERNAL

HOST

ROUTE

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 库提供的 pack 方法默认使用“type.googleapis.com/full.type.name”作为类型 URL,而 unpack 方法仅使用类型 URL 中最后一个“/”后的完全限定类型名称,例如“foo.bar.com/x/y.z”将产生类型名称“y.z”。

JSON 表示

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 路径的最后一部分必须表示类型的完全限定名称(如 path/google.protobuf.Duration)。名称应采用规范形式(例如,不接受前导“.”)。实际上,团队通常会将其预期在 Any 上下文中使用的所有类型预编译到二进制文件中。但是,对于使用方案 httphttps 或无方案的 URL,可以选择设置一个类型服务器,以如下方式将类型 URL 映射到消息定义:* 如果未提供方案,则假定为 https。* 对 URL 的 HTTP GET 必须产生二进制格式的 [google.protobuf.Type][] 值,或产生错误。* 应用程序允许基于 URL 缓存查找结果,或将其预编译到二进制文件中以避免任何查找。因此,需要在类型更改时保留二进制兼容性。(使用版本化的类型名称来管理重大更改。)注意:此功能当前在官方 protobuf 版本中不可用,并且不用于以 type.googleapis.com 开头的类型 URL。截至 2023 年 5 月,没有广泛使用的类型服务器实现,也没有计划实现一个。可能使用除 httphttps(或空方案)之外的其他方案,并具有特定于实现的语义。

ResultFactor

字段名称 必填 可空 类型 描述 格式

message

字符串

url

字符串

SeccompProfileProfileType

枚举值

UNCONFINED

RUNTIME_DEFAULT

LOCALHOST

SecurityContextSELinux

字段名称 必填 可空 类型 描述 格式

user

字符串

role

字符串

type

字符串

level

字符串

SecurityContextSeccompProfile

字段名称 必填 可空 类型 描述 格式

type

SeccompProfileProfileType

UNCONFINED, RUNTIME_DEFAULT, LOCALHOST,

localhostProfile

字符串

StorageContainer

字段名称 必填 可空 类型 描述 格式

id

字符串

config

StorageContainerConfig

image

StorageContainerImage

securityContext

StorageSecurityContext

volumes

StorageVolume 列表

ports

StoragePortConfig 列表

secrets

StorageEmbeddedSecret 列表

resources

StorageResources

name

字符串

livenessProbe

StorageLivenessProbe

readinessProbe

StorageReadinessProbe

StorageContainerConfig

字段名称 必填 可空 类型 描述 格式

env

ContainerConfigEnvironmentConfig 列表

command

string 列表

args

string 列表

directory

字符串

user

字符串

uid

字符串

int64

appArmorProfile

字符串

StorageContainerImage

Next tag: 12
字段名称 必填 可空 类型 描述 格式

id

字符串

name

StorageImageName

notPullable

布尔值

isClusterLocal

布尔值

StorageDeployment

Next available tag: 36
字段名称 必填 可空 类型 描述 格式

id

字符串

name

字符串

hash

字符串

uint64

type

字符串

namespace

字符串

namespaceId

字符串

orchestratorComponent

布尔值

replicas

字符串

int64

labels

string 映射

podLabels

string 映射

labelSelector

StorageLabelSelector

created

日期

日期时间

clusterId

字符串

clusterName

字符串

containers

StorageContainer 列表

annotations

string 映射

priority

字符串

int64

inactive

布尔值

imagePullSecrets

string 列表

serviceAccount

字符串

serviceAccountPermissionLevel

StoragePermissionLevel

UNSET, NONE, DEFAULT, ELEVATED_IN_NAMESPACE, ELEVATED_CLUSTER_WIDE, CLUSTER_ADMIN,

automountServiceAccountToken

布尔值

hostNetwork

布尔值

hostPid

布尔值

hostIpc

布尔值

runtimeClass

字符串

tolerations

StorageToleration 列表

ports

StoragePortConfig 列表

stateTimestamp

字符串

int64

riskScore

浮点数

float

platformComponent

布尔值

StorageEmbeddedSecret

字段名称 必填 可空 类型 描述 格式

name

字符串

path

字符串

StorageImageName

字段名称 必填 可空 类型 描述 格式

registry

字符串

remote

字符串

tag

字符串

fullName

字符串

StorageLabelSelector

Label selector components are joined with logical AND, see     http://kubernetes.ac.cn/docs/concepts/overview/working-with-objects/labels/

下一个可用标签:3

字段名称 必填 可空 类型 描述 格式

matchLabels

string 映射

这实际上是一个oneof,但由于向后兼容性限制,我们无法使其成为oneof。

requirements

StorageLabelSelectorRequirement 列表

StorageLabelSelectorOperator

枚举值

UNKNOWN

IN

NOT_IN

EXISTS

NOT_EXISTS

StorageLabelSelectorRequirement

Next available tag: 4
字段名称 必填 可空 类型 描述 格式

key

字符串

op

StorageLabelSelectorOperator

UNKNOWN, IN, NOT_IN, EXISTS, NOT_EXISTS,

values

string 列表

StorageLivenessProbe

字段名称 必填 可空 类型 描述 格式

defined

布尔值

StoragePermissionLevel

For any update to PermissionLevel, also update: - pkg/searchbasedpolicies/builders/k8s_rbac.go - ui/src/messages/common.js
枚举值

UNSET

NONE

DEFAULT

ELEVATED_IN_NAMESPACE

ELEVATED_CLUSTER_WIDE

CLUSTER_ADMIN

StoragePortConfig

Next Available Tag: 6
字段名称 必填 可空 类型 描述 格式

name

字符串

containerPort

整数

int32

protocol

字符串

exposure

PortConfigExposureLevel

UNSET, EXTERNAL, NODE, INTERNAL, HOST, ROUTE,

exposedPort

整数

int32

exposureInfos

PortConfigExposureInfo 列表

StorageReadinessProbe

字段名称 必填 可空 类型 描述 格式

defined

布尔值

StorageResources

字段名称 必填 可空 类型 描述 格式

cpuCoresRequest

浮点数

float

cpuCoresLimit

浮点数

float

memoryMbRequest

浮点数

float

memoryMbLimit

浮点数

float

StorageRisk

字段名称 必填 可空 类型 描述 格式

id

字符串

subject

StorageRiskSubject

score

浮点数

float

results

StorageRiskResult 列表

StorageRiskResult

字段名称 必填 可空 类型 描述 格式

name

字符串

factors

ResultFactor 列表

score

浮点数

float

StorageRiskSubject

字段名称 必填 可空 类型 描述 格式

id

字符串

namespace

字符串

clusterId

字符串

type

StorageRiskSubjectType

UNKNOWN, DEPLOYMENT, NAMESPACE, CLUSTER, NODE, NODE_COMPONENT, IMAGE, IMAGE_COMPONENT, SERVICEACCOUNT,

StorageRiskSubjectType

Next tag: 9
枚举值

UNKNOWN

DEPLOYMENT

NAMESPACE

CLUSTER

NODE

NODE_COMPONENT

IMAGE

IMAGE_COMPONENT

SERVICEACCOUNT

StorageSecurityContext

字段名称 必填 可空 类型 描述 格式

privileged

布尔值

selinux

SecurityContextSELinux

dropCapabilities

string 列表

addCapabilities

string 列表

readOnlyRootFilesystem

布尔值

seccompProfile

SecurityContextSeccompProfile

allowPrivilegeEscalation

布尔值

StorageTaintEffect

枚举值

UNKNOWN_TAINT_EFFECT

NO_SCHEDULE_TAINT_EFFECT

PREFER_NO_SCHEDULE_TAINT_EFFECT

NO_EXECUTE_TAINT_EFFECT

StorageToleration

字段名称 必填 可空 类型 描述 格式

key

字符串

operator

StorageTolerationOperator

TOLERATION_OPERATION_UNKNOWN, TOLERATION_OPERATOR_EXISTS, TOLERATION_OPERATOR_EQUAL,

value

字符串

taintEffect

StorageTaintEffect

UNKNOWN_TAINT_EFFECT, NO_SCHEDULE_TAINT_EFFECT, PREFER_NO_SCHEDULE_TAINT_EFFECT, NO_EXECUTE_TAINT_EFFECT,

StorageTolerationOperator

枚举值

TOLERATION_OPERATION_UNKNOWN

TOLERATION_OPERATOR_EXISTS

TOLERATION_OPERATOR_EQUAL

StorageVolume

字段名称 必填 可空 类型 描述 格式

name

字符串

source

字符串

destination

字符串

readOnly

布尔值

type

字符串

mountPropagation

VolumeMountPropagation

NONE, HOST_TO_CONTAINER, BIDIRECTIONAL,

V1GetDeploymentWithRiskResponse

字段名称 必填 可空 类型 描述 格式

部署

存储部署

风险

存储风险

VolumeMountPropagation

枚举值

NONE

HOST_TO_CONTAINER

双向