kontena-cli 0.12.3 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/bin/kontena +6 -4
  4. data/lib/kontena/cli/apps/common.rb +21 -7
  5. data/lib/kontena/cli/apps/deploy_command.rb +11 -4
  6. data/lib/kontena/cli/apps/docker_helper.rb +12 -0
  7. data/lib/kontena/cli/apps/logs_command.rb +0 -2
  8. data/lib/kontena/cli/apps/remove_command.rb +23 -14
  9. data/lib/kontena/cli/bytes_helper.rb +40 -0
  10. data/lib/kontena/cli/container_command.rb +0 -1
  11. data/lib/kontena/cli/grid_command.rb +4 -6
  12. data/lib/kontena/cli/grids/logs_command.rb +0 -2
  13. data/lib/kontena/cli/grids/trusted_subnet_command.rb +12 -0
  14. data/lib/kontena/cli/grids/trusted_subnets/add_command.rb +16 -0
  15. data/lib/kontena/cli/grids/trusted_subnets/list_command.rb +17 -0
  16. data/lib/kontena/cli/grids/trusted_subnets/remove_command.rb +20 -0
  17. data/lib/kontena/cli/grids/user_command.rb +12 -0
  18. data/lib/kontena/cli/grids/{add_user_command.rb → users/add_command.rb} +4 -4
  19. data/lib/kontena/cli/grids/{list_users_command.rb → users/list_command.rb} +4 -4
  20. data/lib/kontena/cli/grids/{remove_user_command.rb → users/remove_command.rb} +4 -4
  21. data/lib/kontena/cli/login_command.rb +4 -3
  22. data/lib/kontena/cli/master/aws/create_command.rb +3 -1
  23. data/lib/kontena/cli/master/current_command.rb +17 -0
  24. data/lib/kontena/cli/master/digital_ocean/create_command.rb +5 -3
  25. data/lib/kontena/cli/master/users/role_command.rb +10 -0
  26. data/lib/kontena/cli/master/users/{add_role_command.rb → roles/add_command.rb} +4 -4
  27. data/lib/kontena/cli/master/users/{remove_role_command.rb → roles/remove_command.rb} +4 -4
  28. data/lib/kontena/cli/master/users_command.rb +2 -4
  29. data/lib/kontena/cli/master_command.rb +2 -0
  30. data/lib/kontena/cli/node_command.rb +2 -4
  31. data/lib/kontena/cli/nodes/label_command.rb +14 -0
  32. data/lib/kontena/cli/nodes/{add_label_command.rb → labels/add_command.rb} +2 -2
  33. data/lib/kontena/cli/nodes/{remove_label_command.rb → labels/remove_command.rb} +2 -2
  34. data/lib/kontena/cli/nodes/list_command.rb +2 -1
  35. data/lib/kontena/cli/nodes/show_command.rb +19 -2
  36. data/lib/kontena/cli/registry_command.rb +0 -1
  37. data/lib/kontena/cli/service_command.rb +4 -11
  38. data/lib/kontena/cli/services/create_command.rb +10 -2
  39. data/lib/kontena/cli/services/env_command.rb +12 -0
  40. data/lib/kontena/cli/services/{add_env_command.rb → envs/add_command.rb} +4 -4
  41. data/lib/kontena/cli/services/{envs_command.rb → envs/list_command.rb} +5 -5
  42. data/lib/kontena/cli/services/{remove_env_command.rb → envs/remove_command.rb} +4 -4
  43. data/lib/kontena/cli/services/list_command.rb +3 -2
  44. data/lib/kontena/cli/services/logs_command.rb +0 -2
  45. data/lib/kontena/cli/services/secret_command.rb +10 -0
  46. data/lib/kontena/cli/services/{add_secret_command.rb → secrets/link_command.rb} +4 -4
  47. data/lib/kontena/cli/services/{remove_secret_command.rb → secrets/unlink_command.rb} +4 -4
  48. data/lib/kontena/cli/services/services_helper.rb +35 -8
  49. data/lib/kontena/cli/services/stats_command.rb +6 -1
  50. data/lib/kontena/cli/services/update_command.rb +4 -0
  51. data/lib/kontena/cli/user/forgot_password_command.rb +16 -0
  52. data/lib/kontena/cli/user/reset_password_command.rb +23 -0
  53. data/lib/kontena/cli/user/verify_command.rb +22 -0
  54. data/lib/kontena/cli/user_command.rb +13 -0
  55. data/lib/kontena/cli/vault/list_command.rb +1 -1
  56. data/lib/kontena/cli/vpn_command.rb +0 -1
  57. data/lib/kontena/cli/whoami_command.rb +17 -3
  58. data/lib/kontena/machine/aws/cloudinit_master.yml +13 -4
  59. data/lib/kontena/machine/aws/common.rb +8 -13
  60. data/lib/kontena/machine/aws/master_provisioner.rb +6 -5
  61. data/lib/kontena/machine/azure/cloudinit_master.yml +0 -2
  62. data/lib/kontena/machine/digital_ocean.rb +1 -0
  63. data/lib/kontena/machine/digital_ocean/cloudinit.yml +0 -22
  64. data/lib/kontena/machine/digital_ocean/cloudinit_master.yml +14 -4
  65. data/lib/kontena/machine/digital_ocean/master_provisioner.rb +12 -9
  66. data/lib/kontena/machine/vagrant/cloudinit.yml +2 -0
  67. data/lib/kontena/scripts/completer +4 -4
  68. data/spec/kontena/cli/app/common_spec.rb +55 -7
  69. data/spec/kontena/cli/app/docker_helper_spec.rb +74 -0
  70. data/spec/kontena/cli/grids/trusted_subnets/add_command_spec.rb +38 -0
  71. data/spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb +31 -0
  72. data/spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb +38 -0
  73. data/spec/kontena/cli/master/current_command_spec.rb +57 -0
  74. data/spec/kontena/cli/master/users/{add_role_command_spec.rb → roles/add_command_spec.rb} +3 -3
  75. data/spec/kontena/cli/master/users/{remove_role_command_spec.rb → roles/remove_command_spec.rb} +3 -3
  76. data/spec/kontena/cli/services/{add_secret_command_spec.rb → secrets/link_command_spec.rb} +4 -3
  77. data/spec/kontena/cli/services/{remove_secret_command_spec.rb → secrets/unlink_command_spec.rb} +4 -3
  78. data/spec/kontena/cli/services/services_helper_spec.rb +44 -0
  79. metadata +45 -26
  80. data/lib/kontena/cli/forgot_password_command.rb +0 -13
  81. data/lib/kontena/cli/reset_password_command.rb +0 -19
  82. data/lib/kontena/cli/users_command.rb +0 -15
  83. data/lib/kontena/cli/verify_account_command.rb +0 -13
