Application Resource Definition
The application provides the actual data required to create the clusters, start the instances and specifies how to connect them in the run-time. A sample application definition, together with information on all the properties that can be added in an application definition JSON are as follows:
Sample application definition JSON
The following are sample configurations that can be used in a JSON to define an application:
{ "applicationId": "wso2am-190-application", "multiTenant": true, "alias": "wso2am-190-application", "components": { "groups": [ { "name": "keymanager-gw-manager-gw-worker", "alias": "keymanager-gw-manager-gw-worker", "groupMinInstances": 1, "groupMaxInstances": 1, "cartridges": [ { "type": "wso2am-190-gw-manager", "cartridgeMin": 1, "cartridgeMax": 1, "subscribableInfo": { "alias": "gateway-manager", "deploymentPolicy": "deployment-policy-1", "autoscalingPolicy": "autoscaling-policy-1" } }, { "type": "wso2am-190-gw-worker", "cartridgeMin": 1, "cartridgeMax": 1, "subscribableInfo": { "alias": "gateway-worker", "deploymentPolicy": "deployment-policy-1", "autoscalingPolicy": "autoscaling-policy-1" } }, { "type": "wso2am-190-km", "cartridgeMin": 1, "cartridgeMax": 1, "subscribableInfo": { "alias": "key-manager", "deploymentPolicy": "deployment-policy-1", "autoscalingPolicy": "autoscaling-policy-1" } } ] }, { "name": "pub-store-grp", "alias": "pub-store-grp", "groupMinInstances": 1, "groupMaxInstances": 1, "cartridges": [ { "type": "wso2am-190-pub", "cartridgeMin": 1, "cartridgeMax": 1, "subscribableInfo": { "alias": "publisher", "deploymentPolicy": "deployment-policy-1", "autoscalingPolicy": "autoscaling-policy-1" } }, { "type": "wso2am-190-store", "cartridgeMin": 1, "cartridgeMax": 1, "subscribableInfo": { "alias": "store", "deploymentPolicy": "deployment-policy-1", "autoscalingPolicy": "autoscaling-policy-1" } } ] } ], "dependencies": { "startupOrders": [ { "aliases": [ "group.keymanager-gw-manager-gw-worker", "group.pub-store-grp" ] } ], "terminationBehaviour": "terminate-none" } } }
Property definitions
All the properties that correspond to the application resource are explained as follows:
|
|
|
|
|
Main properties
Property | W | R | U | Description | M | DV | Data Type | Example | |
---|---|---|---|---|---|---|---|---|---|
JSON | UI | ||||||||
| Application Id | √ | √ | X | A unique ID to identify the application. | Yes | N/A | String | test_app_3 |
| √ | √ | X | Whether the application supports multi-tenancy. | No | false | Boolean | true | |
| X | The name of the application | No | N/A | String | ||||
| X | A summarized description of the application. | No | N/A | String | ||||
| √ | X | String | ||||||
| Alias | √ | √ | X | The alias for the application | Yes | N/A | String | phpapp2 |
| Components | √ | √ | X | The components section for the applications will comprise of groups and cartridges. While, each of the children groups can have nested groups. For more information on the sub-properties, see components. | Yes | N/A | components | N/A |
| X | This defines any properties that need to be passed in the application JSON. For more information on the sub-properties, see property. | No | N/A | property array | N/A |
Sub-properties
components
Property | W | R | U | Description | M | DV | Data Type | Example | |
---|---|---|---|---|---|---|---|---|---|
JSON | UI | ||||||||
| Groups | √ | √ | X | This section will have a list of groups that are referred in this application. The groups should have a reference to an already deployed cartridge group definitions using the group name. For more information on the sub-properties, see groups. | No | N/A | groups array | N/A |
| Dependencies | X | The dependencies define the order to instantiate and the groups and cartridges referred in the application definition. For more information on the sub-properties, see dependencies. A sample rule for startup order is shown below: " This would mean the group denoted by | No | N/A | dependencies | N/A | ||
| Cartridges | X | Defines that cartridges that exist in the application. For more information on the sub-properties, see cartridges. | No | N/A | cartridges array | N/A |
groups
Property | W | R | U | Description | M | DV | Data | Example | |
---|---|---|---|---|---|---|---|---|---|
JSON | UI | ||||||||
| name | √ | √ | X | The name of the group. | Yes | String | group2 | |
alias | alias | √ | √ | X | The alias of the group should be unique. | Yes | String | mygroup2 | |
groupMinInstances | groupMinInstances | √ | √ | √ | The minimum number of instances that needs to be maintained in a group. | Yes | Int | 1 | |
groupMaxInstances | groupMaxInstances | √ | √ | √ | The maximum number of instances that needs to be maintained in a group. | Yes | Int | 2 | |
| X | The deployment policy being used for the group | String | ||||||
| √ | √ | X | Defines that sub-cartridges that exist within the group. For more information on the sub-properties, see cartridges. | cartridges array | ||||
groups | Groups | X | Defines the nested groups (sub-groups). The groups should have a reference to an already deployed group definition using the group name. For more information on the sub-properties, see groups. | No | groups array | N/A |
dependencies
Property | W | R | U | Description | M | DV | Data Type | Example | |
---|---|---|---|---|---|---|---|---|---|
JSON | UI | ||||||||
startupOrders | Startup Orders | √ | √ | X | The order in which the applications’s children (sub-groups and sub-cartridges) need to started up. If it is a group, it should use the format of For example if the application "startupOrders": [ { "aliases": [ "group.group2", "cartridge.tomcat" ] } ],
| No | N/A | startupOrders array | group.mygroup2 |
| √ | √ | X | scalingDependents array | |||||
terminationBehaviour | Termination Behaviour | √ | √ | X | This determines how the instances need to be terminated. The "startupOrders": [ { "aliases": [ "group.group2", "cartridge.tomcat" ] }, { "aliases": [ "group.group3", "cartridge.mytomcat222" ] } ], The available terminationBehaviours are as follows:
| No | N/A | String | terminate-none |
cartridges
Property | W | R | U | Description | M | DV | Data | Example | |
---|---|---|---|---|---|---|---|---|---|
JSON | UI | ||||||||
type | Cartridge Type | √ | √ | X | Type of the cartridge. | Yes | String | PHP | |
cartridgeMin | Cartridge Min | √ | √ | √ | The maximum number of instances that needs to be maintained in a cartridge. | Yes | Int | 1 | |
cartridgeMax | Cartridge Max | √ | √ | √ | The minimum number of instances that needs to be maintained in a cartridge. | Yes | Int | 2 | |
subscribableInfo | Subscribable Info | √ | √ | X | Contains the information about all the subscribables that is a part of the cartridge. The fields under artifactRepository must be updated when a cartridge belonging to the Framework category is added (e.g., PHP cartridge, Tomcat cartridge). For more information on the sub-properties, see subscribableInfo. | Yes | subscribableInfo |
subscribableInfo
Property | W | R | U | Description | M | DV | Data | Example | |
---|---|---|---|---|---|---|---|---|---|
JSON | UI | ||||||||
alias | Alias | √ | √ | X | The alias of the cartridge. | Yes | N/A | String | mygroup2tomcat |
| √ | √ | X | String | |||||
autoscalingPolicy | Auto-scaling Policy | √ | √ | X | The autoscaling policy used by the cartridge. | Yes | N/A | String | autoscaling_policy_1 |
maxMembers | X | Int | |||||||
minMembers | X | Int | |||||||
dependencyAliases | X | String | |||||||
artifactRepository | √ | √ | X | The details of the remote Git repository that corresponds to the cartridge. The artifact repository details only need to be mentioned if the cartridge is a single tenant framework cartridge. For more information on the sub-properties, see artifactRepository. | artifactRepository | ||||
persistence | X | Details of the persistence volume that should be attached to the cartridge. For more information on the sub-properties, see persistence. For more information on persistence volume mapping, see Persistence Volume Mapping. | persistence | ||||||
property | X | This defines any properties that need to be passed in the application JSON. Generally, the properties will be listed as name value pairs. However, it is possible to pass the properties as payload parameters if required. For more information on the sub-properties, see property. For more information on how to pass the auto-commit property as a pay load parameter, see Auto Commit. | property array |
persistence
Property | W | R | U | Description | M | DV | Data Type | Example | |
---|---|---|---|---|---|---|---|---|---|
JSON | UI | ||||||||
isRequired | X | Whether an extra volume is required to be attached to the cartridge to store content. | Boolean | ||||||
volumes | X | Details of the persistence volume that should be attached to the cartridge. Details of the persistence volume that should be attached to the cartridge. For more information on the sub-properties, see volumes. | volumes array |
volumes
Property | W | R | U | Description | M | Data Type | Example | |
---|---|---|---|---|---|---|---|---|
JSON | UI | |||||||
| X | String | ||||||
size | X | Capacity of the persistence volume that should be attached to the cartridge. | String | |||||
device | X | String | ||||||
removeOnTermination | X | Whether the volume should be removed after termination of the instance. If the value is set to | Boolean | true | ||||
mappingPath | X | Folder path of the directory onto which the Linux device will be mounted. You should not specify the same mappingPath to multiple volumes. If the latter takes place the volume will be mapped to the volume defined last and it is unpredictable whether the other volumes will be mapped to a directory. | String | |||||
snapshotId | X | String | ||||||
volumeId | X | ID of the persistence volume. | String |
artifactRepository
Property | W | R | U | Description | DV | Data Type | Example | |
---|---|---|---|---|---|---|---|---|
JSON | UI | |||||||
alias | Repository URLAlias | √ | √ | X | The URL of the Git repository.The alias of the cartridge. | N/A | String | www.mygit.com/php.git mygroup2tomcat |
privateRepo | Private Repository | √ | √ | X | Whether the Git repository is a private or public repository. If the value assigned to this field is "true", it indicates that the repository is a private repository. | false | Boolean | true |
| √ | √ | X | The URL of the Git repository. | N/A | String | ||
repoUsername | Repository Username | √ | √ | X | If you have defined a private Git repository, enter the username used to access the repository. | N/A | String | admin |
repoPassword | Repository Password | √ | √ | X | If you have defined a private Git repository, enter the password used to access the repository. | N/A | String | test_password |
property
Property | W | R | U | Description | M | Default Type | Data Type | Example | |
---|---|---|---|---|---|---|---|---|---|
JSON | UI | ||||||||
name | √ | X | Name of the property being passed as a name value pair. | No | N/A | String | |||
value | √ | X | Value that corresponds to the name value pair. | No | N/A | String |