이 콘텐츠는 선택한 언어로 제공되지 않습니다.
13.2. Embedded Cartridges
Embedded cartridges are added to an OpenShift application to extend functionality. For example, a MySQL cartridge provides database support for an application.
13.2.1. Add Embedded Cartridge 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Description
Add an embedded cartridge to an application.
Method and URL Structure
Method | Resource URL |
---|---|
POST | /broker/rest/application/:id/cartridges |
Request Parameters
Name | Description | Required | Default |
---|---|---|---|
name | Name of cartridge; note that valid options may be different from those shown here | Yes | |
colocate_with | Component to colocate with | No | |
scales_from | Minimum number of gears to run component | No | |
scales_to | Maximum number of gears to run component | No | |
additional_storage | Additional GB of storage request on gears running this component | No | |
gear_size | Cartridge gear size | No | |
url | URL to a downloadable cartridge | No | |
environment_variables | Add or update application environment variables | No |
See Section A.7, “Cartridges” for more information about the valid options applicable to these request parameters.
Request
{ "name": "mysql-5.5", "colocate_with": "ruby-2.0", "gear_size": "small" }
{
"name": "mysql-5.5",
"colocate_with": "ruby-2.0",
"gear_size": "small"
}
cURL Command Example
curl -X POST https://openshift.redhat.com/broker/rest/application/534253991015616165707776/cartridges --user "user:Password" --data-urlencode name=mysql-5.5 --data-urlencode colocate_with=ruby-2.0 --data-urlencode gear_size=small
$ curl -X POST https://openshift.redhat.com/broker/rest/application/534253991015616165707776/cartridges --user "user:Password" --data-urlencode name=mysql-5.5 --data-urlencode colocate_with=ruby-2.0 --data-urlencode gear_size=small
JSON Response
The API returns the embedded cartridge resource. Unnecessary information and related resource links returned by the API have been removed for brevity. See Chapter 13, Cartridges for more information on all cartridge parameters.