hammer_cli_katello 0.0.6 → 0.0.7

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWU2MDg5ZTA2Y2VhYWY5Njg4YTQ2OGVlZTVjMDQ3YTYzMjJiNWZkZA==
4
+ NWZlM2QzZWY4MTVmYjA3N2QwMTZkNTUwODJhNWYxOGQ5MWY4ZDgzZg==
5
5
  data.tar.gz: !binary |-
6
- N2EwZTY2Njc4OTU1ZDM5NmU2ZWQxMWFmM2M5YzgxODk0NjdmYWNlMg==
6
+ MjE0OTM2ZDg2ZjY1NGYzZjE3NWNmZjY3NDM2MjBiZWVjNWFmMjE3NQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjExNDJmY2ZmMDA1MmMwN2M2ODZhN2RjYTc0MDczZmUzMGFjMmZjYjY5MTU1
10
- NTM0MDlhYjk3Y2YzNzU1NWRlMzk3Y2RjZjhmZWRmMTdmN2U2NGIzODA5YzQ0
11
- Njc3OWVmNWNhZjliMjdmZjBmNDI2MmNkNmE0ZDA5MjdmYjA3ZGM=
9
+ YzI4OTE0MGY4Nzg1NGRiMDc3NjczYmFmMWIwY2RlZDJmYjA1OGQyZjEyZGJh
10
+ YjFmYmJhMTUyYzhmODNjMjc1OWNjNjM2NDg5OWI4MmQ5NGRiYTcyNWQwOTFk
11
+ NTQ0YjdjZThmOTA3NWRiNDI5YmI1OGUzODA4MzM0YzQ2OWMyY2Q=
12
12
  data.tar.gz: !binary |-
13
- NGNlMDA1N2ViOTBiOGNjNzZmOGQ5OGY4YzQzY2Y5ZTc5NGIwMmUwMzhhZjk2
14
- MTIwYzg5MTg5N2QwODUyNzkyNTMwZmY1NTNhOTQ5M2IzMDM2NmQ3NTBhNDk4
15
- YzExMTBmMjU3OWM2YTA3ODFkZjE3ZWY0MjUwZDk3OTlhZThmMTc=
13
+ ZWFjNmEzZjUzMTYyZGEyMzI0MjZlZGUxNWExOGRiYzNkM2I0Njg2ZGE0NzQw
14
+ YjA2NWJjYTQxYWMyMjQwYWYyY2Y5ZGE3OWI3NGM1YzYxZmRjMWJhOWE2OWFk
15
+ YWI4OTM5YmMwYWMwNThhNDZlMTczNTkxNGM1YjBjNDAyM2ZjMGI=
@@ -34,18 +34,18 @@ module HammerCLIKatello
34
34
  'hammer_cli_katello/organization'
35
35
  )
36
36
 
37
- HammerCLI::MainCommand.lazy_subcommand("gpg", _("manipulate GPG Key actions on the server"),
37
+ HammerCLI::MainCommand.lazy_subcommand("gpg", _("Manipulate GPG Key actions on the server"),
38
38
  'HammerCLIKatello::GpgKeyCommand',
39
39
  'hammer_cli_katello/gpg_key'
40
40
  )
41
41
 
42
42
  HammerCLI::MainCommand.lazy_subcommand("lifecycle-environment",
43
- _("manipulate lifecycle_environments on the server"),
43
+ _("Manipulate lifecycle_environments on the server"),
44
44
  'HammerCLIKatello::LifecycleEnvironmentCommand',
45
45
  'hammer_cli_katello/lifecycle_environment'
46
46
  )
47
47
 
48
- HammerCLI::MainCommand.lazy_subcommand("ping", _("get the status of the server"),
48
+ HammerCLI::MainCommand.lazy_subcommand("ping", _("Get the status of the server"),
49
49
  'HammerCLIKatello::PingCommand',
50
50
  'hammer_cli_katello/ping'
51
51
  )
@@ -66,7 +66,7 @@ module HammerCLIKatello
66
66
  )
67
67
 
68
68
  HammerCLI::MainCommand.lazy_subcommand("repository-set",
69
- _("manipulate repository sets on the server"),
69
+ _("Manipulate repository sets on the server"),
70
70
  'HammerCLIKatello::RepositorySetCommand',
71
71
  'hammer_cli_katello/repository_set'
72
72
  )
@@ -87,7 +87,7 @@ module HammerCLIKatello
87
87
  )
88
88
 
