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):



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 87

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.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)


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

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.



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

def historical_data
  @historical_data
end

#idString

[Required] The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database insight resource.

Returns:

  • (String)


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

def id
  @id
end

#nameString

[Required] The name of the resource.

Returns:

  • (String)


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

def name
  @name
end

#patternString

[Required] Time series patterns used in the forecasting.

Returns:

  • (String)


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

def pattern
  @pattern
end

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

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



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

def projected_data
  @projected_data
end

Class Method Details

.attribute_mapObject

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



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 48

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

.swagger_typesObject

Attribute type mapping.



62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 62

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'name': :'String',
    'days_to_reach_capacity': :'Integer',
    '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



138
139
140
141
142
143
144
145
146
147
148
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 138

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 &&
    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



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 173

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


153
154
155
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 153

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



162
163
164
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 162

def hash
  [id, name, days_to_reach_capacity, 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



206
207
208
209
210
211
212
213
214
215
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 206

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



200
201
202
# File 'lib/oci/opsi/models/exadata_insight_resource_forecast_trend_summary.rb', line 200

def to_s
  to_hash.to_s
end