FcClient
public class FcClient extends BaseClient
源码Source
io/agentscope/runtime/sandbox/client/fc/FcClient.java:38–590Fc 客户端,封装与远端服务的连接和调用。位于 io.agentscope.runtime.sandbox.client.fc 包,继承自 BaseClient。核心成员包括 connect、isConnected、createContainer、startContainer、stopContainer、removeContainer。
A class in io.agentscope.runtime.sandbox.client.fc that deploys, schedules and serves agents. Declared in io.agentscope.runtime.sandbox.client.fc. Extends BaseClient.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public FcClient(FcClientStarter fcClientConfig) throws Exception | 初始化 `FcClient` 实例。 Creates a new instance. |
方法摘要Method Summary
构造器详情Constructor Detail
FcClient
public FcClient(FcClientStarter fcClientConfig) throws Exception
初始化 FcClient 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
fcClientConfig | FcClientStarter | fc 客户端配置(类型 `FcClientStarter`)。The fc client config. |
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/runtime/sandbox/client/fc/FcClient.java:50–59方法详情Method Detail
connect
public boolean connect()
建立连接并完成初始化。
Returns the connect.
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/client/fc/FcClient.java:90–94isConnected
public boolean isConnected()
判断是否已连接。
Returns whether the connected.
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/client/fc/FcClient.java:96–99createContainer
public ContainerCreateResult createContainer(String containerName, String imageName, List<String> ports, List<VolumeBinding> volumeBindings, Map<String, String> environment, Map<String, Object> runtimeConfig)
创建容器。
Creates the container.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerName | String | 容器名称(类型 `String`)。The container name. |
imageName | String | 图像名称(类型 `String`)。The image name. |
ports | List<String> | ports(类型 `List`)。The ports. |
volumeBindings | List<VolumeBinding> | volume Bindings(类型 `List`)。The volume bindings. |
environment | Map<String, String> | 环境(类型 `Map`)。The environment. |
runtimeConfig | Map<String, Object> | 运行时配置(类型 `Map`)。The runtime config. |
ContainerCreateResult返回ContainerCreateResult。Returns container create result.
源码Source
io/agentscope/runtime/sandbox/client/fc/FcClient.java:101–272startContainer
public void startContainer(String containerId)
启动容器。
Starts the container.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
源码Source
io/agentscope/runtime/sandbox/client/fc/FcClient.java:274–316stopContainer
public void stopContainer(String containerId)
停止容器。
Stops the container.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
源码Source
io/agentscope/runtime/sandbox/client/fc/FcClient.java:318–336removeContainer
public void removeContainer(String containerId)
移除容器。
Removes the container.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
源码Source
io/agentscope/runtime/sandbox/client/fc/FcClient.java:338–341removeContainer
public void removeContainer(String containerId, boolean force)
移除容器。
Removes the container.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
force | boolean | force(类型 `boolean`)。The force. |
源码Source
io/agentscope/runtime/sandbox/client/fc/FcClient.java:343–383getContainerStatus
public String getContainerStatus(String containerId)
获取容器状态。
Returns the container status.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/runtime/sandbox/client/fc/FcClient.java:385–399imageExists
public boolean imageExists(String imageName)
设置该参数。
Performs the image exists operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
imageName | String | 图像名称(类型 `String`)。The image name. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/client/fc/FcClient.java:401–405inspectContainer
public boolean inspectContainer(String containerIdOrName)
设置该参数。
Performs the inspect container operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerIdOrName | String | 容器标识或名称(类型 `String`)。The container id or name. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/client/fc/FcClient.java:407–428pullImage
public boolean pullImage(String imageName)
设置该参数。
Performs the pull image operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
imageName | String | 图像名称(类型 `String`)。The image name. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/client/fc/FcClient.java:430–433