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



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
117
118
119
120
121
122
123
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 88

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


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

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



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 52

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_nsg_id_list': :'destinationNsgIdList'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 65

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



132
133
134
135
136
137
138
139
140
141
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 132

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



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 166

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


146
147
148
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 146

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



155
156
157
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 155

def hash
  [source_vnic_id, destination_subnet_id, destination_primary_private_ip_address, destination_primary_private_ip_hostname_label, 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



199
200
201
202
203
204
205
206
207
208
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 199

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



193
194
195
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping_details.rb', line 193

def to_s
  to_hash.to_s
end