Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
11.2. Create an Application
Create a new application. Note that if the specified domain does not exist when attempting to create an application, a domain is automatically created. See Section 7.1, “Create a Domain” for more information on how to create a domain.
Method | URL Structure |
---|---|
POST | /broker/rest/domain/:domain_name/applications |
Name | Description | Required | Default |
---|---|---|---|
name | Name of application | Yes | |
cartridges | Add cartridges to the application by specifying an array of one or more cartridges, using the name or unique ID | No | |
template | UUID of application template | No | |
scale | Mark application as scalable | No | false |
gear_size | Cartridge gear size | No | small |
initial_git_url | URL to Git source code repository that is the basis for this application | No | |
cartridges[][name] | Name of cartridge | No | |
cartridges[][gear_size] | Gear size of each individual cartridge. If gear_size is not specified, default gear size is used depending on user input | No | |
cartridges[][url] | URL to a downloadable cartridge; multiple URLs can be specified | No | |
environment_variables | Add or update application environment variables | No | |
region | Restrict the application to the specified region | No |
Note
curl -X POST https://openshift.redhat.com/broker/rest/domain/mydomain/applications --user user@example.com:password --data-urlencode name=myapp --data-urlencode cartridges=ruby-2.0 --data-urlencode scale=true --data-urlencode gear_size=small
$ curl -X POST https://openshift.redhat.com/broker/rest/domain/mydomain/applications --user user@example.com:password --data-urlencode name=myapp --data-urlencode cartridges=ruby-2.0 --data-urlencode scale=true --data-urlencode gear_size=small
gear_size
parameter is applied to all cartridges that are added to the specified application. However, the following cURL command example shows how to apply the gear_size
parameter to individual cartridges when adding multiple cartridges to an application.
curl -X POST https://openshift.redhat.com/broker/rest/domain/mydomain/applications --user user@example.com:password --data-urlencode name=mysecondapp --data-urlencode cartridges=[][name]=jbosseap-6 --data-urlencode cartridges[][gear_size]=medium --data-urlencode cartridges[][name]=mysql-5.5 --data-urlencode cartridges[][gear_size]=small
$ curl -X POST https://openshift.redhat.com/broker/rest/domain/mydomain/applications --user user@example.com:password --data-urlencode name=mysecondapp --data-urlencode cartridges=[][name]=jbosseap-6 --data-urlencode cartridges[][gear_size]=medium --data-urlencode cartridges[][name]=mysql-5.5 --data-urlencode cartridges[][gear_size]=small
The API returns information about the newly created application with related resource links which have been left out for brevity. See Chapter 11, Applications for more information on all application parameters.
Note