WebLogicドメイン内のサーバー・インスタンスの表示

GETリクエストを使用して、WebLogicドメインで使用可能なサーバー・インスタンスをリストできます。次のステップは、cURLを使用してこのGETリクエストを構築する方法を示しています:
  1. ドメインの管理サーバーのホスト名とポートを特定し、/management/weblogic/{version}/edit/serversエンドポイントを使用してGETリクエストを作成します。このWebLogic Serverリクエストでは次のURL構造を使用します:
    http://localhost:port/management/weblogic/{version}/edit/servers
  2. cURLコマンド・ラインでヘッダーを指定します。
    • -H X-Requested-By:MyClient

    • -H Accept:application/json

  3. ドメイン内のサーバー・インスタンスを表示するGETリクエストを作成します。fieldパラメータを使用して、リクエストによって返されるようにするサーバーのプロパティ(listenPort、listenAddressなど)を指定します。

    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

    GETリクエストは、ドメイン内の構成済サーバーのリスト、その状態および構成情報を含むレスポンスを返します。

    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"
                    ]}
                ]
            }
        ]
    }