Skip to main content

Basic OpenStack async client library using asyncio

Project description


image0 image1


The AsyncOpenStackClient is a asynchronous rest wrapper for the OpenStack API. It provides a nice abstraction for authentication. For method specification, see the official OpenStack documentation:


Use pip:

pip install AsyncOpenStackClient


from asyncopenstackclient import NovaClient, GlanceClient, CinderClient, AuthPassword

# you can either pass credentials explicitly (as shown below)
# or use enviormental variables from OpenStack RC file
auth = AuthPassword(
    username='USER', password='PASS',
nova = NovaClient(session=auth)
glance = GlanceClient(session=auth)
cinder = CinderClient(session=auth)

# api url for each service will be taken from catalog,
# but you may pass `api_url` param to force custom url eg.
# nova = NovaClient(session=auth, api_url='http://my-local-nova:9876/v2/')

await nova.init_api()
await glance.init_api()
await cinder.init_api()

servers = await nova.servers.list(name='testvm')
vm = await nova.servers.get(server_id)

action_spec = {'os-stop': None}
await nova.servers.run_action(server_id, **action_spec)

specs = {
    "name": 'some_name',
    "flavorRef": 'flavor_id',
    "imageRef": 'image_id',
    "security_groups": [{'name': 'group1'}, {'name': 'group2'}]
    "user_data": base64.b64encode(userdata).decode('utf-8')
response = await nova.servers.create(server=specs)

volume = {"size": 200,
          "imageRef": "image_id",
          "name": "some_name"}

response = await cinder.volumes.create(volume=volume)

Available functions


0.8.2 (2021-03-28)

  • Fixed: upgrade dependencies (aiohttp)

0.8.1 (2019-04-03)

  • Fixed: upgrade dependencies (urllib3: CVE-2018-20060)

0.8.0 (2018-08-19)

  • Feature: another part of compute API - run an action on server
  • Feature: CD configuration

0.7.0 (2018-06-15)

  • Feature: Cinder implementation
  • Bugfix: typo fixes

0.6.3 (2018-06-13)

  • Feature: adjustable request timeout, default is 60s now

0.6.2 (2018-05-18)

  • Bugfix: initialize property (api) in Client to get some meaningful error instead of “recursion limit reached”.

0.6.0 (2018-05-12)

  • Feature: wrap requests with Resource/Method proxy

0.5.2 (2018-05-10)

  • Bugfix: adding slash at the end of api_root_url

0.5.1 (2018-04-29)

  • Bugfix: update README with metadata entry and envs notice

0.5.0 (2018-04-25)

  • Feature: partial support for server metadata usage

0.4.1 (2018-04-25)

  • Bugifx: invalid concat auth_url with urljoin

0.4.0 (2018-04-16)

  • Feature: use OS_ variables if present

0.3.0 (2018-04-13)

  • Feature: accept to pass api_url
  • Feature: determine api url if catalog provide incomplete one (eg. without version)

0.2.3 (2018-04-05)

  • Bugfix: do_not_await_sync_method

0.2.2 (2018-04-02)

  • Update simple-rest-client (fixed logging)

0.2.1 (2018-03-28)

  • fix tests, cov report,

0.1.1 (2018-03-02)

  • Update

0.1.0 (2018-02-15)

  • First approach to build async openstack client library for Python3

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for AsyncOpenStackClient, version 0.8.2
Filename, size File type Python version Upload date Hashes
Filename, size AsyncOpenStackClient-0.8.2.tar.gz (24.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page