Enabling RESTful Management Services
WebLogic Server 12c introduces the possibility of monitoring WebLogic Server using RESTful Web Services with new RESTful Management Services.
RESTful Management Services is disabled by default. This recipe will enable it.
Getting ready
WebLogic Administration Server must be up and running.
To enable WebLogic RESTful Management Services, you have to access the Administration Console at http://prod01.domain.local:7001/console
.
How to do it...
Carry out the following steps to enable RESTful Management Services:
Access the Administration Console with your web browser at
http://prod01.domain.local:7001/console
.Click on the Lock & Edit button to create a new change session.
Navigate to Settings for Domain | General by clicking Home and then Domain or by clicking the
PROD_DOMAIN
link.Check the Enable RESTful Management Services checkbox, as shown in the following screenshot:
Restart WebLogic Administration Server and all Servers of the domain.
How it works...
RESTful Management Services exposes WebLogic Server instances and WebLogic clusters, applications, and data sources to be monitored using the HTTP GET method and RESTful formats, such as XML, JSON, and HTML.
The following table displays the resources to be monitored and the corresponding URIs to be accessed.
Resource |
URI |
---|---|
Servers |
|
Specific Server |
|
Clusters |
|
Specific Cluster |
|
Applications |
|
Specific Application |
|
Data Sources |
|
Specific Data Source |
|
Note
To access the full response format of each resource, add "?format=full"
at the end of the URI.
The following image illustrates a RESTful request to monitor all servers of the domain. It contains the name, state, and health of the Administration Server instance PROD_AdminServer
. It also contains the WebLogic version, the machine that this server is running, open sockets, the Java version, the operational system, the Java heap size, and the Java heap in use. The PROD_Server01
and PROD_Server02
instances are down, and their state is also displayed as SHUTDOWN:
There's more...
RESTful Management Services can also be enabled through WLST.
Enabling RESTful using WLST
Log in as a
wls
user to shell and start WLST:[wls@prod01]$ $WL_HOME/common/bin/wlst.sh
Connect to the Administration Server using
wlsadmin
as the user,<pwd>
as the password, andt3://prod01.domain.local:7001
as the server URL:wls:/offline>connect("wlsadmin","<pwd>","t3://prod01.domain.local:7001")
Run the following WLST commands:
edit() startEdit() cd('/RestfulManagementServices/PROD_DOMAIN') cmo.setEnabled(true) save() activate() exit()
Restart WebLogic Administration Server and all servers of the domain.
See also
Starting the Administration Server
Saving and activating changes in the Administration Console