civo_cli 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a990a4394121647d574094b564c731d6c0b3d0c578449a7b3a3242d09073d11a
4
- data.tar.gz: 2e9ab309f83c89f56939ced1394f46f4e412cdc8053526dc6b5084ca57a9328b
3
+ metadata.gz: 978698444b706bd68c75dbee0d66e847ae5deec7094e617667964c30971d9f23
4
+ data.tar.gz: 042c137693dc532f64f27873e36f3f182e7fd7d4a567d481b84b272118c54a7f
5
5
  SHA512:
6
- metadata.gz: 02f29d1426fbeee3e56c7ebb536008694a9dd5eaec3af6047283656fa051d093a7d94909d3053ca8530ee0dceb8b3e6745e88f853996cf4a31f2322223c85eab
7
- data.tar.gz: f5dae08ebcdf7f1e0e0c0206034cda730339932cc1c2ab22facc6a775c6a15ab96dca5ad58c15cb07d53ca00032341f6ebc6accc999602b1e89cd2d2a3a1fcb3
6
+ metadata.gz: 0ee196d1e1587e05fd0b09099151334a6264a65edec7446182d076d2a49119388d838e78bf37cfe4c48b2e1fb5e5a90bb7ec8c391796296e5d1de97f8a94ce6c
7
+ data.tar.gz: de0018540d48efd6b9c0b37d27fcc83a394b5fb3be095511e449a9fb2a694c3c10478390f486f92fa8742dfe3240071a28e79953b5fa575ad1615b3dfb9aacff
data/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@ All notable changes to the Civo CLI will be documented in this file.
3
3
 
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## [0.3.5] - 2019-07-11
7
+ ### Removed
8
+ - Removed password from output of `instance show`
9
+
10
+ ### Added
11
+ - `instance password` method to show initial user password for specific instance. Accepts --quiet (-q) to output single-line.
12
+ - `--quiet (-q)` switch to `instance public_ip` to display output on single line.
13
+
6
14
  ## [0.3.4] - 2019-07-10
7
15
  ### Fixed
8
16
  - Template ID in `instance create` default wasn't working nicely, now defaults to Ubuntu if not provided and no snapshot specified
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- civo_cli (0.3.4)
4
+ civo_cli (0.3.5)
5
5
  bundler (~> 1.17)
6
6
  civo (>= 1.2.1)
