View Server Instances in a WebLogic Domain

You can use a GET request to list the server instances available in a WebLogic domain. The following steps show how to build this GET request using cURL:
  1. Identify the host name and port of your domain's Administration Server and construct the GET request using the /management/weblogic/{version}/edit/servers endpoint. This WebLogic Server request uses the following URL structure:
    http://localhost:port/management/weblogic/{version}/edit/servers
  2. Specify the headers on the cURL command line:
    • -H X-Requested-By:MyClient

    • -H Accept:application/json

  3. Construct the GET request to view server instances in a domain. Use the field parameter to specify the server properties that you want the request to return, such as, listenPort, listenAddress, and so on.

    curl -v \
    --user admin:admin123 \
    -H X-Requested-By:MyClient \
    -H Accept:application/json \
    -X GET http://localhost:7001/management/weblogic/latest/edit/servers?fields=name,listenPort,listenAddress,listenPortEnabled,machine,candidateMachines&links=self

    The GET request returns the response that contains the list of configured servers in the domain, their state, and configuration information.

    HTTP/1.1 200 OK
    
    Response Body:
    {
        "links": [{
            "rel": "self",
            "href": "http:\//localhost:7001/management/weblogic/latest/edit/servers"
        }],
        "items": [
            {
                "links": [{
                    "rel": "self",
                    "href": "http:\//localhost:7001/management/weblogic/latest/edit/servers/AdminServer"
                }],
                "listenAddress": "localhost",
                "listenPortEnabled": true,
                "name": "AdminServer",
                "listenPort": 7001,
                "machine": null,
                "candidateMachines": []
            },
            {
                "links": [{
                    "rel": "self",
                    "href": "http:\//localhost:7001/management/weblogic/latest/edit/servers/server1"
                }],
                "listenAddress": "lhost",
                "listenPortEnabled": true,
                "name": "server1",
                "listenPort": 7777,
                "machine": [
                    "machines",
                    "machine1"
                ],
                "candidateMachines": [
                    {"identity": [
                        "machines",
                        "machine1"
                    ]},
                    {"identity": [
                        "machines",
                        "machine2"
                    ]}
                ]
            }
        ]
    }