Skip to end of metadata
Go to start of metadata

Scalr has an API that allows you to execute commands on your infrastructure. The Scalr API can be used to interact with Farms, Farm Roles, Servers, and more.

Getting Started with the API

Icon

To use the API, you must enable it for each Environment (Profile, Settings, and API Menu > API Access). To make certain the API is being enabled for the appropriate Environment, click on the Environments Menu. The currently selected Enviroment will have a dot next to its name.

Scalr Command Line Tools

Scalr provides a set of command line tools that you can use to access the Scalr API.

Code Samples

Scalr has a library of API examples hosted on Github, you will find API examples for:

API Reference

The list of supported API Calls, as well as the authentication algorithm, are available on this Wiki.

Endpoint for API Calls

If you are using Scalr Open Source or Scalr Enterprise, use the following endpoint when performing API Calls in Scalr Enterprise and Scalr Open Source installations: http://$SCALR_URL/api/api.php, where SCALR_URL is an URL at which your Scalr installation is reachable.

If you are using Hosted Scalr, use the default.

Common Request Parameters

All Query operations share a set of common parameters that must be present in each call:

 

Name

Description

Required

Action

Indicates the action to perform.

Example: TerminateFarm

Yes

KeyID

The KeyID for the request sender. You can get it on 'Settings -> Environments -> [Edit environment]' page

Example: 5d0e16f7498c41cc

Yes

Timestamp

The date and time at which the request is signed, in the format YYYY-MM-DDThh:mm:ssZ. For more information, go to ISO 8601 (http://www.w3.org/TR/NOTE-datetime).

Example: 2009-01-07T15:04:56Z

Yes

Signature

The request signature. To learn how to compute the signature, see this page.

Example: Qnpl4Qk/7tINHzfXCiT7VbBatDA=

Yes

Version

The API version to use.

Example: 2.2.0

Yes

EnvID

Environment id to perform action within. To be used when a user has access more than to one Environment.

If omitted, the user's first environment (the one with the lowest ID) is assumed.

Example: 521

No
AuthVersion

Indicates auth version. You should always use: 3

Yes

Common Response Parameters

The Transaction ID

 In every response from Scalr, you will find a string element called TransactionID. This is simply a unique identifier Scalr assigns to this request for tracking and troubleshooting purposes.

Error conditions in API Calls

When an error occurs during an API Call, the response will include a single Error element (including for authentication errors).

The Error Element has a Message attribute that details the Error that occurred.

Example:

API Versions

Current Version

The Current API Version is 2.3.0 (Added 8 new methods for deployment process)

Older Versions

2.2.0 (Minor improvements and fixes)

2.1.0 (Added methods for working with apache vhosts)

2.0.0

Deprecated Features

Please be mindful that the Scalr 1.X API is not compatible with later versions. This page is provided to help existing installations of Scalr.

 

2010-02-25 (added GetStatisticsGraphURL method) 

2009-10-06 (contains minor improvements and various bugfixes)

2009-08-14 (added GetEvents, GetLogs, GetScriptDetails, RebootInstance methods. Added an ability to execute script with specified revision and arguments)

2009-08-04 (added the ListDNSZonesAddDNSZoneRecordRemoveDNSZoneRecordListDNSZoneRecords methods)

2009-07-07 (added the TerminateInstance, LaunchInstance, GetFarmDetails methods)



  • No labels

2 Comments

Write a comment…