アプリケーションのアップロードおよびデプロイ

post

/management/weblogic/{version}/edit/appDeployments

クライアントからサーバーにアプリケーションをアップロードしてから、デプロイします。

このメソッドは、非同期呼出しとベスト・エフォート同期呼出しの両方をサポートします。動作は'Prefer'ヘッダーによって制御されます。

リクエスト

サポートされているメディア・タイプ
パス・パラメータ
ヘッダー・パラメータ
  • Preferヘッダー・パラメータを使用すると、このメソッドの実行方法に関するプリファレンスを指定できます。値respond-asyncは、リクエストを発行し完了を待機せずにすぐに返すプリファレンスを指定します。また、値wait=#secondsは、返す前にメソッドの完了を#seconds待機するプリファレンスを指定します。Preferヘッダーが指定されていないか無効な場合、300秒の待機が使用されます。
  • X-Requested-Byヘッダーは、クロスサイト・リクエスト・フォージェリ(CSRF)攻撃からの保護に使用されます。値は、MyClientなどの任意の名前です。
フォーム・パラメータ
  • 残りのデプロイメント情報を含みます。

    この文字列パラメータには、次のスキーマに一致するJSONオブジェクトを含める必要があります:

    {
        "type": "object",
        "properties": {
            "archiveVersion": {
                "type": "string",
                "description": "The archive version (optional)."
            },
            "name": {
                "type": "string",
                "description": "The user-specified name of this deployment.This name is included as one of the key properties in the MBean's javax.management.ObjectNameName=user-specified-name"
            },
            "planVersion": {
                "type": "string",
                "description": "The deployment plan's version (optional)."
            },
            "targets": {
                "title": "Target References",
                "type": "array",
                "items": {
                    "title": "Target Reference",
                    "type": "object",
                    "properties": {
                        "identity": {
                            "title": "Identity",
                            "type": "array",
                            "items": {
                                "type": "string",
                                "description": ""
                            },
                            "description": "DOC TEAM TBD - describe an identity - it's a reference to another WLS REST resource."
                        }
                    },
                    "description": "Contains the target reference."
                },
                "description": "Contains the array of target references. The clusters and/or servers on which this application will be deployed.The deployment will only occur once if the targets overlap."
            }
        },
        "required": [
            "name"
        ]
    }
  • アップロードするデプロイメント・プラン(オプション)。

  • アップロードするアプリケーション。

セキュリティ
トップに戻る

レスポンス

201レスポンス

トップに戻る

新しいアプリケーション・デプロイメントを同期的に作成します。

この例では、POSTメソッドを使用してこのコレクションの新しいアプリケーション・デプロイメントを同期的に作成します。

リクエストの例
curl -v \
--user admin:admin123 \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-H Content-Type:multipart/form-data \
-F "model={
  name: 'myapp',
  targets: [ { identity: [ 'servers', 'AdminServer' ] } ]
}" \
-F "sourcePath=@/deployments/MyApp/app/MyApp.ear" \
-X POST http://localhost:7001/management/weblogic/latest/edit/appDeployments?links=job,abort&fields=completed,progress,error,state,operationType,applicationName
レスポンスの例
HTTP/1.1 100 Continue HTTP/1.1 201 Created

Location: http://localhost:7001/management/weblogic/latest/edit/appDeployments/myapp

Response Body:
{
    "links": [{
        "rel": "job",
        "href": "http:\//localhost:7001/management/weblogic/latest/domainRuntime/deploymentManager/deploymentProgressObjects/myapp"
    }],
    "operationType": 3,
    "state": "STATE_COMPLETED",
    "applicationName": "myapp",
    "progress": "success",
    "completed": true
}

新しいアプリケーション・デプロイメントを非同期的に作成します。

この例では、POSTメソッドを使用してこのコレクションの新しいアプリケーション・デプロイメントを非同期的に作成します。

リクエストの例
curl -v \
--user admin:admin123 \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-H Content-Type:multipart/form-data \
-F "model={
  name: 'myapp',
  targets: [ { identity: [ 'servers', 'AdminServer' ] } ]
}" \
-F "sourcePath=@/deployments/MyApp/app/MyApp.ear" \
-H "Prefer:respond-async" \
-X POST http://localhost:7001/management/weblogic/latest/edit/appDeployments?links=job,abort&fields=completed,progress,error,state,operationType,applicationName
レスポンスの例
HTTP/1.1 100 Continue HTTP/1.1 202 Accepted

Location: http://localhost:7001/management/weblogic/latest/domainRuntime/deploymentManager/deploymentProgressObjects/myapp

Response Body:
{
    "links": [{
        "rel": "job",
        "href": "http:\//localhost:7001/management/weblogic/latest/domainRuntime/deploymentManager/deploymentProgressObjects/myapp"
    }],
    "operationType": 3,
    "state": "STATE_RUNNING",
    "applicationName": "myapp",
    "progress": "processing",
    "completed": false
}
トップに戻る