eureka server 常用api说明
常用api枚举请求方式url说明GEThttp://localhost:8761/eureka/apps查询所有应用实例GEThttp://localhost:8761/eureka/apps/SERVICES2根据 AppId 查询GEThttp://localhost:8761/eureka/apps/SERVICES2/services2:7f4...
·
常用api枚举
部分api示例
注册新应用实例
请求内容格式: application/xml
<instance>
<instanceId>services3:7f411a785a97590bf4ae9086489e3d15</instanceId>
<hostName>192.168.1.7</hostName>
<app>SERVICES3</app>
<ipAddr>192.168.1.7</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8083</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<vipAddress>services3</vipAddress>
<secureVipAddress>demo-order2</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1541584436212</lastUpdatedTimestamp>
<lastDirtyTimestamp>1541584436212</lastDirtyTimestamp>
</instance>
查询所有应用实例
返回内容
<applications>
<versions__delta>1</versions__delta>
<apps__hashcode>UP_2_</apps__hashcode>
<application>
<name>SERVICES3</name>
<instance>
<instanceId>services3:7f411a785a97590bf4ae9086489e3d15</instanceId>
<hostName>192.168.1.7</hostName>
<app>SERVICES3</app>
<ipAddr>192.168.1.7</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8083</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>30</renewalIntervalInSecs>
<durationInSecs>90</durationInSecs>
<registrationTimestamp>1541585303887</registrationTimestamp>
<lastRenewalTimestamp>1541585303887</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1541585303383</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<vipAddress>services3</vipAddress>
<secureVipAddress>demo-order2</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1541585303887</lastUpdatedTimestamp>
<lastDirtyTimestamp>1541584436212</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
</application>
<application>
<name>SERVICES2</name>
<instance>
<instanceId>services2:7f411a785a97590bf4ae5176489e3d15</instanceId>
<hostName>192.168.1.7</hostName>
<app>SERVICES2</app>
<ipAddr>192.168.1.7</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8082</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>5</renewalIntervalInSecs>
<durationInSecs>10</durationInSecs>
<registrationTimestamp>1541584436212</registrationTimestamp>
<lastRenewalTimestamp>1541585318895</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1541584435699</serviceUpTimestamp>
</leaseInfo>
<metadata>
<zone>primary</zone>
<profile>dev</profile>
<version></version>
</metadata>
<homePageUrl>http://192.168.1.7:8082/</homePageUrl>
<statusPageUrl>http://192.168.1.7:8082/management/info</statusPageUrl>
<healthCheckUrl>http://192.168.1.7:8082/management/health</healthCheckUrl>
<vipAddress>services2</vipAddress>
<secureVipAddress>services2</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1541584436212</lastUpdatedTimestamp>
<lastDirtyTimestamp>1541584435194</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
</application>
</applications>
修改应用实例元数据
version 就为一个元数据。
修改后:
<application>
<name>SERVICES2</name>
<instance>
<instanceId>services2:7f411a785a97590bf4ae5176489e3d15</instanceId>
<hostName>192.168.1.7</hostName>
<app>SERVICES2</app>
<ipAddr>192.168.1.7</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8082</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>5</renewalIntervalInSecs>
<durationInSecs>10</durationInSecs>
<registrationTimestamp>1541586087528</registrationTimestamp>
<lastRenewalTimestamp>1541586100258</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1541585553811</serviceUpTimestamp>
</leaseInfo>
<metadata>
<zone>primary</zone>
<profile>dev</profile>
<!--元数据version改成了1.1.1-->
<version>1.1.1</version>
</metadata>
<homePageUrl>http://192.168.1.7:8082/</homePageUrl>
<statusPageUrl>http://192.168.1.7:8082/management/info</statusPageUrl>
<healthCheckUrl>http://192.168.1.7:8082/management/health</healthCheckUrl>
<vipAddress>services2</vipAddress>
<secureVipAddress>services2</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1541586087528</lastUpdatedTimestamp>
<lastDirtyTimestamp>1541585847570</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
</application>
源码实现
eureka server 用到了jersey实现api功能,其中包含了子资源路由api功能。具体可以参考 https://blog.csdn.net/qq_30062125/article/details/83758334
更多推荐
已为社区贡献3条内容
所有评论(0)