Skip to main content

An unofficial python wrapper library for Anka

Project description

PyAnka

An unofficial python wrapper library for Anka

Build Status PyPI

Requirements

You will need python3^ and the anka cli.

brew install python3
brew install --cask anka-virtualization

Installing

pip3 install pyanka

Dev Notes

You can run test locally via the bitrise CLI (brew install bitrise) by running bitrise run ci

The library at this point is not feature ready, but sufficient for the Bitrise Infrastructure team's current requirements.

Usage

Import the module and instalce it with the AnkaVm() constructor, this will require you to name the virtual machine in question.

See the examples below or the example file.

import anka from pyanka

# Create an instance of the Anka VM Class
    vm = anka.AnkaVm("test-vm")

    # Start up an already existing VM that is stopped, or suspended
    vm.start()

    # Show runtime properties of an already existing VM
    # This method returns a JSON object, that you can use as a dictionary
    vm.show()

    # CLone an already existing VM
    # You need to define the name of the to be cloned VM
    # The method will initialise an instance of the class with the ne name for you.
    clone = vm.clone("cloned-vm")
    clone.show()

    # Suspend a running VM
    vm.suspend()

    # stop a running or suspended VM
    vm.stop()

    # Delete a VM, this needs to be in a stopped state
    vm.delete()

    # Copy a file from the host machine to the virtual machine
    # TODO make it work both ways
    vm.copy("./example.file", "/tmp/example.file")

    # run a shell command on the virtual machine, and get back the stdout or stderr
    vm.run("ls", "-la")

Authors

Name Mail Address GitHub Profile
Sandor Feher sandor.feher@bitrise.io fehersanyi-bitrise

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

pyanka-0.0.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

pyanka-0.0.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file pyanka-0.0.2.tar.gz.

File metadata

  • Download URL: pyanka-0.0.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for pyanka-0.0.2.tar.gz
Algorithm Hash digest
SHA256 393481741dab221f68332194483d2013ece440e0f4356f9b328ef2230756028a
MD5 c8d6ac59a50df0b3c10e04f58850a487
BLAKE2b-256 afeb10aee68c08cbbefeda75bf8a185e48b7965a16860c668df03113ba6f88d7

See more details on using hashes here.

File details

Details for the file pyanka-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyanka-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for pyanka-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 28ed5cbf91a48275402b974f7acc6a707d7d17972aa8b049eadbb4a55df1772a
MD5 baf3a0621181d7b56d588dc2e18c93a3
BLAKE2b-256 ffda798fa403d61383e380f989739d5a8999b1b9bfb0fac672ed1212ad204189

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