a2 0.1.0 → 0.1.1

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: 7b4e9ff951674c279e7ff7048a99344cce5b20dbf431b18f39c6d7a398fb62ba
4
- data.tar.gz: 7897dbcb642d5ee458986d0e5dae1e467394c5a1a089c79eee50e003cda7c0a9
3
+ metadata.gz: 23a07949036888c04e62fc52f79128f2dcadc32c3774c13677ea127f4492ba71
4
+ data.tar.gz: e74e45e471da6be643120a0c38a83ece3dc02f5b9e28d6fdd08651e98d058ead
5
5
  SHA512:
6
- metadata.gz: 71f4f9287c22826592735d6bde1cb1e32f72de73efffabd45b53d98439f22a6d2957826ea025ca7755341621a596930137b3e8fd451e901f4c962ad3888e0b55
7
- data.tar.gz: 547ec3d4af32a4c072870e994b945e78e742cc36fd76da89b81661c070b164dcae42bd0f4b83700854d00e596d333fbeb483a8e4b1f139a083a9cf6c59b67c2d
6
+ metadata.gz: 9f3b5a94eea60a22bf4617725e828569cfa5223482f441982159585438080a63f0d5f4b50ebe500b50c42fcd2c5c4b723afeaa170a69e9e81a069c3b297a1d97
7
+ data.tar.gz: 75b703e75a824ccfaa4736679b999653ad3397ccd0c84d050830a5ff6acf4c5d9b8874283b74808c095c6416441dd2d9b23c9a64dc6a9a28d0e4608106ab794c
@@ -20,6 +20,7 @@ jobs:
20
20
  uses: ruby/setup-ruby@v1
21
21
  with:
22
22
  ruby-version: ${{ matrix.ruby-version }}
23
- bundler-cache: true # runs 'bundle install' and caches installed gems automatically
23
+ bundler-cache: true
24
+ bundler: '2.2.15'
24
25
  - name: Run tests
25
26
  run: bundle exec rake
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- a2 (0.1.0)
4
+ a2 (0.1.1)
5
5
  cmdparse
6
6
  httparty
7
7
 
@@ -15,18 +15,20 @@ GEM
15
15
  mime-types (3.3.1)
16
16
  mime-types-data (~> 3.2015)
17
17
  mime-types-data (3.2021.0225)
18
- minitest (5.14.2)
18
+ minitest (5.14.4)
19
19
  multi_xml (0.6.0)
20
20
  rake (13.0.3)
21
21
 
22
22
  PLATFORMS
23
23
  ruby
24
+ x86_64-darwin-17
25
+ x86_64-linux
24
26
 
25
27
  DEPENDENCIES
26
28
  a2!
27
- bundler (~> 1.17)
29
+ bundler (~> 2.2.15)
28
30
  minitest (~> 5.0)
29
31
  rake (>= 12.3.3)
30
32
 
31
33
  BUNDLED WITH
32
- 1.17.3
34
+ 2.2.15
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # A2
2
2
 
