Skip to main content

An SDK for building applications to work with ESI

Project description

esisdk

Unified SDK for ESI

Install ESI SDK:

python setup.py install

Create a connection to ESI SDK

There are several methods to establish a connection using the ESI SDK. Since the esi.connection.ESIConnection class inherits from openstack.connection.Connection, methods applicable for creating connections in the OpenStack SDK can also be used with the ESI SDK. Below are some common ways to create an ESIConnection:

Create a connection using only keyword arguments

from esi import connection

conn = connection.ESIConnection(
    region_name='example-region',
    auth={
        'auth_url': 'https://auth.example.com',
        'username': 'user',
        'password': 'password',
        'project_name': 'project_name',
        'user_domain_name': 'user_domain_name',
        'project_domain_name': 'project_domain_name'
    },
    interface='public'
)

Create a connection from existing CloudRegion

from esi import connection
import openstack.config

config = openstack.config.get_cloud_region(
    cloud='example',
    region_name='earth'
)
conn = connection.ESIConnectionn(config=config)

Make API calls

Detailed APIs can be found in the esi/lease/v1/_proxy.py file. Below are simple examples demonstrating lease resource CRUD operations.

import esi
import os

TEST_CLOUD = os.getenv('OS_TEST_CLOUD', 'devstack-admin')
conn = esi.connect(cloud=TEST_CLOUD)

# Create a lease
def lease_create(conn, resource_uuid, project_id, **kwargs):
    lease = conn.lease.create_lease(resource_uuid=resource_uuid,
                                    project_id=project_id,
                                    **kwargs)

# List leases
def lease_list(conn, **kwargs):
    leases = conn.lease.leases(**kwargs)

# Update a lease
def lease_update(conn, lease, **kwargs):
    lease_dict = conn.lease.update_lease(lease, **kwargs)

# Delete a lease
def lease_delete(conn, lease_id):
    leases = conn.lease.delete_lease(lease_id)

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

esisdk-1.4.0.tar.gz (35.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

esisdk-1.4.0-py3-none-any.whl (51.8 kB view details)

Uploaded Python 3

File details

Details for the file esisdk-1.4.0.tar.gz.

File metadata

  • Download URL: esisdk-1.4.0.tar.gz
  • Upload date:
  • Size: 35.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.7

File hashes

Hashes for esisdk-1.4.0.tar.gz
Algorithm Hash digest
SHA256 f51977ee249020d154032bcf2593b213dc45151a19bacc1cfc0828863170e3fd
MD5 3e6eb3a55b30965f8f3ad6d5494c5878
BLAKE2b-256 6950b9a507eb1e5f99ee3220bc06025c2e423b841b57c7d2cd525ed170c4d1cf

See more details on using hashes here.

File details

Details for the file esisdk-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: esisdk-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 51.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.7

File hashes

Hashes for esisdk-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 faf54386c1d5f3f7bb334a126654baf5bd01ce714910aac0ce4470456dfbe5e8
MD5 d48d9c8f727d844d44e202fd731d6cfa
BLAKE2b-256 be3af03123c32230de644c3d2816ce5b1eb891ad90bbd0acb743ccb556042b09

See more details on using hashes here.

Supported by

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