@@ -1,8 +1,8 @@
1
- require_relative "../../../../spec_helper"
1
+ require_relative "../../../../../spec_helper"
2
2
  require 'kontena/cli/master/users_command'
3
- require 'kontena/cli/master/users/add_role_command'
3
+ require 'kontena/cli/master/users/roles/add_command'
4
4
 
5
- describe Kontena::Cli::Master::Users::AddRoleCommand do
5
+ describe Kontena::Cli::Master::Users::Roles::AddCommand do
6
6
 
7
7
  let(:subject) do
8
8
  described_class.new(File.basename($0))
@@ -1,8 +1,8 @@
1
- require_relative "../../../../spec_helper"
1
+ require_relative "../../../../../spec_helper"
2
2
  require 'kontena/cli/master/users_command'
3
- require 'kontena/cli/master/users/remove_role_command'
3
+ require 'kontena/cli/master/users/roles/remove_command'
4
4
 
5
- describe Kontena::Cli::Master::Users::RemoveRoleCommand do
5
+ describe Kontena::Cli::Master::Users::Roles::RemoveCommand do
6
6
 
7
7
  let(:subject) do
8
8
  described_class.new(File.basename($0))
@@ -1,7 +1,8 @@
1
- require_relative "../../../spec_helper"
2
- require "kontena/cli/services/add_secret_command"
1
+ require_relative "../../../../spec_helper"
2
+ require "kontena/cli/grid_options"
3
+ require "kontena/cli/services/secrets/link_command"
3
4
 
4
- describe Kontena::Cli::Services::AddSecretCommand do
5
+ describe Kontena::Cli::Services::Secrets::LinkCommand do
5
6
 
6
7
  include ClientHelpers
7
8
 
@@ -1,7 +1,8 @@
1
- require_relative "../../../spec_helper"
2
- require "kontena/cli/services/remove_secret_command"
1
+ require_relative "../../../../spec_helper"
2
+ require "kontena/cli/grid_options"
3
+ require "kontena/cli/services/secrets/unlink_command"
3
4
 
