hyperonecom / h1-cli

Command-line interface for HyperOne platform
MIT License
6 stars 4 forks source link

h1-cli

Codacy Badge Build Status

h1-cli is a console tool designed to manage the HyperOne cloud infrastructure. You can use it for your own administrative work as well as for creating automation scripts.

Features overview

The reference documentation contains a complete set of information on the possible actions to be taken and their options.

Installation

Detailed instruction about installation is available at HyperOne.com for:

Usage

The commands are composed of the following components:

$ h1 [categories [...]] command [[options] ...]

This structure is repeated in all application commands.

To start the work you should log in via the command:

$ h1 login --username {{user_email}}

You will be asked to enter the password:

? Password: ****

After correctly logging in, you will receive a message about obtaining the API key for the session:

info: You successfully logged and stored your apiKey in config file

The credentials have been saved in $HOME/.h1-cli/conf.json. You must ensure the confidentiality of these files.

If you use more than 1 project you must select actively used by downloading the proper identifier:

$ h1 project list

Then, confirm this choice:

$ h1 project select --project {{project}}

Creating a server

Below is an example session presenting the basic actions - creating a server

$ h1 vm list
ID                        NAME           FLAVOUR    STATE    PROCESSING  TAGS
5b3f7c863adfaa0d10f7b445  docker-node    a1.small   Off      false       
5b3f8b7b3adfaa0d10f7bed4  docker-laas    a1.micro   Running  false       zabbix_agent
5b439f6b3adfaa0d10f90820  docker-node-2  m2.medium  Running  false       zabbix_agent,docker_registry

$ h1 user credentials list
ID                        NAME    TYPE  CREATED
5b30d80cddd5b3c5e9ee8dfe  my-ssh  ssh   2018-06-25T11:54:52.159Z

$ h1 vm create --name vm-tutorial --ssh my-ssh --image ubuntu:18.04 --type a1.micro --os-disk ssd,10
ID                        NAME         FLAVOUR   STATE    PROCESSING  TAGS
5b44b43511b0b1e6f24eb623  vm-tutorial  a1.micro  Running  false  

$ h1 vm list
ID                        NAME           FLAVOUR    STATE    PROCESSING  TAGS
5b44b43511b0b1e6f24eb623  vm-tutorial    a1.micro   Running  false       

Description of the basic command parametersh1 vm create --name vm-tutorial --ssh my-ssh --image ubuntu:18.04 --type a1.micro --os-disk ssd,10:

The SSH key is available after importing it. For example via the command h1 user credentials add --sshkey-file ~/.ssh/id_rsa.pub --name $(hostname)..

Servers managements

The following are the basic actions that can be performed with servers in the form of example commands:

It is also possible to make changes regarding disks attached to the server:

These operations do not require disabling virtual machines for non-system disks.

Disks managements

Disks are data carriers for servers. It is possible to switch them and modify them during the operation of virtual machines.

The following are the basic actions that can be performed with disks in the form of example commands:

Disk extension is not possible for system disks on running server. In the case of a system disk, you have to shut down the server first. In other cases you can resize disk when virtual machine and operating system is running.

Images management

You can create virtual machine images as well as manage them. The image allow you to create servers with the same configuration or to create a temporary copy of the instance, e.g. to protect the system state from significant updates.

The following are the basic actions that can be taken with images in the form of example commands:

Managing other resources

It is worth paying attention to:

For other resources, use the --help parameter, which documents the CLI features in a full and up-to-date manner.

The reference documentation of the other commands is available in the repository.

Reporting problems and comments

If you encounter any errors with the tool, please report the problem through the notification system in the administration panel or the Issues tab in the repository.