Class: IbmCloudPower::NetworkPeerCreate
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- IbmCloudPower::NetworkPeerCreate
- Defined in:
- lib/ibm_cloud_power/models/network_peer_create.rb
Overview
network peer create parameters
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#customer_asn ⇒ Object
ASN number at customer network side.
-
#customer_cidr ⇒ Object
IP address used for configuring customer network interface with network subnet mask.
-
#default_export_route_filter ⇒ Object
default action for export route filter * allow: allow * deny: deny.
-
#default_import_route_filter ⇒ Object
default action for import route filter * allow: allow * deny: deny.
-
#ibm_asn ⇒ Object
ASN number at IBM PowerVS side.
-
#ibm_cidr ⇒ Object
IP address used for configuring IBM network interface with network subnet mask.
-
#name ⇒ Object
user defined name.
-
#peer_interface_id ⇒ Object
peer interface id.
-
#type ⇒ Object
type of the peer network * dcnetwork_bgp: broader gateway protocol is used to share routes between two autonomous network.
-
#vlan ⇒ Object
A vlan configured at the customer network.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ NetworkPeerCreate
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ NetworkPeerCreate
Initializes the object
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 121 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudPower::NetworkPeerCreate` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `IbmCloudPower::NetworkPeerCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'customer_asn') self.customer_asn = attributes[:'customer_asn'] else self.customer_asn = nil end if attributes.key?(:'customer_cidr') self.customer_cidr = attributes[:'customer_cidr'] else self.customer_cidr = nil end if attributes.key?(:'default_export_route_filter') self.default_export_route_filter = attributes[:'default_export_route_filter'] else self.default_export_route_filter = 'allow' end if attributes.key?(:'default_import_route_filter') self.default_import_route_filter = attributes[:'default_import_route_filter'] else self.default_import_route_filter = 'allow' end if attributes.key?(:'ibm_asn') self.ibm_asn = attributes[:'ibm_asn'] else self.ibm_asn = nil end if attributes.key?(:'ibm_cidr') self.ibm_cidr = attributes[:'ibm_cidr'] else self.ibm_cidr = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'peer_interface_id') self.peer_interface_id = attributes[:'peer_interface_id'] else self.peer_interface_id = nil end if attributes.key?(:'type') self.type = attributes[:'type'] else self.type = 'dcnetwork_bgp' end if attributes.key?(:'vlan') self.vlan = attributes[:'vlan'] else self.vlan = nil end end |
Instance Attribute Details
#customer_asn ⇒ Object
ASN number at customer network side
20 21 22 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 20 def customer_asn @customer_asn end |
#customer_cidr ⇒ Object
IP address used for configuring customer network interface with network subnet mask. customerCidr and ibmCidr must have matching network and subnet mask values.
23 24 25 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 23 def customer_cidr @customer_cidr end |
#default_export_route_filter ⇒ Object
default action for export route filter * allow: allow * deny: deny
26 27 28 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 26 def default_export_route_filter @default_export_route_filter end |
#default_import_route_filter ⇒ Object
default action for import route filter * allow: allow * deny: deny
29 30 31 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 29 def default_import_route_filter @default_import_route_filter end |
#ibm_asn ⇒ Object
ASN number at IBM PowerVS side
32 33 34 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 32 def ibm_asn @ibm_asn end |
#ibm_cidr ⇒ Object
IP address used for configuring IBM network interface with network subnet mask. customerCidr and ibmCidr must have matching network and subnet mask values.
35 36 37 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 35 def ibm_cidr @ibm_cidr end |
#name ⇒ Object
user defined name
38 39 40 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 38 def name @name end |
#peer_interface_id ⇒ Object
peer interface id. use API '/v1/network-peers/interfaces' to get a list of valid peer interface id
41 42 43 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 41 def peer_interface_id @peer_interface_id end |
#type ⇒ Object
type of the peer network * dcnetwork_bgp: broader gateway protocol is used to share routes between two autonomous network
44 45 46 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 44 def type @type end |
#vlan ⇒ Object
A vlan configured at the customer network.
47 48 49 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 47 def vlan @vlan end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
88 89 90 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 88 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
93 94 95 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 93 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 72 def self.attribute_map { :'customer_asn' => :'customerASN', :'customer_cidr' => :'customerCidr', :'default_export_route_filter' => :'defaultExportRouteFilter', :'default_import_route_filter' => :'defaultImportRouteFilter', :'ibm_asn' => :'ibmASN', :'ibm_cidr' => :'ibmCidr', :'name' => :'name', :'peer_interface_id' => :'peerInterfaceID', :'type' => :'type', :'vlan' => :'vlan' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 384 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
114 115 116 117 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 114 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 98 def self.openapi_types { :'customer_asn' => :'Integer', :'customer_cidr' => :'String', :'default_export_route_filter' => :'String', :'default_import_route_filter' => :'String', :'ibm_asn' => :'Integer', :'ibm_cidr' => :'String', :'name' => :'String', :'peer_interface_id' => :'String', :'type' => :'String', :'vlan' => :'Integer' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 354 def ==(o) return true if self.equal?(o) self.class == o.class && customer_asn == o.customer_asn && customer_cidr == o.customer_cidr && default_export_route_filter == o.default_export_route_filter && default_import_route_filter == o.default_import_route_filter && ibm_asn == o.ibm_asn && ibm_cidr == o.ibm_cidr && name == o.name && peer_interface_id == o.peer_interface_id && type == o.type && vlan == o.vlan end |
#eql?(o) ⇒ Boolean
371 372 373 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 371 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
377 378 379 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 377 def hash [customer_asn, customer_cidr, default_export_route_filter, default_import_route_filter, ibm_asn, ibm_cidr, name, peer_interface_id, type, vlan].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 198 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @customer_asn.nil? invalid_properties.push('invalid value for "customer_asn", customer_asn cannot be nil.') end if @customer_cidr.nil? invalid_properties.push('invalid value for "customer_cidr", customer_cidr cannot be nil.') end if @ibm_asn.nil? invalid_properties.push('invalid value for "ibm_asn", ibm_asn cannot be nil.') end if @ibm_cidr.nil? invalid_properties.push('invalid value for "ibm_cidr", ibm_cidr cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @peer_interface_id.nil? invalid_properties.push('invalid value for "peer_interface_id", peer_interface_id cannot be nil.') end if @vlan.nil? invalid_properties.push('invalid value for "vlan", vlan cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
406 407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 406 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/ibm_cloud_power/models/network_peer_create.rb', line 234 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @customer_asn.nil? return false if @customer_cidr.nil? default_export_route_filter_validator = EnumAttributeValidator.new('String', ["allow", "deny"]) return false unless default_export_route_filter_validator.valid?(@default_export_route_filter) default_import_route_filter_validator = EnumAttributeValidator.new('String', ["allow", "deny"]) return false unless default_import_route_filter_validator.valid?(@default_import_route_filter) return false if @ibm_asn.nil? return false if @ibm_cidr.nil? return false if @name.nil? return false if @peer_interface_id.nil? type_validator = EnumAttributeValidator.new('String', ["dcnetwork_bgp"]) return false unless type_validator.valid?(@type) return false if @vlan.nil? true end |