7
7
  colorize
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  ## Introduction
4
4
  Civo CLI is a tool to manage your [Civo.com](https://www.civo.com) account from the terminal. The [Civo web control panel](https://www.civo.com/account/) has a user-friendly interface for managing your account, but in case you want to automate or run scripts on your account, or have multiple complex services, the command-line interface outlined here will be useful. This guide will cover the set-up and usage of the Civo CLI tool with examples.
5
5
 
6
- **STATUS:** This project is currently under active development and maintainance.
6
+ **STATUS:** This project is currently under active development and maintenance.
7
7
 
8
8
  ## Table of contents
9
9
  - [Introduction](#introduction)
@@ -99,7 +99,6 @@ $ civo instance show api-demo.test
99
99
  Firewall : (rules: )
100
100
  Region : lon1
101
101
  Initial User : api-demouser
102
- Initial Password : [randomly-assigned-password-here]
103
102
  OpenStack ID : 7c89f7de-2b29-4178-a2e5-55bdaa5c4c21
104
103
  Template ID : 811a8dfb-8202-49ad-b1ef-1e6320b20497
105
104
  Snapshot ID :
@@ -111,6 +110,26 @@ $ civo instance show api-demo.test
111
110
 
112
111
  You will be able to see the instance's details by running `civo instance show api-demo.test` as above.
113
112
 
113
+ #### Viewing the Default User Password For an Instance
114
+ You can view the default user's password for an instance by running `civo instance password ID/hostname`
115
+ ```
116
+ $ civo instance password api-demo.test
117
+ The password for user civo on api-demo.test is 5OaGxNhaN11pLeWB
118
+ ```
119
+ You can also run this command with the option `-q` to get only the password output, useful for scripting situations:
120
+ ```
121
+ $ civo instance password -q api-demo.test
122
+ 5OaGxNhaN11pLeWB
123
+ ```
124
+
125
+ #### Viewing Instance Public IP Address
126
+ If an instance has a public IP address configured, you can display it using `civo instance ip_address ID/hostname`:
127
+ ```
128
+ $ civo instance ip_address -q api-demo.test
129
+ 91.211.152.100
130
+ ```
131
+ The above example uses `-q` to display only the IP address in the output.
132
+
114
133
  #### Setting Firewalls
115
134
  Instances can make use of separately-configured firewalls. By default, an instance is created with no firewall rules set, so you will need to configure some rules (see [Firewalls](#firewalls) for more information).
116
135
 
@@ -174,7 +193,6 @@ $ civo instance show api-demo.test
174
193
  Firewall : (rules: )
175
194
  Region : lon1
176
195
  Initial User : api-demouser
177
- Initial Password : [randomly-assigned-password-here]
178
196
  OpenStack ID : 7c89f7de-2b29-4178-a2e5-55bdaa5c4c21
179
197
  Template ID : 811a8dfb-8202-49ad-b1ef-1e6320b20497
180
198
  Snapshot ID :
@@ -199,7 +217,6 @@ $ civo instance show api-demo-renamed.test
199
217
  Firewall : (rules: )
200
218
  Region : lon1
201
219
  Initial User : api-demouser
202
- Initial Password : [randomly-assigned-password-here]
203
220
  OpenStack ID : 7c89f7de-2b29-4178-a2e5-55bdaa5c4c21
204
221
  Template ID : 811a8dfb-8202-49ad-b1ef-1e6320b20497
205
222
  Snapshot ID :
@@ -255,7 +272,7 @@ $ civo kubernetes list
255
272
  +--------------------------------------+------+---------+-----------+--------+
256
273
  ```
257
274
 
258
- ####  Create a cluster
275
+ #### Create a cluster
259
276
  You can create an instance by running `civo kubernetes create` with a cluster name parameter, as well as any options you provide:
260
277
 
261
278
  * `size` - The size of nodes to create, from the current list of sizes available at [`civo sizes`](#sizes). Defaults to `g2.medium`.
@@ -474,8 +491,7 @@ $ civo quota
474
491
  +------------------+-------+-------+
475
492
  Any items in red are at least 80% of your limit
476
493
  ```
477
- If you have a legitimate need for a quota increase, visit the [
478
- ](https://www.civo.com/account/quota) to place your request - we won't unreasonably withhold any increase, it's just in place so we can control the rate of growth of our platform and so that erran scripts using our API don't suddenly exhaust our available resources.
494
+ If you have a legitimate need for a quota increase, visit the [Quota page](https://www.civo.com/account/quota) to place your request - we won't unreasonably withhold any increase, it's just in place so we can control the rate of growth of our platform and so that erran scripts using our API don't suddenly exhaust our available resources.
479
495
 
480
496
  ## Regions
481
497
  As Civo grows, more regions for hosting your instances will become available. You can run `civo region` to list the regions available. Block storage (Volumes) is region-specific, so if you configure an instance in one region, any volumes you wish to attach to that instance would have to be in the same region.
@@ -566,9 +582,9 @@ Removed SSH key cli-demo with ID 531d0998-4152-410a-af20-0cccb1c7c73b
566
582
  Civo instances are built from a template that specifies a disk image. Templates can contain the bare-bones OS install such as Ubuntu or Debian, or custom pre-configured operating systems that you can create yourself from a bootable volume. This allows you to speedily deploy pre-configured instances.
567
583
 
568
584
  #### Listing Available Template Images
569
- A simple list of available templates, both globally-defined ones and user-configured account-specific templates, can be seen by running `civo template list`:
585
+ A simple list of available templates, both globally-defined ones and user-configured account-specific templates, can be seen by running `civo template list` or `civo template list --verbose` for maximum information:
570
586
  ```
571
- $ civo template list
587
+ $ civo template list --verbose
572
588
  +--------------------------------------+----------------------+--------------------------------------+--------------------------------------+------------------+
573
589
  | ID | Name | Image ID | Volume ID | Default Username |
574
590
  +--------------------------------------+----------------------+--------------------------------------+--------------------------------------+------------------+
@@ -1,3 +1,3 @@
1
1
  module CivoCLI
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
data/lib/instance.rb CHANGED
@@ -61,7 +61,6 @@ module CivoCLI
61
61
  puts " Firewall : #{@firewall&.name} (rules: #{@firewall&.rules_count})"
62
62
  puts " Region : #{instance.region}"
63
63
  puts " Initial User : #{instance.initial_user}"
64
- puts " Initial Password : #{instance.initial_password}"
65
64
  if instance.ssh_key.present?
66
65
  key = ssh_keys.detect { |k| k.id == instance.ssh_key }
67
66
  puts " SSH Key : #{key.name} (#{key.fingerprint})"
@@ -287,12 +286,17 @@ module CivoCLI
287
286
  end
288
287
 
289
288
  desc "public_ip ID/HOSTNAME", "Show public IP of ID/hostname"
289
+ option :quiet, type: :boolean, aliases: '-q'
290
290
  def public_ip(id)
291
291
  CivoCLI::Config.set_api_auth
292
292
 
293
293
  instance = detect_instance(id)
294
294
  unless instance.public_ip.nil?
295
- puts instance.public_ip
295
+ if options[:quiet]
296
+ puts instance.public_ip
297
+ else
298
+ puts "The public IP for #{instance.hostname.colorize(:green)} is #{instance.public_ip.colorize(:green)}"
299
+ end
296
300
  else
297
301
  puts "Error: Instance has no public IP"
298
302
  exit 2
@@ -303,6 +307,21 @@ module CivoCLI
303
307
  exit 1
304
308
  end
305
309
 
310
+ desc "password ID/HOSTNAME", "Show the default user password for instance with ID/HOSTNAME"
311
+ option :quiet, type: :boolean, aliases: '-q'
312
+ def password(id)
313
+ CivoCLI::Config.set_api_auth
314
+ instance = detect_instance(id)
315
+ if options[:quiet]
316
+ puts instance.initial_password
317
+ else
318
+ puts "The password for user #{instance.initial_user.colorize(:green)} on #{instance.hostname.colorize(:green)} is #{instance.initial_password.colorize(:green)}"
319
+ end
320
+ rescue Flexirest::HTTPException => e
321
+ puts e.result.reason.colorize(:red)
322
+ exit 1
323
+ end
324
+
306
325
  default_task :list
307
326
 
308
327
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: civo_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries