/management/wls/{version}/deployments/library/id/{library-name}/redeploy

This resource redeploys a library.

The resource supports the following methods:

POST Method

The resource supports the following methods:

POST Accepting "application/json"

This POST method redeploys the library identified by the resource URL. You should invoke this method after you have updated the underlying deployment archive or exploded directory.

Roles

Administrator, Deployer

Request Query Parameters

This resource launches a job to redeploy the library.

_detached

(Optional) Specifies whether this method runs in detached (background) mode or synchronously.

If the __detached=true query parameter is specified (detached invocation), then this method returns immediately after launching the job. Otherwise, it waits for the job to complete, fail, or timeout (synchronous invocation).

Response Body

If the method was invoked synchronously and successfully launched the job, the response body includes a DeploymentJob entity containing the state of the job (completed, failed, or still running in the case of a timeout) as well as a link to the job resource.

This method can return the following links:

  • uri=/wls/jobs/deployment/{job-id} rel=job title=id

Response Codes

If the method was invoked synchronously and the job successfully completed, the method returns a 200 OK status code. If the job timed out, the method returns a 202 Accepted status code.

If the method was invoked detached and successfully launched the job, the method returns a 202 Accepted status code and a link to the job resource. In this case, the response does not include a DeploymentJob entity.

Example

Example 1   Redeploying a Library

This example uses the POST method to redeploy the specified library.

Example Request

curl -v \
--user username:password \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-X POST http://localhost:7001/management/wls/latest/deployments/library/id/airline/redeploy

Example Response

HTTP/1.1 200 OK

Response Body:
{
    "messages": [{
        "message": "Redeployed the library 'airline'.",
        "severity": "SUCCESS"
    }],
    "links": [{
        "rel": "job",
        "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/jobs\/deployment\/id\/5"
    }],
    "item": {
        "operation": "redeploy",
        "status": "completed",
        "beginTime": 1390587126314,
        "endTime": 1390587126328,
        "name": "ADTR-5",
        "id": "5",
        "type": "deployment",
        "targets": [{
            "errors": [],
            "status": "completed",
            "name": "myserver",
            "type": "server"
        }],
        "deploymentName": "airline",
        "description": "[Deployer:149117]redeploy library airline on myserver."
    }
}

POST Accepting "multipart/form-data"

This POST method uploads and redeploys the library identified by the resource URL. You should invoke this method after you have updated the underlying deployment archive or exploded directory.

Roles

Administrator, Deployer

Request Query Parameters

This resource launches a job to upload and redeploy the library.

_detached

(Optional) Specifies whether this method runs in detached (background) mode or synchronously.

If the __detached=true query parameter is specified (detached invocation), then this method returns immediately after launching the job. Otherwise, it waits for the job to complete, fail, or timeout (synchronous invocation).

Request Body

The request body includes form data with a Content-Type header of multipart/form-data and the following form field:

deployment

(Required) Specifies the library to be redeployed. The Content-Disposition header must have its name parameter set to deployment and must have a filename parameter set to the file name you want the library to have on the server. The Content-Type header must be application/octet-stream and the content must be the library data.

Response Body

If the method was invoked synchronously and successfully launched the job, the response body includes a DeploymentJob entity containing the state of the job (completed, failed, or still running in the case of a timeout) as well as a link to the job resource.

This method can return the following links:

  • uri=/wls/jobs/deployment/{job-id} rel=job title=id

Response Codes

If the method was invoked synchronously and the job successfully completed, the method returns a 200 OK status code. If the job timed out, the method returns a 202 Accepted status code.

If the method was invoked detached and successfully launched the job, the method returns a 202 Accepted status code and a link to the job resource. In this case, the response does not include a DeploymentJob entity.

Example

Example 1   Uploading and Redeploying a Library

This example uses the POST method to upload an archive and redeploy it as a library.

Example Request

curl -v \
--user username:password \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-H Content-Type:multipart/form-data \
-F "deployment=@/deployments/fairShare.war" \
-X POST http://localhost:7001/management/wls/latest/deployments/library/id/airline/redeploy

Example Response

HTTP/1.1 200 OK

Response Body:
{
    "messages": [{
        "message": "Redeployed the library 'airline'.",
        "severity": "SUCCESS"
    }],
    "links": [{
        "rel": "job",
        "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/jobs\/deployment\/id\/9"
    }],
    "item": {
        "operation": "deploy",
        "status": "completed",
        "beginTime": 1390587135085,
        "endTime": 1390587135333,
        "name": "ADTR-9",
        "id": "9",
        "type": "deployment",
        "targets": [{
            "errors": [],
            "status": "completed",
            "name": "myserver",
            "type": "server"
        }],
        "deploymentName": "airline",
        "description": "[Deployer:149117]deploy library airline on myserver."
    }
}
Example 2   Uploading and Redeploying a Library Asynchronously

This example uses the POST method to upload an archive and redeploy it as a library.

Example Request

curl -v \
--user username:password \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-H Content-Type:multipart/form-data \
-F "deployment=@/deployments/fairShare.war" \
-X POST http://localhost:7001/management/wls/latest/deployments/library/id/airline/redeploy?__detached=true

Example Response

HTTP/1.1 202 Accepted

Response Body:
{
    "messages": [{
        "message": "Redeploying the library 'airline'.",
        "severity": "SUCCESS"
    }],
    "links": [{
        "rel": "job",
        "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/jobs\/deployment\/id\/13"
    }]
}