Class: SoracomCli::User

Inherits:
Thor
  • Object
show all
Defined in:
lib/soracom/cli.rb

Overview

User related commands

Instance Method Summary collapse

Instance Method Details

#create_passwordObject



426
427
428
429
430
# File 'lib/soracom/cli.rb', line 426

def create_password
  client = Soracom::Client.new(profile:options.profile)
  data = client.create_user_password(options.user_name, options.password)
  puts JSON.pretty_generate(data)
end

#create_userObject



358
359
360
361
362
# File 'lib/soracom/cli.rb', line 358

def create_user
  client = Soracom::Client.new(profile:options.profile)
  data = client.create_user(options.user_name, options.description)
  puts JSON.pretty_generate(data)
end

#delete_auth_keyObject



392
393
394
395
396
# File 'lib/soracom/cli.rb', line 392

def delete_auth_key
  client = Soracom::Client.new(profile:options.profile)
  data = client.delete_users_auth_key(options.user_name, options.auth_key_id)
  puts JSON.pretty_generate(data)
end

#delete_passwordObject



409
410
411
412
413
# File 'lib/soracom/cli.rb', line 409

def delete_password
  client = Soracom::Client.new(profile:options.profile)
  data = client.delete_user_password(options.user_name)
  puts JSON.pretty_generate(data)
end

#delete_userObject



341
342
343
344
345
# File 'lib/soracom/cli.rb', line 341

def delete_user
  client = Soracom::Client.new(profile:options.profile)
  data = client.delete_user(options.user_name)
  puts JSON.pretty_generate(data)
end

#generate_auth_keyObject



383
384
385
386
387
# File 'lib/soracom/cli.rb', line 383

def generate_auth_key
  client = Soracom::Client.new(profile:options.profile)
  data = client.generate_users_auth_key(options.user_name)
  puts JSON.pretty_generate(data)
end

#get_auth_keyObject



401
402
403
404
405
# File 'lib/soracom/cli.rb', line 401

def get_auth_key
  client = Soracom::Client.new(profile:options.profile)
  data = client.get_users_auth_key(options.user_name, options.auth_key_id)
  puts JSON.pretty_generate(data)
end

#get_permissionObject



434
435
436
437
438
# File 'lib/soracom/cli.rb', line 434

def get_permission
  client = Soracom::Client.new(profile:options.profile)
  data = client.get_user_permission(options.user_name)
  puts JSON.pretty_generate(data)
end

#get_userObject



349
350
351
352
353
# File 'lib/soracom/cli.rb', line 349

def get_user
  client = Soracom::Client.new(profile:options.profile)
  data = client.get_user(options.user_name)
  puts JSON.pretty_generate(data)
end

#has_passwordObject



417
418
419
420
421
# File 'lib/soracom/cli.rb', line 417

def has_password
  client = Soracom::Client.new(profile:options.profile)
  data = client.has_user_password(options.user_name)
  puts JSON.pretty_generate(data)
end

#list_auth_keysObject



375
376
377
378
379
# File 'lib/soracom/cli.rb', line 375

def list_auth_keys
  client = Soracom::Client.new(profile:options.profile)
  data = client.list_users_auth_key(options.user_name)
  puts JSON.pretty_generate(data)
end

#list_usersObject



333
334
335
336
337
# File 'lib/soracom/cli.rb', line 333

def list_users
  client = Soracom::Client.new(profile:options.profile)
  data = client.list_users()
  puts JSON.pretty_generate(data)
end

#update_permissionObject



444
445
446
447
448
# File 'lib/soracom/cli.rb', line 444

def update_permission
  client = Soracom::Client.new(profile:options.profile)
  data = client.update_user_permission(options.user_name, options.permission, options.description)
  puts JSON.pretty_generate(data)
end

#update_userObject



367
368
369
370
371
# File 'lib/soracom/cli.rb', line 367

def update_user
  client = Soracom::Client.new(profile:options.profile)
  data = client.update_user(options.user_name, options.description)
  puts JSON.pretty_generate(data)
end