https://github.com/piwheels/hostedpi
Python library and command line interface to the Mythic Beasts Hosted Pi API
https://github.com/piwheels/hostedpi
hosting mythic-beasts python raspberrypi
Last synced: over 1 year ago
JSON representation
Python library and command line interface to the Mythic Beasts Hosted Pi API
- Host: GitHub
- URL: https://github.com/piwheels/hostedpi
- Owner: piwheels
- License: bsd-3-clause
- Created: 2020-08-30T21:50:21.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2023-04-30T11:16:59.000Z (about 3 years ago)
- Last Synced: 2024-08-10T10:34:03.325Z (almost 2 years ago)
- Topics: hosting, mythic-beasts, python, raspberrypi
- Language: Python
- Homepage: https://hostedpi.readthedocs.io/
- Size: 212 KB
- Stars: 4
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
========
hostedpi
========
.. image:: https://badge.fury.io/py/hostedpi.svg
:target: https://badge.fury.io/py/hostedpi
:alt: Latest Version
Python interface to the `Mythic Beasts Hosted Pi`_ API, developed by the
`piwheels`_ team (`Ben Nuttall`_ and `Dave Jones`_).
.. _Mythic Beasts Hosted Pi: https://www.mythic-beasts.com/order/rpi
.. _piwheels: https://www.piwheels.org/
.. _Ben Nuttall: https://twitter.com/ben_nuttall
.. _Dave Jones: https://twitter.com/waveform80
This module provides a Pythonic interface to the API, as well as a command line
interface.
The authors of this library are not affiliated with Mythic Beasts, but we use
their Pi cloud to power the piwheels project.
Documentation of the API itself can be found at
https://www.mythic-beasts.com/support/api/raspberry-pi
Usage
=====
View the information about a Pi from the command line:
.. code-block:: console
$ hostedpi show mypi
Name: mypi
Provision status: live
Model: Raspberry Pi 3B
Disk size: 10GB
Power: on
IPv6 address: 2a00:1098:8:5b::1
IPv6 network: 2a00:1098:8:5b00::/56
Initialised keys: yes
SSH keys: 4
IPv4 SSH port: 5091
Location: MER
URLs:
http://www.mypi.hostedpi.com
https://www.mypi.hostedpi.com
SSH commands:
ssh -p 5091 root@ssh.mypi.hostedpi.com #IPv4
ssh root@[2a00:1098:8:5b::1] #IPv6
Provision a new Pi and view its SSH command (using Python):
.. code-block:: pycon
>>> from hostedpi import PiCloud
>>> api_id = '8t29hvcux5g9vud8'
>>> secret = 'QNwsvxZY8SxT3OiLt:Vmz-D1mWQuoZ'
>>> cloud = PiCloud(api_id, secret, ssh_key_path='/home/ben/.ssh/id_rsa.pub')
>>> pi = cloud.create_pi('mypi')
>>> print(pi.ssh_command)
ssh -p 5123 root@ssh.mypi.hostedpi.com
See the `getting started`_ page for information on how to authenticate, and
see the `command line interface`_ page for information on using the command line
interface.
.. _getting started: https://hostedpi.readthedocs.io/en/latest/getting_started.html
.. _command line interface: https://hostedpi.readthedocs.io/en/latest/cli.html
Documentation
=============
Documentation for this module can be found at https://hostedpi.readthedocs.io/
Documentation of the API itself can be found at
https://www.mythic-beasts.com/support/api/raspberry-pi
Contributing
============
* Source code can be found on GitHub at https://github.com/piwheels/hostedpi
* Code and documentation contributions welcome
* The issue tracker can be found at https://github.com/piwheels/hostedpi/issues
* For issues with the API itself, please contact Mythic Beasts support
https://www.mythic-beasts.com/support