プロパティの構成 (configprops
)
configprops
エンドポイントは、アプリケーションの @ConfigurationProperties
Bean に関する情報を提供します。
すべての @ConfigurationProperties Bean の取得
すべての @ConfigurationProperties
Bean を取得するには、次のカールベースの例に示すように、/actuator/configprops
に対して GET
リクエストを作成します。
$ curl 'http://localhost:8080/actuator/configprops' -i -X GET
結果のレスポンスは次のようになります。
HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 3411
{
"contexts" : {
"application" : {
"beans" : {
"management.endpoints.web.cors-org.springframework.boot.actuate.autoconfigure.endpoint.web.CorsEndpointProperties" : {
"prefix" : "management.endpoints.web.cors",
"properties" : {
"allowedOrigins" : [ ],
"maxAge" : "PT30M",
"exposedHeaders" : [ ],
"allowedOriginPatterns" : [ ],
"allowedHeaders" : [ ],
"allowedMethods" : [ ]
},
"inputs" : {
"allowedOrigins" : [ ],
"maxAge" : { },
"exposedHeaders" : [ ],
"allowedOriginPatterns" : [ ],
"allowedHeaders" : [ ],
"allowedMethods" : [ ]
}
},
"management.endpoints.web-org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties" : {
"prefix" : "management.endpoints.web",
"properties" : {
"pathMapping" : { },
"exposure" : {
"include" : [ "*" ],
"exclude" : [ ]
},
"basePath" : "/actuator",
"discovery" : {
"enabled" : true
}
},
"inputs" : {
"pathMapping" : { },
"exposure" : {
"include" : [ {
"value" : "*",
"origin" : "\"management.endpoints.web.exposure.include\" from property source \"Inlined Test Properties\""
} ],
"exclude" : [ ]
},
"basePath" : { },
"discovery" : {
"enabled" : { }
}
}
},
"spring.web-org.springframework.boot.autoconfigure.web.WebProperties" : {
"prefix" : "spring.web",
"properties" : {
"localeResolver" : "ACCEPT_HEADER",
"resources" : {
"staticLocations" : [ "classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/" ],
"addMappings" : true,
"chain" : {
"cache" : true,
"compressed" : false,
"strategy" : {
"fixed" : {
"enabled" : false,
"paths" : [ "/**" ]
},
"content" : {
"enabled" : false,
"paths" : [ "/**" ]
}
}
},
"cache" : {
"cachecontrol" : { },
"useLastModified" : true
}
}
},
"inputs" : {
"localeResolver" : { },
"resources" : {
"staticLocations" : [ { }, { }, { }, { } ],
"addMappings" : { },
"chain" : {
"cache" : { },
"compressed" : { },
"strategy" : {
"fixed" : {
"enabled" : { },
"paths" : [ { } ]
},
"content" : {
"enabled" : { },
"paths" : [ { } ]
}
}
},
"cache" : {
"cachecontrol" : { },
"useLastModified" : { }
}
}
}
}
}
}
}
}
レスポンス構造
レスポンスには、アプリケーションの @ConfigurationProperties
Bean の詳細が含まれます。次の表に、レスポンスの構造を示します。
パス | タイプ | 説明 |
---|---|---|
|
| ID をキーとするアプリケーションコンテキスト。 |
|
|
|
|
| Bean のプロパティの名前に適用されるプレフィックス。 |
|
| 名前と値のペアとしての Bean のプロパティ。 |
|
| この Bean にバインドするときに使用される構成プロパティの起源と値。 |
|
| 親アプリケーションコンテキストの ID(存在する場合)。 |
プレフィックスによる @ConfigurationProperties Bean の取得
特定のプレフィックスにマップされた @ConfigurationProperties
Bean を取得するには、次の curl ベースの例に示すように、GET
リクエストを /actuator/configprops/{prefix}
に送信します。
$ curl 'http://localhost:8080/actuator/configprops/spring.jackson' -i -X GET
結果のレスポンスは次のようになります。
HTTP/1.1 200 OK
Content-Disposition: inline;filename=f.txt
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 878
{
"contexts" : {
"application" : {
"beans" : {
"spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties" : {
"prefix" : "spring.jackson",
"properties" : {
"serialization" : { },
"visibility" : { },
"parser" : { },
"datatype" : {
"jsonNode" : { },
"enum" : { }
},
"deserialization" : { },
"generator" : { },
"mapper" : { }
},
"inputs" : {
"serialization" : { },
"visibility" : { },
"parser" : { },
"datatype" : {
"jsonNode" : { },
"enum" : { }
},
"deserialization" : { },
"generator" : { },
"mapper" : { }
}
}
}
}
}
}
{prefix} は正確である必要はありません。より一般的なプレフィックスは、そのプレフィックスステムにマップされたすべての Bean を返します。 |
レスポンス構造
レスポンスには、アプリケーションの @ConfigurationProperties
Bean の詳細が含まれます。次の表に、レスポンスの構造を示します。
パス | タイプ | 説明 |
---|---|---|
|
| ID をキーとするアプリケーションコンテキスト。 |
|
|
|
|
| Bean のプロパティの名前に適用されるプレフィックス。 |
|
| 名前と値のペアとしての Bean のプロパティ。 |
|
| この Bean にバインドするときに使用される構成プロパティの起源と値。 |
|
| 親アプリケーションコンテキストの ID(存在する場合)。 |