89
89
  HammerCLI::MainCommand.lazy_subcommand("content-host",
90
- _("manipulate content hosts on the server"),
90
+ _("Manipulate content hosts on the server"),
91
91
  'HammerCLIKatello::ContentHostCommand',
92
92
  'hammer_cli_katello/content_host'
93
93
  )
@@ -111,4 +111,14 @@ module HammerCLIKatello
111
111
  'HammerCLIKatello::PackageGroupCommand',
112
112
  'hammer_cli_katello/package_group'
113
113
  )
114
+
115
+ HammerCLI::MainCommand.lazy_subcommand("erratum", _("Manipulate errata"),
116
+ 'HammerCLIKatello::ErratumCommand',
117
+ 'hammer_cli_katello/erratum'
118
+ )
119
+
120
+ HammerCLI::MainCommand.lazy_subcommand("docker", _("Manipulate docker content"),
121
+ 'HammerCLIKatello::DockerCommand',
122
+ 'hammer_cli_katello/docker'
123
+ )
114
124
  end
@@ -26,7 +26,7 @@ module HammerCLIKatello
26
26
  data["format_consumed"] = _("%{consumed} of %{limit}") %
27
27
  {
28
28
  :consumed => data["usage_count"],
29
- :limit => data["unlimited"] ? _("Unlimited") : data["usage_limit"]
29
+ :limit => data["unlimited_content_hosts"] ? _("Unlimited") : data["max_content_hosts"]
30
30
  }
31
31
  data
32
32
  end
@@ -51,6 +51,7 @@ module HammerCLIKatello
51
51
  field :name, _("Name")
52
52
  field :id, _("ID")
53
53
  field :description, _("Description")
54
+ field :format_limit, _("Content Host Limit")
54
55
  from :environment do
55
56
  field :name, _("Lifecycle Environment")
56
57
  end
@@ -64,6 +65,12 @@ module HammerCLIKatello
64
65
  end
65
66
  end
66
67
 
68
+ def extend_data(data)
69
+ data["format_limit"] =
70
+ data["unlimited_content_hosts"] ? _("Unlimited") : data["max_content_hosts"]
71
+ data
72
+ end
73
+
67
74
  build_options
68
75
  end
69
76
 
@@ -84,6 +91,19 @@ module HammerCLIKatello
84
91
  build_options
85
92
  end
86
93
 
94
+ class CopyCommand < HammerCLIKatello::CreateCommand
95
+ include LifecycleEnvironmentNameResolvable
96
+ action :copy
97
+
98
+ desc _("Copy an activation key")
99
+ command_name "copy"
100
+
101
+ build_options
102
+
103
+ success_message _("Activation key copied")
104
+ failure_message _("Could not copy the activation key")
105
+ end
106
+
87
107
  class UpdateCommand < HammerCLIKatello::UpdateCommand
88
108
  include LifecycleEnvironmentNameResolvable
89
109
  action :update
@@ -110,70 +130,116 @@ module HammerCLIKatello
110
130
  output do
111
131
  field :id, _("ID")
112
132
  field :product_name, _("Name")
133
+ field :format_consumed, _("Attached")
134
+ field :amount, _("Quantity")
135
+ field :start_date, _("Start Date"), Fields::Date
136
+ field :end_date, _("End Date"), Fields::Date
137
+ field :support_level, _("Support")
138
+ field :contract_number, _("Contract")
139
+ field :account_number, _("Account")
113
140
  end
114
141
 
115
- option '--id', 'ID', _("resource ID")
116
-
117
- def request_params
118
- {
119
- 'activation_key_id' => option_id
120
- }
142
+ def extend_data(data)
143
+ data["format_consumed"] = _("%{consumed} of %{limit}") %
144
+ {
145
+ :consumed => data["consumed"],
146
+ :limit => data["quantity"] == -1 ? _("Unlimited") : data["quantity"]
147
+ }
148
+ data
121
149
  end
122
150
 
151
+ option "--id", "ID", _("ID of activation key"),
152
+ :attribute_name => :option_activation_key_id
153
+ option "--name", "NAME", _("Name of activation key"),
154
+ :attribute_name => :option_activation_key_name
155
+
123
156
  validate_options do
124
- all(:option_id).required
157
+ any(:option_activation_key_id, :option_activation_key_name).required
158
+ end
159
+
160
+ build_options do |o|
161
+ o.expand.only(:organizations)
162
+ o.without(
163
+ :system_id,
164
+ :activation_key_id,
165
+ :full_results,
166
+ :search,
167
+ :order,
168
+ :sort,
169
+ :page,
170
+ :per_page
171
+ )
125
172
  end
