이 콘텐츠는 선택한 언어로 제공되지 않습니다.

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

Expand
Method Resource URL
POST /broker/rest/application/:id/cartridges

Request Parameters

Expand
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"
}
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

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.

{
  "api_version": 1.6,
  "data": {
    "additional_gear_storage": 0,
    "base_gear_storage": 1,
    "collocated_with": [
      "ruby-2.0",
      "haproxy-1.4"
    ],
    "current_scale": 1,
    "description": "MySQL is a multi-user, multi-threaded SQL database server.",
    "display_name": "MySQL Database 5.5",
    "gear_profile": "small",
    "help_topics": {
    },
    "license": "GPL",
    "license_url": "",
    "name": "mysql-5.5",
    "properties": [
      {
        "name": "username",
        "type": "cart_data",
        "description": "Root user on mysql database",
        "value": "adminthGnHLU"
      },
      {
        "name": "password",
        "type": "cart_data",
        "description": "Password for root user on mysql database",
        "value": "dPFjWLrUjfxC"
      },
      {
        "name": "database_name",
        "type": "cart_data",
        "description": "MySQL DB name",
        "value": "myapp"
      },
      {
        "name": "connection_url",
        "type": "cart_data",
        "description": "MySQL DB connection URL",
        "value": "mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/"
      }
    ],
    "scales_from": 1,
    "scales_to": 1,
    "scales_with": "haproxy-1.4",
    "status_messages": null,
    "supported_scales_from": 1,
    "supported_scales_to": 1,
    "tags": [
      "service",
      "database",
      "embedded"
    ],
    "type": "embedded",
    "url": null,
    "usage_rates": [

    ],
    "version": "5.5",
    "website": "http://www.mysql.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Added mysql-5.5 to application myapp"
    },
    {
      "exit_code": 0,
      "field": null,
      "severity": "debug",
      "text": "\n\nmysql-5.5: Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT\n"
    },
Copy to Clipboard Toggle word wrap

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat