Class: OCI::DisasterRecovery::Models::ComputeInstanceMovableVnicMapping

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.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 = {}) ⇒ ComputeInstanceMovableVnicMapping

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
131
132
133
134
135
136
137
138
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 97

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


55
56
57
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 55

def destination_nsg_id_list
  @destination_nsg_id_list
end

#destination_primary_private_ip_addressString

The private IP address to be assigned as the VNIC's primary IP address in the destination subnet. This must be a valid IP address in the destination subnet and the IP address must be available.

Example: 10.0.3.3

Returns:

  • (String)


31
32
33
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 31

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)


40
41
42
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 40

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)


47
48
49
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 47

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)


23
24
25
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 23

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)


16
17
18
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 16

def source_vnic_id
  @source_vnic_id
end

Class Method Details

.attribute_mapObject

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



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

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.



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

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



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

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



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

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


162
163
164
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 162

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



171
172
173
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 171

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



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

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



209
210
211
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 209

def to_s
  to_hash.to_s
end