3
3
  ![build status](https://github.com/gscho/a2-cli/actions/workflows/run-rake.yml/badge.svg?branch=main)
4
+ [![Gem Version](https://badge.fury.io/rb/a2.svg)](https://badge.fury.io/rb/a2)
4
5
 
5
6
  This gem is a CLI for interacting with Chef Automate 2+ APIs.
6
7
 
@@ -26,6 +27,47 @@ SSL_NO_VERIFY=true
26
27
  List the available commands:
27
28
 
28
29
  $ a2 --help
30
+ Usage: a2 [options] {cfgmgmt | help | iam | node | version}
31
+
32
+ Available commands:
33
+ cfgmgmt Chef Infra config management commands
34
+ list-missing-nodes
35
+ list-node-status-counts
36
+ list-nodes
37
+ list-orgs
38
+ show-attributes
39
+ help Provide help for individual commands
40
+ iam Identity access management commands
41
+ add-membership
42
+ create-team
43
+ create-user
44
+ delete-team
45
+ delete-user
46
+ get-team
47
+ get-teams-by-membership
48
+ get-user
49
+ list-team-members
50
+ list-teams
51
+ list-users
52
+ remove-membership
53
+ update-team
54
+ update-user
55
+ node Node commands
56
+ bulk-delete-by-filter
57
+ bulk-delete-by-ids
58
+ delete
59
+ get
60
+ search
61
+ version Show the version of the program
62
+
63
+ Options (take precedence over global options):
64
+ -v, --version Show the version of the program
65
+
66
+ Global Options:
67
+ -u, --automate-url [url] The Chef Automate URL
68
+ -t, --automate-token [token] The Chef Automate API token
69
+ -N, --ssl-no-verify Disable SSL verification
70
+ -h, --help Show help
29
71
 
30
72
 
31
73
  ### Using as a library
data/a2.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.bindir = 'bin'
19
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ['lib']
21
- spec.add_development_dependency 'bundler', '~> 1.17'
21
+ spec.add_development_dependency 'bundler', '~> 2.2.15'
22
22
  spec.add_development_dependency 'rake', '>= 12.3.3'
23
23
  spec.add_development_dependency 'minitest', '~> 5.0'
24
24
  spec.add_dependency 'cmdparse'
data/lib/a2/command.rb CHANGED
@@ -1,6 +1,6 @@
1
- require_relative 'commands/config_mgmt'
2
1
  require_relative 'commands/iam'
3
- require_relative 'commands/node'
2
+ require_relative 'commands/infra'
3
+ require_relative 'commands/node_mgmt'
4
4
 
5
5
  module A2
6
6
  module Command
@@ -0,0 +1,18 @@
1
+ require_relative '../subcommands/infra'
2
+
3
+ module A2
4
+ module Command
5
+ class Infra < CmdParse::Command
6
+ def initialize
7
+ super('infra')
8
+ short_desc('Chef Infra config management commands')
9
+ long_desc('Chef Infra config management commands')
10
+ add_command(A2::Subcommand::Infra::ListAllCheckedInNodes.new)
11
+ add_command(A2::Subcommand::Infra::ListMissingNodesCount.new)
12
+ add_command(A2::Subcommand::Infra::ListNodeStatusCounts.new)
13
+ add_command(A2::Subcommand::Infra::ListOrganizations.new)
14
+ add_command(A2::Subcommand::Infra::ShowAttributes.new)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ require_relative '../subcommands/node_mgmt'
2
+
3
+ module A2
4
+ module Command
5
+ class NodeMgmt < CmdParse::Command
6
+ def initialize
7
+ super('nodemgmt')
8
+ short_desc('Node management commands')
9
+ long_desc('Node management commands')
10
+ add_command(A2::Subcommand::NodeMgmt::Get.new)
11
+ add_command(A2::Subcommand::NodeMgmt::Delete.new)
12
+ add_command(A2::Subcommand::NodeMgmt::BulkDeleteById.new)
13
+ add_command(A2::Subcommand::NodeMgmt::BulkDeleteByFilter.new)
14
+ add_command(A2::Subcommand::NodeMgmt::Search.new)
15
+ end
16
+ end
17
+ end
18
+ end
data/lib/a2/parser.rb CHANGED
@@ -5,9 +5,9 @@ module A2
5
5
  parser.main_options.version = A2::VERSION
6
6
  parser.add_command(CmdParse::HelpCommand.new)
7
7
  parser.add_command(CmdParse::VersionCommand.new)
8
- parser.add_command(A2::Command::ConfigMgmt.new)
9
8
  parser.add_command(A2::Command::IAM.new)
10
- parser.add_command(A2::Command::Node.new)
9
+ parser.add_command(A2::Command::Infra.new)
10
+ parser.add_command(A2::Command::NodeMgmt.new)
11
11
  parser.global_options do |opt|
12
12
  opt.on("-u", "--automate-url [url]", "The Chef Automate URL") do |url|
13
13
  parser.data[:automate_url] = url
@@ -1,6 +1,6 @@
1
1
  module A2
2
2
  module Subcommand
3
- module ConfigMgmt
3
+ module Infra
4
4
  class ListAllCheckedInNodes < CmdParse::Command
5
5
  include A2::Paginated
6
6
  def initialize
@@ -1,6 +1,6 @@
1
1
  module A2
2
2
  module Subcommand
3
- module Node
3
+ module NodeMgmt
4
4
  class Get < CmdParse::Command
5
5
  def initialize
6
6
  super('get', takes_commands: false)
data/lib/a2/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module A2
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: a2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - gscho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-23 00:00:00.000000000 Z
11
+ date: 2021-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.17'
19
+ version: 2.2.15
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.17'
26
+ version: 2.2.15
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -109,15 +109,15 @@ files:
109
109
  - lib/a2/client/teams.rb
110
110
  - lib/a2/client/users.rb
111
111
  - lib/a2/command.rb
112
- - lib/a2/commands/config_mgmt.rb
113
112
  - lib/a2/commands/iam.rb
114
- - lib/a2/commands/node.rb
113
+ - lib/a2/commands/infra.rb
114
+ - lib/a2/commands/node_mgmt.rb
115
115
  - lib/a2/mixins/approved.rb
116
116
  - lib/a2/mixins/filtered.rb
117
117
  - lib/a2/mixins/paginated.rb
118
118
  - lib/a2/parser.rb
119
- - lib/a2/subcommands/config_mgmt.rb
120
- - lib/a2/subcommands/node.rb
119
+ - lib/a2/subcommands/infra.rb
120
+ - lib/a2/subcommands/node_mgmt.rb
121
121
  - lib/a2/subcommands/team.rb
122
122
  - lib/a2/subcommands/user.rb
123
123
  - lib/a2/version.rb
@@ -1,18 +0,0 @@
1
- require_relative '../subcommands/config_mgmt'
2
-
3
- module A2
4
- module Command
5
- class ConfigMgmt < CmdParse::Command
6
- def initialize
7
- super('cfgmgmt')
8
- short_desc('Chef Infra config management commands')
9
- long_desc('Chef Infra config management commands')
10
- add_command(A2::Subcommand::ConfigMgmt::ListAllCheckedInNodes.new)
11
- add_command(A2::Subcommand::ConfigMgmt::ListMissingNodesCount.new)
12
- add_command(A2::Subcommand::ConfigMgmt::ListNodeStatusCounts.new)
13
- add_command(A2::Subcommand::ConfigMgmt::ListOrganizations.new)
14
- add_command(A2::Subcommand::ConfigMgmt::ShowAttributes.new)
15
- end
16
- end
17
- end
18
- end
@@ -1,18 +0,0 @@
1
- require_relative '../subcommands/node'
2
-
3
- module A2
4
- module Command
5
- class Node < CmdParse::Command
6
- def initialize
7
- super('node')
8
- short_desc('Node commands')
9
- long_desc('Node commands')
10
- add_command(A2::Subcommand::Node::Get.new)
11
- add_command(A2::Subcommand::Node::Delete.new)
12
- add_command(A2::Subcommand::Node::BulkDeleteById.new)
13
- add_command(A2::Subcommand::Node::BulkDeleteByFilter.new)
14
- add_command(A2::Subcommand::Node::Search.new)
15
- end
16
- end
17
- end
18
- end