AS AgentScopeAPI 手册 / API Reference

GatewayStrategy

public class GatewayStrategy implements ConnectionStrategy
源码Source io/agentscope/extensions/sandbox/kubernetes/client/internal/strategy/GatewayStrategy.java:39–165

网关 Strategy,在隔离环境中安全执行代码和工具。位于 io.agentscope.extensions.sandbox.kubernetes.client.internal.strategy 包,实现 ConnectionStrategy。核心成员包括 connect、close、GatewayStrategy。

Gateway connection strategy — watches a Kubernetes Gateway resource for an external address, then routes through the sandbox-router.

构造器摘要Constructor Summary

构造器Constructor说明Description
public GatewayStrategy(KubernetesClient client, GatewayConnectionConfig config)
初始化 `GatewayStrategy` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public String connect() throws Exception
建立连接并完成初始化。
Returns the connect.
public void close()
关闭连接并释放相关资源。
Releases resources and connections.

构造器详情Constructor Detail

GatewayStrategy

public GatewayStrategy(KubernetesClient client, GatewayConnectionConfig config)

初始化 GatewayStrategy 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
clientKubernetesClient客户端(类型 `KubernetesClient`)。The client.
configGatewayConnectionConfig配置对象(类型 `GatewayConnectionConfig`)。The config.
源码Source io/agentscope/extensions/sandbox/kubernetes/client/internal/strategy/GatewayStrategy.java:56–59

方法详情Method Detail

connect

public String connect() throws Exception

建立连接并完成初始化。

Returns the connect.

返回Returns String
返回字符串结果。Returns a string.
抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/extensions/sandbox/kubernetes/client/internal/strategy/GatewayStrategy.java:61–111

close

public void close()

关闭连接并释放相关资源。

Releases resources and connections.

源码Source io/agentscope/extensions/sandbox/kubernetes/client/internal/strategy/GatewayStrategy.java:113–116

继承成员Inherited Members

继承自Methods inherited from ConnectionStrategy
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.