Deploying Applications

Applications aren't currently read-only through the API.

Fetching Applications

To fetch details on your applications, use the URI /api/applications:

RestClient.get('https://manage.scalarium.com/api/applications', headers)

The result is a list of applications. The details of how a single application looks like are shown below. You can fetch the attributes for just one application by specifying its ID and use the URI /api/applications/<application_id>.

{
  "id": "8fa9f3d1aec2958e4fe03459237ce26f",
  "name": "Redis-Rails",
  "cluster_id": "21235e5aa99ba6b57085a12d81281bdc",
  "ssl_certificate_ca": null,
  "created_at": "2010/03/26 10:42:39 +0000",
  "scm_user": "",
  "scm_url": "git://github.com/jweiss/redis-rails-example.git",
  "slug_name": "redis_rails",
  "deleted_at": null,
  "updated_at": "2010/04/11 19:23:50 +0000",
  "ssl_certificate_key": "",
  "domain_names": null,
  "ssl_certificate": "",
  "scm_type": "git",
  "scm_password": "",
  "mounted_at": "/",
  "domain_name": "",
  "document_root": "public",
  "scm_ssh_key": "",
  "description": "",
  "rails_env": "production",
  "scm_revision": "",
  "application_type": "rails",
  "ssl_support": false
}

Deploying an Application

Application Deployments are different from Cloud Deployments.

To deploy an application, simply send a POST request to the URI /api/applications/<application_id>/deploy. A request body containing at least the command to be executed is expected.

RestClient.post("https://manage.scalarium.com/api/applications/8fa9f3d1aec2958e4fe03459237ce26f/deploy",
                JSON.dump(:command => 'deploy'),
                headers)

The attributes in the request body must at least contain the command to be run, e.g. deploy, rollback, and so on. Optionally you can specify the following attributes:

  • comment (string): A comment describing the deployment.
  • migrate (boolean): Whether to run rake db:migrate or not.
  • custom_json: the possibility to add custom JSON to the deployment
  • instances (array of IDs): An array containing the IDs of instances the deployment should be executed on. If empty, all instances that are online are deployed on.

The result will contain the ID of the newly generated deployment, return a HTTP status 202 and a resource location to the new deployment. See the knowledge base entry on Fetching Deployment Details for information on how to fetch and handle this data.