Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Latest commit

 

History

History
64 lines (48 loc) · 1.32 KB

python.md

File metadata and controls

64 lines (48 loc) · 1.32 KB

Python Client

zeroos is the Python client used to talk to Zero-OS 0-core.

Install

It is recommended to install the 0-core-client package from GitHub.

On Windows:

https://github.com/zero-os/0-core/archive/master.zip#subdirectory=client/py-client

On Linux:

BRANCH="master"
sudo -H pip3 install --upgrade git+https://github.com/zero-os/0-core.git@${BRANCH}#subdirectory=client/py-client

Or you can clone the who repository:

git clone [email protected]:zero-os/0-core.git
cd 0-core/client/py-client

Alternatively try:

pip3 install 0-core-client

Usage

Make sure your machine joined the same ZeroTier management network as the Zero-OS node. See Join the ZeroTier Management Network for instructions.

Launch the Python interactive shell:

ipython3

Ping your Zero-OS instance on the IP address provided by ZeroTier:

from zeroos.core0.client import Client
cl = Client("<Zero-os node IP address in the ZeroTier network>")
cl.ping()

Some more simple examples:

  • List all processes:

    cl.system('ps -ef').get()
  • List all network interfaces:

    cl.system('ip a').get()
  • List all disks:

    cl.disk.list()

For for more examples see Examples.