Acquia Cloud API
The Acquia Cloud API allows developers to extend, enhance, and customize Acquia Cloud. There are three major components to Cloud API:
-
A RESTful web interface that allows direct control of Acquia Cloud sites. Complete documentation for the Cloud API web interface is below.
-
Acquia Cloud Drush commands, which allow you to use all features of the Cloud API either on the command line or from shell scripts using the Drush command-line tool.
-
Cloud Hooks, which are scripts in your code repository that Acquia Cloud executes on your behalf when a triggering action, including certain Cloud API functions, occurs. Complete documentation, templates, and sample scripts for Cloud Hooks are available at https://github.com/acquia/cloud-hooks.
Cloud API is available to all Acquia Cloud customers. To learn about how to get started with it, including information about your Cloud API credentials, Drush aliases, and the Acquia Cloud, see Developing with the Cloud API.
Additional resources:
API overview
Just the facts:
- Current version
-
v1
- Endpoint
- Format
-
JSON. All resource URLs must specify a “.json” suffix.
- Authentication
-
HTTP Basic Auth over SSL.
- Credentials
-
Available on the Credentials page of your Acquia Profile.
- Status codes
-
Standard.
- Rate limit
-
Varies by Acquia Cloud subscription type.
API functions are listed below, first summarized by category, then followed with complete documentation including arguments, return values, and an example call. In each of the examples, 'user' represents your email address that's registered in your Acquia Profile, while 'pass' represents your Cloud API key, found on the Credentials page of your Acquia Profile.
Users (collapse)
-
- GET '/me/drushrc'
Retrieve Drush aliases for all sites accessible by the caller.
Tasks (collapse)
-
- GET /sites/:site/tasks
List a site's tasks.
-
- GET /sites/:site/tasks/:task
Get a task record.
Domains (collapse)
-
- DELETE /sites/:site/envs/:env/domains/:domain
Delete a domain.
-
- DELETE /sites/:site/envs/:env/domains/:domain/cache
Purge the Varnish cache for a domain.
-
- GET /sites/:site/envs/:env/domains
List an environment's domains.
-
- GET /sites/:site/envs/:env/domains/:domain
Get a domain record.
-
- POST /sites/:site/envs/:env/domains/:domain
Add a domain name.
Servers (collapse)
-
- GET /sites/:site/envs/:env/servers
List a site environment's servers.
-
- GET /sites/:site/envs/:env/servers/:server
Get a server record.
-
- GET /sites/:site/envs/:env/servers/:server/php-procs
Calculate a server's PHP max processes record.
Workflow (collapse)
-
- POST /sites/:site/code-deploy/:source/:target
Deploy code from one site environment to another.
-
- POST /sites/:site/dbs/:db/db-copy/:source/:target
Copy a database from one site environment to another.
-
- POST /sites/:site/domain-move/:source/:target
Move domain(s) from one site environment to another.
-
- POST /sites/:site/envs/:env/code-deploy
Deploy a specific VCS branch or tag to an environment.
-
- POST /sites/:site/files-copy/:source/:target
Copy files from one site environment to another.
Databases, database instances, and backups (collapse)
-
- DELETE /sites/:site/dbs/:db
Delete a database.
-
- DELETE /sites/:site/envs/:env/dbs/:db/backups/:backup
Delete a site environment database instance backup.
-
- GET /sites/:site/dbs
List a site's databases.
-
- GET /sites/:site/dbs/:db
Get a database record.
-
- GET /sites/:site/envs/:env/dbs
List a site environment's database instances.
-
- GET /sites/:site/envs/:env/dbs/:db
Get a database instance.
-
- GET /sites/:site/envs/:env/dbs/:db/backups
List a site environment's database instance backups.
-
- GET /sites/:site/envs/:env/dbs/:db/backups/:backup
Get details about a database instance backup.
-
- GET /sites/:site/envs/:env/dbs/:db/backups/:backup/download
Download a database instance backup from server.
-
- POST /sites/:site/dbs
Add a database.
-
- POST /sites/:site/envs/:env/dbs/:db/backups
Create a database instance backup.
-
- POST /sites/:site/envs/:env/dbs/:db/backups/:backup/restore
Restore a site environment database instance backup.
SVN users (collapse)
-
- DELETE /sites/:site/svnusers/:svnuserid
Delete an SVN user.
-
- GET /sites/:site/svnusers
List a site's SVN users.
-
- GET /sites/:site/svnusers/:svnuserid
Get an SVN user.
-
- POST /sites/:site/svnusers/:username
Add an SVN user.
Sites and environments (collapse)
-
- GET '/sites'
List all sites accessible by the caller.
-
- GET /sites/:site
Get a site record.
-
- GET /sites/:site/envs
List a site's environments.
-
- GET /sites/:site/envs/:env
Get an environment record.
-
- GET /sites/:site/envs/:env/logstream
Retrieve an authenticated command to stream log files for an environment.
-
- POST /sites/:site/envs/:env/install/:type
Install a Drupal distro or Drush Make file into an environment.
-
- POST /sites/:site/envs/:env/livedev/:action
Configure Live Development on an environment.
Instance Method Details
- DELETE /sites/:site/dbs/:db
Delete a database.
- DELETE /sites/:site/envs/:env/dbs/:db/backups/:backup
Delete a site environment database instance backup.
- DELETE /sites/:site/envs/:env/domains/:domain
Delete a domain
- DELETE /sites/:site/envs/:env/domains/:domain/cache
Purge the Varnish cache for a domain
- DELETE /sites/:site/svnusers/:svnuserid
Delete an SVN user
- GET '/me/drushrc'
Retrieve Drush aliases for all sites accessible by the caller.
- GET '/sites'
List all sites accessible by the caller.
- GET /sites/:site
Get a site record.
- GET /sites/:site/dbs
List a site's databases.
- GET /sites/:site/dbs/:db
Get a database record.
{
"name": "mysite"
}
- GET /sites/:site/envs
List a site's environments.
- GET /sites/:site/envs/:env
Get an environment record.
- GET /sites/:site/envs/:env/dbs
List a site environment's database instances.
- GET /sites/:site/envs/:env/dbs/:db
Get a database instance.
{
"db_cluster": "4",
"host": "srv-4",
"instance_name": "mysitedev",
"name": "mysite",
"password": "UeytUwwZxpfqutH",
"username": "mysitedev"
}
- GET /sites/:site/envs/:env/dbs/:db/backups
List a site environment's database instance backups.
- GET /sites/:site/envs/:env/dbs/:db/backups/:backup
Get details about a database instance backup.
- GET /sites/:site/envs/:env/dbs/:db/backups/:backup/download
Download a database instance backup from server.
- GET /sites/:site/envs/:env/domains
List an environment's domains.
- GET /sites/:site/envs/:env/domains/:domain
Get a domain record.
- GET /sites/:site/envs/:env/logstream
Retrieve an authenticated command to stream log files for an environment.
- GET /sites/:site/envs/:env/servers
List a site environment's servers.
- GET /sites/:site/envs/:env/servers/:server
Get a server record.
- GET /sites/:site/envs/:env/servers/:server/php-procs
Calculate a server's PHP max processes record.
- GET /sites/:site/svnusers
List a site's SVN users.
]
- GET /sites/:site/svnusers/:svnuserid
Get an SVN user.
- GET /sites/:site/tasks
List a site's tasks.
- GET /sites/:site/tasks/:task
Get a task record.
- POST /sites/:site/code-deploy/:source/:target
Deploy code from one site environment to another.
- POST /sites/:site/dbs
Add a database.
- POST /sites/:site/dbs/:db/db-copy/:source/:target
Copy a database from one site environment to another
- POST /sites/:site/domain-move/:source/:target
Move domain(s) from one site environment to another
- POST /sites/:site/envs/:env/code-deploy
Deploy a specific VCS branch or tag to an environment.
- POST /sites/:site/envs/:env/dbs/:db/backups
Create a database instance backup.
- POST /sites/:site/envs/:env/dbs/:db/backups/:backup/restore
Restore a site environment database instance backup.
- POST /sites/:site/envs/:env/domains/:domain
Add a domain name.
- POST /sites/:site/envs/:env/install/:type
Install a Drupal distro or Drush Make file into an environment.
- POST /sites/:site/envs/:env/livedev/:action
Configure Live Development on an environment.
- POST /sites/:site/files-copy/:source/:target
Copy files from one site environment to another
- POST /sites/:site/svnusers/:username
Add an SVN user.