Skip to main content

Basic OpenStack client library using asyncio

Project description

AsyncOpenstakClient

image0

Introduction

The AsyncOpenStakClient is rest wrapper to OpenStack API. It provides very raw functionality however, it has a nice abstraction for authetication. For method specification go to official OpenStack reference https://docs.openstack.org/queens/api/.

Installation

Use pip:

pip install AsyncOpenStackClient

Usage

As mentioned above this is “raw” library, so you must handle params and/or body and the response.

from asyncopenstackclient import NovaClient, GlanceClient, AuthPassword

auth = AuthPassword(
    auth_url='https://keystone:5999/v3'
    username='USER', password='PASS',
    project_name='my-project',
    user_domain_name='default',
    project_domain_name='foo.bar'
)
nova = NovaClient(API_VERSION, session=auth)
glance = GlanceClient(session=auth)
await nova.init_api()
await glance.init_api()


servers = await nova.api.servers.list(params={'name': 'testvm'})
vm = await nova.api.servers.get(id)


body = {
    "server": {
        "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.api.servers.create(body=body)
print(response.body)

Available functions

License

Apache License 2.0

Changelog

0.1.1 (2018-03-02)

  • Update MANIFEST.in

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.

Source Distribution

File details

Details for the file AsyncOpenStackClient-0.2.0.linux-x86_64.tar.gz.

File metadata

File hashes

Hashes for AsyncOpenStackClient-0.2.0.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 b847fb4a23d6f998cb3345fee395d66ac4ed68b9001e7277813f16f4ea81cc90
MD5 7ed24cbacd490126008dfbed844f5025
BLAKE2b-256 5a92e5de566cae2e2338a023b9be2bbf63589d656e5eb16f7f12d78e7f3a4ae7

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page