Pesquisar

Este conteúdo não está disponível no idioma selecionado.

Chapter 13. Cartridges

download PDF
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 having administer or update the included feature. There are two types of cartridges available with OpenShift: standalone and embedded.
Standalone Cartridges

Standalone cartridges offer a variety of programming languages and frameworks for developing an application. Every application requires a framework cartridge. Examples include PHP, JBoss, and Ruby.

The following table describes each parameter associated with both standalone and embedded cartridges.
Name Description
name Name of the cartridge.
id Unique ID of the cartridge.
obsolete Indicates whether the cartridge is marked obsolete. Can be true or false.
added_time The date and time when the cartridge was added to an application.
activation_time The date and time when the cartridge version was marked active. Nil if the cartridge is not active.
automatic_updates Set to true if the cartridge receives updates when a security update is released.
version Version of the packaged software in the cartridge.
license License of the packaged software in the cartridge.
license_url URL of the license file for the packaged software in the cartridge.
website Website URL for the packaged software in the cartridge.
help_topics Map of topics and associated URLs that provide help on how to use and configure the cartridge.
display_name Formatted name of the cartridge for user interfaces.
description Description of the cartridge for user interfaces.
current_scale Current number of gears used to run the cartridge.
scales_from Minimum 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_to Maximum 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_with Names 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_from Minimum number of gears supported by the cartridge; the scales_from value cannot be less than this number.
supported_scales_to Maximum number of gears supported by the cartridge; the scales_to value cannot be greater than this number.
tags Array of tags associated with the cartridge.
usage_rates Plan usage costs.
status_messages Status messages returned by the cartridge.

Note

The scales_from and scales_to parameters can be set separately or set in the same REST API call. If the scales_from value is greater than the scales_to value, the broker logic automatically interchanges the two values.
Embedded Cartridges

Embedded cartridges provide extended functionality to OpenShift applications. Examples include MySQL, PostgreSQL, and Jenkins Client.

The following table describes each parameter associated with only embedded cartridges.
Name Description
additional_gear_storage Set additional filesystem storage in gigabytes for the gear profile that the cartridge is running on.
base_gear_storage Default basic storage in gigabytes associated with the gear profile that the cartridge is running on.
collocated_with Array of names of other cartridges that share the same gear(s) with the cartridge.
gear_profile Size of the gears grouped in this profile that the cartridge is running on; all gears in a group will have the same gear_profile.
properties List of environment variables and property values exposed by the cartridge and usable in application code.

13.1. List Cartridges

Description

Get a list of all available OpenShift cartridges.

Method and URL Structure

Method Resource URL
GET /broker/rest/cartridges

Request Parameters

Not applicable

cURL Command Example

$ curl -X GET https://openshift.redhat.com/broker/rest/cartridges --user user@example.com

JSON Response

The API returns the cartridge resource with a list of all available OpenShift cartridges. Information on other available cartridges has been removed for brevity. See Chapter 13, Cartridges for more information on all cartridge parameters.

{
    "api_version": 1.6,
    "data": [
        {
            "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,
            "scales_with": "haproxy-1.4",
            "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 3.4",
            "help_topics": {},
            "license": "GPLv2",
            "license_url": "",
            "name": "phpmyadmin-3",
            "scales_from": 1,
            "scales_to": 1,
            "scales_with": "haproxy-1.4",
            "supported_scales_from": 1,
            "supported_scales_to": 1,
            "tags": [
                "embedded"
            ],
            "type": "embedded",
            "usage_rates": [],
            "version": "3",
            "website": "http://www.phpmyadmin.net/"
        },
        {
            "current_scale": 0,
            "description": "Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js is perfect for data-intensive real-time applications that run across distributed devices.",
            "display_name": "Node.js 0.10",
            "help_topics": {
                "Developer Center": "https://www.openshift.com/developers"
            },
            "license": "MIT License",
            "license_url": "https://raw.github.com/joyent/node/v0.6/LICENSE",
            "name": "nodejs-0.6",
            "scales_from": 1,
            "scales_to": -1,
            "scales_with": "haproxy-1.4",
            "supported_scales_from": 1,
            "supported_scales_to": -1,
            "tags": [
                "service",
                "javascript",
                "nodejs",
                "web_framework"
            ],
            "type": "standalone",
            "usage_rates": [],
            "version": "0.6",
            "website": "http://www.nodejs.org/"
        },
    ],
    "status": "ok",
    "supported_api_versions": [
      1.0,
      1.1,
      1.2,
      1.3,
      1.4,
      1.5,
      1.6
    ],
    "type": "cartridges",
    "version": "1.6"
}

Red Hat logoGithubRedditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja oBlog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

© 2024 Red Hat, Inc.