AS AgentScopeAPI 手册 / API Reference

HttpSelfRegistration

public final class HttpSelfRegistration implements AutoCloseable
源码Source io/agentscope/extensions/controlplane/transport/HttpSelfRegistration.java:40–284

HTTP 自身注册,承载智能体的部署、调度与服务化运行。位于 io.agentscope.extensions.controlplane.transport 包,实现 AutoCloseable。核心成员包括 start、identity、setIdentityListener、close、HttpSelfRegistration。

v5 external-application registration against service-controlplane: POST /api/v1/agent-registrations + periodic instance heartbeats.

The control plane then polls this instance's /agentscope/* contract at baseUrl. Failures are swallowed and retried — registration must never disturb the agent.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
RegisteredIdentity记录record
承载已注册身份数据的记录类型。
Stable identity returned by the Catalog registration transaction.

构造器摘要Constructor Summary

构造器Constructor说明Description
public HttpSelfRegistration(String controlPlaneHttp, String internalToken, String registrationCredential, String agentKey, String tenant, String namespace, String instanceKey, String baseUrl, String runtime, String framework, int contractLevel, List<String> capabilities, long heartbeatIntervalMs)
初始化 `HttpSelfRegistration` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public void start()
执行启动相关操作。
Returns the start.
public RegisteredIdentity identity()
返回身份。
Returns the last successfully registered stable identity, or `null`.
public void setIdentityListener(Consumer<RegisteredIdentity> listener)
设置身份监听器。
Receives every successfully refreshed identity, including generation changes.
public void close()
关闭连接并释放相关资源。
Releases resources and connections.

构造器详情Constructor Detail

HttpSelfRegistration

public HttpSelfRegistration(String controlPlaneHttp, String internalToken, String registrationCredential, String agentKey, String tenant, String namespace, String instanceKey, String baseUrl, String runtime, String framework, int contractLevel, List<String> capabilities, long heartbeatIntervalMs)

初始化 HttpSelfRegistration 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
controlPlaneHttpString控制面 HTTP(类型 `String`)。The control plane http.
internalTokenString内部令牌(类型 `String`)。The internal token.
registrationCredentialString注册凭证(类型 `String`)。The registration credential.
agentKeyString智能体键(类型 `String`)。The agent key.
tenantString租户(类型 `String`)。The tenant.
namespaceString命名空间(类型 `String`)。The namespace.
instanceKeyString实例键(类型 `String`)。The instance key.
baseUrlString基类 URL(类型 `String`)。The base url.
runtimeString运行时(类型 `String`)。The runtime.
frameworkStringframework(类型 `String`)。The framework.
contractLevelint契约级别(类型 `int`)。The contract level.
capabilitiesList<String>能力(类型 `List`)。The capabilities.
heartbeatIntervalMslong心跳间隔 Ms(类型 `long`)。The heartbeat interval ms.
源码Source io/agentscope/extensions/controlplane/transport/HttpSelfRegistration.java:75–106

方法详情Method Detail

start

public void start()

执行启动相关操作。

Returns the start.

源码Source io/agentscope/extensions/controlplane/transport/HttpSelfRegistration.java:108–125

identity

public RegisteredIdentity identity()

返回身份。

Returns the last successfully registered stable identity, or null.

返回Returns RegisteredIdentity
返回RegisteredIdentity。Returns registered identity.
源码Source io/agentscope/extensions/controlplane/transport/HttpSelfRegistration.java:128–130

setIdentityListener

public void setIdentityListener(Consumer<RegisteredIdentity> listener)

设置身份监听器。

Receives every successfully refreshed identity, including generation changes.

参数Parameters
名称Name类型Type说明Description
listenerConsumer<RegisteredIdentity>监听器(类型 `Consumer`)。The listener.
源码Source io/agentscope/extensions/controlplane/transport/HttpSelfRegistration.java:133–135

close

public void close()

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

Releases resources and connections.

源码Source io/agentscope/extensions/controlplane/transport/HttpSelfRegistration.java:137–161

嵌套类详情Nested Class Detail

RegisteredIdentity

public record RegisteredIdentity( String agentId, String agentKey, String bindingId, String instanceId, String instanceKey, long generation, String registrationCredential)

承载已注册身份数据的记录类型。位于 io.agentscope.extensions.controlplane.transport 包。核心成员包括 agentId、agentKey、bindingId、instanceId、instanceKey、generation。

Stable identity returned by the Catalog registration transaction.

基于官方固定版本源码静态生成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.