Bean (beans)
beans 端点提供关于应用程序 bean 的信息。
检索 Bean
要检索 bean,请向 /actuator/beans 发出 GET 请求,如以下基于 curl 的示例所示
$ curl 'https://:8080/actuator/beans' -i -X GET
结果响应类似于以下内容
HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 1027
{
"contexts" : {
"application" : {
"beans" : {
"org.springframework.boot.webmvc.autoconfigure.actuate.web.WebMvcEndpointManagementContextConfiguration" : {
"aliases" : [ ],
"dependencies" : [ ],
"scope" : "singleton",
"type" : "org.springframework.boot.webmvc.autoconfigure.actuate.web.WebMvcEndpointManagementContextConfiguration"
},
"org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration" : {
"aliases" : [ ],
"dependencies" : [ ],
"scope" : "singleton",
"type" : "org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration"
},
"org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration" : {
"aliases" : [ ],
"dependencies" : [ ],
"scope" : "singleton",
"type" : "org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration"
}
}
}
}
}
响应结构
响应包含应用程序 bean 的详细信息。下表描述了响应的结构
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
按 ID 键控的应用程序上下文。 |
|
|
父应用程序上下文的 ID(如果有)。 |
|
|
应用程序上下文中按名称键控的 bean。 |
|
|
任何别名的名称。 |
|
|
bean 的作用域。 |
|
|
bean 的完全限定类型。 |
|
|
定义 bean 的资源(如果有)。 |
|
|
任何依赖项的名称。 |