Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Summary of RedHat's Openshift RESTfull API
############################################
# Summary of RedHat's Openshift RESTfull API
#
# METHOD PATH PARAMETER_NAME=[VALUE|...] <NAME=[VALUE|...]>
#
# - <...> are optional parameter.
# - VALUE* is the default.
############################################
# Domains
GET /broker/rest/domains
POST /broker/rest/domains id=[Domain_ID]
GET /broker/rest/domains/[Domain_ID]
PUT /broker/rest/domains/[Domain_ID] id=[New_Domain_ID]
DELETE /broker/rest/domains/[Domain_ID] force=[true|false*]
# Applications
GET /broker/rest/domains/[Domain_ID]/applications
POST /broker/rest/domains/[Domain_ID]/applications name=[App_Name] cartridge=[Cartridge_Name] <template=[Template_UUID] scale=[true|false*] gear_profile=small>
GET /broker/rest/domains/[Domain_ID]/applications/[App_Name]
POST /broker/rest/domains/[Domain_ID]/applications/[App_Name]/events event=[start|stop|force-stop|restart|show-port|expose-port|conceal-port|scale-up|scale-down]
POST /broker/rest/domains/[Domain_ID]/applications/[App_Name]/events event=[add-alias|remove-alias] alias=[Alias_Name]
GET /broker/rest/domains/[Domain_ID]/applications/[App_Name]/events/descriptor
DELETE /broker/rest/domains/[Domain_ID]/applications/[App_Name]
GET /broker/rest/domains/[Domain_ID]/applications/[App_Name]/gears
# Cartridges
GET /broker/rest/cartridges
GET /broker/rest/domains/[Domain_ID]/applications/[App_Name]/cartridges
POST /broker/rest/domains/[Domain_ID]/applications/[App_Name]/cartridges cartridge=[Cartridge_Name]
GET /broker/rest/domains/[Domain_ID]/applications/[App_Name]/cartridges/[Cartridge_Name]
POST /broker/rest/domains/[Domain_ID]/applications/[App_Name]/cartridges/[Cartridge_Name]/events event=[start|stop|restart|reload]
DELETE /broker/rest/domains/[Domain_ID]/applications/[App_Name]/cartridges/[Cartridge_Name]
# Users
GET /broker/rest/user
GET /broker/rest/user/keys
POST /broker/rest/user/keys name=[Key_Name] type=[Key_Type] content=[URLEncoded_Key_Content]
GET /broker/rest/user/keys/[Key_Name]
PUT /broker/rest/user/keys/[Key_Name] type=[Key_Type] content=[URLEncoded_Key_Content]
DELETE /broker/rest/user/keys/[Key_Name]
# Templates
GET /broker/rest/application_template
GET /broker/rest/application_template/[Template_UUID|Template_Tag]
@ksurya
Copy link

ksurya commented Jan 10, 2013

what are these? I mean, where to use?

@caruccio
Copy link
Author

This is the basic RESTfull API for OpenShift. Just a quick reference. It is used to programmatically interact with your account/app.

Examples:

To list all user apps:

$ curl -k --user 'USERNAME:PASSWORD' https://openshift.redhat.com/broker/rest/domains/MyDomain/applications

To delete an app:

$ curl -k --user 'USERNAME:PASSWORD' -X DELETE https://openshift.redhat.com/broker/rest/domains/MyDomain/applications/MyApp

You can find more detailed information here: https://openshift.redhat.com/community/sites/default/files/documents/OpenShift-2.0-REST_API_Guide-en-US_0.pdf

@missedone
Copy link

hi,
do you see is there any api for creating new account?
thanks

@caruccio
Copy link
Author

one year later...

No. There is no such entry point. To add user you need to manually add it to /etc/openshift/htpasswd like any apache's basic user.

@caruccio
Copy link
Author

This API seams to be outdated. Please refer to https://access.redhat.com/documentation/en-US/OpenShift/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment