Class: WavefrontCli::Proxy
Overview
CLI coverage for the v2 ‘proxy’ API.
Constant Summary
Constants included from Constants
Constants::ALL_PAGE_SIZE, Constants::DEFAULT_CONFIG, Constants::DEFAULT_OPTS, Constants::HUMAN_TIME_FORMAT, Constants::HUMAN_TIME_FORMAT_MS
Instance Attribute Summary
Attributes inherited from Base
#klass, #klass_word, #options, #wf
Instance Method Summary collapse
Methods inherited from Base
#_sdk_class, #cannot_noop!, #check_status, #conds_to_query, #dispatch, #display, #display_api_error, #display_no_api_response, #do_delete, #do_describe, #do_import, #do_list, #do_search, #do_undelete, #do_update, #extract_values, #failed_validation_message, #format_var, #handle_error, #handle_response, #hcl_fields, #import_to_create, #initialize, #load_display_class, #load_file, #load_from_stdin, #mk_creds, #mk_opts, #ok_exit, #one_or_all, #options_and_exit, #parseable_output, #range_hash, #run, #search_key, #smart_delete, #smart_delete_message, #validate_id, #validate_input, #validate_opts, #validate_tags, #validator_exception, #validator_method
Constructor Details
This class inherits a constructor from WavefrontCli::Base
Instance Method Details
#do_rename ⇒ Object
12 13 14 15 |
# File 'lib/wavefront-cli/proxy.rb', line 12 def do_rename wf_string?([:'<name>']) wf.rename([:'<id>'], [:'<name>']) end |
#do_versions ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/wavefront-cli/proxy.rb', line 17 def do_versions raw = wf.list(0, :all).response.items.map do |i| { id: i.id, version: i.version, name: i.name } end raw.sort_by { |p| Gem::Version.new(p[:version]) }.reverse end |
#extra_validation ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/wavefront-cli/proxy.rb', line 25 def extra_validation return unless [:'<name>'] begin wf_string?([:'<name>']) rescue Wavefront::Exception::InvalidString abort "'#{[:'<name>']}' is not a valid proxy name." end end |
#no_api_response ⇒ Object
8 9 10 |
# File 'lib/wavefront-cli/proxy.rb', line 8 def no_api_response %w[do_versions] end |