126
173
  end
127
174
 
128
- class AddSubscriptionCommand < HammerCLIKatello::UpdateCommand
129
- resource :subscriptions, :create
175
+ class AddSubscriptionsCommand < HammerCLIKatello::SingleResourceCommand
176
+ action :add_subscriptions
130
177
 
131
178
  desc "Add subscription"
132
179
  command_name "add-subscription"
133
180
 
134
- option '--id', 'ID', _("resource ID")
135
- option '--subscription-id', 'ID', _("subscription ID")
136
- option '--quantity', 'QUANTITY', _("subscription quantity")
137
-
138
- def request_params
139
- {
140
- 'activation_key_id' => option_id,
141
- 'id' => option_subscription_id,
142
- 'quantity' => option_quantity
143
- }
144
- end
181
+ option "--subscription-id", "SUBSCRIPTION_ID", _("ID of subscription"),
182
+ :attribute_name => :option_subscription_id, :required => true
145
183
 
146
- validate_options do
147
- all(:option_id, :option_subscription_id).required
184
+ build_options do |o|
185
+ o.expand.except(:subscriptions)
186
+ o.without(:subscriptions)
148
187
  end
149
188
 
150
189
  success_message _("Subscription added to activation key")
151
190
  failure_message _("Could not add subscription to activation key")
152
191
  end
153
192
 
154
- class RemoveSubscriptionCommand < HammerCLIKatello::UpdateCommand
155
- resource :subscriptions, :destroy
193
+ class RemoveSubscriptionCommand < HammerCLIKatello::SingleResourceCommand
194
+ action :remove_subscriptions
156
195
 
157
196
  desc _("Remove subscription")
158
197
  command_name "remove-subscription"
159
198
 
160
- option '--id', 'ID', _("resource ID")
161
- option '--subscription-id', 'ID', _("subscription ID")
199
+ option "--subscription-id", "SUBSCRIPTION_ID", _("ID of subscription"),
200
+ :attribute_name => :option_subscription_id, :required => true
162
201
 
163
- def request_params
164
- {
165
- 'id' => option_subscription_id,
166
- 'activation_key_id' => option_id
167
- }
202
+ build_options do |o|
203
+ o.expand.except(:subscriptions)
204
+ o.without(:subscriptions)
168
205
  end
169
206
 
170
- validate_options do
171
- all(:option_id, :option_subscription_id).required
172
- end
173
207
  success_message _("Subscription removed from activation key")
174
208
  failure_message _("Could not remove subscription from activation key")
175
209
  end
176
210
 
211
+ class ProductContentCommand < HammerCLIKatello::ListCommand
212
+ action :product_content
213
+
214
+ desc _("List associated products")
215
+ command_name "product-content"
216
+
217
+ output do
218
+ from :content do
219
+ field :id, _("ID")
220
+ field :name, _("Name")
221
+ field :type, _("Type")
222
+ field :contentUrl, _("URL")
223
+ field :gpgUrl, _("GPG Key")
224
+ field :label, _("Label")
225
+ end
226
+ end
227
+
228
+ build_options
229
+ end
230
+
231
+ class ContentOverrideCommand < HammerCLIKatello::SingleResourceCommand
232
+ action :content_override
233
+
234
+ desc _("Override product content defaults")
235
+ command_name "content-override"
236
+
237
+ build_options
238
+
239
+ success_message _("Updated content override")
240
+ failure_message _("Could not update content override")
241
+ end
242
+
177
243
  class HostCollectionsCommand < HammerCLIKatello::ListCommand
178
244
  resource :host_collections, :index
179
245
 
@@ -185,16 +251,27 @@ module HammerCLIKatello
185
251
  field :name, _("Name")
186
252
  end
187
253
 
188
- option '--id', 'ID', _("resource ID")
254
+ option "--id", "ID", _("ID of activation key"),
255
+ :attribute_name => :option_activation_key_id
256
+ option "--name", "NAME", _("Name of activation key"),
257
+ :attribute_name => :option_activation_key_name
189
258
 
190
- def request_params
191
- {
192
- 'activation_key_id' => option_id
193
- }
259
+ validate_options do
260
+ any(:option_activation_key_id, :option_activation_key_name).required
194
261
  end
195
262
 
196
- validate_options do
197
- all(:option_id).required
263
+ build_options do |o|
264
+ o.expand.only(:organizations)
265
+ o.without(
266
+ :system_id,
267
+ :activation_key_id,
268
+ :full_results,
269
+ :search,
270
+ :order,
271
+ :sort,
272
+ :page,
273
+ :per_page
274
+ )
198
275
  end
