Class: OCI::DisasterRecovery::Models::ComputeInstanceMovableVnicMappingDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb

Overview

Source VNIC to destination subnet mapping for a movable compute instance.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ComputeInstanceMovableVnicMappingDetails

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
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_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.source_vnic_id = attributes[:'sourceVnicId'] if attributes[:'sourceVnicId']

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

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

  self.destination_subnet_id = attributes[:'destinationSubnetId'] if attributes[:'destinationSubnetId']

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

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

  self.destination_primary_private_ip_address = attributes[:'destinationPrimaryPrivateIpAddress'] if attributes[:'destinationPrimaryPrivateIpAddress']

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

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

  self.destination_primary_private_ip_hostname_label = attributes[:'destinationPrimaryPrivateIpHostnameLabel'] if attributes[:'destinationPrimaryPrivateIpHostnameLabel']

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

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

  self.destination_reserved_public_ip_id = attributes[:'destinationReservedPublicIpId'] if attributes[:'destinationReservedPublicIpId']

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

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

  self.destination_nsg_id_list = attributes[:'destinationNsgIdList'] if attributes[:'destinationNsgIdList']

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

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

Instance Attribute Details

#destination_nsg_id_listArray<String>

A list of OCIDs of network security groups (NSG) in the destination region which should be assigned to the source VNIC.

Example: [ ocid1.networksecuritygroup.oc1..uniqueID, ocid1.networksecuritygroup.oc1..uniqueID ]

Returns:

  • (Array<String>)


56
57
58
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 56

def destination_nsg_id_list
  @destination_nsg_id_list
end

#destination_primary_private_ip_addressString

The primary private IP address to be assigned to the source VNIC in the destination subnet. This IP address must belong to the destination subnet.

Example: 10.0.3.3

Returns:

  • (String)


32
33
34
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 32

def destination_primary_private_ip_address
  @destination_primary_private_ip_address
end

#destination_primary_private_ip_hostname_labelString

The hostname label to be assigned in the destination subnet for the primary private IP of the source VNIC. This label is the hostname portion of the private IP's fully qualified domain name (FQDN) (for example, 'myhost1' in the FQDN 'myhost1.subnet123.vcn1.oraclevcn.com').

Example: myhost1

Returns:

  • (String)


41
42
43
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 41

def destination_primary_private_ip_hostname_label
  @destination_primary_private_ip_hostname_label
end

#destination_reserved_public_ip_idString

The OCID of the reserved public IP address to be assigned to the compute instance in the destination region.

Example: ocid1.publicip.oc1..uniqueID

Returns:

  • (String)


48
49
50
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 48

def destination_reserved_public_ip_id
  @destination_reserved_public_ip_id
end

#destination_subnet_idString

[Required] The OCID of the destination subnet to which the source VNIC should connect.

Example: ocid1.subnet.oc1..uniqueID

Returns:

  • (String)


24
25
26
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 24

def destination_subnet_id
  @destination_subnet_id
end

#source_vnic_idString

[Required] The OCID of the source VNIC.

Example: ocid1.vnic.oc1..uniqueID

Returns:

  • (String)


17
18
19
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 17

def source_vnic_id
  @source_vnic_id
end

Class Method Details

.attribute_mapObject

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



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 59

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'source_vnic_id': :'sourceVnicId',
    'destination_subnet_id': :'destinationSubnetId',
    'destination_primary_private_ip_address': :'destinationPrimaryPrivateIpAddress',
    'destination_primary_private_ip_hostname_label': :'destinationPrimaryPrivateIpHostnameLabel',
    'destination_reserved_public_ip_id': :'destinationReservedPublicIpId',
    'destination_nsg_id_list': :'destinationNsgIdList'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 73

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'source_vnic_id': :'String',
    'destination_subnet_id': :'String',
    'destination_primary_private_ip_address': :'String',
    'destination_primary_private_ip_hostname_label': :'String',
    'destination_reserved_public_ip_id': :'String',
    'destination_nsg_id_list': :'Array<String>'
    # 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



148
149
150
151
152
153
154
155
156
157
158
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 148

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

  self.class == other.class &&
    source_vnic_id == other.source_vnic_id &&
    destination_subnet_id == other.destination_subnet_id &&
    destination_primary_private_ip_address == other.destination_primary_private_ip_address &&
    destination_primary_private_ip_hostname_label == other.destination_primary_private_ip_hostname_label &&
    destination_reserved_public_ip_id == other.destination_reserved_public_ip_id &&
    destination_nsg_id_list == other.destination_nsg_id_list
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



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 183

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


163
164
165
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 163

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



172
173
174
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 172

def hash
  [source_vnic_id, destination_subnet_id, destination_primary_private_ip_address, destination_primary_private_ip_hostname_label, destination_reserved_public_ip_id, destination_nsg_id_list].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



216
217
218
219
220
221
222
223
224
225
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 216

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



210
211
212
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 210

def to_s
  to_hash.to_s
end