Giter VIP home page Giter VIP logo

pylxd's Introduction

pylxd Build Status

A Python library for interacting with the LXD REST API.

Getting started with pylxd

If you're running on Ubuntu Wily or greater:

sudo apt-get install python-pylxd lxd

otherwise you can track LXD development on other Ubuntu releases:

sudo add-apt-repository ppa:ubuntu-lxc/lxd-git-master && sudo apt-get update
sudo apt-get install lxd

and install pylxd using pip:

pip install pylxd

First steps

Once you have pylxd installed, you're ready to start interacting with LXD:

import uuid
from pylxd import api

# Let's pick a random name, avoiding clashes
CONTAINER_NAME = str(uuid.uuid1())

lxd = api.API()

try:
    lxd.container_defined(CONTAINER_NAME)
except Exception as e:
    print("Container does not exist: %s" % e)

config = {'name': CONTAINER_NAME,
          'source': {'type': 'none'}}
lxd.container_init(config)
if lxd.container_defined(CONTAINER_NAME):
    print("Container is running")
else:
    print("Whoops - please report a bug!")
containers = lxd.container_list()
for x in containers:
    lxd.container_destroy(x)

Bug reports

Bug reports can be filed at https://github.com/lxc/pylxd/issues/new

Support and discussions

We use the LXC mailing-lists for developer and user discussions, you can find and subscribe to those at: https://lists.linuxcontainers.org

If you prefer live discussions, some of us also hang out in #lxcontainers on irc.freenode.net.

pylxd's People

Contributors

aarnaud avatar datashaman avatar itxaka avatar ivuk avatar javacruft avatar mgwilliams avatar reversecipher avatar rockstar avatar saviq avatar sergiusens avatar stgraber avatar thomasgoirand avatar uglide avatar zulcss avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.