199
276
  end
200
277
 
@@ -19,6 +19,9 @@ module HammerCLIKatello
19
19
  output do
20
20
  field :uuid, _("ID")
21
21
  field :name, _("Name")
22
+ from :errata_counts do
23
+ field :total, _("Available Errata")
24
+ end
22
25
  end
23
26
 
24
27
  build_options
@@ -44,6 +47,11 @@ module HammerCLIKatello
44
47
  field :entitlementStatus, _("Entitlement Status")
45
48
  field :releaseVer, _("Release Version")
46
49
  field :autoheal, _("Autoheal")
50
+ from :errata_counts do
51
+ field :security, _("Security Errata")
52
+ field :bugfix, _("Bugfix Errata")
53
+ field :enhancement, _("Enhancement Errata")
54
+ end
47
55
  end
48
56
 
49
57
  build_options
@@ -12,6 +12,21 @@ module HammerCLIKatello
12
12
  build_options
13
13
  end
14
14
 
15
+ class ListCommand < HammerCLIKatello::ListCommand
16
+ resource :systems, :errata
17
+ command_name "list"
18
+
19
+ output do
20
+ field :id, _("ID")
21
+ field :errata_id, _("Erratum ID")
22
+ field :type, _("Type")
23
+ field :title, _("Title")
24
+ field :available, _("Available")
25
+ end
26
+
27
+ build_options
28
+ end
29
+
15
30
  class InfoCommand < HammerCLIKatello::InfoCommand
16
31
  resource :system_errata, :show
17
32
  command_name "info"
@@ -33,7 +33,13 @@ module HammerCLIKatello
33
33
  field :name, _("Organization")
34
34
  end
35
35
 
36
- collection :repositories, _("Repositories") do
36
+ collection :_yum_repositories, _("Yum Repositories") do
37
+ field :id, _("ID")
38
+ field :name, _("Name")
39
+ field :label, _("Label")
40
+ end
41
+
42
+ collection :_docker_repositories, _("Docker Repositories") do
37
43
  field :id, _("ID")
38
44
  field :name, _("Name")
39
45
  field :label, _("Label")
@@ -48,7 +54,7 @@ module HammerCLIKatello
48
54
  field :updated_at, _("Updated"), Fields::Date
49
55
  end
50
56
 
51
- collection :environments, _("Environments") do
57
+ collection :environments, _("Lifecycle Environments") do
52
58
  field :id, _("ID")
53
59
  field :name, _("Name")
54
60
  end
@@ -69,6 +75,17 @@ module HammerCLIKatello
69
75
  end
70
76
  end
71
77
 
78
+ def extend_data(data)
79
+ data["_yum_repositories"] = data["repositories"].select do |repo|
80
+ repo["content_type"] == "yum"
81
+ end
82
+
83
+ data["_docker_repositories"] = data["repositories"].select do |repo|
84
+ repo["content_type"] == "docker"
85
+ end
86
+ data
87
+ end
88
+
72
89
  build_options
73
90
  end
74
91
 
@@ -26,6 +26,7 @@ module HammerCLIKatello
26
26
  field :id, _("ID")
27
27
  field :name, _("Name")
28
28
  field :version, _("Version")
29
+ field :description, _("Description")
29
30
 
30
31
  from :content_view do
31
32
  field :id, _("Content View ID")
@@ -67,6 +68,10 @@ module HammerCLIKatello
67
68
  success_message _("Content view is being promoted with task %{id}")
68
69
  failure_message _("Could not promote the content view")
69
70
 
71
+ option "--force",
72
+ :flag,
73
+ _("force content view promotion and bypass lifecycle environment restriction")
74
+
70
75
  option "--from-lifecycle-environment", "FROM_ENVIRONMENT",
71
76
  _("Name of the source environment"), :attribute_name => :option_environment_name
72
77
  option "--from-lifecycle-environment-id", "FROM_ENVIRONMENT_ID",
@@ -76,18 +81,20 @@ module HammerCLIKatello
76
81
  option "--to-lifecycle-environment-id", "TO_ENVIRONMENT_ID",
77
82
  _("Id of the target environment"), :attribute_name => :option_to_environment_id
78
83
 
