Class: OCI::DatabaseManagement::Models::LoadSqlPlanBaselinesFromAwrDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb

Overview

The details required to load plans from Automatic Workload Repository (AWR).

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ LoadSqlPlanBaselinesFromAwrDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 98

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.job_name = attributes[:'jobName'] if attributes[:'jobName']

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

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

  self.job_description = attributes[:'jobDescription'] if attributes[:'jobDescription']

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

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

  self.begin_snapshot = attributes[:'beginSnapshot'] if attributes[:'beginSnapshot']

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

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

  self.end_snapshot = attributes[:'endSnapshot'] if attributes[:'endSnapshot']

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

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

  self.sql_text_filter = attributes[:'sqlTextFilter'] if attributes[:'sqlTextFilter']

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

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

  self.is_fixed = attributes[:'isFixed'] unless attributes[:'isFixed'].nil?

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

  self.is_fixed = attributes[:'is_fixed'] unless attributes[:'is_fixed'].nil?

  self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?

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

  self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?

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

Instance Attribute Details

#begin_snapshotInteger

[Required] The begin snapshot.

Returns:

  • (Integer)


22
23
24
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 22

def begin_snapshot
  @begin_snapshot
end

#credentialsOCI::DatabaseManagement::Models::ManagedDatabaseCredential

This attribute is required.



50
51
52
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 50

def credentials
  @credentials
end

#end_snapshotInteger

[Required] The end snapshot.

Returns:

  • (Integer)


26
27
28
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 26

def end_snapshot
  @end_snapshot
end

#is_enabledBOOLEAN

Indicates whether the loaded plans are enabled (true) or not (false). By default, they are enabled.

Returns:

  • (BOOLEAN)


46
47
48
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 46

def is_enabled
  @is_enabled
end

#is_fixedBOOLEAN

Indicates whether the plans are loaded as fixed plans (true) or non-fixed plans (false). By default, they are loaded as non-fixed plans.

Returns:

  • (BOOLEAN)


40
41
42
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 40

def is_fixed
  @is_fixed
end

#job_descriptionString

The description of the job.

Returns:

  • (String)


18
19
20
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 18

def job_description
  @job_description
end

#job_nameString

[Required] The name of the database job used for loading SQL plan baselines.

Returns:

  • (String)


14
15
16
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 14

def job_name
  @job_name
end

#sql_text_filterString

A filter applied to AWR to select only qualifying plans to be loaded. By default all plans in AWR are selected. The filter can take the form of any WHERE clause predicate that can be specified against the column DBA_HIST_SQLTEXT.SQL_TEXT. An example is sql_text like 'SELECT %'.

Returns:

  • (String)


34
35
36
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 34

def sql_text_filter
  @sql_text_filter
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
66
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 53

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'job_name': :'jobName',
    'job_description': :'jobDescription',
    'begin_snapshot': :'beginSnapshot',
    'end_snapshot': :'endSnapshot',
    'sql_text_filter': :'sqlTextFilter',
    'is_fixed': :'isFixed',
    'is_enabled': :'isEnabled',
    'credentials': :'credentials'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 69

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'job_name': :'String',
    'job_description': :'String',
    'begin_snapshot': :'Integer',
    'end_snapshot': :'Integer',
    'sql_text_filter': :'String',
    'is_fixed': :'BOOLEAN',
    'is_enabled': :'BOOLEAN',
    'credentials': :'OCI::DatabaseManagement::Models::ManagedDatabaseCredential'
    # 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



156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 156

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

  self.class == other.class &&
    job_name == other.job_name &&
    job_description == other.job_description &&
    begin_snapshot == other.begin_snapshot &&
    end_snapshot == other.end_snapshot &&
    sql_text_filter == other.sql_text_filter &&
    is_fixed == other.is_fixed &&
    is_enabled == other.is_enabled &&
    credentials == other.credentials
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



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 193

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


173
174
175
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 173

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



182
183
184
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 182

def hash
  [job_name, job_description, begin_snapshot, end_snapshot, sql_text_filter, is_fixed, is_enabled, credentials].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



226
227
228
229
230
231
232
233
234
235
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 226

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



220
221
222
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_awr_details.rb', line 220

def to_s
  to_hash.to_s
end