civo 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +17 -0
- data/bin/civo +1 -1
- data/lib/civo.rb +1 -1
- data/lib/civo/cli/commands/accounts.rb +6 -0
- data/lib/civo/cli/commands/instances.rb +7 -15
- data/lib/civo/cli/commands/regions.rb +1 -0
- data/lib/civo/cli/commands/sizes.rb +3 -0
- data/lib/civo/cli/commands/sshkeys.rb +7 -0
- data/lib/civo/cli/commands/templates.rb +1 -0
- data/lib/civo/cli/commands/tokens.rb +6 -0
- data/lib/civo/version.rb +1 -1
- metadata +1 -2
- data/lib/civo/cli/commands/version.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88fb842b620664375d47a297a498bffc90d906ba
|
4
|
+
data.tar.gz: 75269b25b36f9bb7c4aafe806ec3f79598853e18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b7927c1ed8cbdf0ec0c605310bd3f240a63b0c89463840ae994461fe9b8b13b1a3f1178a96f9beb7d698a04266ed5f66fcc672221dbedd11b9a12a4c2010740
|
7
|
+
data.tar.gz: 650c51ba8cb87e2e9d20de8e4681898122c8df560df08d1b3756ebd340457ba4ee36bb141644541359827a765fefb4fb04af3926cfb3141b30bf6f0e08274741
|
data/Rakefile
CHANGED
@@ -15,3 +15,20 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
15
15
|
end
|
16
16
|
|
17
17
|
Bundler::GemHelper.install_tasks
|
18
|
+
|
19
|
+
task :console do
|
20
|
+
require 'irb'
|
21
|
+
require 'irb/completion'
|
22
|
+
ENGINE_ROOT = File.expand_path('..', __FILE__)
|
23
|
+
ENGINE_PATH = File.expand_path('../lib/civo/engine', __FILE__)
|
24
|
+
|
25
|
+
# Set up gems listed in the Gemfile.
|
26
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
27
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
28
|
+
require 'commander/import'
|
29
|
+
require 'toml'
|
30
|
+
require 'flexirest'
|
31
|
+
require_relative "#{ENGINE_ROOT}/lib/civo.rb"
|
32
|
+
ARGV.clear
|
33
|
+
IRB.start
|
34
|
+
end
|
data/bin/civo
CHANGED
@@ -11,7 +11,7 @@ require 'toml'
|
|
11
11
|
require 'flexirest'
|
12
12
|
require_relative "#{ENGINE_ROOT}/lib/civo.rb"
|
13
13
|
|
14
|
-
program :version,
|
14
|
+
program :version, Civo::VERSION
|
15
15
|
program :description, 'Civo CLI and API client library'
|
16
16
|
|
17
17
|
require_relative "#{ENGINE_ROOT}/lib/civo/cli/commands/tokens.rb"
|
data/lib/civo.rb
CHANGED
@@ -12,7 +12,7 @@ module Civo
|
|
12
12
|
autoload :Base, "#{ENGINE_ROOT}/app/models/civo/base"
|
13
13
|
autoload :SshKey, "#{ENGINE_ROOT}/app/models/civo/ssh_key"
|
14
14
|
autoload :Quota, "#{ENGINE_ROOT}/app/models/civo/quota"
|
15
|
-
autoload :Size, "#{ENGINE_ROOT}/app/models/civo/size"
|
15
|
+
autoload :Size, "#{ENGINE_ROOT}/app/models/civo/size.rb"
|
16
16
|
autoload :Region, "#{ENGINE_ROOT}/app/models/civo/region"
|
17
17
|
autoload :Template, "#{ENGINE_ROOT}/app/models/civo/template"
|
18
18
|
autoload :Instance, "#{ENGINE_ROOT}/app/models/civo/instance"
|
@@ -9,6 +9,7 @@ command "accounts" do |c|
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
12
|
+
alias_command "account", "accounts"
|
12
13
|
|
13
14
|
command "accounts:create" do |c|
|
14
15
|
c.description = "Create an account (CIVO-INTERNAL-USE ONLY)"
|
@@ -22,6 +23,7 @@ command "accounts:create" do |c|
|
|
22
23
|
end
|
23
24
|
end
|
24
25
|
end
|
26
|
+
alias_command "account:create", "accounts:create"
|
25
27
|
|
26
28
|
command "accounts:reset" do |c|
|
27
29
|
c.description = "Reset the API Key for an account (CIVO-INTERNAL-USE ONLY)"
|
@@ -35,6 +37,7 @@ command "accounts:reset" do |c|
|
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|
40
|
+
alias_command "account:reset", "accounts:reset"
|
38
41
|
|
39
42
|
command "accounts:remove" do |c|
|
40
43
|
c.description = "Remove an account (and all instances, networks, etc) (CIVO-INTERNAL-USE ONLY)"
|
@@ -56,3 +59,6 @@ command "accounts:remove" do |c|
|
|
56
59
|
end
|
57
60
|
end
|
58
61
|
end
|
62
|
+
alias_command "account:remove", "accounts:remove"
|
63
|
+
alias_command "accounts:delete", "accounts:remove"
|
64
|
+
alias_command "account:delete", "accounts:remove"
|
@@ -15,6 +15,7 @@ command "instances" do |c|
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
18
|
+
alias_command "instance", "instances"
|
18
19
|
|
19
20
|
command "instances:create" do |c|
|
20
21
|
c.description = "Create an instance"
|
@@ -45,23 +46,11 @@ command "instances:create" do |c|
|
|
45
46
|
end
|
46
47
|
end
|
47
48
|
end
|
48
|
-
|
49
|
-
command "instances:reset" do |c|
|
50
|
-
c.description = "Reset the API Key for an account"
|
51
|
-
c.example "Resets the account called 'testuser' with a new API key", 'civo instances:reset testuser'
|
52
|
-
c.action do |args, options|
|
53
|
-
begin
|
54
|
-
account = Civo::Instance.reset(name: args.first)
|
55
|
-
puts "Account '#{args.first}' reset, the new API key is '#{account.api_key}'"
|
56
|
-
rescue Flexirest::HTTPUnauthorisedClientException, Flexirest::HTTPForbiddenClientException
|
57
|
-
puts "Access denied to your default token, ensure it's set correctly with 'civo tokens'"
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
49
|
+
alias_command "instance:create", "instances:create"
|
61
50
|
|
62
51
|
command "instances:remove" do |c|
|
63
|
-
c.description = "Remove an
|
64
|
-
c.example "Removes an
|
52
|
+
c.description = "Remove an instance by hostname or id"
|
53
|
+
c.example "Removes an instance called 'test.example.com'", 'civo instances:remove test.example.com'
|
65
54
|
c.action do |args, options|
|
66
55
|
begin
|
67
56
|
if args.first[/(\w{8}(-\w{4}){3}-\w{12}?)/]
|
@@ -85,3 +74,6 @@ command "instances:remove" do |c|
|
|
85
74
|
end
|
86
75
|
end
|
87
76
|
end
|
77
|
+
alias_command "instance:remove", "instances:remove"
|
78
|
+
alias_command "instances:delete", "instances:remove"
|
79
|
+
alias_command "instance:delete", "instances:remove"
|
@@ -9,6 +9,7 @@ command "sizes" do |c|
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
12
|
+
# alias_command "sizes", "size"
|
12
13
|
|
13
14
|
command "sizes:reset" do |c|
|
14
15
|
c.description = "Reset available instance sizes"
|
@@ -21,3 +22,5 @@ command "sizes:reset" do |c|
|
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
25
|
+
|
26
|
+
alias_command "size:reset", "sizes:reset"
|
@@ -9,6 +9,7 @@ command "sshkeys" do |c|
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
12
|
+
alias_command "sshkey", "sshkeys"
|
12
13
|
|
13
14
|
command "sshkeys:upload" do |c|
|
14
15
|
c.description = "Upload an SSH public key for installing in to new instances"
|
@@ -23,6 +24,9 @@ command "sshkeys:upload" do |c|
|
|
23
24
|
end
|
24
25
|
end
|
25
26
|
end
|
27
|
+
alias_command "sshkeys:create", "sshkeys:upload"
|
28
|
+
alias_command "sshkey:upload", "sshkeys:upload"
|
29
|
+
alias_command "sshkey:create", "sshkeys:upload"
|
26
30
|
|
27
31
|
command "sshkeys:remove" do |c|
|
28
32
|
c.description = "Remove an SSH public key from the list you've uploaded"
|
@@ -44,3 +48,6 @@ command "sshkeys:remove" do |c|
|
|
44
48
|
end
|
45
49
|
end
|
46
50
|
end
|
51
|
+
alias_command "sshkey:remove", "sshkeys:remove"
|
52
|
+
alias_command "sshkey:delete", "sshkeys:remove"
|
53
|
+
alias_command "sshkeys:delete", "sshkeys:remove"
|
@@ -9,6 +9,7 @@ command "tokens" do |c|
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
12
|
+
alias_command "token", "tokens"
|
12
13
|
|
13
14
|
command "tokens:save" do |c|
|
14
15
|
c.description = "Save an API token supplied by Civo.com"
|
@@ -17,6 +18,7 @@ command "tokens:save" do |c|
|
|
17
18
|
Civo::Token.save(args[0], args[1])
|
18
19
|
end
|
19
20
|
end
|
21
|
+
alias_command "token:save", "tokens:save"
|
20
22
|
|
21
23
|
command "tokens:default" do |c|
|
22
24
|
c.description = "Set the default token from the list you have saved"
|
@@ -25,6 +27,9 @@ command "tokens:default" do |c|
|
|
25
27
|
Civo::Token.set_default(args[0])
|
26
28
|
end
|
27
29
|
end
|
30
|
+
alias_command "tokens:use", "tokens:default"
|
31
|
+
alias_command "token:use", "tokens:default"
|
32
|
+
alias_command "token:default", "tokens:default"
|
28
33
|
|
29
34
|
command "tokens:remove" do |c|
|
30
35
|
c.description = "Remove a token from the list you have saved"
|
@@ -33,3 +38,4 @@ command "tokens:remove" do |c|
|
|
33
38
|
Civo::Token.remove(args[0])
|
34
39
|
end
|
35
40
|
end
|
41
|
+
alias_command "token:remove", "tokens:remove"
|
data/lib/civo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: civo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Jeffries
|
@@ -82,7 +82,6 @@ files:
|
|
82
82
|
- lib/civo/cli/commands/sshkeys.rb
|
83
83
|
- lib/civo/cli/commands/templates.rb
|
84
84
|
- lib/civo/cli/commands/tokens.rb
|
85
|
-
- lib/civo/cli/commands/version.rb
|
86
85
|
- lib/civo/cli/config.rb
|
87
86
|
- lib/civo/cli/token.rb
|
88
87
|
- lib/civo/engine.rb
|