类 InstanceController
- java.lang.Object
-
- com.alibaba.nacos.naming.controllers.InstanceController
-
@RestController @RequestMapping("/v1/ns/instance") public class InstanceController extends java.lang.ObjectInstance operation controller.- 作者:
- nkorange
-
-
字段概要
字段 修饰符和类型 字段 说明 private InstanceOperatorClientImplinstanceServiceV2private static java.lang.StringMETADATAprivate SwitchDomainswitchDomain
-
构造器概要
构造器 构造器 说明 InstanceController()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 com.fasterxml.jackson.databind.node.ObjectNodebatchDeleteInstanceMetadata(javax.servlet.http.HttpServletRequest request)Batch delete instance's metadata. old key exist = delete, old key not exist = not operatecom.fasterxml.jackson.databind.node.ObjectNodebatchUpdateInstanceMetadata(javax.servlet.http.HttpServletRequest request)Batch update instance's metadata. old key exist = update, old key not exist = add.com.fasterxml.jackson.databind.node.ObjectNodebeat(javax.servlet.http.HttpServletRequest request)Create a beat for instance.private InstanceOperationInfobuildOperationInfo(java.lang.String serviceName, java.lang.String consistencyType, java.util.List<com.alibaba.nacos.api.naming.pojo.Instance> instances)java.lang.Stringderegister(javax.servlet.http.HttpServletRequest request)Deregister instances.com.fasterxml.jackson.databind.node.ObjectNodedetail(javax.servlet.http.HttpServletRequest request)Get detail information of specified instance.private InstanceOperatorgetInstanceOperator()java.lang.Objectlist(javax.servlet.http.HttpServletRequest request)Get all instance of input service.com.fasterxml.jackson.databind.node.ObjectNodelistWithHealthStatus(java.lang.String key)List all instance with health status.private java.util.List<com.alibaba.nacos.api.naming.pojo.Instance>parseBatchInstances(java.lang.String instances)java.lang.Stringpatch(javax.servlet.http.HttpServletRequest request)Patch instance.java.lang.Stringregister(javax.servlet.http.HttpServletRequest request)Register new instance.java.lang.Stringupdate(javax.servlet.http.HttpServletRequest request)Update instance.
-
-
-
字段详细资料
-
switchDomain
@Autowired private SwitchDomain switchDomain
-
instanceServiceV2
@Autowired private InstanceOperatorClientImpl instanceServiceV2
-
METADATA
private static final java.lang.String METADATA
- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
register
@PostMapping public java.lang.String register(javax.servlet.http.HttpServletRequest request) throws java.lang.ExceptionRegister new instance.- 参数:
request- http request- 返回:
- 'ok' if success
- 抛出:
java.lang.Exception- any error during register
-
deregister
@DeleteMapping public java.lang.String deregister(javax.servlet.http.HttpServletRequest request) throws java.lang.ExceptionDeregister instances.- 参数:
request- http request- 返回:
- 'ok' if success
- 抛出:
java.lang.Exception- any error during deregister
-
update
@PutMapping public java.lang.String update(javax.servlet.http.HttpServletRequest request) throws java.lang.ExceptionUpdate instance.- 参数:
request- http request- 返回:
- 'ok' if success
- 抛出:
java.lang.Exception- any error during update
-
batchUpdateInstanceMetadata
@PutMapping("/metadata/batch") public com.fasterxml.jackson.databind.node.ObjectNode batchUpdateInstanceMetadata(javax.servlet.http.HttpServletRequest request) throws java.lang.ExceptionBatch update instance's metadata. old key exist = update, old key not exist = add.- 参数:
request- http request- 返回:
- success updated instances. such as '{"updated":["2.2.2.2:8080:unknown:xxxx-cluster:ephemeral"}'.
- 抛出:
java.lang.Exception- any error during update- 从以下版本开始:
- 1.4.0
-
batchDeleteInstanceMetadata
@DeleteMapping("/metadata/batch") public com.fasterxml.jackson.databind.node.ObjectNode batchDeleteInstanceMetadata(javax.servlet.http.HttpServletRequest request) throws java.lang.ExceptionBatch delete instance's metadata. old key exist = delete, old key not exist = not operate- 参数:
request- http request- 返回:
- success updated instances. such as '{"updated":["2.2.2.2:8080:unknown:xxxx-cluster:ephemeral"}'.
- 抛出:
java.lang.Exception- any error during update- 从以下版本开始:
- 1.4.0
-
buildOperationInfo
private InstanceOperationInfo buildOperationInfo(java.lang.String serviceName, java.lang.String consistencyType, java.util.List<com.alibaba.nacos.api.naming.pojo.Instance> instances)
-
parseBatchInstances
private java.util.List<com.alibaba.nacos.api.naming.pojo.Instance> parseBatchInstances(java.lang.String instances)
-
patch
@PatchMapping public java.lang.String patch(javax.servlet.http.HttpServletRequest request) throws java.lang.ExceptionPatch instance.- 参数:
request- http request- 返回:
- 'ok' if success
- 抛出:
java.lang.Exception- any error during patch
-
list
@GetMapping("/list") public java.lang.Object list(javax.servlet.http.HttpServletRequest request) throws java.lang.ExceptionGet all instance of input service.- 参数:
request- http request- 返回:
- list of instance
- 抛出:
java.lang.Exception- any error during list
-
detail
@GetMapping public com.fasterxml.jackson.databind.node.ObjectNode detail(javax.servlet.http.HttpServletRequest request) throws java.lang.ExceptionGet detail information of specified instance.- 参数:
request- http request- 返回:
- detail information of instance
- 抛出:
java.lang.Exception- any error during get
-
beat
@PutMapping("/beat") public com.fasterxml.jackson.databind.node.ObjectNode beat(javax.servlet.http.HttpServletRequest request) throws java.lang.ExceptionCreate a beat for instance.- 参数:
request- http request- 返回:
- detail information of instance
- 抛出:
java.lang.Exception- any error during handle
-
listWithHealthStatus
@RequestMapping("/statuses") public com.fasterxml.jackson.databind.node.ObjectNode listWithHealthStatus(@RequestParam java.lang.String key) throws com.alibaba.nacos.api.exception.NacosExceptionList all instance with health status.- 参数:
key- (namespace##)?serviceName- 返回:
- list of instance
- 抛出:
com.alibaba.nacos.api.exception.NacosException- any error during handle
-
getInstanceOperator
private InstanceOperator getInstanceOperator()
-
-