This documentation is for WSO2 Private PaaS 4.1.0. View documentation for the latest release.
Updating a Cartridge - WSO2 Private PaaS 4.1.0 - WSO2 Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
||
Skip to end of metadata
Go to start of metadata

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
DescriptionUpdate 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  <JSON_FILE_PATH>  value.

Parameter definition
Short optionLong optionDescriptionRequiredExample value
-p
--resource-pathFolder path where the JSON file that defines the cartridge is stored.Yes
<PRIVATE_PAAS_SAMPLES>/common/samples/
cartridges/mock/wso2am-190/wso2am-190.json
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
DescriptionUpdate a cartridge definition.
Resource Path

/cartridges

HTTP MethodPUT
Request/Response Format

application/json

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
  • The path to the JSON file that defines the deployment policy needs to be defined as the  <JSON_PAYLOAD> value.
  • By default, <USERNAME>:<PASSWORD> is admin:admin.
  • By default, <PRIVATE_PAAS_HOST> is localhost. However, if you are using a public IP, the respective IP address or domain needs to be specified.
  • By default, <PRIVATE_PAAS_HTTPS_PORT> has been set to 9443. However, if the port offset has been incremented by n, the default port value needs to be incremented by n.
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:

  1. Click Configurations on the home page.
  2. Click Cartridges.
  3. Hover your mouse pointer over the cartridge that you wish to update, for the Edit button to appear.
  4. Update the cartridge definition as required. For property definitions, see the Cartridge Resource Definition.
  5. Click SAVE.
Updating a cartridge via the JSON editor

Follow the instructions below to view the details of a cartridge:

  1. Click Configurations on the home page.
  2. Click Cartridges.
  3. Hover your mouse pointer over the cartridge, which you wish to update, for the Edit button to appear and click Edit.
  4. Click on the editor control to switch to the JSON editor. The JSON code format to update a cartridge will appear.
  5. 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.
  6. Update the cartridge definition using JSON. For property definitions, see the Cartridge Resource Definition.
  7. 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"
    }
  ]
}
  • No labels