FcClient
public class FcClient extends BaseClient
io/agentscope/runtime/sandbox/manager/client/FcClient.java:36–588Fc 客户端,封装与远端服务的连接和调用。位于 io.agentscope.runtime.sandbox.manager.client 包,继承自 BaseClient。核心成员包括 connect、isConnected、createContainer、startContainer、stopContainer、removeContainer。
A class in io.agentscope.runtime.sandbox.manager.client that deploys, schedules and serves agents. Declared in io.agentscope.runtime.sandbox.manager.client. Extends BaseClient.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public FcClient(FcClientConfig fcClientConfig) throws Exception | 初始化 `FcClient` 实例。 Creates a new instance. |
方法摘要Method Summary
构造器详情Constructor Detail
FcClient
public FcClient(FcClientConfig fcClientConfig) throws Exception
初始化 FcClient 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
fcClientConfig | FcClientConfig | fc 客户端配置(类型 `FcClientConfig`)。The fc client config. |
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
io/agentscope/runtime/sandbox/manager/client/FcClient.java:48–57方法详情Method Detail
connect
public boolean connect()
建立连接并完成初始化。
Returns the connect.
booleanio/agentscope/runtime/sandbox/manager/client/FcClient.java:88–92isConnected
public boolean isConnected()
判断是否已连接。
Returns whether the connected.
booleanio/agentscope/runtime/sandbox/manager/client/FcClient.java:94–97createContainer
public ContainerCreateResult createContainer(String containerName, String imageName, List<String> ports, List<VolumeBinding> volumeBindings, Map<String, String> environment, Map<String, Object> runtimeConfig)
创建容器。
Creates the container.
| 名称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. |
ContainerCreateResultio/agentscope/runtime/sandbox/manager/client/FcClient.java:99–270startContainer
public void startContainer(String containerId)
启动容器。
Starts the container.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
io/agentscope/runtime/sandbox/manager/client/FcClient.java:272–314stopContainer
public void stopContainer(String containerId)
停止容器。
Stops the container.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
io/agentscope/runtime/sandbox/manager/client/FcClient.java:316–334removeContainer
public void removeContainer(String containerId)
移除容器。
Removes the container.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
io/agentscope/runtime/sandbox/manager/client/FcClient.java:336–339removeContainer
public void removeContainer(String containerId, boolean force)
移除容器。
Removes the container.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
force | boolean | force(类型 `boolean`)。The force. |
io/agentscope/runtime/sandbox/manager/client/FcClient.java:341–381getContainerStatus
public String getContainerStatus(String containerId)
获取容器状态。
Returns the container status.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
Stringio/agentscope/runtime/sandbox/manager/client/FcClient.java:383–397imageExists
public boolean imageExists(String imageName)
设置该参数。
Performs the image exists operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
imageName | String | 图像名称(类型 `String`)。The image name. |
booleanio/agentscope/runtime/sandbox/manager/client/FcClient.java:399–403inspectContainer
public boolean inspectContainer(String containerIdOrName)
设置该参数。
Performs the inspect container operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerIdOrName | String | 容器标识或名称(类型 `String`)。The container id or name. |
booleanio/agentscope/runtime/sandbox/manager/client/FcClient.java:405–426pullImage
public boolean pullImage(String imageName)
设置该参数。
Performs the pull image operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
imageName | String | 图像名称(类型 `String`)。The image name. |
booleanio/agentscope/runtime/sandbox/manager/client/FcClient.java:428–431