Class: OCI::DisasterRecovery::Models::ComputeInstanceMovableVnicMapping
- Inherits:
-
Object
- Object
- OCI::DisasterRecovery::Models::ComputeInstanceMovableVnicMapping
- 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
-
#destination_nsg_id_list ⇒ Array<String>
A list of OCIDs of network security groups (NSG) in the destination region which should be assigned to the source VNIC.
-
#destination_primary_private_ip_address ⇒ String
The private IP address to be assigned as the VNIC's primary IP address in the destination subnet.
-
#destination_primary_private_ip_hostname_label ⇒ String
The hostname label to be assigned in the destination subnet for the primary private IP of the source VNIC.
-
#destination_subnet_id ⇒ String
[Required] The OCID of the destination subnet to which the source VNIC should connect.
-
#source_vnic_id ⇒ String
[Required] The OCID of the source VNIC.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ComputeInstanceMovableVnicMapping
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ ComputeInstanceMovableVnicMapping
Initializes the object
87 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 |
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 87 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_list ⇒ Array<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 ]
48 49 50 |
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 48 def destination_nsg_id_list @destination_nsg_id_list end |
#destination_primary_private_ip_address ⇒ String
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
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_label ⇒ String
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
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_subnet_id ⇒ String
[Required] The OCID of the destination subnet to which the source VNIC should connect.
Example: ocid1.subnet.oc1..uniqueID
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_id ⇒ String
[Required] The OCID of the source VNIC.
Example: ocid1.vnic.oc1..uniqueID
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_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 51 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_types ⇒ Object
Attribute type mapping.
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 64 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.
131 132 133 134 135 136 137 138 139 140 |
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 131 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
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 165 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
145 146 147 |
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 145 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
154 155 156 |
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 154 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_hash ⇒ Hash
Returns the object in the form of hash
198 199 200 201 202 203 204 205 206 207 |
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 198 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 ⇒ String
Returns the string representation of the object
192 193 194 |
# File 'lib/oci/disaster_recovery/models/compute_instance_movable_vnic_mapping.rb', line 192 def to_s to_hash.to_s end |