hetznercloud / cli Goto Github PK
View Code? Open in Web Editor NEWA command-line interface for Hetzner Cloud
License: MIT License
A command-line interface for Hetzner Cloud
License: MIT License
Hi, when using hcloud to create a new server i get this error: "Server limit reached" Was it this ?
hcloud server change-type ID TYPE
hcloud server update ID --name NAME
It is not possbile to get the server location and datacenter via the CLI neither with
hcloud server list
nor
hcloud server describe xxx
While the API provides the information.
Hi, is the option --user-data supported when creating server ?
It builds, but there are problems:
hcloud: config file path unknown
(Windows has no $HOME
)hcloud server attach-iso ID ISO
We want to be able to control how output is formatted.
For example, we want to disable printing the column names (first line) to be able to do things like:
$ hcloud server list | wc -l
5
Or to specify which columns are printed:
$ hcloud server list
ID
1
2
3
In the future we might also want to support other output formats (JSON, YAML).
Output is completely controlled via the -o
option which can be specified multiple times with different values. A value is either just a key key
or a key-value pair key=value
.
To disable printing column names:
$ hcloud -o nocolumns server list
To only print the ID and name columns and sort by name:
$ hcloud -o columns=id,name -o sort=name:desc server list
To output JSON:
$ hcloud -o format=json server list
The option format=table
is the default output format.
I'm under Windows 10 using "hcloud-windows-amd64-v1.3.1.zip" release.
I followed the 3 steps from https://github.com/hetznercloud/cli#getting-started
Result: hcloud: unable to authenticate your token (unauthorized)
For some reason hcloud is not using/accepting my token.
hcloud image update <TAB>
does not complete image ID.
When using hcloud
in a CI environment, the user should be able to pass the token via environment variables.
hcloud iso describe ID
Most users seem to assume that after creating a context it is automatically used. Maybe we can satisfy this expectation?
Even if we do not decide to auto-select recently created context we should print a message after context creation which clearly indicates what has happened:
Either
hcloud context x use
to activate orHiho,
maybe I'm blind, but the most obvious point seems to be missing: metrics. This is surprising, since the API has a query for that: https://docs.hetzner.cloud/#resources-servers-get-2
Would love to see that for daily reports :)
hcloud image update ID --description DESCRIPTION --type TYPE
Using dep.
$ hcloud floating-ip list
ID TYPE DESCRIPTION IP HOME SERVER DNS
49 ipv6 dsds 2a01:4f8:1c17:2c:: fsn1 - -
Fix it everywhere.
Floating IPs:
- ID: 49
Description: dsds
IP: 2a01:4f8:1c17:2c::
An asciinema showing the CLI in action would be nice.
hcloud server enable-backup ID --window WINDOW
Sometimes you want to use the CLI in a shell script to get some information, but parsing the output is obviously a bad idea. We should consider adding JSON support so you can access information in a structured way.
Have a look at how docker inspect
enables this: https://docs.docker.com/engine/reference/commandline/inspect/#extended-description
>hcloud floating-ip create --help
Create a Floating IP
Usage:
hcloud floating-ip create FLAGS
Flags:
--description string Description
-h, --help help for create
--home-location string Home location
--server string Server to assign Floating IP to
--type string Type
For type we should show the valid choices (ipv4
, ipv6
) in the help text.
How about making ipv4 the default for type?
Just builded the client on a ubuntu-16.04 machine (while being connectec via ssh) with golang-1.9 the auto-completion sometimes fails (for example auto completing the ssh-key inside the server create) will lead to the following error:
_handle_flag:27: bad math expression: illegal character: ^[
In the case of spawning a lot of instances, it may be useful to set the reverse lookup to the instance name, if the instance name is a DNS hostname.
This would prevent to change in XYZ instances manually in the console or with the API.
like initial setup cannot be scripted:
# echo "XXXXXXXX_TOKEN_XXXXXXXX" | hcloud context create Testing
Token:
hcloud: inappropriate ioctl for device
server delete
floating-ip delete
image delete
ssh-key delete
hcloud server rebuild ID --image IMAGE
hcloud server detach-iso ID
hcloud ssh-key describe NAME
hcloud ssh-key delete NAME
When there are no contexts and the first one is created, automatically activate it.
hcloud iso list
Like when entering a password on the command line. There is probably already a library providing this.
Use -o noheader
instead deleting the header with grep -v '^ID'
.
$ hcloud server update test1
Server test1 updated
github.com/hetznercloud/hcloud-go
to v1.0.0
in Gopkg.tomlVersion
constant to 1.0.0hcloud datacenter list
The builds include textfiles. Their line endings are currently in unix format. When building the Windows version we should convert them to the Windows format.
Maybe use one of the methods from http://www.microhowto.info/howto/convert_the_line_endings_in_a_text_file_from_unix_to_dos_format.html ?
Don’t just say “unauthorized”. 😕
Right now hcloud image list
seems to show images of all types. We should consider adding an optional argument --type
which enables you to only list images of a certain type, e.g.
hcloud image list --type system
will only show system images
Show -
when it’s zero.
hcloud floating-ip update ID --description DESCRIPTION
hcloud location list
hcloud server disable-backup ID
$ hcloud image describe ubuntu-16.04
...
Created: 2018-01-15 11:34:45 +0000 +0000 (1 week ago)
...
Having the offset printed twice looks odd. We should print it either as UTC or in the user’s local time.
$ hcloud context active
foo
$ HCLOUD_CONTEXT=bar hcloud context active
bar
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.