Eureka Server的REST端点
Eureka Server的REST端点
Windows下面可以安装Curl;
使用more命令可以显示xml内容;
D:\Java\IdeaProjects>more rest-api-test.xml|curl -v -X POST -H "Content-type:app
lication/xml" -d @- http://localhost:8761/eureka/apps/rest-api-test
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8761 (#0)
> POST /eureka/apps/rest-api-test HTTP/1.1
> Host: localhost:8761
> User-Agent: curl/7.57.0
> Accept: */*
> Content-type:application/xml
> Content-Length: 672
>
* upload completely sent off: 672 out of 672 bytes
< HTTP/1.1 204
< Content-Type: application/xml
< Date: Sun, 31 Dec 2017 07:44:12 GMT
<
* Connection #0 to host localhost left intact
xml文件:
<instance>
<instanceId>stono:rest-api-test:9000</instanceId>
<hostName>stono</hostName>
<app>REST-API-TEST</app>
<ipAddr>127.0.0.1</ipAddr>
<vipAddress>rest-api-test</vipAddress>
<secureVipAddress>rest-api-test</secureVipAddress>
<status>UP</status>
<port enabled="true">9000</port>
<securePort enabled="false">433</securePort>
<homePageUrl>http://127.0.0.1:9000</homePageUrl>
<statusPageUrl>http://127.0.0.1:9000/info</statusPageUrl>
<healthCheckUrl>http://27.0.0.1:9000/health</healthCheckUrl>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
</instance>
过一段时间后,服务会被删掉,因为就是没有这个服务;
如果使用Postman进行测试,方法选择POST,地址:http://localhost:8761/eureka/apps/rest-api-test ,Body 选择 raw,下拉框选择 XML(application/xml); 输入框内输入XML文件;
注销微服务:
D:\Java\IdeaProjects>curl -v -X DELETE http://localhost:8761/eureka/apps/rest-ap
i-test/stono:rest-api-test:9000
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8761 (#0)
> DELETE /eureka/apps/rest-api-test/stono:rest-api-test:9000 HTTP/1.1
> Host: localhost:8761
> User-Agent: curl/7.57.0
> Accept: */*
>
< HTTP/1.1 200
< Content-Type: application/xml
< Content-Length: 0
< Date: Sun, 31 Dec 2017 07:50:17 GMT
<
* Connection #0 to host localhost left intact
使用Postman注销微服务,方法选择DELETE,地址http://localhost:8761/eureka/apps/rest-api-test/stono:rest-api-test:9000
Eureka Server的REST端点的更多相关文章
- 【SpringCloud Eureka源码】从Eureka Client发起注册请求到Eureka Server处理的整个服务注册过程(下)
目录 一.Spring Cloud Eureka Server自动配置及初始化 @EnableEurekaServer EurekaServerAutoConfiguration - 注册服务自动配置 ...
- SpringCloud 学习(二)-2 :Securing The Eureka Server
由于工作等种种原因未能连续进行学习,现在继续学习微服务,不过是新建的demo,springcloud版本用的是Finchley.SR2. 之前用简单demo实现了注册中心,现在来对注册中心加安全验证: ...
- Eureka Server不剔除已关停的节点的问题
由于Eureka拥有自我保护机制,当其注册表里服务因为网络或其他原因出现故障而关停时,Eureka不会剔除服务注册,而是等待其修复.这是AP的一种实现. 自我保护机制:Eureka Server在运行 ...
- Spring Cloud Eureka Server集群Demo级搭建
将上篇随笔Spring Cloud Eureka服务Demo级搭建进行改造,改造成一个在本机的伪集群 1.修改hosts文件(windows10 hosts文件位置:C:\Windows\System ...
- (2-2)SpringCloud-服务注册到Eureka Server集群并消费
服务注册到Eureka Server集群 在(2-1)SpringCloue-Eureka实现高可用注册中心中我们搭建好了高可用的Eureka注册中心,下面我们要把服务注册到Eureka Server ...
- Spring Cloud Eureka Server高可用注册服务中心的配置
前言 Eureka 作为一个云端负载均衡,本身是一个基于REST的服务,在 Spring Cloud 中用于发现和注册服务. 那么当成千上万个微服务注册到Eureka Server中的时候,Eurek ...
- SpringCloud(2) 服务注册和发现Eureka Server
一.简介 EureKa在Spring Cloud全家桶中担任着服务的注册与发现的落地实现.Netflix在设计EureKa时遵循着AP原则,它基于REST的服务,用于定位服务,以实现云端中间层服务发现 ...
- springboot中关闭eureka server中已注册服务列表自我保护配置
配置集群服务可以向eureka通知应用是否可以使用a.在eureka server的application.properties中加入:# 设为false,关闭自我保护eureka.server.en ...
- sprigcloud Eureka Server环境搭建
1.搭建springcloud的Erueka组件,现在搭建这些套件已经变的很方便了,进入https://start.spring.io/页面,如下图: 2.选择好Eureka Server,点击Gen ...
随机推荐
- J - Borg Maze
J - Borg Maze 思路:bfs+最小生成树. #include<queue> #include<cstdio> #include<cstring> #in ...
- D - Constructing Roads
D - Constructing Roads 思路:并查集板子 #include<cstdio> #include<cstring> #include<iostream& ...
- Java 嵌套类和内部类演示样例<三>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-s ...
- 详解Mysql分布式事务XA(跨数据库事务)
详解Mysql分布式事务XA(跨数据库事务) 学习了:http://blog.csdn.net/soonfly/article/details/70677138 mysql执行XA事物的时候,mysq ...
- 初探swift语言的学习笔记十(block)
作者:fengsh998 原文地址:http://blog.csdn.net/fengsh998/article/details/35783341 转载请注明出处 假设觉得文章对你有所帮助,请通过留言 ...
- codeforces 571A--Lengthening Sticks(组合+容斥)
A. Lengthening Sticks time limit per test 1 second memory limit per test 256 megabytes input standar ...
- iOS 8使用Touch ID进行身份认证
iOS 8的SDK开放了Touch ID的接口.从WWDC的视频中能够看到Touch ID应用在两个方面:用于Key Chain加密和用于授权.iOS 8正式版公布以后我们能够看到Evernote的i ...
- OzymanDNS 使用——perl 5.22没有成功。。。
最初官方的代码没有找到,但是发现github里貌似有: git clone https://github.com/splitbrain/dnstunnel.git 源码是perl写的,需要安装一些pe ...
- 【转】iOS多语言本地化(国际化)设置
原文网址:http://www.jianshu.com/p/2b7743ae9c90 讨论的iOS应用中的多语言设置,Ok 一般是两种情况: 1.根据当前设备语言自动切换显示 2.在应用中可进行语言设 ...
- 自动化框架的两种断言设计(pytest 版)
自动化测试断言失败时,根据不同业务场景,可能需要立即终止或继续执行.这里以 Appium + pytest 为例. 一. 断言失败立即终止 用途一:用例的预期结果是其他用例的前提条件时,assert ...