class OCI::Database::Models::CreateDataGuardAssociationWithNewDbSystemDetails

The configuration details for creating a Data Guard association for a virtual machine DB system database. For this type of DB system database, the `creationType` should be `NewDbSystem`. A new DB system will be launched to create the standby database.

To create a Data Guard association for a database in a bare metal or Exadata DB system, use the {#create_data_guard_association_to_existing_db_system_details create_data_guard_association_to_existing_db_system_details} subtype instead.

Attributes

availability_domain[RW]

The name of the availability domain that the standby database DB system will be located in. For example- "Uocm:PHX-AD-1". @return [String]

backup_network_nsg_ids[RW]

A list of the [OCIDs](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security groups (NSGs) that the backup network of this DB system belongs to. Setting this to an empty array after the list is created removes the resource from all NSGs. For more information about NSGs, see [Security Rules](docs.cloud.oracle.com/Content/Network/Concepts/securityrules.htm). Applicable only to Exadata systems.

@return [Array<String>]

display_name[RW]

The user-friendly name of the DB system that will contain the the standby database. The display name does not have to be unique. @return [String]

hostname[RW]

The hostname for the DB node. @return [String]

nsg_ids[RW]

A list of the [OCIDs](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security groups (NSGs) that this resource belongs to. Setting this to an empty array after the list is created removes the resource from all NSGs. For more information about NSGs, see [Security Rules](docs.cloud.oracle.com/Content/Network/Concepts/securityrules.htm). **NsgIds restrictions:**

  • Autonomous Databases with private access require at least 1 Network Security Group (NSG). The nsgIds array cannot be empty.

@return [Array<String>]

shape[RW]

The virtual machine DB system shape to launch for the standby database in the Data Guard association. The shape determines the number of CPU cores and the amount of memory available for the DB system. Only virtual machine shapes are valid options. If you do not supply this parameter, the default shape is the shape of the primary DB system.

To get a list of all shapes, use the {#list_db_system_shapes list_db_system_shapes} operation.

@return [String]

subnet_id[RW]

The OCID of the subnet the DB system is associated with. **Subnet Restrictions:**

  • For 1- and 2-node RAC DB systems, do not use a subnet that overlaps with 192.168.16.16/28

These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and backup subnet.

@return [String]

Public Class Methods

attribute_map() click to toggle source

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

# File lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb, line 58
def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'database_software_image_id': :'databaseSoftwareImageId',
    'database_admin_password': :'databaseAdminPassword',
    'protection_mode': :'protectionMode',
    'transport_type': :'transportType',
    'creation_type': :'creationType',
    'display_name': :'displayName',
    'availability_domain': :'availabilityDomain',
    'shape': :'shape',
    'subnet_id': :'subnetId',
    'nsg_ids': :'nsgIds',
    'backup_network_nsg_ids': :'backupNetworkNsgIds',
    'hostname': :'hostname'
    # rubocop:enable Style/SymbolLiteral
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash @option attributes [String] :database_software_image_id The value to assign to the {OCI::Database::Models::CreateDataGuardAssociationDetails#database_software_image_id database_software_image_id} proprety @option attributes [String] :database_admin_password The value to assign to the {OCI::Database::Models::CreateDataGuardAssociationDetails#database_admin_password database_admin_password} proprety @option attributes [String] :protection_mode The value to assign to the {OCI::Database::Models::CreateDataGuardAssociationDetails#protection_mode protection_mode} proprety @option attributes [String] :transport_type The value to assign to the {OCI::Database::Models::CreateDataGuardAssociationDetails#transport_type transport_type} proprety @option attributes [String] :display_name The value to assign to the {#display_name} property @option attributes [String] :availability_domain The value to assign to the {#availability_domain} property @option attributes [String] :shape The value to assign to the {#shape} property @option attributes [String] :subnet_id The value to assign to the {#subnet_id} property @option attributes [Array<String>] :nsg_ids The value to assign to the {#nsg_ids} property @option attributes [Array<String>] :backup_network_nsg_ids The value to assign to the {#backup_network_nsg_ids} property @option attributes [String] :hostname The value to assign to the {#hostname} property

# File lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb, line 114
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['creationType'] = 'NewDbSystem'

  super(attributes)

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

  self.availability_domain = attributes[:'availabilityDomain'] if attributes[:'availabilityDomain']

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

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

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

  self.subnet_id = attributes[:'subnetId'] if attributes[:'subnetId']

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

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

  self.nsg_ids = attributes[:'nsgIds'] if attributes[:'nsgIds']

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

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

  self.backup_network_nsg_ids = attributes[:'backupNetworkNsgIds'] if attributes[:'backupNetworkNsgIds']

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

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

  self.hostname = attributes[:'hostname'] if attributes[:'hostname']
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb, line 78
def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'database_software_image_id': :'String',
    'database_admin_password': :'String',
    'protection_mode': :'String',
    'transport_type': :'String',
    'creation_type': :'String',
    'display_name': :'String',
    'availability_domain': :'String',
    'shape': :'String',
    'subnet_id': :'String',
    'nsg_ids': :'Array<String>',
    'backup_network_nsg_ids': :'Array<String>',
    'hostname': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Public Instance Methods

==(other) click to toggle source

Checks equality by comparing each attribute. @param [Object] other the other object to be compared

# File lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb, line 166
def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    database_software_image_id == other.database_software_image_id &&
    database_admin_password == other.database_admin_password &&
    protection_mode == other.protection_mode &&
    transport_type == other.transport_type &&
    creation_type == other.creation_type &&
    display_name == other.display_name &&
    availability_domain == other.availability_domain &&
    shape == other.shape &&
    subnet_id == other.subnet_id &&
    nsg_ids == other.nsg_ids &&
    backup_network_nsg_ids == other.backup_network_nsg_ids &&
    hostname == other.hostname
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb, line 207
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) click to toggle source

@see the `==` method @param [Object] other the other object to be compared

# File lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb, line 187
def eql?(other)
  self == other
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb, line 196
def hash
  [database_software_image_id, database_admin_password, protection_mode, transport_type, creation_type, display_name, availability_domain, shape, subnet_id, nsg_ids, backup_network_nsg_ids, hostname].hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb, line 240
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_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb, line 234
def to_s
  to_hash.to_s
end

Private Instance Methods

_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb, line 257
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end