Class: Verizon::MECPerformanceMetrics
- Defined in:
- lib/verizon/models/mec_performance_metrics.rb
Overview
Response to query the most recent data for Key Performance Indicators (KPIs) like network availability, MEC hostnames and more.
Instance Attribute Summary collapse
-
#mend ⇒ String
Timestamp of the query’s end , format:mm/dd/yyyy, hr:min:sec.
-
#query_result ⇒ Array[MECPerformanceQueryResult]
MEC performance query result.
-
#query_status ⇒ String
Success or Failed.
-
#start ⇒ String
Timestamp of the query’s start, format:mm/dd/yyyy,hr:min:sec.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(query_status = SKIP, start = SKIP, mend = SKIP, query_result = SKIP) ⇒ MECPerformanceMetrics
constructor
A new instance of MECPerformanceMetrics.
Methods inherited from BaseModel
Constructor Details
#initialize(query_status = SKIP, start = SKIP, mend = SKIP, query_result = SKIP) ⇒ MECPerformanceMetrics
Returns a new instance of MECPerformanceMetrics.
54 55 56 57 58 59 60 |
# File 'lib/verizon/models/mec_performance_metrics.rb', line 54 def initialize(query_status = SKIP, start = SKIP, mend = SKIP, query_result = SKIP) @query_status = query_status unless query_status == SKIP @start = start unless start == SKIP @mend = mend unless mend == SKIP @query_result = query_result unless query_result == SKIP end |
Instance Attribute Details
#mend ⇒ String
Timestamp of the query’s end , format:mm/dd/yyyy, hr:min:sec.
23 24 25 |
# File 'lib/verizon/models/mec_performance_metrics.rb', line 23 def mend @mend end |
#query_result ⇒ Array[MECPerformanceQueryResult]
MEC performance query result.
27 28 29 |
# File 'lib/verizon/models/mec_performance_metrics.rb', line 27 def query_result @query_result end |
#query_status ⇒ String
Success or Failed.
15 16 17 |
# File 'lib/verizon/models/mec_performance_metrics.rb', line 15 def query_status @query_status end |
#start ⇒ String
Timestamp of the query’s start, format:mm/dd/yyyy,hr:min:sec.
19 20 21 |
# File 'lib/verizon/models/mec_performance_metrics.rb', line 19 def start @start end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/verizon/models/mec_performance_metrics.rb', line 63 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. query_status = hash.key?('QueryStatus') ? hash['QueryStatus'] : SKIP start = hash.key?('Start') ? hash['Start'] : SKIP mend = hash.key?('End') ? hash['End'] : SKIP # Parameter is an array, so we need to iterate through it query_result = nil unless hash['QueryResult'].nil? query_result = [] hash['QueryResult'].each do |structure| query_result << (MECPerformanceQueryResult.from_hash(structure) if structure) end end query_result = SKIP unless hash.key?('QueryResult') # Create object from extracted values. MECPerformanceMetrics.new(query_status, start, mend, query_result) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/verizon/models/mec_performance_metrics.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['query_status'] = 'QueryStatus' @_hash['start'] = 'Start' @_hash['mend'] = 'End' @_hash['query_result'] = 'QueryResult' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/verizon/models/mec_performance_metrics.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 47 |
# File 'lib/verizon/models/mec_performance_metrics.rb', line 40 def self.optionals %w[ query_status start mend query_result ] end |