Virtual application patterns REST API
Use this REST API to manage your virtual application patterns.
List all application patterns
GET /resources/virtualApplicationPatterns/
| REST API information | Value | Description |
|---|---|---|
| Example URL | https://localhost/resources/virtualApplicationPatterns/ | |
| Response content-type | application/json | |
| Response example | |
|
| Response code | 200 | OK |
| 401 | The user is not authorized to perform this action. | |
| 403 | Access forbidden | |
| 500 | Unexpected error |
Return a specific virtual application pattern
GET /resources/virtualApplicationPatterns/{app_id}
| REST API information | Value | Description |
|---|---|---|
| Example URL | https://localhost/resources/irtualApplicationPatterns/a-679a68f4-6798-424f-8039-1f682f949f45 | |
| Response content-type | application/json | |
| Response example | |
|
| Response code | 200 | OK |
| 401 | The user is not authorized to perform this action. | |
| 403 | Access forbidden | |
| 404 | The application that is specified by {appID} is
not found. |
|
| 500 | Unexpected error |
Create an application pattern with specific attributes
POST /resources/virtualApplicationPatterns/Different
kinds of attributes can be combined. A unique ID is generated for
the application.
| REST API information | Value | Description |
|---|---|---|
| Example URL | https://localhost/resources/virtualApplicationPatterns/ | |
| Request body Content-type |
Content-Type - application/json (appmodel.json file) Content-Type - application/zip file (compressed file that includes the application model and artifacts files) |
|
| Request body example | JSON Application model | |
| Response content-type | application/json | |
| Response example | |
|
| Response header location | https://localhost/resources/virtualApplicationPatterns/a-4e21f6e9-2ca7-4a3a-a5cc-00f04f7b7f08 | |
| Response code | 201 | Created |
| 401 | The user is not authorized to perform this action. | |
| 403 | Access forbidden | |
| 412 | Invalid parameter supplied, for example, the JSON file is invalid. | |
| 415 | Invalid content type | |
| 500 | Unexpected error |
Create an application pattern from an existing application or template (clone)
POST /resources/virtualApplicationPatterns/?source={app_id}&app_name={name}&app_type={app_type}A
unique ID is generated for the application. - Attribute "source": specify application template or application (required)
- Attribute "app_name": specify application name (required)
- Attribute "app_type": specify application type for target application. The values can be application or template. The default value is application.
| REST API information | Value | Description |
|---|---|---|
| Example URL | https://localhost/resources/virtualApplicationPatterns/?source=a-679a68f4-6798-424f-8039-1f682f949f45&app_name=testApp Create
an application name |
|
| Response content-type | application/json | |
| Response example | |
|
| Response header location | https://localhost/resources/virtualApplicationPatterns/a-fb70796e-1b13-467a-babe-b8b700bd563b | |
| Response code | 201 | Created |
| 401 | The user is not authorized to perform this action. | |
| 403 | Access forbidden | |
| 412 | Invalid parameter supplied, for example, the application ID is not found. | |
| 415 | Invalid content type | |
| 500 | Unexpected error |
Deploy a virtual application pattern
There
are two options when you deploy a virtual application pattern:
- Deploy the application with the placement that is determined by
the system, if applicable, or by not using placement if it is not
supported by the application. To deploy the application with this
method, use the
POSTREST API and do not include the placement_only parameter in the request body, or set it toFalse. - Modify the placement before you deploy the application, and use
the modified placement for the deployment. To use this method, the
deployment must be called in two phases:
- First, generate the placement and topology by including
placement_only:"True"in the request body.This parameter tells the system to generate a
placementfor the deployment, which is returned in response body. You can modify this placement before you pass it to the system in the second phase to deploy the pattern. - Then, deploy the pattern by calling the
PUTREST API with thedeployPlacementoperation, and pass the modifiedplacementfor the deployment in the request body.
- First, generate the placement and topology by including
Note:
- Because placement is handled by the system, you do not have to specify a cloud group or IP group if an environment profile is specified. If the pattern cannot use placement, then the cloud group and IP group parameters are required. For example, if some of the plug-ins in the pattern do not require Foundation 2.1, the application cannot use placement. In this scenario, the cloud group and IP group are required. If you do not specify these parameters for a pattern that cannot use placement, the deployment fails.
- If "placement_only":True is
in the request body, but placement is not supported for the pattern,
that parameter is ignored by the system. The pattern is deployed as
if the placement_only was not specified, or was
set to
False.
Restriction: If your API version is less than 5.0.0.0:
- The cloud group and IP group are required parameters.
- Deploying to an environment profile with the cloud management type set to "By way of external network" is not supported.
Deploy the application, or generate the placement
if you are using the two-phase method:
POST /resources/virtualApplicationPatterns/pattern ID/virtualApplicationInstances/
| REST API information | Value | Description |
|---|---|---|
| Example URL | http://server/resources/virtualApplicationPatterns/a-123/virtualApplicationInstances/ | |
| Request content-type | application/json | |
| Request body example | Request body example for a one-phase deployment
that either uses the placement that is determined by the system, or
does not use placement:Request body for the first phase of a two-phase deployment.
Set "placement_only": true in the request body: |
|
| Response headers content-type | application/json | |
| Response body example | Response body example for a one-phase deployment
that either uses the placement that is determined by the system, or
does not use placement:Response body example for the first phase of a two-phase
deployment. When "placement_only": true is included
in the request body, placement is returned in the
response body: |
|
| Response code | 201 | Created successfully |
| 403 | Access forbidden | |
| 500 | Unexpected error |
Second phase of a two-phase deployment:
PUT /resources/virtualApplicationPatterns/pattern IDYou
can specify three parameters in the request body:- placement
- Required. The modified placement for the deployment.
- topology_parameters
- Optional. Define the topology parameters that are needed for deployment
as a key value map. The key format is
topologyname.parameterid. For example,WAS.PASSWORD. - addon_parameters
- Optional. Define the topology parameters that are needed for deployment as a key value map.
| REST API information | Value | Description |
|---|---|---|
| Example URL | https://localhost/resources/virtualApplications/d-55e08a31-a3f0-419e-b262-3cdba2cf6be2 | |
| Request content-type | application/json Specify the updated placement in the request body. |
|
| Request example | |
|
| Response code | 200 | OK |
| 401 | The user is not authorized to perform this action. | |
| 403 | Access forbidden | |
| 404 | The application that is specified by {appID} is
not found. |
|
| 412 | A specified parameter is not valid. For example, the JSON file is not valid. | |
| 500 | Unexpected error |
Update a virtual application pattern
PUT /resources/virtualApplicationPatterns/{app_id}
| REST API information | Value | Description |
|---|---|---|
| Example URL | https://localhost/resources/virtualApplicationPatterns/a-cdaac959-672c-4df7-a648-b333a3843422 | |
| Request content-type and body | Content-Type - application/json (body
is the application model JSON file) Content-Type - application/zip (body is compressed file, including the application model and artifacts files) |
|
| Request content-type | application/json | |
| Response body example | |
|
| Response code | 200 | OK |
| 401 | The user is not authorized to perform this action. | |
| 403 | Access forbidden | |
| 404 | The application that is specified by {appID} is
not found. |
|
| 412 | A specified parameter is not valid. For example, the JSON file is not valid. | |
| 500 | Unexpected error |
Delete a specified application pattern
DELETE /resources/virtualApplicationPatterns/{app_id}
| REST API information | Value | Description |
|---|---|---|
| Example URL | https://localhost/resources/virtualApplicationPatterns/a-cdaac959-672c-4df7-a648-b333a3843422 | |
| Response content-type | application/json | |
| Response code | 200 | OK Note: If an application specified by
{appID} is
not found, the 200 response code returns, response body: {"success":
"false"}) |
| 401 | The user is not authorized to perform this action. | |
| 403 | Access forbidden | |
| 409 | Conflict | |
| 500 | Unexpected error |