类 InstanceController


  • @RestController
    @RequestMapping("/v1/ns/instance")
    public class InstanceController
    extends java.lang.Object
    Instance operation controller.
    作者:
    nkorange
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      com.fasterxml.jackson.databind.node.ObjectNode batchDeleteInstanceMetadata​(javax.servlet.http.HttpServletRequest request)
      Batch delete instance's metadata. old key exist = delete, old key not exist = not operate
      com.fasterxml.jackson.databind.node.ObjectNode batchUpdateInstanceMetadata​(javax.servlet.http.HttpServletRequest request)
      Batch update instance's metadata. old key exist = update, old key not exist = add.
      com.fasterxml.jackson.databind.node.ObjectNode beat​(javax.servlet.http.HttpServletRequest request)
      Create a beat for instance.
      private InstanceOperationInfo buildOperationInfo​(java.lang.String serviceName, java.lang.String consistencyType, java.util.List<com.alibaba.nacos.api.naming.pojo.Instance> instances)  
      java.lang.String deregister​(javax.servlet.http.HttpServletRequest request)
      Deregister instances.
      com.fasterxml.jackson.databind.node.ObjectNode detail​(javax.servlet.http.HttpServletRequest request)
      Get detail information of specified instance.
      private InstanceOperator getInstanceOperator()  
      java.lang.Object list​(javax.servlet.http.HttpServletRequest request)
      Get all instance of input service.
      com.fasterxml.jackson.databind.node.ObjectNode listWithHealthStatus​(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.String patch​(javax.servlet.http.HttpServletRequest request)
      Patch instance.
      java.lang.String register​(javax.servlet.http.HttpServletRequest request)
      Register new instance.
      java.lang.String update​(javax.servlet.http.HttpServletRequest request)
      Update instance.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • InstanceController

        public InstanceController()
    • 方法详细资料

      • register

        @PostMapping
        public java.lang.String register​(javax.servlet.http.HttpServletRequest request)
                                  throws java.lang.Exception
        Register 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.Exception
        Deregister 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.Exception
        Update 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.Exception
        Batch 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.Exception
        Batch 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.Exception
        Patch 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.Exception
        Get 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.Exception
        Get 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.Exception
        Create 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.NacosException
        List all instance with health status.
        参数:
        key - (namespace##)?serviceName
        返回:
        list of instance
        抛出:
        com.alibaba.nacos.api.exception.NacosException - any error during handle