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

11.2. Create an Application


Description

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 and URL Structure

Expand
Method URL Structure
POST /broker/rest/domain/:domain_name/applications

Request Parameters

Expand
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

Valid cartridge options may be different based on your OpenShift Enterprise deployment.

See Section A.6, “Applications” for more information about the valid options applicable to these request parameters.
Request

{
  "name": "myapp",
  "cartridges": "ruby-2.0",
  "scale": "true",
  "gear_size": "small",
  "initial_git_url": ""
}
Copy to Clipboard Toggle word wrap

cURL Command Example

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

In the previous cURL command example, the 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
Copy to Clipboard Toggle word wrap
JSON Response

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.

{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapp-mydomain.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-21T01:58:41Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      }
    },
    "framework": "ruby-2.0",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://534253991015616165707776@myapp-mydomain.rhcloud.com/~/git/myapp.git/",
    "health_check_path": "health",
    "id": "534253991015616165707776",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "5213a826e499b22f15000001",
        "name": "user@example.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapp",
    "scalable": true,
    "ssh_url": "ssh://534253991015616165707776@myapp-mydomain.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Application myapp was created."
    },
    {
      "exit_code": 0,
      "field": null,
      "severity": "warning",
      "text": "HAProxy instance is started\n"
    }
  ],
  "status": "created",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6,
    1.7
  ],
  "type": "application",
  "version": "1.7"
}
Copy to Clipboard Toggle word wrap

Note

An application may not be immediately available after it is created. Therefore, ensure the application DNS resolves correctly before executing other REST API calls to that application.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

Theme

© 2025 Red Hat