docli 0.0.2.pre.alpha.pre.12 → 0.0.2.pre.alpha.pre.15

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06acab63a46aed64a70bd67cd7998673bd31ba0e
4
- data.tar.gz: 0468079d371e5641e939eb7a77df4166c7998121
3
+ metadata.gz: 2798d692a350a4cbb3cf235c247ca534ba9b75c8
4
+ data.tar.gz: fcfdfa9fb9bad47bcd24551474ade885e6b4d2ed
5
5
  SHA512:
6
- metadata.gz: 1945b36413d38282a14c7cc476e8f0f9e295a1a15e58606a1b507567dd58a401d34706ed62fb1adbc4e9260194f5e8924f34f8b9db925f3bf99a0d9c05edb47f
7
- data.tar.gz: 177a01a6428f1a2883c63946d95d724a4702edbd83e11bffcb2cb4090229f675f7d56216399741abd82714186b86ecc0e3dd8ca4e2ce45d322644af8b9a31bc9
6
+ metadata.gz: 76eb57cbd8c4d930dfbc84bca1a75119e7c48dc8971b064e6e4b5961578d96d3d401def18a62d1ceaeba57fa0fcd59dddd6eaada6f87a1940c44a1636ba5051e
7
+ data.tar.gz: 840ac7bfdc9e325b6a165a6248f3fbfc7278afbd68e0f50f68cd33a3d4d69e0c6310608a503307fe82ff98c143ccc975fbfc7324d07a84df519579d08bfcb40f
data/.byebug_history CHANGED
@@ -1,142 +1,9 @@
1
1
  exit