4
- describe Kontena::Cli::Services::RemoveSecretCommand do
5
+ describe Kontena::Cli::Services::Secrets::UnlinkCommand do
5
6
 
6
7
  include ClientHelpers
7
8
 
@@ -130,5 +130,49 @@ module Kontena::Cli::Services
130
130
  expect(subject.parse_image('redis:3.0')).to eq('redis:3.0')
131
131
  end
132
132
  end
133
+
134
+ describe '#parse_memory' do
135
+ it 'parses kilobytes' do
136
+ expect(subject.parse_memory("1024k")).to eq(1 * 1024 * 1024)
137
+ expect(subject.parse_memory("1024K")).to eq(1 * 1024 * 1024)
138
+ end
139
+
140
+ it 'parses megabytes' do
141
+ expect(subject.parse_memory("32m")).to eq(32 * 1024 * 1024)
142
+ expect(subject.parse_memory("32M")).to eq(32 * 1024 * 1024)
143
+ end
144
+
145
+ it 'parses gigabytes' do
146
+ expect(subject.parse_memory("2g")).to eq(2 * 1024 * 1024 * 1024)
147
+ expect(subject.parse_memory("2G")).to eq(2 * 1024 * 1024 * 1024)
148
+ end
149
+
150
+ it 'parses plain bytes' do
151
+ expect(subject.parse_memory("#{12 * 1024 * 1024}")).to eq(12 * 1024 * 1024)
152
+ end
153
+
154
+ it 'raises error if invalid format' do
155
+ expect{subject.parse_memory("1.024g")}.to raise_error(ArgumentError)
156
+ expect{subject.parse_memory("1MG")}.to raise_error(ArgumentError)
157
+ end
158
+ end
159
+
160
+ describe '#parse_relative_time' do
161
+ it 'parses minutes' do
162
+ expect(subject.parse_relative_time("60min")).to eq(60 * 60)
163
+ end
164
+
165
+ it 'parses hours' do
166
+ expect(subject.parse_relative_time("8h")).to eq(8 * 60 * 60)
167
+ end
168
+
169
+ it 'parses days' do
170
+ expect(subject.parse_relative_time("7d")).to eq(7 * 24 * 60 * 60)
171
+ end
172
+
173
+ it 'parses seconds by default' do
174
+ expect(subject.parse_relative_time("600")).to eq(600)
175
+ end
176
+ end
133
177
  end
134
178
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kontena-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kontena, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-06 00:00:00.000000000 Z
11
+ date: 2016-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -158,6 +158,7 @@ files:
158
158
  - lib/kontena/cli/apps/show_command.rb
159
159
  - lib/kontena/cli/apps/start_command.rb
160
160
  - lib/kontena/cli/apps/stop_command.rb
161
+ - lib/kontena/cli/bytes_helper.rb
161
162
  - lib/kontena/cli/common.rb
162
163
  - lib/kontena/cli/container_command.rb
163
164
  - lib/kontena/cli/containers/exec_command.rb
@@ -174,10 +175,8 @@ files:
174
175
  - lib/kontena/cli/external_registries/list_command.rb
175
176
  - lib/kontena/cli/external_registries/remove_command.rb
176
177
  - lib/kontena/cli/external_registry_command.rb
177
- - lib/kontena/cli/forgot_password_command.rb
178
178
  - lib/kontena/cli/grid_command.rb
179
179
  - lib/kontena/cli/grid_options.rb
180
- - lib/kontena/cli/grids/add_user_command.rb
181
180
  - lib/kontena/cli/grids/audit_log_command.rb
182
181
  - lib/kontena/cli/grids/cloud_config_command.rb
183
182
  - lib/kontena/cli/grids/common.rb
@@ -185,28 +184,36 @@ files:
185
184
  - lib/kontena/cli/grids/current_command.rb
186
185
  - lib/kontena/cli/grids/env_command.rb
187
186
  - lib/kontena/cli/grids/list_command.rb
188
- - lib/kontena/cli/grids/list_users_command.rb
189
187
  - lib/kontena/cli/grids/logs_command.rb
190
188
  - lib/kontena/cli/grids/remove_command.rb
191
- - lib/kontena/cli/grids/remove_user_command.rb
192
189
  - lib/kontena/cli/grids/show_command.rb
