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

This resource redeploys an application.

The resource supports the following methods:

POST Method

The resource supports the following methods:

POST Accepting "application/json"

This POST method redeploys the application identified by the resource URL. Use this method when the file to redeploy is already on the Administration Server file system. For example, you've physically replaced the file that the deployment refers to, and you want the deployment to start using the new file.

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 application.

_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 an Application

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

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/application/id/fairShare/redeploy

Example Response

HTTP/1.1 200 OK

Response Body:
{
    "messages": [{
        "message": "Redeployed the application 'fairShare'.",
        "severity": "SUCCESS"
    }],
    "links": [{
        "rel": "job",
        "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/jobs\/deployment\/id\/25"
    }],
    "item": {
        "operation": "redeploy",
        "status": "completed",
        "beginTime": 1390587186018,
        "endTime": 1390587186120,
        "name": "ADTR-25",
        "id": "25",
        "type": "deployment",
        "targets": [
            {
                "errors": [],
                "status": "completed",
                "name": "Cluster-0",
                "type": "cluster"
            },
            {
                "errors": [],
                "status": "completed",
                "name": "myserver",
                "type": "server"
            }
        ],
        "deploymentName": "fairShare",
        "description": "[Deployer:149026]redeploy application fairShare on Cluster-0,myserver."
    }
}
Example 2   Redeploying an Application Asynchronously

This example uses the POST method to redeploy the specified application asynchronously.

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/application/id/fairShare/redeploy?__detached=true

Example Response

HTTP/1.1 202 Accepted

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

POST Accepting "multipart/form-data"

This POST method uploads and redeploys the application. Use this method when the file to redeploy exists on the client's file system. It uploads the file to the Administration Server and then signals the deployment to start using it.

Roles

Administrator

Request Query Parameters

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

_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 fields:

deployment

(Required) Specifies the application to redeploy. 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 deployment archive to have on the server. The Content-Type header must be application/octet-stream and the content must be the deployment archive data.

plan

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

archiveVersion

(Optional) Specifies the archive version, as a String. The Content-Disposition header must have its name parameter set to archiveVersion. The Content-Type header must be text/plain.

planVersion

(Optional) Specifies the plan version, as a String. The Content-Disposition header must have its name parameter set to planVersion. The Content-Type header must be text/plain.

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 an Application

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

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/application/id/myapp/redeploy

Example Response

 HTTP/1.1 200 OK

Response Body:
{
    "messages": [{
        "message": "Redeployed the application 'myapp'.",
        "severity": "SUCCESS"
    }],
    "links": [{
        "rel": "job",
        "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/jobs\/deployment\/id\/29"
    }],
    "item": {
        "operation": "deploy",
        "status": "completed",
        "beginTime": 1390587195811,
        "endTime": 1390587196066,
        "name": "ADTR-29",
        "id": "29",
        "type": "deployment",
        "targets": [
            {
                "errors": [],
                "status": "completed",
                "name": "Cluster-0",
                "type": "cluster"
            },
            {
                "errors": [],
                "status": "completed",
                "name": "myserver",
                "type": "server"
            }
        ],
        "deploymentName": "myapp",
        "description": "[Deployer:149026]deploy application myapp on Cluster-0,myserver."
    }
}
Example 2   Uploading and Redeploying an Application Asynchronously

This example uses the POST method to upload an archive and redeploy it as an application asynchronously.

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