REST API Documentation version 1.6

Resources

Api
User
Key
Authorization
Domain
Member
Application
Cartridge
Alias
Environment variable
Gear group
Descriptor

Api

Authentication

The OpenShift API uses Basic Authentication. A client is required to send the username and password, separated by a colon, with all requests to correctly authenticate. For example, send the credentials as username:password. This string is encoded with Base64 algorithm, and transmitted in the HTTP authorization header in the formats shown below.

Using Ruby

  require 'base64'
  base64string = Base64.encode64("#{username}:#{password}").strip
  headers = { "Authorization" => "Basic #{base64string}" }

Using Python

  import base64
  base64string = base64.encodestring('%s:%s' % (username, password))[:-1]
  request.add_header("Authorization", "Basic %s" % base64string)

Using cURL

The cURL library supports basic authentication using the --user or -u option, as shown in the example below.
  $ curl -k https://openshift.redhat.com/broker/rest/user --user "user@myemail.com:password"

API Response

Each response from the REST API contains te following information
NameDescription
statusHTTP status text e.g. ok, not_found, etc
dataThe data requested from the API (may be null in cases where there is no data to return)
typeThe type of data e.g. application, cartridge, etc (may be null in cases where there is no data)
messagesAn Array of messages returned to the client (See API Messages)
API versionThe API version requested by client and returned by the API. The version defaults to latest if the client does not specify a version (See Version)
supported API versionsAn Array of supported API versions

API Messages

Each response from the REST API may contain 0 or more messages.
NameDescription
severityThe severity of the message e.g. debug, info, warning, error or result
textThe text of the message
fieldIndicates that the message is relevant to a particual field in the resource. Used for validation errors. May be null.
exit codeExit code returned from API (0 if everyhting is ok)

Note: Messages with severity=result contain information that should be passed on to the user. For example the database username and password.

API Version

Every OpenShift REST API call returns the current API version, and other versions that are supported.
For example:
{
  "supported_api_versions": [
   1.0,
   1.1,
   1.2,
   1.3,
   1.4
  ],
  "api_version": 1.5
}
To request a specific API version, the client must include a HTTP header with the request.
  JSON Clients       Accept: application/json; version=1.4
 
  XML Clients        Accept: application/xml; version=1.4
If the version requested by the client is not supported, the server responds with the HTTP status code 406, as shown below.
{
  "messages": [
    {
      "field": null,
      "severity": "error",
      "text": "Requested API version 2.0 is not supported. Supported versions are 1.0, 1.1, 1.2, 1.3, 1.4"
    }
  ],
  "status": "not_acceptable",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4
  ],
  "api_version": 1.4
}

Response Type

Although OpenShift supports both XML and JSON response formats, the default server response is in JSON. To receive the response in XML, send the following HTTP header with your request:
  Accept: application/xml
Example using cURL
  $ curl -k "https://openshift.redhat.com/broker/rest/api" -H "Accept: application/xml"

Links

The OpenShift REST API implements the Hypermedia as the Engine of Application State, or HATEOAS, design principle of the REST application architecture. This principle implies that the interaction between a client and a network application happens entirely through links provided dynamically by the application server. No prior knowledge, beyond a generic understanding of REST and HTTP protocol, is required from the REST client on how to interact with any particular application or server. Entry to the REST application by a REST client is through a simple fixed URL. All future actions the client takes are discovered within resource representations returned from the server. The client selects the links within these resources to navigate to the required resource.

Each resource returned by the OpenShift REST API will have an array of relevant links embedded in it. Each link has the following attributes:
nameDescription
methodHTTP method to use with resource link: GET, PUT, POST or DELETE
hrefThe full URI for the resource
required parametersAn Array of input parameters that the client is required to provide
optional parametersAn Array of optional input parameters

Each required input parameter has the following attributes:
NameDescription
nameThe name of the parameter
typeThe type of the paramater e.g. String, Integer, Array or Boolean
descriptionA brief description of the paramater
valid optionsAn Array of valid values (May be empty)
invalid optionsAn Array of invalid values (May be empty)

Each optional input parameter has the following attributes:
NameDescription
nameThe name of the parameter
typeThe type of the paramater e.g. String, Integer, Array or Boolean
descriptionA brief description of the paramater
valid optionsAn Array of valid values (May be empty)
default valueThe value this parameter defaults to if not provided by the client

Note: The links can be excluded from the API response by passing nolinks=true to any API call.

HTTP Status Codes

The OpenShift REST API attempts to return standard HTTP status codes, with the more common status codes shown in the table below along with a brief description of each.

Code Text Description
200 OK Standard response for successful HTTP requests.
201 Created The resource was successfully created.
204 No content The requested delete operation was successful.
301 Moved Permanently The resource has moved, and all future requests should be made to the new URI.
400 Bad Request Invalid request due to bad syntax.
401 Unauthorized Authentication has failed, or was not provided.
403 Forbidden The request is understood, but server is refusing to respond.
404 Not Found The requested resource cannot be found.
406 Not Acceptable The content from the requested resource is not acceptable according to the Accept headers. Possibly due to version requested, or it no longer being supported.
409 Conflict The request could not be processed because of conflict in the request.
410 Gone The resource is no longer available, and will not be available again.
422 Unprocessable Entity The request was well formed, but was not followed due to semantic errors.
500 Internal Server Error A generic error message when something is broken.
502 Bad Gateway Server was acting as a gateway or proxy, and received an invalid response.
503 Service Unavailable The server is currently unavailable; possibly down for maintenance.
504 Gateway Timeout The server was acting as a gateway or proxy and did not receive a timely response.

Api entry point