190
+ - lib/kontena/cli/grids/trusted_subnet_command.rb
191
+ - lib/kontena/cli/grids/trusted_subnets/add_command.rb
192
+ - lib/kontena/cli/grids/trusted_subnets/list_command.rb
193
+ - lib/kontena/cli/grids/trusted_subnets/remove_command.rb
193
194
  - lib/kontena/cli/grids/update_command.rb
194
195
  - lib/kontena/cli/grids/use_command.rb
196
+ - lib/kontena/cli/grids/user_command.rb
197
+ - lib/kontena/cli/grids/users/add_command.rb
198
+ - lib/kontena/cli/grids/users/list_command.rb
199
+ - lib/kontena/cli/grids/users/remove_command.rb
195
200
  - lib/kontena/cli/login_command.rb
196
201
  - lib/kontena/cli/logout_command.rb
197
202
  - lib/kontena/cli/master/aws/create_command.rb
198
203
  - lib/kontena/cli/master/aws_command.rb
199
204
  - lib/kontena/cli/master/azure/create_command.rb
200
205
  - lib/kontena/cli/master/azure_command.rb
206
+ - lib/kontena/cli/master/current_command.rb
201
207
  - lib/kontena/cli/master/digital_ocean/create_command.rb
202
208
  - lib/kontena/cli/master/digital_ocean_command.rb
203
209
  - lib/kontena/cli/master/list_command.rb
204
210
  - lib/kontena/cli/master/use_command.rb
205
- - lib/kontena/cli/master/users/add_role_command.rb
206
211
  - lib/kontena/cli/master/users/invite_command.rb
207
212
  - lib/kontena/cli/master/users/list_command.rb
208
213
  - lib/kontena/cli/master/users/remove_command.rb
209
- - lib/kontena/cli/master/users/remove_role_command.rb
214
+ - lib/kontena/cli/master/users/role_command.rb
215
+ - lib/kontena/cli/master/users/roles/add_command.rb
216
+ - lib/kontena/cli/master/users/roles/remove_command.rb
210
217
  - lib/kontena/cli/master/users_command.rb
211
218
  - lib/kontena/cli/master/vagrant/create_command.rb
212
219
  - lib/kontena/cli/master/vagrant/restart_command.rb
@@ -217,7 +224,6 @@ files:
217
224
  - lib/kontena/cli/master/vagrant_command.rb
218
225
  - lib/kontena/cli/master_command.rb
219
226
  - lib/kontena/cli/node_command.rb
220
- - lib/kontena/cli/nodes/add_label_command.rb
221
227
  - lib/kontena/cli/nodes/aws/create_command.rb
222
228
  - lib/kontena/cli/nodes/aws/restart_command.rb
223
229
  - lib/kontena/cli/nodes/aws/terminate_command.rb
@@ -230,9 +236,11 @@ files:
230
236
  - lib/kontena/cli/nodes/digital_ocean/restart_command.rb
231
237
  - lib/kontena/cli/nodes/digital_ocean/terminate_command.rb
232
238
  - lib/kontena/cli/nodes/digital_ocean_command.rb
239
+ - lib/kontena/cli/nodes/label_command.rb
240
+ - lib/kontena/cli/nodes/labels/add_command.rb
241
+ - lib/kontena/cli/nodes/labels/remove_command.rb
233
242
  - lib/kontena/cli/nodes/list_command.rb
234
243
  - lib/kontena/cli/nodes/remove_command.rb
235
- - lib/kontena/cli/nodes/remove_label_command.rb
236
244
  - lib/kontena/cli/nodes/show_command.rb
237
245
  - lib/kontena/cli/nodes/ssh_command.rb
238
246
  - lib/kontena/cli/nodes/update_command.rb
@@ -248,25 +256,26 @@ files:
248
256
  - lib/kontena/cli/registry/delete_command.rb
249
257
  - lib/kontena/cli/registry/remove_command.rb
250
258
  - lib/kontena/cli/registry_command.rb
251
- - lib/kontena/cli/reset_password_command.rb
252
259
  - lib/kontena/cli/service_command.rb
253
- - lib/kontena/cli/services/add_env_command.rb
254
- - lib/kontena/cli/services/add_secret_command.rb
255
260
  - lib/kontena/cli/services/container_command.rb
256
261
  - lib/kontena/cli/services/containers_command.rb
257
262
  - lib/kontena/cli/services/create_command.rb
