Overview

CLI command
update-application
DescriptionUpdate an application.
Command format
update-application -p <JSON_FILE_PATH>

The path to the JSON file that defines the application needs to be defined as the <JSON_FILE_PATH> value.

Parameter definitions

Short option
Long option
Description
Required
Example value
-p
--resource-pathFolder path where the JSON file that defines the application is stored.yes

<STRATOS_SOURCE_HOME>/samples/applications/complex/wordpress/ artifacts/application.json

Sample application JSON

{  
   "applicationId":"wordpress",
   "alias":"wordpress",
   "components":{  
      "groups":[  
         {  
            "name":"mysql-php-group",
            "alias":"mysql-php-group",
            "groupMinInstances":1,
            "groupMaxInstances":1,
            "cartridges":[  
               {  
                  "type":"mysql",
                  "cartridgeMin":2,
                  "cartridgeMax":5,
                  "subscribableInfo":{  
                     "alias":"my-mysql",
                     "deploymentPolicy":"deployment-policy-2",
                     "autoscalingPolicy":"autoscaling-policy-1"
                  }
               },
               {  
                  "type":"php",
                  "cartridgeMin":2,
                  "cartridgeMax":5,
                  "subscribableInfo":{  
                     "alias":"my-php",
                     "deploymentPolicy":"deployment-policy-2",
                     "autoscalingPolicy":"autoscaling-policy-1",
                     "artifactRepository":{  
                        "privateRepo":false,
                        "repoUrl":"https://github.com/imesh/stratos-php-applications.git"
                     }
                  }
               }
            ]
         }
      ]
   }
}
  • An application can only be multi-tenant, if all cartridges that correspond to the application are multi-tenant.
  • The artifact repository details should not be entered in a multi-tenant application definition. Instead, these details need to be passed in the payload at the time of application sign up.
{
  "applicationId": "single-cartridge-app",
  "alias": "single-cartridge-app",
  "multiTenant": true,
  "components": {
    "cartridges": [
      {
        "type": "php",
        "cartridgeMin": 1,
        "cartridgeMax": 10,
        "subscribableInfo": {
          "alias": "my-php",
          "autoscalingPolicy": "autoscaling-policy-1",
          "deploymentPolicy": "deployment-policy-1"
        }
      }
    ]
  }
} 

For information on all the properties that can be used in an application definition, see the Application Resource Definition.

Example

Use case: Update the application defined in the <STRATOS_SOURCE_HOME>/samples/applications/wordpress/artifacts/application.json file.

update-application -p <STRATOS_SOURCE_HOME>/samples/applications/complex/wordpress/artifacts/application.json

Sample output

Successfully updated application.
  • No labels