Overview

DescriptionUsed to deploy a Cartridge definition
URL

/cartridge/definition

HTTP MethodPOST
Request/Response Format

application/json

Sample request

{
    "type":"php",
    "provider":"apache",
    "host":"stratos.org",
    "displayName":"PHP",
    "description":"PHP Cartridge",
    "version":"7",
	"defaultAutoscalingPolicy":"economyPolicy",
    "multiTenant":"false",
    "portMapping":[
         {
            "protocol":"http",
            "port":"80",
            "proxyPort":"8280"
         },
         {
            "protocol":"https",
            "port":"443",
            "proxyPort":"8243"
         }
    ],
    "iaasProvider":[
         {
            "type":"ec2",
            "imageId":"ap-southeast-1/ami-2e0d5a7c",
            "maxInstanceLimit":"4",
            "property":[
               {
                  "name":"instanceType",
                  "value":"m1.medium"
               },
               {
                  "name":"keyPair",
                  "value":"xxxxxxxx"
               }
            ],
            "networkInterfaces": [
                {
                    "networkUuid": "fb9c21f4-0672-48b2-8279-77334bb63a53"
 },
  {
                    "networkUuid": "1e43f86f-4165-4f2e-8017-dd4cfb5548b0"
                }
            ],
         }
    ],
    "loadBalancer":{
         "type":"lb",
         "property":{
            "name":"default.load.balancer",
            "value":"true"
         }
    },
    "persistence": {
       "isRequired": "true",
       "volume" : [
                    {
                      "device": "/dev/sdc",
                      "mappingPath": "/home/ubuntu/sdc",
                      "size": "11",
                      "removeOnTermination": "false"
                    }
                    
                ]
               }
} 

For information on the parameter definitions, see Sample Cartridge Definition and Sample LB Definition.

Example

Use case: Deploy a PHP Cartridge. The example request is as follows:

 curl -X POST -H "Content-Type: application/json" -d @PHP-request -k -v -u admin:admin https://<SM_HOST>:9443/stratos/admin/cartridge/definition

Sample response

{
  "stratosAdminResponse": {
    "message": "Successfully deployed cartridge definition with type php"
  }
} 
  • No labels