258
263
  - lib/kontena/cli/services/delete_command.rb
259
264
  - lib/kontena/cli/services/deploy_command.rb
260
- - lib/kontena/cli/services/envs_command.rb
265
+ - lib/kontena/cli/services/env_command.rb
266
+ - lib/kontena/cli/services/envs/add_command.rb
267
+ - lib/kontena/cli/services/envs/list_command.rb
268
+ - lib/kontena/cli/services/envs/remove_command.rb
261
269
  - lib/kontena/cli/services/link_command.rb
262
270
  - lib/kontena/cli/services/list_command.rb
263
271
  - lib/kontena/cli/services/logs_command.rb
264
272
  - lib/kontena/cli/services/monitor_command.rb
265
273
  - lib/kontena/cli/services/remove_command.rb
266
- - lib/kontena/cli/services/remove_env_command.rb
267
- - lib/kontena/cli/services/remove_secret_command.rb
268
274
  - lib/kontena/cli/services/restart_command.rb
269
275
  - lib/kontena/cli/services/scale_command.rb
276
+ - lib/kontena/cli/services/secret_command.rb
277
+ - lib/kontena/cli/services/secrets/link_command.rb
278
+ - lib/kontena/cli/services/secrets/unlink_command.rb
270
279
  - lib/kontena/cli/services/services_helper.rb
271
280
  - lib/kontena/cli/services/show_command.rb
272
281
  - lib/kontena/cli/services/start_command.rb
@@ -274,14 +283,16 @@ files:
274
283
  - lib/kontena/cli/services/stop_command.rb
275
284
  - lib/kontena/cli/services/unlink_command.rb
276
285
  - lib/kontena/cli/services/update_command.rb
277
- - lib/kontena/cli/users_command.rb
286
+ - lib/kontena/cli/user/forgot_password_command.rb
287
+ - lib/kontena/cli/user/reset_password_command.rb
288
+ - lib/kontena/cli/user/verify_command.rb
289
+ - lib/kontena/cli/user_command.rb
278
290
  - lib/kontena/cli/vault/list_command.rb
279
291
  - lib/kontena/cli/vault/read_command.rb
280
292
  - lib/kontena/cli/vault/remove_command.rb
281
293
  - lib/kontena/cli/vault/update_command.rb
282
294
  - lib/kontena/cli/vault/write_command.rb
283
295
  - lib/kontena/cli/vault_command.rb
284
- - lib/kontena/cli/verify_account_command.rb
285
296
  - lib/kontena/cli/version.rb
286
297
  - lib/kontena/cli/version_command.rb
287
298
  - lib/kontena/cli/vpn/config_command.rb
@@ -337,18 +348,22 @@ files:
337
348
  - spec/kontena/cli/app/docker_helper_spec.rb
338
349
  - spec/kontena/cli/app/scale_spec.rb
339
350
  - spec/kontena/cli/common_spec.rb
351
+ - spec/kontena/cli/grids/trusted_subnets/add_command_spec.rb
352
+ - spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
353
+ - spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb
340
354
  - spec/kontena/cli/login_command_spec.rb
355
+ - spec/kontena/cli/master/current_command_spec.rb
341
356
  - spec/kontena/cli/master/use_command_spec.rb
342
- - spec/kontena/cli/master/users/add_role_command_spec.rb
343
357
  - spec/kontena/cli/master/users/invite_command_spec.rb
344
358
  - spec/kontena/cli/master/users/remove_command_spec.rb
345
- - spec/kontena/cli/master/users/remove_role_command_spec.rb
359
+ - spec/kontena/cli/master/users/roles/add_command_spec.rb
360
+ - spec/kontena/cli/master/users/roles/remove_command_spec.rb
346
361
  - spec/kontena/cli/register_command_spec.rb
347
- - spec/kontena/cli/services/add_secret_command_spec.rb
348
362
  - spec/kontena/cli/services/containers_command_spec.rb
349
363
  - spec/kontena/cli/services/link_command_spec.rb
350
- - spec/kontena/cli/services/remove_secret_command_spec.rb
351
364
  - spec/kontena/cli/services/restart_command_spec.rb
365
+ - spec/kontena/cli/services/secrets/link_command_spec.rb
366
+ - spec/kontena/cli/services/secrets/unlink_command_spec.rb
352
367
  - spec/kontena/cli/services/services_helper_spec.rb
