Skip to main content

xenvman client for Python

Project description

Python client for xenvman

This is a Python client library for xenvman.

Installation

Installing is a simple as running:

pip install xenvman

Usage

The very first thing to do is to create a client:

import xenvman

cl = xenvman.Client()

if address argument is not provided, the default http://localhost:9876 will be used. Also if shell environment variable XENV_API_SERVER is set, it will be used instead.

Once you have a client, you can create environment:

env = cl.new_env(xenvman.InputEnv(
    "python-test",
    description="Python test!",
    templates=[
        xenvman.Tpl("db/mongo")
    ],
))

And that's it! Once new_env() returns, you have an environment which you can start using in your integration tests.

cont = env.get_container("db/mongo", 0, "mongo")

# Get the full mongo url with exposed port
mongo_url = "{}:{}".format(env.external_address(), cont.ports["27017"])

Don't forget to terminate your env after you're done:

env.terminate()

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

xenvman-0.0.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

xenvman-0.0.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file xenvman-0.0.1.tar.gz.

File metadata

  • Download URL: xenvman-0.0.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.2 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.2

File hashes

Hashes for xenvman-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b8e8b53e66f5df8fafd3b59375f0916e9e9a739e0ceeb12543c587ee5c1358e0
MD5 269317dfa90a3932aafa92ac3fdd418e
BLAKE2b-256 736ec0a66807356391f7d5af61e9a58adf6acd199fb2754b989ebad3f692f7dd

See more details on using hashes here.

File details

Details for the file xenvman-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: xenvman-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.2 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.2

File hashes

Hashes for xenvman-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e3218bbed89599cd3a776c084733efc9f39c28dcb7b722a4fa7483ff9cb1568
MD5 4583b12aaba988c4dbf49d780a86ca4d
BLAKE2b-256 4e2f313c1a1a46f9832f740bb38db5b6e181d9224c0f3456e0d5d41b69b7039f

See more details on using hashes here.

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