环境:WebLogic Server 12.1.1(下载)
测试工具:REST Console (下载)
基础知识
支持资源类型:JSON、XML、HTML
单资源展示格式(以JSON举例)
{
"body": {
"item": {
// attributes for the item, e.g.
// "name": "adminserver"
// "state": "RUNNING",
// …
}
},
"messages": [
// an array of messages
]
}
集合资源展标格式
{
"body": {
"items": [
{
// attributes for item 1
// "name": "adminserver"
// "state": "RUNNING",
// …
},
{
// attributes for item 2
},
…
{
// attributes for item n
}
],
"messages": [
]
}REST资源列表
监控所有服务器
http(s)://host:port/management/tenant-monitoring/servers
监控指定服务器
http(s)://host:port/management/tenant-monitoring/servers/{servername}
监控服务器所有集群
http(s)://host:port/management/tenant-monitoring/clusters
监控指定集群
http(s)://host:port/management/tenant-monitoring/clusters/{clustername}
监控所有应用
http(s)://host:port/management/tenant-monitoring/applications
监控指定应用
http(s)://host:port/management/tenant-monitoring/applications/{applicationname}
监控所有数据源
http(s)://host:port/management/tenant-monitoring/datasources
监控指定数据源
http(s)://host:port/management/tenant-monitoring/datasources/{datasourcename}
配置过程
1. 激活RESTful服务
进入控制台->[Your Domain]->Configuration->Advanced->Enable RESTful Management Services
2. 使用REST Console进行测试
- Request URI: http://localhost:7001/management/tenant-monitoring/servers
- Content-Type:application/json
参考资料
Overview OTN: http://www.oracle.com/technetwork/middleware/weblogic/documentation/index.html
WLS 12c Data sheet: http://www.oracle.com/us/products/middleware/application-server/oracle-weblogic-server-ds-1391360.pdf
WLS 12c online Documentation Library: http://docs.oracle.com/cd/E24329_01/index.htm
Usind RESTful Services With WLS 12c: http://docs.oracle.com/cd/E24329_01/web.1211/e26722/toc.htm