353
368
  - spec/kontena/cli/services/unlink_command_spec.rb
354
369
  - spec/kontena/cli/version_command_spec.rb
@@ -391,18 +406,22 @@ test_files:
391
406
  - spec/kontena/cli/app/docker_helper_spec.rb
392
407
  - spec/kontena/cli/app/scale_spec.rb
393
408
  - spec/kontena/cli/common_spec.rb
409
+ - spec/kontena/cli/grids/trusted_subnets/add_command_spec.rb
410
+ - spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
411
+ - spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb
394
412
  - spec/kontena/cli/login_command_spec.rb
413
+ - spec/kontena/cli/master/current_command_spec.rb
395
414
  - spec/kontena/cli/master/use_command_spec.rb
396
- - spec/kontena/cli/master/users/add_role_command_spec.rb
397
415
  - spec/kontena/cli/master/users/invite_command_spec.rb
398
416
  - spec/kontena/cli/master/users/remove_command_spec.rb
399
- - spec/kontena/cli/master/users/remove_role_command_spec.rb
417
+ - spec/kontena/cli/master/users/roles/add_command_spec.rb
418
+ - spec/kontena/cli/master/users/roles/remove_command_spec.rb
400
419
  - spec/kontena/cli/register_command_spec.rb
401
- - spec/kontena/cli/services/add_secret_command_spec.rb
402
420
  - spec/kontena/cli/services/containers_command_spec.rb
403
421
  - spec/kontena/cli/services/link_command_spec.rb
404
- - spec/kontena/cli/services/remove_secret_command_spec.rb
405
422
  - spec/kontena/cli/services/restart_command_spec.rb
423
+ - spec/kontena/cli/services/secrets/link_command_spec.rb
424
+ - spec/kontena/cli/services/secrets/unlink_command_spec.rb
406
425
  - spec/kontena/cli/services/services_helper_spec.rb
407
426
  - spec/kontena/cli/services/unlink_command_spec.rb
408
427
  - spec/kontena/cli/version_command_spec.rb
@@ -1,13 +0,0 @@
1
- class Kontena::Cli::ForgotPasswordCommand < Clamp::Command
2
- include Kontena::Cli::Common
3
-
4
- parameter "EMAIL", "Email address"
5
-
6
- def execute
7
- require_api_url
8
-
9
- params = {email: email}
10
- client.post('user/password_reset', params)
11
- puts 'Email with password reset instructions is sent to your email address. Please follow the instructions to change your password.'
12
- end
13
- end
@@ -1,19 +0,0 @@
1
- class Kontena::Cli::ResetPasswordCommand < Clamp::Command
2
- include Kontena::Cli::Common
3
-
4
- parameter "TOKEN", "Password reset token"
5
-
6
- def execute
7
- require 'highline/import'
8
-
9
- require_api_url
10
- password = ask("Password: ") { |q| q.echo = "*" }
11
- password2 = ask("Password again: ") { |q| q.echo = "*" }
12
- if password != password2
13
- abort("Passwords don't match")
14
- end
15
- params = {token: token, password: password}
16
- client.put('user/password_reset', params)
17
- puts 'Password is now changed. To login with the new password, please run: kontena login'
18
- end
19
- end
@@ -1,15 +0,0 @@
1
- require_relative 'users/invite_command'
2
- require_relative 'users/list_command'
3
- require_relative 'users/add_role_command'
4
- require_relative 'users/remove_role_command'
5
-
6
- class Kontena::Cli::UsersCommand < Clamp::Command
7
-
8
- subcommand "invite", "Invite user to Kontena Master", Kontena::Cli::Users::InviteCommand
9
- subcommand ["list", "ls"], "List users", Kontena::Cli::Users::ListCommand
10
- subcommand "add-role", "Add role to user", Kontena::Cli::Users::AddRoleCommand
11
- subcommand "remove-role", "Remove role from user", Kontena::Cli::Users::RemoveRoleCommand
12
-
13
- def execute
14
- end
15
- end
@@ -1,13 +0,0 @@
1
- class Kontena::Cli::VerifyAccountCommand < Clamp::Command
2
- include Kontena::Cli::Common
3
-
4
- parameter "TOKEN", "Kontena verify token"
5
-
6
- def execute
7
- require_api_url
8
-
9
- params = {token: token}
10
- client.post('user/email_confirm', params)
11
- puts 'Account verified'.colorize(:green)
12
- end
13
- end