Class: WavefrontCli::DerivedMetric
- Includes:
- Mixin::Tag
- Defined in:
- lib/wavefront-cli/derivedmetric.rb
Overview
CLI coverage for the v2 ‘derivedmetric’ API.
Constant Summary
Constants included from Constants
Constants::ALL_PAGE_SIZE, Constants::DEFAULT_CONFIG, Constants::DEFAULT_OPTS, Constants::EVENT_STATE_DIR, Constants::HUMAN_TIME_FORMAT, Constants::HUMAN_TIME_FORMAT_MS, Constants::SEARCH_SPLIT
Instance Attribute Summary
Attributes inherited from Base
#klass, #klass_word, #options, #wf
Instance Method Summary collapse
-
#create_body ⇒ Object
rubocop:disable Metrics/AbcSize.
- #do_create ⇒ Object
- #do_delete ⇒ Object
- #do_describe ⇒ Object
- #do_history ⇒ Object
-
#valid_tags? ⇒ Boolean
rubocop:enable Metrics/AbcSize.
- #validator_exception ⇒ Object
Methods included from Mixin::Tag
#do_tag_add, #do_tag_clear, #do_tag_delete, #do_tag_pathsearch, #do_tag_set, #do_tags
Methods inherited from Base
#_sdk_class, #cannot_noop!, #check_response_blocks, #check_status, #cli_output_class, #conds_to_query, #descriptive_name, #dispatch, #display, #display_api_error, #display_class, #display_no_api_response, #do_dump, #do_import, #do_list, #do_search, #do_set, #do_undelete, #dump_json, #dump_yaml, #extract_values, #failed_validation_message, #format_var, #handle_error, #handle_response, #hcl_fields, #import_to_create, #initialize, #item_dump_call, #load_display_class, #matching_method, #method_word_list, #mk_creds, #mk_opts, #name_of_do_method, #no_api_response, #ok_exit, #one_or_all, #options_and_exit, #parseable_output, #range_hash, #require_sdk_class, #run, #search_key, #smart_delete, #smart_delete_message, #status_error_handler, #unsupported_format_message, #validate_id, #validate_input, #validate_opts, #validate_tags, #validator_method, #warning_message
Constructor Details
This class inherits a constructor from WavefrontCli::Base
Instance Method Details
#create_body ⇒ Object
rubocop:disable Metrics/AbcSize
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/wavefront-cli/derivedmetric.rb', line 34 def create_body { query: [:'<query>'], name: [:'<name>'], minutes: [:range].to_i, includeObsoleteMetrics: [:obsolete], processRateMinutes: [:interval].to_i }.tap do |b| b[:additionalInformation] = [:desc] if [:desc] b[:tags] = [:ctag] if end end |
#do_create ⇒ Object
29 30 31 |
# File 'lib/wavefront-cli/derivedmetric.rb', line 29 def do_create wf.create(create_body) end |
#do_delete ⇒ Object
21 22 23 |
# File 'lib/wavefront-cli/derivedmetric.rb', line 21 def do_delete smart_delete('derived metric') end |
#do_describe ⇒ Object
17 18 19 |
# File 'lib/wavefront-cli/derivedmetric.rb', line 17 def do_describe wf.describe([:'<id>'], [:version]) end |
#do_history ⇒ Object
25 26 27 |
# File 'lib/wavefront-cli/derivedmetric.rb', line 25 def do_history wf.history([:'<id>']) end |
#valid_tags? ⇒ Boolean
rubocop:enable Metrics/AbcSize
46 47 48 |
# File 'lib/wavefront-cli/derivedmetric.rb', line 46 def ![:ctag].empty? && ([:ctag]) end |
#validator_exception ⇒ Object
13 14 15 |
# File 'lib/wavefront-cli/derivedmetric.rb', line 13 def validator_exception Wavefront::Exception::InvalidDerivedMetricId end |