Class: OCI::Opsi::Models::ExadataInsightResourceForecastTrendSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb

Overview

List of resource id, name , capacity insight value, pattern, historical usage and projected data.

Constant Summary collapse

PATTERN_ENUM =
[
  PATTERN_LINEAR = 'LINEAR'.freeze,
  PATTERN_MONTHLY_SEASONS = 'MONTHLY_SEASONS'.freeze,
  PATTERN_MONTHLY_AND_YEARLY_SEASONS = 'MONTHLY_AND_YEARLY_SEASONS'.freeze,
  PATTERN_WEEKLY_SEASONS = 'WEEKLY_SEASONS'.freeze,
  PATTERN_WEEKLY_AND_MONTHLY_SEASONS = 'WEEKLY_AND_MONTHLY_SEASONS'.freeze,
  PATTERN_WEEKLY_MONTHLY_AND_YEARLY_SEASONS = 'WEEKLY_MONTHLY_AND_YEARLY_SEASONS'.freeze,
  PATTERN_WEEKLY_AND_YEARLY_SEASONS = 'WEEKLY_AND_YEARLY_SEASONS'.freeze,
  PATTERN_YEARLY_SEASONS = 'YEARLY_SEASONS'.freeze,
  PATTERN_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ExadataInsightResourceForecastTrendSummary

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 95

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.id = attributes[:'id'] if attributes[:'id']

  self.name = attributes[:'name'] if attributes[:'name']

  self.days_to_reach_capacity = attributes[:'daysToReachCapacity'] if attributes[:'daysToReachCapacity']

  raise 'You cannot provide both :daysToReachCapacity and :days_to_reach_capacity' if attributes.key?(:'daysToReachCapacity') && attributes.key?(:'days_to_reach_capacity')

  self.days_to_reach_capacity = attributes[:'days_to_reach_capacity'] if attributes[:'days_to_reach_capacity']

  self.selected_forecast_algorithm = attributes[:'selectedForecastAlgorithm'] if attributes[:'selectedForecastAlgorithm']

  raise 'You cannot provide both :selectedForecastAlgorithm and :selected_forecast_algorithm' if attributes.key?(:'selectedForecastAlgorithm') && attributes.key?(:'selected_forecast_algorithm')

  self.selected_forecast_algorithm = attributes[:'selected_forecast_algorithm'] if attributes[:'selected_forecast_algorithm']

  self.pattern = attributes[:'pattern'] if attributes[:'pattern']

  self.historical_data = attributes[:'historicalData'] if attributes[:'historicalData']

  raise 'You cannot provide both :historicalData and :historical_data' if attributes.key?(:'historicalData') && attributes.key?(:'historical_data')

  self.historical_data = attributes[:'historical_data'] if attributes[:'historical_data']

  self.projected_data = attributes[:'projectedData'] if attributes[:'projectedData']

  raise 'You cannot provide both :projectedData and :projected_data' if attributes.key?(:'projectedData') && attributes.key?(:'projected_data')

  self.projected_data = attributes[:'projected_data'] if attributes[:'projected_data']
end

Instance Attribute Details

#days_to_reach_capacityInteger

[Required] Days to reach capacity for a storage server

Returns:

  • (Integer)


34
35
36
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 34

def days_to_reach_capacity
  @days_to_reach_capacity
end

#historical_dataArray<OCI::Opsi::Models::HistoricalDataItem>

[Required] Time series data used for the forecast analysis.



46
47
48
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 46

def historical_data
  @historical_data
end

#idString

[Required] The OCID of the database insight resource.

Returns:

  • (String)


26
27
28
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 26

def id
  @id
end

#nameString

[Required] The name of the resource.

Returns:

  • (String)


30
31
32
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 30

def name
  @name
end

#patternString

[Required] Time series patterns used in the forecasting.

Returns:

  • (String)


42
43
44
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 42

def pattern
  @pattern
end

#projected_dataArray<OCI::Opsi::Models::ProjectedDataItem>

[Required] Time series data result of the forecasting analysis.



50
51
52
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 50

def projected_data
  @projected_data
end

#selected_forecast_algorithmString

Auto-ML algorithm leveraged for the forecast. Only applicable for Auto-ML forecast.

Returns:

  • (String)


38
39
40
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 38

def selected_forecast_algorithm
  @selected_forecast_algorithm
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 53

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'name': :'name',
    'days_to_reach_capacity': :'daysToReachCapacity',
    'selected_forecast_algorithm': :'selectedForecastAlgorithm',
    'pattern': :'pattern',
    'historical_data': :'historicalData',
    'projected_data': :'projectedData'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 68

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'name': :'String',
    'days_to_reach_capacity': :'Integer',
    'selected_forecast_algorithm': :'String',
    'pattern': :'String',
    'historical_data': :'Array<OCI::Opsi::Models::HistoricalDataItem>',
    'projected_data': :'Array<OCI::Opsi::Models::ProjectedDataItem>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 152

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    id == other.id &&
    name == other.name &&
    days_to_reach_capacity == other.days_to_reach_capacity &&
    selected_forecast_algorithm == other.selected_forecast_algorithm &&
    pattern == other.pattern &&
    historical_data == other.historical_data &&
    projected_data == other.projected_data
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 188

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


168
169
170
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 168

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



177
178
179
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 177

def hash
  [id, name, days_to_reach_capacity, selected_forecast_algorithm, pattern, historical_data, projected_data].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



221
222
223
224
225
226
227
228
229
230
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 221

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



215
216
217
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 215

def to_s
  to_hash.to_s
end