GET /broker/rest/api
Response
{
  "api_version": 1.6,
  "data": {
    "API": {
      "href": "https://openshift.redhat.com/broker/rest/api",
      "method": "GET",
      "optional_params": [

      ],
      "rel": "API entry point",
      "required_params": [

      ]
    },
    "GET_ENVIRONMENT": {
      "href": "https://openshift.redhat.com/broker/rest/environment",
      "method": "GET",
      "optional_params": [

      ],
      "rel": "Get environment information",
      "required_params": [

      ]
    },
    "GET_USER": {
      "href": "https://openshift.redhat.com/broker/rest/user",
      "method": "GET",
      "optional_params": [

      ],
      "rel": "Get user information",
      "required_params": [

      ]
    },
    "ADD_DOMAIN": {
      "href": "https://openshift.redhat.com/broker/rest/domains",
      "method": "POST",
      "optional_params": [

      ],
      "rel": "Create new domain",
      "required_params": [
        {
          "description": "Name of the domain",
          "invalid_options": [
            "amentra",
            "aop",
            "apiviz",
            "arquillian",
            "blacktie",
            "boxgrinder",
            "byteman",
            "cirras",
            "cloud",
            "cloudforms",
            "cygwin",
            "davcache",
            "dogtag",
            "drools",
            "drools",
            "ejb3",
            "errai",
            "esb",
            "fedora",
            "freeipa",
            "gatein",
            "git",
            "gfs",
            "gravel",
            "guvnor",
            "hibernate",
            "hornetq",
            "iiop",
            "infinispan",
            "ironjacamar",
            "javassist",
            "jbcaa",
            "jbcd",
            "jboss",
            "jbpm",
            "jdcom",
            "jgroups",
            "jmx",
            "jopr",
            "jrunit",
            "jsfunit",
            "kosmos",
            "liberation",
            "makara",
            "mass",
            "maven",
            "metaji...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/api 

User

This resource provides information that allow a client to manage OpenShift user account information.
The table below describes each parameter associated with a user account.
NameDescription
capabilities Map of user capabilities. See the table below for user capabilities.
consumed_gears Total number of gears consumed by all applications owned by user.
login Account user name.
max_gears Maximum number of gears available to the specified user.
plan_id Subscription plan of the specified user.
plan_state State of the account for the specified user.

The table below further describes each available capability for the user.
NameDescription
plan_upgrade_enabled Indicates whether the user is on an upgraded plan.
subaccounts Indicates whether the user has the ability to create subaccounts.
gear_sizes Available gear sizes depending on the type of plan.
max_storage_per_gear Maximum storage in gigabytes available per gear to the specified user.
private_ssl_certificatesWhether the user can add their own private SSL certificates

Get user information

GET /broker/rest/user
Response
{
  "api_version": 1.6,
  "data": {
    "capabilities": {
      "subaccounts": false,
      "gear_sizes": [
        "small"
      ],
      "plan_upgrade_enabled": true,
      "private_ssl_certificates": true,
      "max_storage_per_gear": 20
    },
    "consumed_gears": 0,
    "created_at": "2013-08-27T00:51:15Z",
    "id": "521bf803656c674541000001",
    "login": "first.last@mycompany.com",
    "max_gears": 3,
    "plan_id": "free",
    "plan_state": "ACTIVE",
    "usage_account_id": null
  },
  "messages": [

  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "user",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/user

Key

This resource provides information that allows a client to view and manage SSH keys.
The table below describes each parameter associated with SSH keys.
NameDescription
nameName of the SSH key as specific by the user.
contentContent of the public SSH key.
typeType of SSH key; for example, RSA or DSA.

Add new ssh key

POST /broker/rest/user/keys
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
nameName of the keyYesN/A
typeType of Key
Note: Valid options may be different on your actual implementation of OpenShift.
Yesssh-rsa, ssh-dss, ssh-rsa-cert-v01@openssh.com, ssh-dss-cert-v01@openssh.com, ssh-rsa-cert-v00@openssh.com, ssh-dss-cert-v00@openssh.comN/A
contentThe key portion of an rsa key (excluding ssh-rsa and comment)YesN/A
Request
{
  "name": "mykey",
  "type": "ssh-rsa",
  "content": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDBJHobjmzxy8cv9A1xw9X5TlnQd0bW/19FwOC0c6jPNu9ZbtWQcAE0xfODl7ZqVPPU2qAFOh4rbL3gL2UzTyA+NwERyDrH7tMXAoXPT2L6sqExl0xxuEvb/lXUfLquMq+BMOFxxqCEg8X7GavHN72FMUHwweNybE7C82So+OFSWqFoctiWMNdNsKW4lvBd/jkIudGdRdK+/PzV75TW1LcpfsBrFOJZbd5WzDJEPNdMqOH68YDExD82VtzeJm0HEavhMY9HtxIDEmjIhtfedzCGZLe+6OxReuatw6M+n1sFxT9liprZ6NIANvbnYZKGT50hYfnIi/hZOTCvqYNS97O3"
}
Response
{
  "api_version": 1.6,
  "data": {
    "content": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDBJHobjmzxy8cv9A1xw9X5TlnQd0bW/19FwOC0c6jPNu9ZbtWQcAE0xfODl7ZqVPPU2qAFOh4rbL3gL2UzTyA+NwERyDrH7tMXAoXPT2L6sqExl0xxuEvb/lXUfLquMq+BMOFxxqCEg8X7GavHN72FMUHwweNybE7C82So+OFSWqFoctiWMNdNsKW4lvBd/jkIudGdRdK+/PzV75TW1LcpfsBrFOJZbd5WzDJEPNdMqOH68YDExD82VtzeJm0HEavhMY9HtxIDEmjIhtfedzCGZLe+6OxReuatw6M+n1sFxT9liprZ6NIANvbnYZKGT50hYfnIi/hZOTCvqYNS97O3",
    "name": "mykey",
    "type": "ssh-rsa"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Created SSH key mykey"
    }
  ],
  "status": "created",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "key",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/user/keys  --data-urlencode name=mykey  --data-urlencode type=ssh-rsa  --data-urlencode content=AAAAB3NzaC1yc2EAAAADAQABAAABAQDBJHobjmzxy8cv9A1xw9X5TlnQd0bW/19FwOC0c6jPNu9ZbtWQcAE0xfODl7ZqVPPU2qAFOh4rbL3gL2UzTyA+NwERyDrH7tMXAoXPT2L6sqExl0xxuEvb/lXUfLquMq+BMOFxxqCEg8X7GavHN72FMUHwweNybE7C82So+OFSWqFoctiWMNdNsKW4lvBd/jkIudGdRdK+/PzV75TW1LcpfsBrFOJZbd5WzDJEPNdMqOH68YDExD82VtzeJm0HEavhMY9HtxIDEmjIhtfedzCGZLe+6OxReuatw6M+n1sFxT9liprZ6NIANvbnYZKGT50hYfnIi/hZOTCvqYNS97O3 

List ssh keys

GET /broker/rest/user/keys
Response
{
  "api_version": 1.6,
  "data": [

  ],
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Found 0 ssh keys"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "keys",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/user/keys 

Get ssh key

GET /broker/rest/user/keys/:name
Response
{
  "api_version": 1.6,
  "data": {
    "content": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDBJHobjmzxy8cv9A1xw9X5TlnQd0bW/19FwOC0c6jPNu9ZbtWQcAE0xfODl7ZqVPPU2qAFOh4rbL3gL2UzTyA+NwERyDrH7tMXAoXPT2L6sqExl0xxuEvb/lXUfLquMq+BMOFxxqCEg8X7GavHN72FMUHwweNybE7C82So+OFSWqFoctiWMNdNsKW4lvBd/jkIudGdRdK+/PzV75TW1LcpfsBrFOJZbd5WzDJEPNdMqOH68YDExD82VtzeJm0HEavhMY9HtxIDEmjIhtfedzCGZLe+6OxReuatw6M+n1sFxT9liprZ6NIANvbnYZKGT50hYfnIi/hZOTCvqYNS97O3",
    "name": "mykey",
    "type": "ssh-rsa"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Found SSH key 'mykey'"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "key",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/user/keys/mykey

Update ssh key

PUT /broker/rest/user/keys/:name
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
typeType of Key
Note: Valid options may be different on your actual implementation of OpenShift.
Yesssh-rsa, ssh-dss, ssh-rsa-cert-v01@openssh.com, ssh-dss-cert-v01@openssh.com, ssh-rsa-cert-v00@openssh.com, ssh-dss-cert-v00@openssh.comN/A
contentThe key portion of an rsa key (excluding ssh key type and comment)YesN/A
Request
{
  "type": "ssh-rsa",
  "content": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDBJHobjmzxy8cv9A1xw9X5TlnQd0bW/19FwOC0c6jPNu9ZbtWQcAE0xfODl7ZqVPPU2qAFOh4rbL3gL2UzTyA+NwERyDrH7tMXAoXPT2L6sqExl0xxuEvb/lXUfLquMq+BMOFxxqCEg8X7GavHN72FMUHwweNybE7C82So+OFSWqFoctiWMNdNsKW4lvBd/jkIudGdRdK+/PzV75TW1LcpfsBrFOJZbd5WzDJEPNdMqOH68YDExD82VtzeJm0HEavhMY9HtxIDEmjIhtfedzCGZLe+6OxReuatw6M+n1sFxT9liprZ6NIANvbnYZKGT50hYfnIi/hZOTCvqYNS97O3"
}
Response
{
  "api_version": 1.6,
  "data": {
    "content": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDBJHobjmzxy8cv9A1xw9X5TlnQd0bW/19FwOC0c6jPNu9ZbtWQcAE0xfODl7ZqVPPU2qAFOh4rbL3gL2UzTyA+NwERyDrH7tMXAoXPT2L6sqExl0xxuEvb/lXUfLquMq+BMOFxxqCEg8X7GavHN72FMUHwweNybE7C82So+OFSWqFoctiWMNdNsKW4lvBd/jkIudGdRdK+/PzV75TW1LcpfsBrFOJZbd5WzDJEPNdMqOH68YDExD82VtzeJm0HEavhMY9HtxIDEmjIhtfedzCGZLe+6OxReuatw6M+n1sFxT9liprZ6NIANvbnYZKGT50hYfnIi/hZOTCvqYNS97O3",
    "name": "mykey",
    "type": "ssh-rsa"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Updates SSH key mykey for user first.last@mycompany.com"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "key",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X PUT -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/user/keys/mykey  --data-urlencode type=ssh-rsa  --data-urlencode content=AAAAB3NzaC1yc2EAAAADAQABAAABAQDBJHobjmzxy8cv9A1xw9X5TlnQd0bW/19FwOC0c6jPNu9ZbtWQcAE0xfODl7ZqVPPU2qAFOh4rbL3gL2UzTyA+NwERyDrH7tMXAoXPT2L6sqExl0xxuEvb/lXUfLquMq+BMOFxxqCEg8X7GavHN72FMUHwweNybE7C82So+OFSWqFoctiWMNdNsKW4lvBd/jkIudGdRdK+/PzV75TW1LcpfsBrFOJZbd5WzDJEPNdMqOH68YDExD82VtzeJm0HEavhMY9HtxIDEmjIhtfedzCGZLe+6OxReuatw6M+n1sFxT9liprZ6NIANvbnYZKGT50hYfnIi/hZOTCvqYNS97O3 

Delete ssh key

DELETE /broker/rest/user/keys/:name
Response
{
  "api_version": 1.6,
  "data": null,
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Deleted SSH key mykey"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": null,
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X DELETE -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/user/keys/mykey

Authorization

This chapter provides information on API resources to add, view, and manage authorization tokens. An authorization token is a secret value that allows access to an OpenShift account without having to supply login information each time. An authorization token can also be used to grant another user access to your account. Authorization tokens use scopes to determine the type of access a user is granted and what they can do with that token; for example full access versus limited access. Authorization tokens are easily managed, and offer better security because you are not repeatedly supplying your login credentials. For example, if your password is ever compromised, the password must be reset. If a secret authorization token is compromised, that token can be revoked and another one created. The table below describes each parameter associated with an OpenShift authorization token.
NameDescription
idUnique OpenShift login that created this authorization token.
scopeScope of the authorization token to determine type of access. Scopes that are supported by a server are described in the ADD_AUTHORIZATION resource link and may be different for each server.
noteA reminder description of what the authorization is for.
expires_inTotal time in seconds before this authorization expires. Out of range values will be set to the maximum allowed time.
expires_in_secondsRemaining time in seconds before this authorization expires.
reuseAttempt to locate and reuse an authorization that matches the scope and note and has not yet expired.
tokenAuthorization string that contains user credentials.
The table below describes the available scope options that determine the type of access a user is granted with an authorization.
NameDescription
sessionEquivalent of logging into an account with normal login credentials such as user name and password.
readAccess to the API is read-only, while authorization endpoints cannot be read.
userinfoOnly read access to the /user API resource is provided.

List authorizations

GET /broker/rest/user/authorizations
Response
{
  "api_version": 1.6,
  "data": [

  ],
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "List authorizations"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "authorizations",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/user/authorizations 

Add new authorization

POST /broker/rest/user/authorizations
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
scopeSelect one or more scopes that this authorization will grant access to:

* session
Grants a client the authority to perform all API actions against your account. Valid for 1 day.
* read
Allows the client to access resources you own without making changes. Does not allow access to view authorization tokens. Valid for about 1 month.
* userinfo
Allows a client to view your login name, unique id, and your user capabilities. Valid for about 1 month.
* domain/:id/view
Grant read-only access to a single domain. Valid for about 1 month.
* domain/:id/edit
Grant edit access to a single domain and all its applications. Valid for about 1 month.
* domain/:id/admin
Grant full administrative access to a single domain and all its applications. Valid for about 1 month.
* application/:id/view
Grant read-only access to a single application. Valid for about 1 month.
* application/:id/edit
Grant edit access to a single application. Valid for about 1 month.
* application/:id/admin
Grant full administrative access to a single application. Valid for about 1 month.
Note: Valid options may be different on your actual implementation of OpenShift.
Nosession, read, userinfo, domain/:id/view, domain/:id/edit, domain/:id/admin, application/:id/view, application/:id/edit, application/:id/adminuserinfo
noteA description to remind you what this authorization is for.No
expires_inThe number of seconds before this authorization expires. Out of range values will be set to the maximum allowed time.No-1
reuseAttempt to locate and reuse an authorization that matches the scope and note and has not yet expired.Notrue, falsefalse
Request
{
  "scope": "userinfo",
  "note": "This is my UPDATED note to myself",
  "expires_in": -1,
  "reuse": false
}
Response
{
  "api_version": 1.6,
  "data": {
    "created_at": "2013-08-27T00:55:20Z",
    "expires_in": 2592000,
    "expires_in_seconds": 2592000,
    "id": "521bf8f8656c67454100009d",
    "identity": "first.last@mycompany.com",
    "note": "This is my UPDATED note to myself",
    "scopes": "userinfo",
    "token": "e8b028f2579c069ac033e5c162dfaf73302a3e51c1e69925e60bdb959e9b8bcf"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Create authorization"
    }
  ],
  "status": "created",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "authorization",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/user/authorizations  --data-urlencode scope=userinfo  --data-urlencode note=This is my UPDATED note to myself  --data-urlencode expires_in=-1  --data-urlencode reuse=false 

Get authorization

GET /broker/rest/user/authorizations/:id
Response
{
  "api_version": 1.6,
  "data": {
    "created_at": "2013-08-27T00:55:20Z",
    "expires_in": 2592000,
    "expires_in_seconds": 2592000,
    "id": "521bf8f8656c67454100009d",
    "identity": "first.last@mycompany.com",
    "note": "This is my UPDATED note to myself",
    "scopes": "userinfo",
    "token": "e8b028f2579c069ac033e5c162dfaf73302a3e51c1e69925e60bdb959e9b8bcf"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Display authorization"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "authorization",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/user/authorizations/521bf8f8656c67454100009d

Update authorization

PUT /broker/rest/user/authorizations/:id
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
noteA note to remind you what this token is for.YesN/A
Request
{
  "note": "This is a note to myself"
}
Response
{
  "api_version": 1.6,
  "data": {
    "created_at": "2013-08-27T00:55:20Z",
    "expires_in": 2592000,
    "expires_in_seconds": 2592000,
    "id": "521bf8f8656c67454100009d",
    "identity": "first.last@mycompany.com",
    "note": "This is a note to myself",
    "scopes": "userinfo",
    "token": "e8b028f2579c069ac033e5c162dfaf73302a3e51c1e69925e60bdb959e9b8bcf"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Change authorization"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "authorization",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X PUT -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/user/authorizations/521bf8f8656c67454100009d  --data-urlencode note=This is a note to myself 

Delete authorization

DELETE /broker/rest/user/authorizations/:id
Response
{
  "api_version": 1.6,
  "data": null,
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Authorization 521bf8f8656c67454100009d is revoked."
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": null,
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X DELETE -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/user/authorizations/521bf8f8656c67454100009d

Domain

This chapter provides information on API resources to add, update, and manage OpenShift user domains. A domain must be created before an OpenShift application can be created. Domain names on OpenShift are non-strict, meaning there is no preceding period, and form part of the application name. Therefore, the syntax for the application name is ApplicationName–DomainName.DomainSuffix. Each username can only support a single domain, but multiple applications can be created within a domain.
The table below describes each parameter associated with an OpenShift domain.
NameDescription
nameThe name of the domain
suffixDomain suffix

Create new domain

POST /broker/rest/domains
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
nameName of the domainYesN/A
Request
{
  "name": "mydomain"
}
Response
{
  "api_version": 1.6,
  "data": {
    "allowed_gear_sizes": [
      "small"
    ],
    "creation_time": "2013-08-27T00:51:35Z",
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "owner",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "mydomain",
    "suffix": "dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Created domain with name mydomain"
    }
  ],
  "status": "created",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "domain",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/domains  --data-urlencode name=mydomain 

List all domains you have access to

GET /broker/rest/domains
Response
{
  "api_version": 1.6,
  "data": [

  ],
  "messages": [

  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "domains",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/domains 

List domains

GET /broker/rest/domains
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
ownerReturn only the domains owned by the specified user id or identity. Use @self to refer to the current user.Yes@self, *N/A
Request
{
  "owner": "@self"
}
Response
{
  "api_version": 1.6,
  "data": [

  ],
  "messages": [

  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "domains",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/domains  --data-urlencode owner=@self 

Get domain

GET /broker/rest/domains/:name
Response
{
  "api_version": 1.6,
  "data": {
    "allowed_gear_sizes": [
      "small"
    ],
    "creation_time": "2013-08-27T00:51:35Z",
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "owner",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "mydomain",
    "suffix": "dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Found domain mydomain"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "domain",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/domains/mydomain

Update domain

PUT /broker/rest/domains/:name
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
nameName of the domainYesN/A
allowed_gear_sizesArray of zero or more gear sizes allowed on this domainNo
Request
{
  "name": "mydomainX"
}
Response
{
  "api_version": 1.6,
  "data": {
    "allowed_gear_sizes": [
      "small"
    ],
    "creation_time": "2013-08-27T00:51:35Z",
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "owner",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "mydomainx",
    "suffix": "dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Updated domain mydomainx"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "domain",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X PUT -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/domains/mydomain  --data-urlencode name=mydomainX 

Delete domain

DELETE /broker/rest/domains/:name
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
forceForce delete domain. i.e. delete any applications under this domainNotrue, falsefalse
Response
{
  "api_version": 1.6,
  "data": null,
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Domain mydomainx deleted."
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": null,
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X DELETE -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/domains/mydomain

Member

TODO: Describe members here

List members of this domain

GET /broker/rest/domains/:name/members
Response
{
  "api_version": 1.6,
  "data": [
    {
      "explicit_role": null,
      "from": [
        {
          "type": "owner",
          "role": "admin"
        }
      ],
      "id": "521bf803656c674541000001",
      "name": "first.last@mycompany.com",
      "owner": true,
      "role": "admin",
      "type": "user"
    }
  ],
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Found 1 member."
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "members",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/domains/mydomain/members 

Add one or more members to this domain

POST /broker/rest/domains/:name/members
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
roleThe role the user should have on the domainYesview, edit, adminN/A
idUnique identifier of the userNo
loginThe user's login attributeNo
Request
{
  "role": "view",
  "login": "team.member@mycompany.com"
}
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/domains/mydomain/members  --data-urlencode role=view  --data-urlencode login=team.member@mycompany.com 

List members of this application

GET /broker/rest/applications/:id/members
Response
{
  "api_version": 1.6,
  "data": [
    {
      "explicit_role": null,
      "from": [
        {
          "type": "domain",
          "role": "admin"
        }
      ],
      "id": "521bf803656c674541000001",
      "name": "first.last@mycompany.com",
      "owner": true,
      "role": "admin",
      "type": "user"
    }
  ],
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Found 1 member."
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "members",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/members 

Application

This resource provides information that allow a client to create and manage OpenShift applications. OpenShift supports a number of application frameworks, such as PHP, JBoss, and Ruby. The table below describes each parameter associated with an OpenShift application.
NameDescription
nameName of the application.
frameworkApplication framework. For example, JBoss, PHP, or Ruby.
domain_idThe domain ID of the application.
embeddedList of cartridges that have been added to this application.
creation_timeTime the application was created.
scalableWhether application is scaled or not scaled. The values are either true or false.
gear_countNumber of gears for this application.
gear_profileThe gear size for this application. For example, small.
aliasesApplication server aliases, if applicable.
app_urlThe URL to access this application.
git_urlThe URL to access the Git repository for this application.
ssh_urlThe URL to access this application using an SSH terminal.
health_check_pathThe URL to check if the application is running.
uuidUnique identifier for this application.
initial_git_urlThe URL that was used to initialize the Git repository for this application

List application

GET /broker/rest/applications
Response
{
  "api_version": 1.6,
  "data": [

  ],
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Found 0 applications."
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "applications",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications 

Create new application

POST /broker/rest/domains/:name/applications
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
nameName of the applicationYesN/A
cartridgesArray of one or more cartridge names
Note: Valid options may be different on your actual implementation of OpenShift.
Nonodejs-0.6, python-3.3, python-2.7, python-2.6, zend-5.6, ruby-1.9, ruby-1.8, jenkins-1, jbossews-2.0, jbossews-1.0, mock-0.2, mock-0.1, perl-5.10, php-5.3, jbosseap-6, diy-0.1, jbossas-7
scaleMark application as scalableNotrue, falsefalse
gear_sizeThe size of the gearNosmallsmall
initial_git_urlA URL to a Git source code repository that will be the basis for this application.No, empty
cartridges[][url]A URL to a downloadable cartridge. You may specify an multiple urls via {'cartridges' : [{'url':'http://...'}, ...]}No
environment_variablesAdd or Update application environment variables, e.g.:[{'name':'FOO', 'value':'123'}, {'name':'BAR', 'value':'abc'}]No
Request
{
  "name": "myapplication",
  "cartridges": "ruby-1.9",
  "scale": "true",
  "gear_size": "small",
  "initial_git_url": ""
}
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Application myapplication was created."
    }
  ],
  "status": "created",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/domains/mydomain/applications  --data-urlencode name=myapplication  --data-urlencode cartridges=ruby-1.9  --data-urlencode scale=true  --data-urlencode gear_size=small  --data-urlencode initial_git_url= 

List applications for a domain

GET /broker/rest/domains/:name/applications
Response
{
  "api_version": 1.6,
  "data": [

  ],
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Found 0 applications."
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "applications",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/domains/mydomain/applications 

Get application

GET /broker/rest/applications/:id
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Application 'myapplication' found"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001

Start application

POST /broker/rest/applications/:id/events
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
eventeventYesstartN/A
Request
{
  "event": "start"
}
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Application myapplication has started"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/events  --data-urlencode event=start 

Stop application

POST /broker/rest/applications/:id/events
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
eventeventYesstopN/A
Request
{
  "event": "stop"
}
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Application myapplication has stopped"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/events  --data-urlencode event=stop 

Force stop application

POST /broker/rest/applications/:id/events
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
eventeventYesforce-stopN/A
Request
{
  "event": "force-stop"
}
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Application myapplication has forcefully stopped"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/events  --data-urlencode event=force-stop 

Restart application

POST /broker/rest/applications/:id/events
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
eventeventYesrestartN/A
Request
{
  "event": "restart"
}
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Application myapplication has restarted"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/events  --data-urlencode event=restart 

Scale up application

POST /broker/rest/applications/:id/events
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
eventeventYesscale-upN/A
Request
{
  "event": "scale-up"
}
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 2,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Application myapplication has scaled up"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/events  --data-urlencode event=scale-up 

Scale down application

POST /broker/rest/applications/:id/events
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
eventeventYesscale-downN/A
Request
{
  "event": "scale-down"
}
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Application myapplication has scaled down"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/events  --data-urlencode event=scale-down 

Tidy the application framework

POST /broker/rest/applications/:id/events
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
eventeventYestidyN/A
Request
{
  "event": "tidy"
}
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Application myapplication called tidy"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/events  --data-urlencode event=tidy 

Reload the application

POST /broker/rest/applications/:id/events
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
eventeventYesreloadN/A
Request
{
  "event": "reload"
}
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Application myapplication called reload"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/events  --data-urlencode event=reload 

Trigger thread dump

POST /broker/rest/applications/:id/events
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
eventeventYesthread-dumpN/A
Request
{
  "event": "thread-dump"
}
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": ""
    },
    {
      "exit_code": 0,
      "field": null,
      "severity": "result",
      "text": "Success\nThe thread dump file will be available via: rhc tail myapplication -f /var/lib/openshift/521bf818656c67309c000001/ruby//logs//error_log-20130827-* -o '-n 250'\n"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/events  --data-urlencode event=thread-dump 

Resolve dns

GET /broker/rest/applications/:id/dns_resolvable
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/dns_resolvable 

Delete application

DELETE /broker/rest/applications/:id
Response
{
  "api_version": 1.6,
  "data": null,
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Application 521bf818656c67309c000001 is deleted."
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": null,
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X DELETE -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001

Cartridge

This chapter provides information on API resources that allow a client to manage OpenShift cartridges. Cartridges are the components of an OpenShift application, and include databases, build systems, and management capabilities. Adding a cartridge to an application provides the desired capability without requiring you to administer or update the included feature. T here are two types of cartridges available with OpenShift: standalone and embedded.

Standalone Cartridges

Standalone cartridges allow you to choose from a variety of programming languages and frameworks for developing your application. Every application requires a framework cartridge. Examples include PHP, JBoss, and Ruby. The table below describes each parameter associated with both standalone and embedded cartridges.
NameDescription
nameName of the cartridge.
versionVersion of the packaged software in the cartridge.
licenseLicense of the packaged software in the cartridge.
license_urlURL of the license file for the packaged software in the cartridge.
websiteWebsite URL for the packaged software in the cartridge.
help_topicsMap of topics and associated URLs that can provide help on how to use and configure the cartridge.
display_nameFormatted name of the cartridge for user interfaces.
descriptionDescription of the cartridge for user interfaces.
current_scaleCurrent number of gears used to run the cartridge.
scales_fromMinimum number of gears that a cartridge can scale to; once reached, scale_down requests are rejected. Cannot be less than the supported_scales_from value.
scales_toMaximum number of gears that a cartridge can scale to; once reached, scale_up requests are rejected. Cannot be greater than the supported_scales_to value.
scales_withNames of other cartridges that scale with this cartridge and run on the same set of gears; currently only HAProxy-1.4 is available.
supported_scales_fromMinimum number of gears supported by the cartridge; the scales_from value cannot be less than this number.
supported_scales_toMaximum number of gears supported by the cartridge; the scales_to value cannot be greater than this number.
tagsArray of tags associated with the cartridge.
usage_ratesPlan usage costs.
status_messagesStatus messages returned back by the cartridge.

Embedded Cartridges


Embedded cartridges provide extended functionality to OpenShift applications. Examples include MySQL, MongoDB, and phpMyAdmin. The table below describes each parameter associated with only embedded cartridges.
NameDescription
additional_gear_storageSet additional filesystem storage in gigabytes for the gear profile that the cartridge is running on.
base_gear_storageDefault basic storage in gigabytes associated with the gear profile that the cartridge is running on.
collocated_withArray of names of other cartridges that share the same gear(s) with the cartridge.
gear_profileSize of the gears grouped in this profile that the cartridge is running on; all gears in a group will have the same gear_profile.
propertiesList of environment variables and property values exposed by the cartridge and usable in application code.

List cartridges

GET /broker/rest/cartridges
Response
{
  "api_version": 1.6,
  "data": [
    {
      "current_scale": 0,
      "description": "A mock plugin cartridge for development use only.",
      "display_name": "Mock Plugin Cartridge 0.1",
      "help_topics": {
      },
      "license": "ASL 2.0",
      "license_url": "",
      "name": "mock-plugin-0.1",
      "scales_from": 1,
      "scales_to": 1,
      "supported_scales_from": 1,
      "supported_scales_to": 1,
      "tags": [
        "service",
        "database",
        "embedded"
      ],
      "type": "embedded",
      "usage_rates": [

      ],
      "version": "0.1",
      "website": ""
    },
    {
      "current_scale": 0,
      "description": "The Cron cartridge allows you to run command line programs at scheduled times. Use this for background jobs and periodic processing.",
      "display_name": "Cron 1.4",
      "help_topics": {
        "Getting Started Guide": "https://www.openshift.com/blogs/getting-started-with-cron-jobs-on-openshift"
      },
      "license": "ASL 2.0",
      "license_url": "http://www.apache.org/licenses/LICENSE-2.0.txt",
      "name": "cron-1.4",
      "scales_from": 1,
      "scales_to": 1,
      "supported_scales_from": 1,
      "supported_scales_to": 1,
      "tags": [
        "embedded"
      ],
      "type": "embedded",
      "usage_rates": [

      ],
      "version": "1.4",
      "website": "http://www.openshift.com/"
    },
    {
      "current_scale": 0,
      "description": "Web based MySQL admin tool. Requires the MySQL cartridge to be installed first.",
      "display_name": "phpMyAdmin 4",
      "help_topics": {
      },
      "license": "GPLv2",
      "license_url": "",
      "name": "phpmyadmin-4",
      "scales_from": 1,
      "scales_to": 1,
      "supported_scales_from": 1,
      "supported_scales_to": 1,
      "tags": [
        "embedded"
      ],
      "type": "embedded",
      "usage_rates": [

      ],
      "version": "3",
      "website": "http://www.phpmyadmin.net/"
    },
    {
      "current_sc...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/cartridges 

Add embedded cartridge

POST /broker/rest/applications/:id/cartridges
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
nameName of the cartridge, e.g. mongodb-2.2
Note: Valid options may be different on your actual implementation of OpenShift.
Yesmock-plugin-0.1, cron-1.4, phpmyadmin-4, rockmongo-1.1, switchyard-0, metrics-0.1, 10gen-mms-agent-0.1, mysql-5.1, haproxy-1.4, postgresql-9.2, postgresql-8.4, mongodb-2.2, jenkins-client-1N/A
colocate_withThe component to colocate withNoruby-1.9, haproxy-1.4
scales_fromMinimum number of gears to run the component on.No
scales_toMaximum number of gears to run the component on.No
additional_storageAdditional GB of space to request on all gears running this component.No
urlA URL to a downloadable cartridge.No
environment_variablesAdd or Update application environment variables, e.g.:[{'name':'FOO', 'value':'123'}, {'name':'BAR', 'value':'abc'}]No
Request
{
  "name": "mysql-5.1",
  "colocate_with": "ruby-1.9"
}
Response
{
  "api_version": 1.6,
  "data": {
    "additional_gear_storage": 0,
    "base_gear_storage": 1,
    "collocated_with": [
      "ruby-1.9",
      "haproxy-1.4"
    ],
    "current_scale": 1,
    "description": "MySQL is a multi-user, multi-threaded SQL database server.",
    "display_name": "MySQL Database 5.1",
    "gear_profile": "small",
    "help_topics": {
    },
    "license": "GPL",
    "license_url": "",
    "name": "mysql-5.1",
    "properties": [
      {
        "name": "username",
        "type": "cart_data",
        "description": "Root user on mysql database",
        "value": "adminzZu3vRW"
      },
      {
        "name": "password",
        "type": "cart_data",
        "description": "Password for root user on mysql database",
        "value": "xE61v_vw6Vqh"
      },
      {
        "name": "database_name",
        "type": "cart_data",
        "description": "MySQL DB name",
        "value": "myapplication"
      },
      {
        "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.1",
    "website": "http://www.mysql.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Added mysql-5.1 to application myapplication"
    },
    {
      "exit_code": 0,
      "field": null,
      "severity": "debug",
      "text": "\n\nmysql-5.1: Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT\n"
    },
    {
      "exit_code": 0,
      "field": null,
      "severity": "result",
      "text": "MySQL 5.1 database adde...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/cartridges  --data-urlencode name=mysql-5.1  --data-urlencode colocate_with=ruby-1.9 

List embedded cartridges

GET /broker/rest/applications/:id/cartridges
Response
{
  "api_version": 1.6,
  "data": [
    {
      "additional_gear_storage": 10,
      "base_gear_storage": 1,
      "collocated_with": [
        "haproxy-1.4"
      ],
      "current_scale": 1,
      "description": "Ruby is a dynamic, reflective, general-purpose object-oriented programming language. Popular development frameworks include Ruby on Rails and Sinatra.",
      "display_name": "Ruby 1.9",
      "gear_profile": "small",
      "help_topics": {
      },
      "license": "Ruby BSDL",
      "license_url": "http://www.ruby-lang.org/en/about/license.txt",
      "links": {
        "GET": {
          "href": "https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/cartridges/ruby-1.9",
          "method": "GET",
          "optional_params": [

          ],
          "rel": "Get cartridge",
          "required_params": [

          ]
        },
        "UPDATE": {
          "href": "https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/cartridges/ruby-1.9",
          "method": "PUT",
          "optional_params": [
            {
              "default_value": null,
              "description": "Additional filesystem storage in gigabytes on each gear having cartridge ruby-1.9",
              "name": "additional_gear_storage",
              "type": "integer",
              "valid_options": [

              ]
            },
            {
              "default_value": null,
              "description": "Minimum number of gears having cartridge ruby-1.9",
              "name": "scales_from",
              "type": "integer",
              "valid_options": [

              ]
            },
            {
              "default_value": null,
              "description": "Maximum number of gears having cartridge ruby-1.9",
              "name": "scales_to",
              "type": "integer",
              "valid_options": [

              ]
            }
          ],
          "rel": "Update cartridge configuration",
          "required_params": [

   ...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/cartridges 

Get cartridge

GET /broker/rest/applications/:id/cartridges/:name
Response
{
  "api_version": 1.6,
  "data": {
    "additional_gear_storage": 0,
    "base_gear_storage": 1,
    "collocated_with": [
      "ruby-1.9",
      "haproxy-1.4"
    ],
    "current_scale": 1,
    "description": "MySQL is a multi-user, multi-threaded SQL database server.",
    "display_name": "MySQL Database 5.1",
    "gear_profile": "small",
    "help_topics": {
    },
    "license": "GPL",
    "license_url": "",
    "name": "mysql-5.1",
    "properties": [
      {
        "name": "username",
        "type": "cart_data",
        "description": "Root user on mysql database",
        "value": "adminzZu3vRW"
      },
      {
        "name": "password",
        "type": "cart_data",
        "description": "Password for root user on mysql database",
        "value": "xE61v_vw6Vqh"
      },
      {
        "name": "database_name",
        "type": "cart_data",
        "description": "MySQL DB name",
        "value": "myapplication"
      },
      {
        "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.1",
    "website": "http://www.mysql.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Showing cartridge mysql-5.1 for application myapplication under domain mydomain"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "cartridge",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/cartridges/mysql-5.1

Update cartridge configuration

PUT /broker/rest/applications/:id/cartridges/:name
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
additional_gear_storageAdditional filesystem storage in gigabytes on each gear having cartridge mysql-5.1No
scales_fromMinimum number of gears having cartridge mysql-5.1No
scales_toMaximum number of gears having cartridge mysql-5.1No
Request
{
  "additional_gear_storage": 10
}
Response
{
  "api_version": 1.6,
  "data": {
    "additional_gear_storage": 10,
    "base_gear_storage": 1,
    "collocated_with": [
      "ruby-1.9",
      "haproxy-1.4"
    ],
    "current_scale": 1,
    "description": "MySQL is a multi-user, multi-threaded SQL database server.",
    "display_name": "MySQL Database 5.1",
    "gear_profile": "small",
    "help_topics": {
    },
    "license": "GPL",
    "license_url": "",
    "name": "mysql-5.1",
    "properties": [
      {
        "name": "username",
        "type": "cart_data",
        "description": "Root user on mysql database",
        "value": "adminzZu3vRW"
      },
      {
        "name": "password",
        "type": "cart_data",
        "description": "Password for root user on mysql database",
        "value": "xE61v_vw6Vqh"
      },
      {
        "name": "database_name",
        "type": "cart_data",
        "description": "MySQL DB name",
        "value": "myapplication"
      },
      {
        "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.1",
    "website": "http://www.mysql.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Showing cartridge mysql-5.1 for application myapplication under domain mydomain"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "cartridge",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X PUT -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/cartridges/mysql-5.1  --data-urlencode additional_gear_storage=10 

Start cartridge

POST /broker/rest/applications/:id/cartridges/:name/events
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
eventeventYesstartN/A
Request
{
  "event": "start"
}
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      },
      "mysql-5.1": {
        "connection_url": "mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/",
        "username": "adminzZu3vRW",
        "password": "xE61v_vw6Vqh",
        "database_name": "myapplication",
        "info": "Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/"
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Added start on mysql-5.1 for application myapplication"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/cartridges/mysql-5.1/events  --data-urlencode event=start 

Stop cartridge

POST /broker/rest/applications/:id/cartridges/:name/events
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
eventeventYesstopN/A
Request
{
  "event": "stop"
}
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      },
      "mysql-5.1": {
        "connection_url": "mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/",
        "username": "adminzZu3vRW",
        "password": "xE61v_vw6Vqh",
        "database_name": "myapplication",
        "info": "Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/"
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Added stop on mysql-5.1 for application myapplication"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/cartridges/mysql-5.1/events  --data-urlencode event=stop 

Restart cartridge

POST /broker/rest/applications/:id/cartridges/:name/events
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
eventeventYesrestartN/A
Request
{
  "event": "restart"
}
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      },
      "mysql-5.1": {
        "connection_url": "mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/",
        "username": "adminzZu3vRW",
        "password": "xE61v_vw6Vqh",
        "database_name": "myapplication",
        "info": "Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/"
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Added restart on mysql-5.1 for application myapplication"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/cartridges/mysql-5.1/events  --data-urlencode event=restart 

Reload cartridge

POST /broker/rest/applications/:id/cartridges/:name/events
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
eventeventYesreloadN/A
Request
{
  "event": "reload"
}
Response
{
  "api_version": 1.6,
  "data": {
    "aliases": [

    ],
    "app_url": "http://myapplication-mydomain.dev.rhcloud.com/",
    "build_job_url": null,
    "building_app": null,
    "building_with": null,
    "creation_time": "2013-08-27T00:51:36Z",
    "domain_id": "mydomain",
    "embedded": {
      "haproxy-1.4": {
      },
      "mysql-5.1": {
        "connection_url": "mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/",
        "username": "adminzZu3vRW",
        "password": "xE61v_vw6Vqh",
        "database_name": "myapplication",
        "info": "Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/"
      }
    },
    "framework": "ruby-1.9",
    "gear_count": 1,
    "gear_profile": "small",
    "git_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com/~/git/myapplication.git/",
    "health_check_path": "health",
    "id": "521bf818656c67309c000001",
    "initial_git_url": null,
    "members": [
      {
        "explicit_role": null,
        "from": [
          {
            "type": "domain",
            "role": "admin"
          }
        ],
        "id": "521bf803656c674541000001",
        "name": "first.last@mycompany.com",
        "owner": true,
        "role": "admin",
        "type": "user"
      }
    ],
    "name": "myapplication",
    "scalable": true,
    "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Added reload on mysql-5.1 for application myapplication"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "application",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/cartridges/mysql-5.1/events  --data-urlencode event=reload 

Delete cartridge

DELETE /broker/rest/applications/:id/cartridges/:name
Response
{
  "api_version": 1.6,
  "data": null,
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Removed mysql-5.1 from application myapplication"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": null,
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X DELETE -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/cartridges/mysql-5.1

Alias

This chapter provides information on API resources that allow a client to manage application aliases and SSL certificates for OpenShift applications. The table below describes each parameter associated with an OpenShift application with aliases and SSL certificates added.
NameDescription
idName of application alias.
certificate_added_atThe date and time when the SSL certificate was added.
has_private_ssl_certificateIndicates whether an SSL certificate has been added to the specified application.

Create new alias

POST /broker/rest/applications/:id/aliases
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
idAlias for applicationYesN/A
ssl_certificateContent of SSL CertificateNo
private_keyPrivate key for the certificate. Required if adding a certificateNo
pass_phraseOptional passphrase for the private keyNo
Request
{
  "id": "myalias",
  "ssl_certificate": "-----BEGIN CERTIFICATE-----\nMIIDoDCCAogCCQDzF8AJCHnrbjANBgkqhkiG9w0BAQUFADCBkTELMAkGA1UEBhMC\nVVMxCzAJBgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxDzANBgNVBAoMBnJl\nZGhhdDESMBAGA1UECwwJb3BlbnNoaWZ0MRIwEAYDVQQDDAlvcGVuc2hpZnQxKDAm\nBgkqhkiG9w0BCQEWGWluZm9Ab3BlbnNoaWZ0LnJlZGhhdC5jb20wHhcNMTMwMjE5\nMjExMTQ4WhcNMTQwMjE5MjExMTQ4WjCBkTELMAkGA1UEBhMCVVMxCzAJBgNVBAgM\nAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxDzANBgNVBAoMBnJlZGhhdDESMBAGA1UE\nCwwJb3BlbnNoaWZ0MRIwEAYDVQQDDA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FDe9J5fZU9HvosVu\n1xTNIvSZ6xHYI2MGZcGYIQKBgEYeebaV5C7PV6xWu1F46O19U9rS9DM//H/XryVi\nQv4vo7IWuj7QQe7SPsXC98ntfPR0rqoCLf/R3ChfgGsr8H8wf/bc+v9HHj8S5E/f\ndy1e3Nccg2ej3PDm7jNsGSlwmmUkAQGHAL7KwYzcBm1UB+bycvZ1j2FtS+UckPpg\nMDgBAoGALD8PkxHb4U4DtbNFSYRrUdvS9heav/yph3lTMfifNkOir36io6v8RPgb\nD2bHKKZgmYlTgJrxD45Er9agC5jclJO35QRU/OfGf3GcnABkBI7vlvUKADAo65Sq\nweZkdJnbrIadcvLOHOzkKC9m+rxFTC9VoN1dwK2zwYvUXfa1VJA=\n-----END RSA PRIVATE KEY-----",
  "pass_phrase": "abcd"
}
Response
{
  "api_version": 1.6,
  "data": {
    "certificate_added_at": "2013-08-26T00:00:00Z",
    "has_private_ssl_certificate": true,
    "id": "myalias"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Added myalias to application myapplication"
    }
  ],
  "status": "created",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "alias",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/aliases  --data-urlencode id=myalias  --data-urlencode ssl_certificate=-----BEGIN CERTIFICATE-----
MIIDoDCCAogCCQDzF8AJCHnrbjANBgkqhkiG9w0BAQUFADCBkTELMAkGA1UEBhMC
VVMxCzAJBgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxDzANBgNVBAoMBnJl
ZGhhdDESMBAGA1UECwwJb3BlbnNoaWZ0MRIwEAYDVQQDDAlvcGVuc2hpZnQxKDAm
BgkqhkiG9w0BCQEWGWluZm9Ab3BlbnNoaWZ0LnJlZGhhdC5jb20wHhcNMTMwMjE5
MjExMTQ4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B/auAIwqDGN6gHU/1TP4ke
pWLi1O55tfpXSzv+BnUbB96PQgPUop7aP7xBIlBrBiI7aVZOOBf/qHT3CF421geu
8tHWa7NxlIrl/vgn9lfGYyDYmXlpb1amXLEsBVGGF/e1TGZWFDe9J5fZU9HvosVu
1xTNIvSZ6xHYI2MGZcGYIQKBgEYeebaV5C7PV6xWu1F46O19U9rS9DM//H/XryVi
Qv4vo7IWuj7QQe7SPsXC98ntfPR0rqoCLf/R3ChfgGsr8H8wf/bc+v9HHj8S5E/f
dy1e3Nccg2ej3PDm7jNsGSlwmmUkAQGHAL7KwYzcBm1UB+bycvZ1j2FtS+UckPpg
MDgBAoGALD8PkxHb4U4DtbNFSYRrUdvS9heav/yph3lTMfifNkOir36io6v8RPgb
D2bHKKZgmYlTgJrxD45Er9agC5jclJO35QRU/OfGf3GcnABkBI7vlvUKADAo65Sq
weZkdJnbrIadcvLOHOzkKC9m+rxFTC9VoN1dwK2zwYvUXfa1VJA=
-----END RSA PRIVATE KEY-----  --data-urlencode pass_phrase=abcd 

List application aliases

GET /broker/rest/applications/:id/aliases
Response
{
  "api_version": 1.6,
  "data": [

  ],
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Listing aliases for application myapplication under domain mydomain"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "aliases",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/aliases 

Get alias

GET /broker/rest/applications/:id/aliases/:id
Response
{
  "api_version": 1.6,
  "data": {
    "certificate_added_at": "2013-08-26T00:00:00Z",
    "has_private_ssl_certificate": true,
    "id": "myalias"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Showing alias myalias for application myapplication under domain mydomain"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "alias",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/aliases/myalias

Update alias

PUT /broker/rest/applications/:id/aliases/:id
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
ssl_certificateContent of SSL CertificateYesN/A
private_keyPrivate key for the certificate. Required if adding a certificateYesN/A
pass_phraseOptional passphrase for the private keyNo
Request
{
  "ssl_certificate": "-----BEGIN CERTIFICATE-----\nMIIDoDCCAogCCQDzF8AJCHnrbjANBgkqhkiG9w0BAQUFADCBkTELMAkGA1UEBhMC\nVVMxCzAJBgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxDzANBgNVBAoMBnJl\nZGhhdDESMBAGA1UECwwJb3BlbnNoaWZ0MRIwEAYDVQQDDAlvcGVuc2hpZnQxKDAm\nBgkqhkiG9w0BCQEWGWluZm9Ab3BlbnNoaWZ0LnJlZGhhdC5jb20wHhcNMTMwMjE5\nMjExMTQ4WhcNMTQwMjE5MjExMTQ4WjCBkTELMAkGA1UEBhMCVVMxCzAJBgNVBAgM\nAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxDzANBgNVBAoMBnJlZGhhdDESMBAGA1UE\nCwwJb3BlbnNoaWZ0MRIwEAYDVQQDDAlvcGVuc2hpZnQxKDAmBgkqhkiG9w0BCQEW\nGWluZm9Ab3BlbnNoaWZ0LnJlZGhhdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB\nDwAwggEKAoIBAQDAEbH4MCi3iIDP1HS+/Xwu8SjdSc5WJX6htV7hJpmFZ8HohV/8\nba0v6aM9IJIIt+sIe2J62t/9G3leOdIHBxeACN4fV2l/iA/fvxvlnFKeD7sHm9Oc\nYj1H6YYJ57sIOf/oLDpJl6l3Rw8VC3+3W0/lzlVpA8qt7fpkiW7XQJCPplUSrdVC\n3okQ2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OfGf3GcnABkBI7vlvUKADAo65Sq\nweZkdJnbrIadcvLOHOzkKC9m+rxFTC9VoN1dwK2zwYvUXfa1VJA=\n-----END RSA PRIVATE KEY-----",
  "pass_phrase": "abcd"
}
Response
{
  "api_version": 1.6,
  "data": {
    "certificate_added_at": "2013-08-26T00:00:00Z",
    "has_private_ssl_certificate": true,
    "id": "myalias"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Updated myalias to application myapplication"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "alias",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X PUT -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/aliases/myalias  --data-urlencode ssl_certificate=-----BEGIN CERTIFICATE-----
MIIDoDCCAogCCQDzF8AJCHnrbjANBgkqhkiG9w0BAQUFADCBkTELMAkGA1UEBhMC
VVMxCzAJBgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxDzANBgNVBAoMBnJl
ZGhhdDESMBAGA1UECwwJb3BlbnNoaWZ0MRIwEAYDVQQDDAlvcGVuc2hpZnQxKDAm
BgkqhkiG9w0BCQEWGWluZm9Ab3BlbnNoaWZ0LnJlZGhhdC5jb20wHhcNMTMwMjE5
MjExMTQ4WhcNMTQwMjE5MjExMTQ4WjCBkTELMAkGA1UEBhMCVVMxCzAJBgNVBAgM
AkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxDzANBgNVBAoMBnJlZGhhdDESMBAGA1UE
CwwJb3BlbnNoaWZ0MRIwEAYDVQQDDAlvcGVuc2hpZnQxKDAmBgkqhkiG9w0BCQEW
GWluZm9Ab3BlbnNoaWZ0LnJlZGhhdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQDAEbH4MCi3iIDP1HS+/Xwu8SjdSc5WJX6htV7hJpmFZ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wYzcBm1UB+bycvZ1j2FtS+UckPpg
MDgBAoGALD8PkxHb4U4DtbNFSYRrUdvS9heav/yph3lTMfifNkOir36io6v8RPgb
D2bHKKZgmYlTgJrxD45Er9agC5jclJO35QRU/OfGf3GcnABkBI7vlvUKADAo65Sq
weZkdJnbrIadcvLOHOzkKC9m+rxFTC9VoN1dwK2zwYvUXfa1VJA=
-----END RSA PRIVATE KEY-----  --data-urlencode pass_phrase=abcd 

Delete alias

DELETE /broker/rest/applications/:id/aliases/:id
Response
{
  "api_version": 1.6,
  "data": null,
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Removed myalias from application myapplication"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": null,
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X DELETE -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/aliases/myalias

Environment variable

This resource provides the mean for adding user-defined environment variables set in an application deployment scope. Basically the user will be able to set environment variables during app creation, cartridge addition or even on existing applications. Environment variables set by the user will be persistent and replicated through all gears of the app, including new gears added in scaling events for example.
Think for example usernames and passwords, url's for SMTP hosts, API client id's and authorization tokens, etc. You don't want to set for example an access token for the Instagram API in config files in your git repo, specially if your app is open source. So if your app interacts with the Instagram API you could set the access token values on environment variables (and make your app read it from env vars).
NameDescription
nameName of the environment variable
valueValue of the environment variable

Add an environment variable

POST /broker/rest/applications/:id/environment-variables
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
nameName of the environment variableYesN/A
valueValue of the environment variableYesN/A
Request
{
  "name": "FOO",
  "value": "bar"
}
Response
{
  "api_version": 1.6,
  "data": {
    "name": "FOO",
    "value": "bar"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Added environment variable 'FOO' to application myapplication"
    }
  ],
  "status": "created",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "environment-variable",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X POST -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/environment-variables  --data-urlencode name=FOO  --data-urlencode value=bar 

List all environment variables

GET /broker/rest/applications/:id/environment-variables
Response
{
  "api_version": 1.6,
  "data": [

  ],
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Listing environment variables for application myapplication"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "environment-variables",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/environment-variables 

Get environment variable

GET /broker/rest/applications/:id/environment-variables/FOO
Response
{
  "api_version": 1.6,
  "data": {
    "name": "FOO",
    "value": "bar"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Showing environment variable 'FOO' for application myapplication"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "environment-variable",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/environment-variables/FOO

Update environment variable

PUT /broker/rest/applications/:id/environment-variables/FOO
Request Parameters
NameDescriptionRequired Valid OptionsDefault Value
valueValue of the environment variableYesN/A
Request
{
  "value": "Xbar"
}
Response
{
  "api_version": 1.6,
  "data": {
    "name": "FOO",
    "value": "Xbar"
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Updated environment variable 'FOO' in application myapplication"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "environment-variable",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X PUT -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/environment-variables/FOO  --data-urlencode value=Xbar 

Delete environment variable

DELETE /broker/rest/applications/:id/environment-variables/FOO
Response
{
  "api_version": 1.6,
  "data": null,
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Removed environment variable 'FOO' from application myapplication"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": null,
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X DELETE -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/environment-variables/FOO

Gear group

Describes an set of gears which run the same cartridges and share scaling limits. All cartridges in the gear group scale together.

Get application gear groups

GET /broker/rest/applications/:id/gear_groups
Response
{
  "api_version": 1.6,
  "data": [
    {
      "additional_gear_storage": 0,
      "base_gear_storage": 1,
      "cartridges": [
        {
          "name": "ruby-1.9",
          "display_name": "Ruby 1.9",
          "tags": [
            "service",
            "ruby",
            "web_framework"
          ]
        },
        {
          "name": "haproxy-1.4",
          "display_name": "OpenShift Web Balancer",
          "tags": [
            "web_proxy",
            "scales",
            "embedded"
          ]
        }
      ],
      "gear_profile": "small",
      "gears": [
        {
          "id": "521bf818656c67309c000001",
          "state": "started",
          "ssh_url": "ssh://521bf818656c67309c000001@myapplication-mydomain.dev.rhcloud.com",
          "port_interfaces": [
            {
              "_id": "521bf82b656c674541000028",
              "cartridge_name": "ruby-1.9",
              "external_address": "54.243.5.227",
              "external_port": "35536",
              "internal_address": "127.0.250.129",
              "internal_port": "8080"
            }
          ]
        }
      ],
      "id": "521bf818656c674541000015",
      "name": "521bf818656c674541000015",
      "scales_from": 1,
      "scales_to": -1
    }
  ],
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Showing gear groups for application 'myapplication' with domain 'mydomain'"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "gear_groups",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/gear_groups

Descriptor

The descriptor contains all the metadata necessary to describe the application.

Get application descriptor

GET /broker/rest/applications/:id/descriptor
Response
{
  "api_version": 1.6,
  "data": "---\nName: myapplication\nRequires:\n- ruby-1.9\n- haproxy-1.4\nGroup-Overrides:\n- components:\n  - comp: ruby-1.9\n    cart: ruby-1.9\n  - comp: web_proxy\n    cart: haproxy-1.4\n  min_gears: 1\n  max_gears: -1\n",
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Show descriptor for application 'myapplication' for domain 'mydomain'"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5,
    1.6
  ],
  "type": "descriptor",
  "version": "1.6"
}...click to see full response including links
Example using curl command
curl -X GET -u first.last@mycompany.com:password https://openshift.redhat.com/broker/rest/applications/521bf818656c67309c000001/descriptor