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 的資源(如果有)。 |
|
|
任何依賴項的名稱。 |