2
- config
3
- c
4
- exit
5
- options
6
- exit
7
- options.symbolize_keys
8
- options
9
- exit
10
- options.symbolize_keys
11
- options.symbolize_keys!
12
- options
13
- options.symbolize_keys!
14
- options.symbolize_keys
15
- options.symbolze_keys
16
- options
17
- exit
18
- options.to_hash
19
- options.class
20
- options['filename']
21
- options[:filename]
22
- options
23
- exit
24
- method(:options).source_location
25
- Docli::Utils.symbolize_keys(options)
26
- options
27
- exit
28
- options
29
- exit
30
- Docli.client.droplets.all('tag_name' => 'ThanhPM').count
31
- Docli.client.droplets.all(tag_name: 'ThanhPM').count
32
- droplet_objects.map { |v| v.name}
33
- droplet_objects.count
34
- droplet_objects = Docli.client.droplets.all(tag_name: 'ThanhPM')
35
- options.symbolize_keys!
36
- options
37
- c
38
- })
39
- status: drlet.status
40
- size: drlet.size_slug,
41
- region: "#{drlet.region.slug} (#{drlet.region.name})",
42
- ipv4: drlet.networks.v4.find { |v| v.type == 'public' }.ip_address,
43
- name: drlet.name,
44
- id: drlet.id,
45
- tp({
46
- drlet.id
47
- drlet.name
48
- drlet.networks.v4.find { |v| v.type == 'public' }.ip_address
49
- "#{drlet.region.slug} (#{drlet.region.name})"
50
- "#{drlet.region.slug}(#{drlet.region.name})"
51
- drlet.size_slug
52
- drlet.status
53
- drlet = droplet_object
54
- drlet
55
- drlet.status
56
- [Ddrlet.status
57
- c
58
- droplet_object.region.name
59
- droplet_object.region
60
- droplet_object.name
61
- droplet_object.id
62
- droplet_object
63
- exit
64
- def l
65
- name: drlet.name,
66
- x = {
67
- }
68
- :status => drlet.status
69
- size_slug: drlet.size_slug.
70
- region: drlet.region.slug,
71
- ipv4: drlet.networks.v4.find { |v| v.type == 'public' }.ip_address,
72
- name: drlet.name,
73
- e = {
74
- e
75
- }
76
- :status => drlet.status
77
- size_slug: drlet.size_slug.
78
- region: drlet.region.slug,
79
- ipv4: drlet.networks.v4.find { |v| v.type == 'public' }.ip_address,
80
- name: drlet.name,
81
- x = {
82
- }
83
- :status => drlet.status
84
- size_slug: drlet.size_slug.
85
- region: drlet.region.slug,
86
- ipv4: drlet.networks.v4.find { |v| v.type == 'public' }.ip_address,
87
- name: drlet.name,
88
- tp {
89
- drlet = e
90
- e.as_json(only: [:id])
91
- e
92
- puts e.to_json
93
- puts e.as_json
94
- puts _
95
- e.as_json
96
- e.memory
97
- e.sizes
98
- e.size
99
- e.status
100
- e = droplet_objects.first
101
- droplet_objects.count
102
- droplet_objects
103
- exit
104
- puts ex.message
105
- ex.message
106
- ex.class
107
- ex.cause
108
- ex.methods
109
- ex.message
110
- ex.body
111
- ex.message
112
- ex
113
- c
114
- exit
115
- access_token
116
- exit
117
- access_token
118
- exit
119
- access_token
120
- exit
121
- current_access_token
122
- new_access_token
123
- access_token
124
- exit
125
- new_access_token
126
- access_token
127
- exit
128
- new_access_token
129
- access_token
130
- exit
131
- FileUtils::mkdir_p Docli::CONFIG_FILE.split('/')[0..-2].join('/')
132
- FileUtils::mkdir_p Docli::CONFIG_FILE.split('/')[0..-1].join('/')
133
- FileUtils::mkdir_p Docli::CONFIG_FILE
134
- FileUtils::mkdir_p Docli::CONFIG_FILE.split('/')[0..-1].join
135
- Docli::CONFIG_FILE
136
- exit
137
- config[:current_command].name
138
- config[:current_command].to_s
139
- config[:current_command]
140
- config
141
- local_options
142
- args
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
data/docli.gemspec CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.add_runtime_dependency 'colorize', '0.8.1'
34
34
  spec.add_runtime_dependency 'json', '2.0.4'
35
35
  spec.add_runtime_dependency 'table_print', '1.5.6'
36
- spec.add_runtime_dependency 'droplet_kit', '1.4.3'
36
+ spec.add_runtime_dependency 'droplet_kit', '2.1.0'
37
37
  spec.add_runtime_dependency 'thread_safe', '~> 0.3'
38
38
  spec.add_runtime_dependency 'activesupport', '< 5.1'
39
39
  spec.add_runtime_dependency 'concurrent-ruby', '1.0.5'
@@ -46,7 +46,7 @@ Gem::Specification.new do |spec|
46
46
  spec.add_runtime_dependency 'equalizer', '0.0.11'
47
47
  spec.add_runtime_dependency 'tzinfo', '1.2.3'
48
48
  spec.add_runtime_dependency 'descendants_tracker', '0.0.4'
49
- spec.add_runtime_dependency 'resource_kit', '0.1.5'
49
+ spec.add_runtime_dependency 'resource_kit', '0.1.6'
50
50
  spec.add_runtime_dependency 'faraday', '0.9.2'
51
51
  spec.add_runtime_dependency 'axiom-types', '0.1.1'
52
52
  spec.add_runtime_dependency 'coercible', '1.0.0'
data/exe/docli CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  require 'docli'
4
4
 
5
- Docli::Main.start(ARGV)
5
+ Docli::Main.start(ARGV)
data/lib/cmd/account.rb CHANGED
@@ -1,12 +1,9 @@
1
1
  # Account information
2
2
 
3
3
  module Cmd
4
- class Account
5
- @client = Docli.client
6
-
4
+ class Accounts
7
5
  def self.get_user_information
8
- return @client.account.info
6
+ return Docli.client.account.info
9
7
  end
10
-
11
8
  end
12
9
  end
data/lib/cmd/domains.rb CHANGED
@@ -3,10 +3,9 @@
3
3
 
4
4
  module Cmd
5
5
  class Domains
6
- @client = Docli.client
7
6
 
8
7
  def self.list_all_domains domain
9
- return @client.domains.create(domain)
8
+ return Docli.client.domains.create(domain)
10
9
  end
11
10
 
12
11
  end
data/lib/cmd/volume.rb CHANGED
@@ -1,9 +1,8 @@
1
1
  # Block storage actions and informations
2
2
 
3
3
 
4
- module CMD
4
+ module Cmd
5
5
  class Volumes
6
- @client = Docli.client
7
6
  # volume_options = {
8
7
  # :size_gigabytes => integer,
9
8
  # :name => string,
@@ -19,7 +18,7 @@ module CMD
19
18
  region: volume_options[:region],
20
19
  snapshot_id: volume_options[:snapshot_id]
21
20
  )
22
- return @client.volumes.create(new_volume)
21
+ return Docli.client.volumes.create(new_volume)
23
22
  end
24
23
 
25
24
  # options = {
@@ -28,11 +27,11 @@ module CMD
28
27
  # region =>
29
28
  # }
30
29
  def self.attach_volume_to_droplet options
31
- return @client.volume_actions.attach(options)
30
+ return Docli.client.volume_actions.attach(options)
32
31
  end
33
32
 
34
33
  def self.list_all_volumes
35
- return @client.volumes.all
34
+ return Docli.client.volumes.all
36
35
  end
37
36
 
38
37
  # options = {
@@ -41,11 +40,11 @@ module CMD
41
40
  # region =>
42
41
  # }
43
42
  def self.attach_volume_to_droplet options
44
- return @client.volume_actions.detach(options)
43
+ return Docli.client.volume_actions.detach(options)
45
44
  end
46
45
 
47
46
  def self.retrieve_existing_volume volume_id
48
- return @client.volumes.find(id: volume_id)
47
+ return Docli.client.volumes.find(id: volume_id)
49
48
  end
50
49
 
51
50
  end
data/lib/docli/get.rb CHANGED
@@ -24,6 +24,32 @@ module Docli
24
24
  )
25
25
  end
26
26
 
27
+ desc 'account', 'Show account information'
28
+ def account
29
+ account = Cmd::Accounts.get_user_information
30
+ puts 'Email: '.yellow + account.email.red
31
+ puts 'Droplet Limit: '.yellow + account.droplet_limit.to_s.red
32
+ puts 'Floating IP Limit: '.yellow + account.floating_ip_limit.to_s.red
33
+ puts 'Verified: '.yellow + account.email_verified.to_s.red
34
+ end
35
+
36
+ desc 'blockstorages', 'List all block storage / volume'
37
+ def blockstorages
38
+ volumes = Cmd::Volumes.list_all_volumes.each.as_json
39
+ tp (
40
+ volumes.map do |vl|
41
+ {
42
+ id: vl['id'],
43
+ name: vl['name'],
44
+ region: vl['region']['name'],
45
+ droplet_id: vl['droplet_ids'],
46
+ size: vl['size_gigabytes'].to_s + " GB",
47
+ created_at: vl['created_at']
48
+ }
49
+ end
50
+ ), {:id => {:width => 100}}, :name, :region, {:droplet_id => {:width => 100}}, :size, :created_at
51
+ end
52
+
27
53
  desc 'droplet', 'Show a droplet by id'
28
54
  def droplet(droplet_id)
29
55
  puts "`get droplet` called with params: #{droplet_id}, options: #{options}" if Docli.debug?
@@ -39,5 +65,6 @@ module Docli
39
65
  puts "\t#{k}: #{v}"
40
66
  end
41
67
  end
68
+
42
69
  end
43
70
  end
data/lib/docli.rb CHANGED
@@ -21,7 +21,6 @@ require 'docli/create'
21
21
  require 'docli/delete'
22
22
  require 'docli/get'
23
23
 
24
-
25
24
  module Docli
26
25
 
27
26
  CONFIG_FILE = ENV['HOME'] + '/.docli/config'
@@ -49,7 +48,7 @@ module Docli
49
48
  end
50
49
 
51
50
  def initialize(args = [], local_options = {}, config = {})
52
- require_config! unless %w{help init version}.include? config[:current_command].name
51
+ require_config! unless %w{help init version config}.include? config[:current_command].name
53
52
  super
54
53
  end
55
54
 
@@ -122,6 +121,6 @@ module Docli
122
121
  end
123
122
  end
124
123
 
125
- module CMD
124
+ module Cmd
126
125
  require_all 'cmd'
127
126
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.pre.alpha.pre.12
4
+ version: 0.0.2.pre.alpha.pre.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wayarmy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-09 00:00:00.000000000 Z
11
+ date: 2017-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 1.4.3
131
+ version: 2.1.0
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: 1.4.3
138
+ version: 2.1.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: thread_safe
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -310,14 +310,14 @@ dependencies:
310
310
  requirements:
311
311
  - - '='
312
312
  - !ruby/object:Gem::Version
313
- version: 0.1.5
313
+ version: 0.1.6
314
314
  type: :runtime
315
315
  prerelease: false
316
316
  version_requirements: !ruby/object:Gem::Requirement
317
317
  requirements:
318
318
  - - '='
319
319
  - !ruby/object:Gem::Version
320
- version: 0.1.5
320
+ version: 0.1.6
321
321
  - !ruby/object:Gem::Dependency
322
322
  name: faraday
323
323
  requirement: !ruby/object:Gem::Requirement