Class: Chef::Knife::ClientKeyList
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- Chef::Knife::ClientKeyList
- Includes:
- KeyListBase
- Defined in:
- lib/chef/knife/client_key_list.rb
Overview
Implements knife user key list using Chef::Knife::KeyList as a service class.
Constant Summary
Constants inherited from Chef::Knife
CHEF_ORGANIZATION_MANAGEMENT, OFFICIAL_PLUGINS, OPSCODE_HOSTED_CHEF_ACCESS_CONTROL
Instance Attribute Summary collapse
-
#actor ⇒ String
readonly
the name of the client that this key is for.
Attributes inherited from Chef::Knife
Instance Method Summary collapse
- #actor_missing_error ⇒ Object
- #apply_params!(params) ⇒ Object
-
#initialize(argv = []) ⇒ ClientKeyList
constructor
A new instance of ClientKeyList.
- #list_method ⇒ Object
- #run ⇒ Object
- #service_object ⇒ Object
Methods included from KeyListBase
Methods inherited from Chef::Knife
#api_key, #apply_computed_config, category, chef_config_dir, #cli_keys, common_name, #config_file_settings, config_loader, #config_source, #configure_chef, #create_object, #delete_object, dependency_loaders, deps, #format_rest_error, guess_category, #humanize_exception, #humanize_http_exception, inherited, list_commands, load_commands, load_config, load_deps, #maybe_setup_fips, #merge_configs, msg, #noauth_rest, #parse_options, reset_config_loader!, reset_subcommands!, #rest, run, #run_with_pretty_exceptions, #server_url, #show_usage, snake_case_name, subcommand_category, subcommand_class_from, subcommand_files, subcommand_loader, subcommands, subcommands_by_category, #test_mandatory_field, ui, unnamed?, use_separate_defaults?, #username
Methods included from Mixin::ConvertToClassName
#constantize, #convert_to_class_name, #convert_to_snake_case, #filename_to_qualified_string, #normalize_snake_case_name, #snake_case_basename
Constructor Details
#initialize(argv = []) ⇒ ClientKeyList
Returns a new instance of ClientKeyList.
38 39 40 41 |
# File 'lib/chef/knife/client_key_list.rb', line 38 def initialize(argv = []) super(argv) @service_object = nil end |
Instance Attribute Details
#actor ⇒ String (readonly)
the name of the client that this key is for
31 32 33 |
# File 'lib/chef/knife/client_key_list.rb', line 31 def actor @actor end |
Instance Method Details
#actor_missing_error ⇒ Object
52 53 54 |
# File 'lib/chef/knife/client_key_list.rb', line 52 def actor_missing_error "You must specify a client name" end |
#apply_params!(params) ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/chef/knife/client_key_list.rb', line 60 def apply_params!(params) @actor = params[0] if @actor.nil? show_usage ui.fatal(actor_missing_error) exit 1 end end |
#list_method ⇒ Object
48 49 50 |
# File 'lib/chef/knife/client_key_list.rb', line 48 def list_method :list_by_client end |
#run ⇒ Object
43 44 45 46 |
# File 'lib/chef/knife/client_key_list.rb', line 43 def run apply_params!(@name_args) service_object.run end |