Eureka官方API介绍地址:

Eureka Rest API简介

【 服务动态注册】

http://localhost:8761/eureka/apps/appID
demo:http://localhost:8761/eureka/apps/IOT-API-CSB
请求参数
{
        "instance": {
            "instanceId": "iot-api-csb:8005",
            "hostName": "192.168.3.12",
            "app": "IOT-API-CSB",
            "ipAddr": "192.168.3.12",
            "status": "UP",
            "overriddenstatus": "UNKNOWN",
            "port": {
                "$": 8004,
                "@enabled": "true"
            },
            "securePort": {
                "$": 443,
                "@enabled": "false"
            },
            "countryId": 1,
            "dataCenterInfo": {
                "@class": "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo",
                "name": "MyOwn"
            },
            "leaseInfo": {
                "renewalIntervalInSecs": 30,
                "durationInSecs": 90,
                "registrationTimestamp": 1508809472405,
                "lastRenewalTimestamp": 1508812833399,
                "evictionTimestamp": 0,
                "serviceUpTimestamp": 1508809472406
            },
            "metadata": {
                "turbine-cluster-key": "iot-api"
            },
            "homePageUrl": "http://192.168.3.12:8005/",
            "statusPageUrl": "http://192.168.3.12:8005/info",
            "healthCheckUrl": "http://192.168.3.12:8005/health",
            "vipAddress": "iot-api-csb",
            "secureVipAddress": "iot-api-csb",
            "isCoordinatingDiscoveryServer": "false",
            "lastUpdatedTimestamp": "1508809472406",
            "lastDirtyTimestamp": "1508809471716",
            "actionType": "ADDED"
        }
}

【 服务注册信息获取】

http://localhost:8761/eureka/apps/appID
demo:http://localhost:8761/eureka/apps/IOT-API-CSB
Header:[{"key":"Accept","value":"application/json","description":""}]
{
    "application": {
        "name": "IOT-API-CSB",
        "instance": [{
            "instanceId": "iot-api-csb:8004",
            "hostName": "192.168.3.12",
            "app": "IOT-API-CSB",
            "ipAddr": "192.168.3.12",
            "status": "UP",
            "overriddenstatus": "UNKNOWN",
            "port": {
                "$": 8004,
                "@enabled": "true"
            },
            "securePort": {
                "$": 443,
                "@enabled": "false"
            },
            "countryId": 1,
            "dataCenterInfo": {
                "@class": "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo",
                "name": "MyOwn"
            },
            "leaseInfo": {
                "renewalIntervalInSecs": 30,
                "durationInSecs": 90,
                "registrationTimestamp": 1508809472405,
                "lastRenewalTimestamp": 1508812833399,
                "evictionTimestamp": 0,
                "serviceUpTimestamp": 1508809472406
            },
            "metadata": {
                "turbine-cluster-key": "iot-api"
            },
            "homePageUrl": "http://192.168.3.12:8004/",
            "statusPageUrl": "http://192.168.3.12:8004/info",
            "healthCheckUrl": "http://192.168.3.12:8004/health",
            "vipAddress": "iot-api-csb",
            "secureVipAddress": "iot-api-csb",
            "isCoordinatingDiscoveryServer": "false",
            "lastUpdatedTimestamp": "1508809472406",
            "lastDirtyTimestamp": "1508809471716",
            "actionType": "ADDED"
        }]
    }
}

【 服务注册信息删除】

DELETE /eureka/apps/appID/instanceID	
demo: DELETE http://localhost:8761/eureka/apps/IOT-API-CSB/iot-api-csb:8005

标题:Eureka Rest API 拓展使用
作者:TravelEngineers
地址:https://www.mycitymemory.com/articles/2019/07/21/1563700083962.html
版权声明:转载请注明博文地址,尊重作者劳动成果。
作者简介:坐标魔都,一枚爱旅行爱摄影的攻城狮。愿攻城拔寨的路上,你不用996,也不再孤单,加油。