Code Monkey home page Code Monkey logo

packet-python3-cli's Introduction

packet-python3-cli

Simple cli for packet cloud done with Argh from packet-python. It's just exposing the methods of the manager class from https://github.com/packethost/packet-python/blob/master/packet/Manager.py to command line arguments.

Installation

You will need pip3 packages:

$ pip3 install packet-python argh tabulate

Usage demo

asciicast

Example Usage

You will need your API token exported in env var PACKET_API_TOKEN

$ packet-cli help
$ packet-cli list-projects

# list devices in a project
$ packet-cli list-devices 89b497ee-5afc-420a-8fb5-56984898f444

# list available plan, facilities and operating systems
$ packet-cli list-plans
$ packet-cli list-facilities
$ packet-cli list-operating-systems

# create device in a project, there's name, plan, faciltiy and OS
$ packet-cli create-device 89b497ee-5afc-420a-8fb5-56984898f444 anstest88 baremetal_0 ams1 ubuntu_16_04_image

# power off device:
$ packet-cli -p "{type: power_off }" call-api /devices/95108175-2b85-48e1-bf3f-81a4a4b21131/actions POST

# remove device
$ packet-cli call-api /devices/6865479e-14d2-492d-ae61-e63dff813229 DELETE

# lock device
$ packet-cli --params "{locked : true }" call-api devices/d39ecd03-d5df-4252-8bc6-f558d53a86bf PATCH

# create new SSH key
$ packet-cli create-ssh-key newkeylabel "`cat keys/key.pub`"

packet-python3-cli's People

Contributors

t0mk avatar

Watchers

James Cloos avatar  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.