79
- def request_params
80
- params = super
81
-
82
- env_search_opts = {
84
+ def environment_search_options
85
+ {
83
86
  "option_id" => options["option_to_environment_id"],
84
87
  "option_name" => options["option_to_environment_name"],
85
88
  "option_organization_id" => options["option_organization_id"],
86
89
  "option_organization_name" => options["option_organization_name"],
87
90
  "option_organization_label" => options["option_organization_label"]
88
91
  }
92
+ end
89
93
 
90
- params['environment_id'] = resolver.lifecycle_environment_id(env_search_opts)
94
+ def request_params
95
+ params = super
96
+ params['environment_id'] = resolver.lifecycle_environment_id(environment_search_options)
97
+ params['force'] = option_force?
91
98
  params
92
99
  end
93
100
 
@@ -0,0 +1,13 @@
1
+ require 'hammer_cli_katello/docker_image'
2
+ require 'hammer_cli_katello/docker_tag'
3
+
4
+ module HammerCLIKatello
5
+ class DockerCommand < HammerCLIKatello::Command
6
+ subcommand 'image',
7
+ HammerCLIKatello::DockerImageCommand.desc,
8
+ HammerCLIKatello::DockerImageCommand
9
+ subcommand 'tag',
10
+ HammerCLIKatello::DockerTagCommand.desc,
11
+ HammerCLIKatello::DockerTagCommand
12
+ end
13
+ end
@@ -0,0 +1,36 @@
1
+ module HammerCLIKatello
2
+ class DockerImageCommand < HammerCLIKatello::Command
3
+ resource :docker_images
4
+ command_name 'image'
5
+ desc 'Manage docker images'
6
+
7
+ class ListCommand < HammerCLIKatello::ListCommand
8
+ output do
9
+ field :id, _("ID")
10
+ field :image_id, _("Image ID")
11
+ field :size, _("Size")
12
+ end
13
+
14
+ build_options do |o|
15
+ o.expand.including(:products, :organizations, :content_views)
16
+ end
17
+ end
18
+
19
+ class InfoCommand < HammerCLIKatello::InfoCommand
20
+ output do
21
+ field :id, _("ID")
22
+ field :image_id, _("Image ID")
23
+ field :size, _("Size")
24
+
25
+ collection :tags, _("Tags") do
26
+ field :repository_id, _("Repository ID")
27
+ field :tag, _("Tag")
28
+ end
29
+ end
30
+
31
+ build_options
32
+ end
33
+
34
+ autoload_subcommands
35
+ end
36
+ end
@@ -0,0 +1,35 @@
1
+ module HammerCLIKatello
2
+ class DockerTagCommand < HammerCLIKatello::Command
3
+ resource :docker_tags
4
+ command_name 'tag'
5
+ desc 'Manage docker tags'
6
+
7
+ class ListCommand < HammerCLIKatello::ListCommand
8
+ output do
9
+ field :id, _("ID")
10
+ field :tag, _("Tag")
11
+ field :repository_id, _("Repository ID")
12
+ end
13
+
14
+ build_options do |o|
15
+ o.expand.including(:products, :organizations, :content_views)
16
+ end
17
+ end
18
+
19
+ class InfoCommand < HammerCLIKatello::InfoCommand
20
+ output do
21
+ field :id, _("ID")
22
+ field :tag, _("Tag")
23
+ field :repository_id, _("Repository ID")
24
+
25
+ from :image do
26
+ field :id, _("Docker Image ID")
27
+ end
28
+ end
29
+
30
+ build_options
31
+ end
32
+
33
+ autoload_subcommands
34
+ end
35
+ end
@@ -0,0 +1,38 @@
1
+ module HammerCLIKatello
2
+
3
+ class ErratumCommand < HammerCLIKatello::Command
4
+ resource :errata
5
+
6
+ class ListCommand < HammerCLIKatello::ListCommand
7
+ output do
8
+ field :id, _("ID")
9
+ field :errata_id, _("Errata ID")
10
+ field :type, _("Type")
11
+ field :title, _("Title")
12
+ end
13
+
14
+ build_options do |o|
15
+ o.expand.including(:products, :organizations, :content_views)
16
+ end
17
+ end
18
+
19
+ class InfoCommand < HammerCLIKatello::InfoCommand
20
+ output do
21
+ field :id, _("ID")
22
+ field :errata_id, _("Errata ID")
23
+ field :title, _("Title")
24
+ field :type, _("Type")
25
+ field :severity, _("Severity")
26
+ field :issued, _("Issued")
27
+ field :updated, _("Updated")
28
+ field :description, _("Description")
29
+ field :summary, _("Summary")
30
+ field :solution, _("Solution")
31
+ end
32
+
33
+ build_options
34
+ end
35
+
36
+ autoload_subcommands
37
+ end
38
+ end
@@ -5,10 +5,10 @@ module HammerCLIKatello
5
5
 
6
6
  module UuidRequestable
7
7
  def self.included(base)
8
- base.option "--host-collection-ids",
9
- "HOST_COLLECTION_IDS",
10
- _("Array of content host ids to replace the content hosts in host collection"),
11
- :format => HammerCLI::Options::Normalizers::List.new
8
+ base.option("--host-collection-ids",
9
+ "HOST_COLLECTION_IDS",
10
+ _("Array of content host ids to replace the content hosts in host collection"),
11
+ :format => HammerCLI::Options::Normalizers::List.new)
12
12
  end
13
13
 
14
14
  def request_params
@@ -125,5 +125,63 @@ module HammerCLIKatello
125
125
  end
126
126
 
127
127
  autoload_subcommands
128
+
129
+ class ContentBaseCommand < DeleteCommand
130
+ resource :systems_bulk_actions
131
+
132
+ build_options do |o|
133
+ o.without(:content_type, :content, :ids, :search)
134
+ end
135
+
136
+ def request_params
137
+ params = super
138
+ params['content'] = content
139
+ params['content_type'] = content_type
140
+ params['included'] = { :search => "host_collection_ids:#{params['id']}" }
141
+ params.delete('id')
142
+ params
143
+ end
144
+
145
+ def resolver
146
+ api = HammerCLI::Connection.get("foreman").api
147
+ custom_resolver = Class.new(HammerCLIKatello::IdResolver) do
148
+ def systems_bulk_action_id(options)
149
+ host_collection_id(options)
150
+ end
151
+ end
152
+ custom_resolver.new(api, HammerCLIKatello::Searchables.new)
153
+ end
154
+ end
155
+
156
+ class InstallContentBaseCommand < ContentBaseCommand
157
+ action :install_content
158
+ command_name "install"
159
+ end
160
+
161
+ class UpdateContentBaseCommand < ContentBaseCommand
162
+ action :update_content
163
+ command_name "update"
164
+ end
165
+
166
+ class RemoveContentBaseCommand < ContentBaseCommand
167
+ action :remove_content
168
+ command_name "remove"
169
+ end
170
+
171
+ require 'hammer_cli_katello/host_collection_package'
172
+ subcommand HammerCLIKatello::HostCollectionPackageCommand.command_name,
173
+ HammerCLIKatello::HostCollectionPackageCommand.desc,
174
+ HammerCLIKatello::HostCollectionPackageCommand
175
+
176
+ require 'hammer_cli_katello/host_collection_package_group'
177
+ subcommand HammerCLIKatello::HostCollectionPackageGroupCommand.command_name,
178
+ HammerCLIKatello::HostCollectionPackageGroupCommand.desc,
179
+ HammerCLIKatello::HostCollectionPackageGroupCommand
180
+
181
+ require 'hammer_cli_katello/host_collection_erratum'
182
+ subcommand HammerCLIKatello::HostCollectionErratumCommand.command_name,
183
+ HammerCLIKatello::HostCollectionErratumCommand.desc,
184
+ HammerCLIKatello::HostCollectionErratumCommand
128
185
  end
186
+
129
187
  end
@@ -0,0 +1,24 @@
1
+ module HammerCLIKatello
2
+ class HostCollectionErratumCommand < HammerCLIKatello::Command
3
+ command_name "erratum"
4
+ desc _("Manipulate errata for a host collection")
5
+
6
+ class InstallCommand < HammerCLIKatello::HostCollection::InstallContentBaseCommand
7
+ desc _("Install errata on content hosts contained within a host collection")
8
+ success_message _("Successfully scheduled installation of errata")
9
+ failure_message _("Could not schedule installation of errata")
10
+
11
+ option('--errata',
12
+ 'ERRATA',
13
+ _("comma-separated list of errata to install"),
14
+ :required => true,
15
+ :format => HammerCLI::Options::Normalizers::List.new)
16
+
17
+ def content_type
18
+ 'errata'
19
+ end
20
+ end
21
+
22
+ autoload_subcommands
23
+ end
24
+ end
@@ -0,0 +1,44 @@
1
+ module HammerCLIKatello
2
+ class HostCollectionPackageCommand < HammerCLIKatello::Command
3
+ command_name "package"
4
+ desc _("Manipulate packages for a host collection")
5
+
6
+ module PackageContentType
7
+ def self.included(base)
8
+ base.option('--packages',
9
+ 'PACKAGES',
10
+ _("comma-separated list of packages to install"),
11
+ :required => true,
12
+ :format => HammerCLI::Options::Normalizers::List.new,
13
+ :attribute_name => :content)
14
+ end
15
+
16
+ def content_type
17
+ 'package'
18
+ end
19
+ end
20
+
21
+ class InstallCommand < HammerCLIKatello::HostCollection::InstallContentBaseCommand
22
+ include PackageContentType
23
+ desc _("Install packages on content hosts contained within a host collection")
24
+ success_message _("Successfully scheduled installation of package(s)")
25
+ failure_message _("Could not schedule installation of package(s)")
26
+ end
27
+
28
+ class UpdateCommand < HammerCLIKatello::HostCollection::UpdateContentBaseCommand
29
+ include PackageContentType
30
+ desc _("Update packages on content hosts contained within a host collection")
31
+ success_message _("Successfully scheduled update of package(s)")
32
+ failure_message _("Could not schedule update of package(s)")
33
+ end
34
+
35
+ class RemoveCommand < HammerCLIKatello::HostCollection::RemoveContentBaseCommand
36
+ include PackageContentType
37
+ desc _("Remove packages on content hosts contained within a host collection")
38
+ success_message _("Successfully scheduled removal of package(s)")
39
+ failure_message _("Could not schedule removal of package(s)")
40
+ end
41
+
42
+ autoload_subcommands
43
+ end
44
+ end
@@ -0,0 +1,44 @@
1
+ module HammerCLIKatello
2
+ class HostCollectionPackageGroupCommand < HammerCLIKatello::Command
3
+ command_name "package-group"
4
+ desc _("Manipulate package-groups for a host collection")
5
+
6
+ module PackageGroupContentType
7
+ def self.included(base)
8
+ base.option('--package-groups',
9
+ 'PACKAGE-GROUPS',
10
+ _("comma-separated list of package-groups to install"),
11
+ :required => true,
12
+ :format => HammerCLI::Options::Normalizers::List.new,
13
+ :attribute_name => :content)
14
+ end
15
+
16
+ def content_type
17
+ 'package_group'
18
+ end
19
+ end
20
+
21
+ class InstallCommand < HammerCLIKatello::HostCollection::InstallContentBaseCommand
22
+ include PackageGroupContentType
23
+ desc _("Install package-groups on content hosts contained within a host collection")
24
+ success_message _("Successfully scheduled installation of package-group(s)")
25
+ failure_message _("Could not schedule installation of package-group(s)")
26
+ end
27
+
28
+ class UpdateCommand < HammerCLIKatello::HostCollection::UpdateContentBaseCommand
29
+ include PackageGroupContentType
30
+ desc _("Update package-groups on content hosts contained within a host collection")
31
+ success_message _("Successfully scheduled update of package-groups(s)")
32
+ failure_message _("Could not schedule update of package-group(s)")
33
+ end
34
+
35
+ class RemoveCommand < HammerCLIKatello::HostCollection::RemoveContentBaseCommand
36
+ include PackageGroupContentType
37
+ desc _("Remove package-groups on content hosts contained within a host collection")
38
+ success_message _("Successfully scheduled removal of package-groups(s)")
39
+ failure_message _("Could not schedule removal of package-group(s)")
40
+ end
41
+
42
+ autoload_subcommands
43
+ end
44
+ end
@@ -76,9 +76,12 @@ module HammerCLIKatello
76
76
  end
77
77
 
78
78
  def create_repositories_search_options(options)
79
+ name = options[HammerCLI.option_accessor_name("name")]
80
+ product_id = options[HammerCLI.option_accessor_name("product_id")]
81
+
79
82
  search_options = {}
80
- search_options['name'] = options[HammerCLI.option_accessor_name("name")]
81
- search_options['product_id'] = options[HammerCLI.option_accessor_name("product_id")]
83
+ search_options['name'] = name if name
84
+ search_options['product_id'] = product_id if product_id
82
85
  search_options
83
86
  end
84
87
 
@@ -66,6 +66,7 @@ module HammerCLIKatello
66
66
  from :content do
67
67
  field :name, _("Repo Name")
68
68
  field :contentUrl, _("URL")
69
+ field :type, _("Content Type")
69
70
  end
70
71
  end
71
72
  end
@@ -87,6 +88,18 @@ module HammerCLIKatello
87
88
  build_options
88
89
  end
89
90
 
91
+ class SyncCommand < HammerCLIKatello::SingleResourceCommand
92
+ include HammerCLIForemanTasks::Async
93
+
94
+ action :sync
95
+ command_name "synchronize"
96
+
97
+ success_message _("Product repositories are being synchronized in task %{id}")
98
+ failure_message _("Could not synchronize the product repositories")
99
+
100
+ build_options
101
+ end
102
+
90
103
  class SetSyncPlanCommand < HammerCLIKatello::UpdateCommand
91
104
  desc _("Assign sync plan to product.")
92
105
  command_name "set-sync-plan"
@@ -108,8 +121,10 @@ module HammerCLIKatello
108
121
 
109
122
  resource :products, :update
110
123
 
111
- build_options :without => [:name, :label, :provider_id, :description,
112
- :gpg_key_id, :sync_plan_id]
124
+ build_options do |o|
125
+ o.expand(:all).except(:sync_plans)
126
+ o.without(:sync_plan_id)
127
+ end
113
128
 
114
129
  def request_params
115
130
  super.merge("sync_plan_id" => nil)
@@ -29,6 +29,7 @@ module HammerCLIKatello
29
29
  end
30
30
  field :_redhat_repo, _("Red Hat Repository")
31
31
  field :content_type, _("Content Type")
32
+ field :checksum_type, _("Checksum Type"), Fields::Field, :hide_blank => true
32
33
  field :url, _("URL")
33
34
  field :_publish_via_http, _("Publish Via HTTP")
34
35
  field :full_path, _("Published At")
@@ -243,6 +244,28 @@ module HammerCLIKatello
243
244
  end
244
245
  end
245
246
 
247
+ class RemoveContentCommand < HammerCLIKatello::SingleResourceCommand
248
+ include RepositoryScopedToProduct
249
+
250
+ resource :repositories, :remove_content
251
+ command_name "remove-content"
252
+
253
+ option ["--content-ids"], "CONTENT_IDS",
254
+ _("Comma separated list of package/puppet module/docker image ids"),
255
+ :format => HammerCLI::Options::Normalizers::List.new, :required => true
256
+
257
+ def request_params
258
+ super.tap do |opts|
259
+ opts[:uuids] = option_content_ids
260
+ end
261
+ end
262
+
263
+ success_message _("Repository content removed")
264
+ failure_message _("Could not remove content")
265
+
266
+ build_options :without => ["uuids"]
267
+ end
268
+
246
269
  autoload_subcommands
247
270
  end
248
271
  end
@@ -1,5 +1,5 @@
1
1
  module HammerCLIKatello
2
2
  def self.version
3
- @version ||= Gem::Version.new('0.0.6')
3
+ @version ||= Gem::Version.new('0.0.7')
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_katello
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Price
@@ -23,7 +23,7 @@ authors:
23
23
  autorequire:
24
24
  bindir: bin
25
25
  cert_chain: []
26
- date: 2014-09-12 00:00:00.000000000 Z
26
+ date: 2014-12-19 00:00:00.000000000 Z
27
27
  dependencies:
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: hammer_cli_foreman
@@ -53,6 +53,20 @@ dependencies:
53
53
  - - ~>
54
54
  - !ruby/object:Gem::Version
55
55
  version: 0.0.3
56
+ - !ruby/object:Gem::Dependency
57
+ name: hammer_cli_foreman_bootdisk
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
56
70
  - !ruby/object:Gem::Dependency
57
71
  name: rake
58
72
  requirement: !ruby/object:Gem::Requirement
@@ -199,11 +213,18 @@ files:
199
213
  - lib/hammer_cli_katello/content_view.rb
200
214
  - lib/hammer_cli_katello/content_view_puppet_module.rb
201
215
  - lib/hammer_cli_katello/content_view_version.rb
216
+ - lib/hammer_cli_katello/docker.rb
217
+ - lib/hammer_cli_katello/docker_image.rb
218
+ - lib/hammer_cli_katello/docker_tag.rb
219
+ - lib/hammer_cli_katello/erratum.rb
202
220
  - lib/hammer_cli_katello/exception_handler.rb
203
221
  - lib/hammer_cli_katello/filter.rb
204
222
  - lib/hammer_cli_katello/filter_rule.rb
205
223
  - lib/hammer_cli_katello/gpg_key.rb
206
224
  - lib/hammer_cli_katello/host_collection.rb
225
+ - lib/hammer_cli_katello/host_collection_erratum.rb
226
+ - lib/hammer_cli_katello/host_collection_package.rb
227
+ - lib/hammer_cli_katello/host_collection_package_group.rb
207
228
  - lib/hammer_cli_katello/i18n.rb
208
229
  - lib/hammer_cli_katello/id_resolver.rb
209
230
  - lib/hammer_cli_katello/lifecycle_environment.rb