Add a New Managed Server
You can use a POST request to add a new Managed Server to a domain. The following steps show how to build this POST request using cURL:
-
Identify the host name and port of your domain's Administration Server and construct the POST 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
-
Specify the headers on the cURL command line:
-
-H X-Requested-By:MyClient
-
-H Accept:application/json
-
-H Content-Type:application/json
-
-
Specify the name, listen port and listen address of the new managed server in the JSON format in the request body using the
???d
option as shown in the following example.-d "{ name: 'server1', listenPort: 7654, listenAddress: 'lhost' }" \
The following sample shows the complete POST request for creating a managed server, server1.
curl -v \
--user admin:admin123 \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-H Content-Type:application/json \
-d "{
name: 'server1',
listenPort: 7654,
listenAddress: 'lhost'
}" \
-X POST http://localhost:7001/management/weblogic/latest/edit/servers
The following sample shows the response that is returned by this POST request.
HTTP/1.1 201 Created
Location: http://localhost:7001/management/weblogic/latest/edit/servers/server1
Response Body:
{}