Gee, it’s been some time since my last update…

Acquia Cloud can be a good ally for the Drupal community in terms of deploying different projects and maintaining them on a service that has been created specifically for Drupal, and the API can be an excellent companion tool for a ton of CI implementations (specially the ones I’m working on for my client :P ). As the new API documentation states, there’re different client implementations, but none of them in Python.

So here it is, a very first alpha version that will change a lot in the next months, given that Acquia is planning to change some stuff on their side. But I’ll try to keep the lib updated as much as possible.

This library is intended to be used with Python >= 3.5, and it’s being release under the MIT License.

Installing

Via PIP

This is the recommended method, there’s nothing easier than pip :)

pip install acapi2

Manually

$ git clone git@github.com:pmatias/python-acquia-cloud-2.git acapi2
$ cd acapi2
$ ./setup.py build
$ ./setup.py install

Examples

Minimal request

acquia = Acquia(api_key, api_secret)
application = acquia.application("a47ac10b-58cc-4372-a567-0e02b2c3d470")

print(application["name"])

Using filters

subscription_name = "MySubsName"
filters = "name=" + subscription_name

application = acapi.applications(filters=filters).first()
dev_environment = application.environments()["dev"]

print(dev_environment["id"])

dev_environment.set_php_version("7.0")

more_settings = {
  "max_execution_time": 10,
  "memory_limit": 192,
  "apc": 128,
  "max_input_vars": 1000,
  "max_post_size": 256,
  "sendmail_path": "/usr/bin/sendmail",
  "varnish_over_ssl": false
}

dev_environment.configure(more_settings)

Like I’ve said, there’s a lot to work to do, but changes and improvements are coming in the following weeks / months.

Pypi project page

Github page