busbar-cli 1.9.2 → 1.9.3

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: 43e2cd62ee569c5924e2c40ae7a5a78953020481
4
- data.tar.gz: b4ea75f0060950b659618297f6ab26b41874c835
3
+ metadata.gz: cdc228f546309ef55d73857144c42342aab59774
4
+ data.tar.gz: be9080480a0f1ce0632a0730ede8170cd7e48091
5
5
  SHA512:
6
- metadata.gz: 5def75407305739a39b012da13e213477dcee1a6ac5da4b830b291e9e96499075e4ff6845fc6ed828eac2246d878af2a92574a374d39c4f2686070e9889fb1ec
7
- data.tar.gz: 5262e2b395f4305daf5f5d7b3b2fadeed55b422b321d9fb5ad37e8169117cd698f1c54f52a4027d37ab199517ec98e4cf0fd6d897b7ac3a874c33afde459dfab
6
+ metadata.gz: b36299c95d25c838dfed38ccecac1617473f87269cbc4ce3f96b634d4557ccd95ecfb4f6391c16e3a2a5e84c17bacb4a0d46270501cb0b73d771235b8aabad11
7
+ data.tar.gz: 75729de146953bde8b911242738446ba0412b795478ac2feb8802b7bda679ba313d7551aa2a2a7d676bda8b9a0121e86c3d0a9d3d6874967d5025ea87d247cb1
@@ -46,4 +46,5 @@ class BusbarCLI < Thor
46
46
  include Commands::BusbarVersion
47
47
  include Commands::Copy
48
48
  include Commands::Exec
49
+ include Commands::Nodetypes
49
50
  end
@@ -34,3 +34,4 @@ require 'busbar_cli/commands/kubeconfig_update'
34
34
  require 'busbar_cli/commands/__version'
35
35
  require 'busbar_cli/commands/copy'
36
36
  require 'busbar_cli/commands/exec'
37
+ require 'busbar_cli/commands/nodetypes'
@@ -0,0 +1,17 @@
1
+ module Commands
2
+ module Nodetypes
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ desc 'nodetypes', 'Show available Busbar Nodetypes'
7
+
8
+ def nodetypes ()
9
+ resources = NodetypesRepository.all()
10
+
11
+ resources.map do |resource|
12
+ Printer.print_resource(resource)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,6 +1,6 @@
1
1
  # Version Variables
2
2
  VERSION = '1.9'.freeze
3
- BUSBAR_PATCH_VERSION = '2'.freeze
3
+ BUSBAR_PATCH_VERSION = '3'.freeze
4
4
  KUBECTL_PATCH_VERSION = '6'.freeze
5
5
  BUSBAR_VERSION = "#{VERSION}.#{BUSBAR_PATCH_VERSION}".freeze
6
6
  KUBECTL_VERSION = "#{VERSION}.#{KUBECTL_PATCH_VERSION}".freeze
@@ -5,3 +5,4 @@ require 'busbar_cli/models/component_log'
5
5
  require 'busbar_cli/models/database'
6
6
  require 'busbar_cli/models/environment'
7
7
  require 'busbar_cli/models/setting'
8
+ require 'busbar_cli/models/nodetype'
@@ -13,6 +13,7 @@ class Environment
13
13
  attribute :public, Boolean
14
14
  attribute :created_at, String
15
15
  attribute :updated_at, String
16
+ attribute :components, Array
16
17
 
17
18
  def as_text
18
19
  "App: #{app_id}\n" \
@@ -25,6 +26,7 @@ class Environment
25
26
  "Default Branch: #{default_branch}\n" \
26
27
  "Default Node ID: #{default_node_id}\n" \
27
28
  "Settings: \n#{pretty_settings}\n" \
29
+ "Components: \n#{pretty_components}\n" \
28
30
  "Created_at: #{created_at}\n" \
29
31
  "Updated_at: #{updated_at}"
30
32
  end
@@ -36,4 +38,12 @@ class Environment
36
38
  "\t#{setting}: #{value}"
37
39
  end.join("\n")
38
40
  end
41
+
42
+ def pretty_components
43
+ components.sort_by(&:first).map do |component|
44
+ component.map do |attribute, value|
45
+ "\t#{attribute}: #{value}"
46
+ end.join("\n")
47
+ end.join("\n\t--\n")
48
+ end
39
49
  end
@@ -0,0 +1,12 @@
1
+ class Nodetype
2
+ include Virtus.model
3
+
4
+ attribute :id, String
5
+ attribute :cpu, String
6
+ attribute :guaranteed_cpu, String
7
+ attribute :memory, String
8
+
9
+ def as_text
10
+ "#{id} =>\tCPU: #{cpu}\tMemory: #{memory}"
11
+ end
12
+ end
@@ -5,3 +5,4 @@ require 'busbar_cli/repositories/deployments_repository'
5
5
  require 'busbar_cli/repositories/databases_repository'
6
6
  require 'busbar_cli/repositories/environments_repository'
7
7
  require 'busbar_cli/repositories/settings_repository'
8
+ require 'busbar_cli/repositories/nodetypes_repository'
@@ -0,0 +1,13 @@
1
+ class NodetypesRepository
2
+ NODETYPES_ROUTE = '/nodes/'.freeze
3
+
4
+ class << self
5
+ def all
6
+ nodetypes_data = JSON.parse(Request.get(NODETYPES_ROUTE).body)
7
+
8
+ nodetypes_data.map do |nodetype_data|
9
+ Nodetype.new(nodetype_data)
10
+ end
11
+ end
12
+ end
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: busbar-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.2
4
+ version: 1.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Marques
@@ -157,6 +157,7 @@ files:
157
157
  - lib/busbar_cli/commands/kubeconfig_update.rb
158
158
  - lib/busbar_cli/commands/latest_build.rb
159
159
  - lib/busbar_cli/commands/logs.rb
160
+ - lib/busbar_cli/commands/nodetypes.rb
160
161
  - lib/busbar_cli/commands/profile.rb
161
162
  - lib/busbar_cli/commands/profiles.rb
162
163
  - lib/busbar_cli/commands/publish.rb
@@ -187,6 +188,7 @@ files:
187
188
  - lib/busbar_cli/models/component_log.rb
188
189
  - lib/busbar_cli/models/database.rb
189
190
  - lib/busbar_cli/models/environment.rb
191
+ - lib/busbar_cli/models/nodetype.rb
190
192
  - lib/busbar_cli/models/setting.rb
191
193
  - lib/busbar_cli/repositories.rb
192
194
  - lib/busbar_cli/repositories/apps_repository.rb
@@ -195,6 +197,7 @@ files:
195
197
  - lib/busbar_cli/repositories/databases_repository.rb
196
198
  - lib/busbar_cli/repositories/deployments_repository.rb
197
199
  - lib/busbar_cli/repositories/environments_repository.rb
200
+ - lib/busbar_cli/repositories/nodetypes_repository.rb
198
201
  - lib/busbar_cli/repositories/settings_repository.rb
199
202
  - lib/busbar_cli/services.rb
200
203
  - lib/busbar_cli/services/app_config.rb