[英]spring-cloud how to use Endpoints
For a Spring Boot Actuator application there are some additional management endpoints: 对于Spring Boot Actuator应用程序,还有一些其他管理端点:
POST to /env to update the Environment and rebind @ConfigurationProperties and log levels
http://localhost:8080/env/testprop it works and returns: http:// localhost:8080 / env / testprop它可以工作并返回:
{
"testprop": "test value"
}
but when I do POST: http://localhost:8080/env/testprop Request method 'POST' not supported 但是当我执行POST时: http:// localhost:8080 / env / testprop请求方法'POST'不支持
I want to update testprop
, how to do it with API? 我想更新
testprop
,如何使用API?
I found the following in the docs 我在文档中找到了以下内容
For a Spring Boot Actuator application there are some additional management endpoints:
对于Spring Boot Actuator应用程序,还有一些其他管理端点:
POST to /env to update the Environment and rebind @ConfigurationProperties and log levels
POST到/ env以更新环境并重新绑定@ConfigurationProperties和日志级别
/refresh for re-loading the boot strap context and refreshing the @RefreshScope beans
/ refresh用于重新加载引导上下文并刷新@RefreshScope bean
/restart for closing the ApplicationContext and restarting it (disabled by default)
/ restart以关闭ApplicationContext并重新启动它(默认情况下禁用)
/pause and /resume for calling the Lifecycle methods (stop() and start() on the ApplicationContext)
/ pause和/ resume调用生命周期方法(ApplicationContext上的stop()和start())
Looks like you have to post agains /env instead of /end/$yourProperty 看来您必须发布筹码/ env而不是/ end / $ yourProperty
Ok, it works: must POST with empty body http://localhost:8080/env/?test=dasda and response is: 好的,它可以正常工作:必须使用空主体http:// localhost:8080 / env /?test = dasda进行POST ,响应为:
{
"test": "dasda"
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.