/management/wls/{version}/deployments/library

This resource manages the libraries that are deployed in this WLS domain.

The resource supports the following methods:

GET Method

The GET method on this resource returns a listing of all the libraries in this WLS domain.

Roles

Administrator, Deployer, Operator, Monitor

Response Body

The response body returned includes a collection of Library entities. It also contains links to their corresponding resources.

This method can return the following links:

  • uri=/management/wls/{version}/deployments rel=parent

  • uri=/management/wls/{version}/deployments/library/id/{library-name} rel=items.name title=name

Response Codes

This method returns one of the Standard HTTP Status Codes.

Example

Example 1   Viewing Libraries

This example uses the GET method to return a summary of all libraries.

Example Request

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

Example Response

HTTP/1.1 200 OK

Response Body:
{
    "links": [
        {
            "rel": "parent",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/deployments"
        },
        {
            "rel": "items.name",
            "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/deployments\/library\/id\/airline",
            "title": "airline"
        }
    ],
    "items": [{
        "name": "airline",
        "state": "active",
        "type": "library",
        "targets": ["myserver"],
        "displayName": "airline",
        "deploymentPath": "\/deployments\/airline.war"
    }]
}

OPTIONS Method

The OPTIONS method on this resource returns a template entity that has been pre-populated with default values.

If you want to deploy a library, call this method to get the template, fill in values, such as the path to the library, then use it in the POST method to deploy the library.

Roles

Administrator

Response Body

The response body returned includes a Library template entity that can be customized and then used to deploy the library.

Response Codes

This method returns one of the Standard HTTP Status Codes.

Example

Example 1   Getting a Template Library Entity

This example uses the OPTIONS method to obtain a template for a library deployment.

Example Request

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

Example Response

HTTP/1.1 200 OK

Response Body:
{"item": {
    "name": null,
    "state": null,
    "type": "library",
    "targets": null,
    "displayName": null,
    "specVersion": null,
    "implVersion": null,
    "deploymentPath": null,
    "referencingApplications": null,
    "referencingLibraries": null
}}

POST Method

The resource supports the following methods:

POST Accepting "application/json"

This POST method deploys a new library.

Roles

Administrator

Request Query Parameters

This resource launches a job to deploy 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 must include a fully populated Library entity that describes the new library. Read only parameter values are ignored.

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=name

Response Codes

If the method was invoked synchronously and the job successfully completed, the method returns a 201 Created status code and a Location header with a link to the new library resource. If the job timed out, the method returns a 202 Accepted status code and a Location header with a link to the expected new library resource.

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

Example

Example 1   Deploying a Library

This example uses the POST method to deploy a new library.

Example Request

curl -v \
--user username:password \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-H Content-Type:application/json \
-d "{
    name: 'airline',
    deploymentPath: '/deployments/airline.war',
    targets: [ 'myserver', 'Cluster-0' ]
}" \
-X POST http://localhost:7001/management/wls/latest/deployments/library

Example Response

HTTP/1.1 201 Created

Location: http://localhost:7001/management/wls/latest/deployments/library/id/airline

Response Body:
{
    "messages": [{
        "message": "Deployed the library 'airline'.",
        "severity": "SUCCESS"
    }],
    "links": [{
        "rel": "job",
        "uri": "http:\/\/localhost:7001\/management\/wls\/latest\/jobs\/deployment\/id\/1"
    }],
    "item": {
        "operation": "deploy",
        "status": "completed",
        "beginTime": 1390587116296,
        "endTime": 1390587116676,
        "name": "ADTR-1",
        "id": "1",
        "type": "deployment",
        "targets": [
            {
                "errors": [],
                "status": "completed",
                "name": "Cluster-0",
                "type": "cluster"
            },
            {
                "errors": [],
                "status": "completed",
                "name": "myserver",
                "type": "server"
            }
        ],
        "deploymentName": "airline",
        "description": "[Deployer:149117]deploy library airline on Cluster-0,myserver."
    }
}
Example 2   Deploying an Library Asynchronously

This example uses the POST method to deploy a new library asynchronously.

Example Request

curl -v \
--user username:password \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-H Content-Type:application/json \
-d "{
    name: 'airline',
    deploymentPath: '/deployments/airline.war',
    targets: [ 'myserver', 'Cluster-0' ]
}" \
-X POST http://localhost:7001/management/wls/latest/deployments/library

Example Response

HTTP/1.1 201 Created

Location: http://localhost:7001/management/wls/latest/deployments/library/id/airline

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

POST Accepting "multipart/form-data"

This POST method uploads and deploys a new library.

Note: When using a multi-part form to create, you need to:

  1. Specify the file to deploy via the deployment form element.

  2. Send in the rest of the template via the model form element.

Roles

Administrator

Request Query Parameters

This resource launches a job to upload and deploy 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 fields:

model

(Required) Specifies all the necessary information about the library to deploy. The Content-Disposition header must have its name parameter set to model. The Content-Type header must be application/json and the content must be a JSON object containing a Library entity excluding the deployment field.

deployment

(Required) Specifies the library to be deployed. 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 201 Created status code and a Location header with a link to the new library resource. If the job timed out, the method returns a 202 Accepted status code and a Location header with a link to the expected new library resource.

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

Example

Example 1   Uploading and Deploying a Library

This example uses the POST method to upload a deployment archive and deploy it as a new library.

Example Request

curl -v \
--user username:password \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-H Content-Type:multipart/form-data \
-F "model={
    name: 'airline',
    targets: [ 'myserver' ]
}" \
-F "deployment=@/deployments/airline.war" \
-X POST http://localhost:7001/management/wls/latest/deployments/library

Example Response

 HTTP/1.1 201 Created

Location: http://localhost:7001/management/wls/latest/deployments/library/id/airline

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

This example uses the POST method to upload a deployment archive and deploy it as a new library.

Example Request

curl -v \
--user username:password \
-H X-Requested-By:MyClient \
-H Accept:application/json \
-H Content-Type:multipart/form-data \
-F "model={
    name: 'airline',
    targets: [ 'myserver' ]
}" \
-F "deployment=@/deployments/airline.war" \
-X POST http://localhost:7001/management/wls/latest/deployments/library?__detached=true

Example Response

HTTP/1.1 202 Accepted

Location: http://localhost:7001/management/wls/latest/deployments/library/id/airline

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