第 32 章 ListeningEndpointsService


32.1. GetListeningEndpoints

GET /v1/listening_endpoints/deployment/{deploymentId}

GetListeningEndpoints 返回侦听端点,以及为给定部署打开它们的进程

32.1.1. 描述

32.1.2. 参数

32.1.2.1. 路径参数

Name描述必填defaultpattern

deploymentId

 

X

null

 

32.1.3. 返回类型

V1GetProcessesListeningOnPortsResponse

32.1.4. 内容类型

  • application/json

32.1.5. 响应

表 32.1. HTTP 响应代码
代码消息datatype

200

成功响应。

V1GetProcessesListeningOnPortsResponse

0

意外错误响应。

RuntimeError

32.1.6. Samples

32.1.7. 常规对象参考

32.1.7.1. ProcessListeningOnPortEndpoint

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

port

  

Long

 

int64

protocol

  

StorageL4Protocol

 

L4_PROTOCOL_UNKNOWN, L4_PROTOCOL_TCP, L4_PROTOCOL_UDP, L4_PROTOCOL_ICMP, L4_PROTOCOL_RAW, L4_PROTOCOL_SCTP, L4_PROTOCOL_ANY,

32.1.7.2. ProcessSignalLineageInfo

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

parentUid

  

Long

 

int64

parentExecFilePath

  

字符串

  

32.1.7.3. ProtobufAny

any 包含任意序列化协议缓冲区消息,以及一个描述序列化消息的类型的 URL。

protobuf 库以实用程序函数形式提供对 pack/unpack Any 值的支持,或者对 Any 类型的其他生成的方法提供其他生成的方法。

示例 1: Pack 并在 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/x/y.z"。

32.1.7.3.1. JSON 表示

any 值的 JSON 表示使用反序列化的、嵌入式消息的常规表示,以及包含类型 URL 的附加字段 @type。Example:

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 表示法,则该表示将被嵌入一个字段值,该值 除 @type 字段外还包含自定义 JSON。示例(用于消息 [google.protobuf.Duration][]):

{
  "@type": "type.googleapis.com/google.protobuf.Duration",
  "value": "1.212s"
}
字段名称必填nullable类型描述格式

typeUrl

  

字符串

唯一标识序列化协议缓冲消息的 URL/资源名称。此字符串必须至少包含一个 \"/\" 字符。URL 路径的最后一部分必须代表类型的完全限定名称(如 path/google.protobuf.Duration)。名称应采用规范形式(例如,未接受前面的 \".\")。在实践中,团队通常会预编译到期望其在任意上下文中使用的所有类型的二进制代码。但是,对于使用方案 http、https 或无方案的 URL,可以选择设置一个类型服务器,将类型 URL 映射到消息定义,如下所示:* 如果没有提供方案,则假设 https。* URL 上的 HTTP GET 必须以二进制格式生成一个 [google.protobuf.Type][] 值,或者产生错误。* 应用程序允许根据 URL 缓存查找结果,或者预先编译到二进制文件以避免出现任何查找。因此,为了更改类型,二进制兼容性需要保留。(使用版本控制类型名称来管理中断的更改。)注意:这个功能目前在官方 protobuf 版本中可用,它不用于以 type.googleapis.com 开头的类型 URL。自 2023 年 5 月起,没有广泛使用的类型服务器实施,没有计划实施。http 之外的方案(或空方案)可以与实施特定语义一起使用。

 

value

  

byte[]

必须是上述指定类型的有效序列化协议缓冲。

BYTE

32.1.7.4. RuntimeError

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

错误

  

字符串

  

code

  

整数

 

int32

message

  

字符串

  

详情

  

ProtobufAny列表

  

32.1.7.5. StorageL4Protocol

Enum 值

L4_PROTOCOL_UNKNOWN

L4_PROTOCOL_TCP

L4_PROTOCOL_UDP

L4_PROTOCOL_ICMP

L4_PROTOCOL_RAW

L4_PROTOCOL_SCTP

L4_PROTOCOL_ANY

32.1.7.6. StorageProcessListeningOnPort

The API returns an array of these
字段名称必填nullable类型描述格式

端点

  

ProcessListeningOnPortEndpoint

  

deploymentId

  

字符串

  

containerName

  

字符串

  

podId

  

字符串

  

podUid

  

字符串

  

signal

  

StorageProcessSignal

  

clusterId

  

字符串

  

namespace

  

字符串

  

containerStartTime

  

Date

 

date-time

imageId

  

字符串

  

32.1.7.7. StorageProcessSignal

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

id

  

字符串

用于识别消息的唯一 UUID,此处有此此,而不是在顶级,因为我们希望包含每个消息。

 

containerId

  

字符串

  

time

  

Date

 

date-time

名称

  

字符串

  

args

  

字符串

  

execFilePath

  

字符串

  

pid

  

Long

 

int64

uid

  

Long

 

int64

gid

  

Long

 

int64

lineage

  

字符串列表

  

scraped

  

布尔值

  

lineageInfo

  

ProcessSignalLineageInfo列表

  

32.1.7.8. V1GetProcessesListeningOnPortsResponse

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

listeningEndpoints

  

StorageProcessListeningOnPort列表

  
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部