You can update a cartridge using the CLI tool, REST API or the PPaaS Console as shown below:
Update a cartridge via the CLI
Overview
CLI command | update-cartridge |
Description | Update a cartridge definition. |
Command format | update-cartridge -p <JSON_FILE_PATH> The path to the JSON file that defines the cartridge needs to be defined as the |
Parameter definition
Short option | Long option | Description | Required | Example value |
---|---|---|---|---|
-p | --resource-path | Folder path where the JSON file that defines the cartridge is stored. | Yes | <PRIVATE_PAAS_SAMPLES>/common/samples/ |
Example
Update the cartridge that is defined in the <PRIVATE_PAAS_SAMPLES>/common/samples/cartridges/mock/wso2am-190/wso2am-190.json
file.
update-cartridge -p <PRIVATE_PAAS_SAMPLES>/common/samples/cartridges/mock/wso2am-190/wso2am-190.json
Sample output
Cartridge updated successfully
Update a cartridge via the REST API
Overview
Description | Update a cartridge definition. |
Resource Path |
|
HTTP Method | PUT |
Request/Response Format |
|
Command format | curl -X PUT -H "Content-Type: application/json" -d @'<JSON_PAYLOAD>' -k -v -u <USERNAME>:<PASSWORD> https://<PRIVATE_PAAS_HOST>:<PRIVATE_PAAS_HTTPS_PORT>/api/cartridges
|
Example
Update the cartridge that is defined in the <PRIVATE_PAAS_SAMPLES>/common/samples/cartridges/mock/wso2am-190/wso2am-190.json
file.
cd <PRIVATE_PAAS_SAMPLES>/common/samples curl -X PUT -H "Content-Type: application/json" -d @'cartridges/mock/wso2am-190/wso2am-190.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
Sample output
> PUT /api/cartridges HTTP/1.1 > Host: localhost:9443 > Authorization: Basic YWRtaW46YWRtaW4= > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Content-Length: 1170 > Expect: 100-continue > < HTTP/1.1 100 Continue < HTTP/1.1 200 OK < Date: Tue, 06 Oct 2015 08:00:28 GMT < Content-Type: application/json < Transfer-Encoding: chunked < Server: WSO2 Carbon Server < {"status":"success","message":"Cartridge updated successfully"}
You will come across the following HTTP status codes while updating a cartridge:
HTTP status code | 100, 200, 500 See the descriptions of the HTTP status codes here. |
Location header URL |
https://<STRATOS_HOST>:<STRATOS_HTTPS_PORT>/api/cartridges/<CARTRIDGE_TYPE>
|
Update a cartridge via the PPaaS Console
Updating a cartridge via the UI editor
Follow the instructions below to view the details of a cartridge:
- Click Configurations on the home page.
- Click Cartridges.
- Hover your mouse pointer over the cartridge that you wish to update, for the Edit button to appear.
- Update the cartridge definition as required. For property definitions, see the Cartridge Resource Definition.
- Click SAVE.
Updating a cartridge via the JSON editor
Follow the instructions below to view the details of a cartridge:
- Click Configurations on the home page.
- Click Cartridges.
- Hover your mouse pointer over the cartridge, which you wish to update, for the Edit button to appear and click Edit.
- Click on the editor control to switch to the JSON editor. The JSON code format to update a cartridge will appear.
- Optionally, check the Auto correct with schema option to ensure that you do not accidentally delete any mandatory fields from the cartridge definition JSON code.
- Update the cartridge definition using JSON. For property definitions, see the Cartridge Resource Definition.
- Click SAVE.
Sample cartridge JSON
It is not required for you to define the name
and value
parameters under the property
field in the cartridge definition, If you are running Private PaaS on the mock IaaS.
{ "type": "wso2am-190", "category": "framework", "provider": "wso2", "host": "am.wso2.org", "displayName": "WSO2 AM 1.9.0", "description": "WSO2 AM 1.9.0 Cartridge", "version": "1.9.0", "multiTenant": true, "loadBalancingIPType": "public", "portMapping": [ { "name": "mgt-https", "protocol": "https", "port": 9443, "proxyPort": 0, "kubernetesPortType": "NodePort" } ], "iaasProvider": [ { "type": "mock", "imageId": "wso2/am:1.9.0", "networkInterfaces": [ ] } ], "property": [ ] }
Define the values under the property
field of the cartridge definition, if you are running Private PaaS on the EC2, Kubernetes or OpenStack IaaS
{ "type": "wso2am-190", "category": "framework", "provider": "wso2", "host": "am.wso2.org", "displayName": "WSO2 AM 1.9.0", "description": "WSO2 AM 1.9.0 Cartridge", "version": "1.9.0", "multiTenant": true, "loadBalancingIPType": "public", "portMapping": [ { "name": "mgt-https", "protocol": "https", "port": 9443, "proxyPort": 0, "kubernetesPortType": "NodePort" }, { "name": "mgt-http", "protocol": "http", "port": 9763, "proxyPort": 0, "kubernetesPortType": "NodePort" }, { "name": "pt-http", "protocol": "http", "port": 8280, "proxyPort": 0, "kubernetesPortType": "NodePort" }, { "name": "pt-https", "protocol": "https", "port": 8243, "proxyPort": 0, "kubernetesPortType": "NodePort" } ], "iaasProvider": [ { "type": "kubernetes", "imageId": "wso2/am:1.9.0", "networkInterfaces": [ ] } ], "property": [ { "name": "KUBERNETES_CONTAINER_CPU", "value": "0" }, { "name": "KUBERNETES_CONTAINER_MEMORY", "value": "0" }, { "name": "KUBERNETES_SERVICE_SESSION_AFFINITY", "value": "ClientIP" }, { "name": "payload_parameter.START_CMD", "value": "PCA" }, { "name": "payload_parameter.CONFIG_PARAM_PROFILE", "value": "Default" }, { "name": "payload_parameter.CONFIG_PARAM_APIMGT_DB_URL", "value": "jdbc:mysql://192.168.30.7:3306/apim_db" }, { "name": "payload_parameter.CONFIG_PARAM_DB_USER_NAME", "value": "root" }, { "name": "payload_parameter.CONFIG_PARAM_DB_PASSWORD", "value": "root" }, { "name": "payload_parameter.CONFIG_PARAM_LB_IP", "value": "127.0.0.1" } ] }