Class: Fog::ApplicationGateway::AzureRM::Gateway
- Inherits:
-
Model
- Object
- Model
- Fog::ApplicationGateway::AzureRM::Gateway
- Defined in:
- lib/fog/azurerm/models/application_gateway/gateway.rb
Overview
Gateway model class for Application Gateway Service
Class Method Summary collapse
Instance Method Summary collapse
- #add_frontend_port(frontend_port_obj) ⇒ Object
- #add_probe(probe_obj) ⇒ Object
- #add_ssl_certificate(ssl_certificate_obj) ⇒ Object
- #destroy ⇒ Object
- #get_gateway_params ⇒ Object
- #remove_frontend_port(frontend_port_obj) ⇒ Object
- #remove_probe(probe_obj) ⇒ Object
- #remove_ssl_certificate(ssl_certificate_obj) ⇒ Object
- #save ⇒ Object
- #serialize_sub_resources(gateway_params) ⇒ Object
- #update_gateway_ip_configuration(subnet_id) ⇒ Object
- #update_sku(sku_name, sku_capacity = nil) ⇒ Object
- #validate_backend_address_pool_params(backend_address_pool) ⇒ Object
- #validate_backend_address_pools(backend_address_pools) ⇒ Object
- #validate_backend_http_settings_list(backend_http_settings_list) ⇒ Object
- #validate_backend_http_settings_params(backend_http_settings) ⇒ Object
- #validate_frontend_ip_configuration_params(frontend_ip_configuration) ⇒ Object
- #validate_frontend_ip_configurations(frontend_ip_configurations) ⇒ Object
- #validate_frontend_port_params(frontend_port) ⇒ Object
- #validate_frontend_ports(frontend_ports) ⇒ Object
- #validate_gateway_ip_configuration_params(gateway_ip_configuration) ⇒ Object
- #validate_gateway_ip_configurations(gateway_ip_configurations) ⇒ Object
- #validate_http_listener_params(http_listener) ⇒ Object
- #validate_http_listeners(http_listeners) ⇒ Object
- #validate_probe_params(probe) ⇒ Object
- #validate_probes(probes) ⇒ Object
- #validate_request_routing_rule_params(request_routing_rule) ⇒ Object
- #validate_request_routing_rules(request_routing_rules) ⇒ Object
- #validate_ssl_certificate_params(ssl_certificate) ⇒ Object
- #validate_ssl_certificates(ssl_certificates) ⇒ Object
- #validate_url_path_map_params(url_path_map) ⇒ Object
- #validate_url_path_maps(url_path_maps) ⇒ Object
Class Method Details
.parse(gateway) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 26 def self.parse(gateway) hash = {} hash['name'] = gateway.name hash['id'] = gateway.id hash['location'] = gateway.location hash['resource_group'] = get_resource_group_from_id(gateway.id) hash['provisioning_state'] = gateway.provisioning_state unless gateway.sku.nil? hash['sku_name'] = gateway.sku.name hash['sku_tier'] = gateway.sku.tier hash['sku_capacity'] = gateway.sku.capacity end hash['operational_state'] = gateway.operational_state hash['gateway_ip_configurations'] = [] gateway.gateway_ipconfigurations.each do |ip_configuration| gateway_ip_configuration = IPConfiguration.new hash['gateway_ip_configurations'] << gateway_ip_configuration.merge_attributes(IPConfiguration.parse(ip_configuration)) end unless gateway.gateway_ipconfigurations.nil? hash['ssl_certificates'] = [] gateway.ssl_certificates.each do |certificate| ssl_certificate = SslCertificate.new hash['ssl_certificates'] << ssl_certificate.merge_attributes(SslCertificate.parse(certificate)) end unless gateway.ssl_certificates.nil? hash['frontend_ip_configurations'] = [] gateway.frontend_ipconfigurations.each do |frontend_ip_config| frontend_ip_configuration = FrontendIPConfiguration.new hash['frontend_ip_configurations'] << frontend_ip_configuration.merge_attributes(FrontendIPConfiguration.parse(frontend_ip_config)) end unless gateway.frontend_ipconfigurations.nil? hash['frontend_ports'] = [] gateway.frontend_ports.each do |port| frontend_port = FrontendPort.new hash['frontend_ports'] << frontend_port.merge_attributes(FrontendPort.parse(port)) end unless gateway.frontend_ports.nil? hash['probes'] = [] gateway.probes.each do |probe| gateway_probe = Probe.new hash['probes'] << gateway_probe.merge_attributes(Probe.parse(probe)) end unless gateway.probes.nil? hash['backend_address_pools'] = [] gateway.backend_address_pools.each do |address| backend_address_pool = BackendAddressPool.new hash['backend_address_pools'] << backend_address_pool.merge_attributes(BackendAddressPool.parse(address)) end unless gateway.backend_address_pools.nil? hash['backend_http_settings_list'] = [] gateway.backend_http_settings_collection.each do |http_setting| backend_http_setting = BackendHttpSetting.new hash['backend_http_settings_list'] << backend_http_setting.merge_attributes(BackendHttpSetting.parse(http_setting)) end unless gateway.backend_http_settings_collection.nil? hash['http_listeners'] = [] gateway.http_listeners.each do |listener| http_listener = HttpListener.new hash['http_listeners'] << http_listener.merge_attributes(HttpListener.parse(listener)) end unless gateway.http_listeners.nil? hash['url_path_maps'] = [] gateway.url_path_maps.each do |map| url_path_map = UrlPathMap.new hash['url_path_maps'] << url_path_map.merge_attributes(UrlPathMap.parse(map)) end unless gateway.url_path_maps.nil? hash['request_routing_rules'] = [] gateway.request_routing_rules.each do |rule| request_routing_rule = RequestRoutingRule.new hash['request_routing_rules'] << request_routing_rule.merge_attributes(RequestRoutingRule.parse(rule)) end unless gateway.request_routing_rules.nil? hash end |
Instance Method Details
#add_frontend_port(frontend_port_obj) ⇒ Object
576 577 578 579 580 581 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 576 def add_frontend_port(frontend_port_obj) gateway_hash = serialize_sub_resources(get_gateway_params) gateway_hash[:frontend_ports] << frontend_port_obj gateway = service.create_or_update_application_gateway(gateway_hash) merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway)) end |
#add_probe(probe_obj) ⇒ Object
590 591 592 593 594 595 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 590 def add_probe(probe_obj) gateway_hash = serialize_sub_resources(get_gateway_params) gateway_hash[:probes] << probe_obj gateway = service.create_or_update_application_gateway(gateway_hash) merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway)) end |
#add_ssl_certificate(ssl_certificate_obj) ⇒ Object
562 563 564 565 566 567 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 562 def add_ssl_certificate(ssl_certificate_obj) gateway_hash = serialize_sub_resources(get_gateway_params) gateway_hash[:ssl_certificates] << ssl_certificate_obj gateway = service.create_or_update_application_gateway(gateway_hash) merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway)) end |
#destroy ⇒ Object
604 605 606 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 604 def destroy service.delete_application_gateway(resource_group, name) end |
#get_gateway_params ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 120 def get_gateway_params { name: name, location: location, resource_group: resource_group, sku_name: sku_name, sku_tier: sku_tier, sku_capacity: sku_capacity, gateway_ip_configurations: gateway_ip_configurations, ssl_certificates: ssl_certificates, frontend_ip_configurations: frontend_ip_configurations, frontend_ports: frontend_ports, probes: probes, backend_address_pools: backend_address_pools, backend_http_settings_list: backend_http_settings_list, http_listeners: http_listeners, url_path_maps: url_path_maps, request_routing_rules: request_routing_rules } end |
#remove_frontend_port(frontend_port_obj) ⇒ Object
583 584 585 586 587 588 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 583 def remove_frontend_port(frontend_port_obj) gateway_hash = serialize_sub_resources(get_gateway_params) gateway_hash[:frontend_ports].delete(frontend_port_obj) gateway = service.create_or_update_application_gateway(gateway_hash) merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway)) end |
#remove_probe(probe_obj) ⇒ Object
597 598 599 600 601 602 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 597 def remove_probe(probe_obj) gateway_hash = serialize_sub_resources(get_gateway_params) gateway_hash[:probes].delete(probe_obj) gateway = service.create_or_update_application_gateway(gateway_hash) merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway)) end |
#remove_ssl_certificate(ssl_certificate_obj) ⇒ Object
569 570 571 572 573 574 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 569 def remove_ssl_certificate(ssl_certificate_obj) gateway_hash = serialize_sub_resources(get_gateway_params) gateway_hash[:ssl_certificates].delete(ssl_certificate_obj) gateway = service.create_or_update_application_gateway(gateway_hash) merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway)) end |
#save ⇒ Object
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 102 def save requires :name, :location, :resource_group, :sku_name, :sku_tier, :sku_capacity, :gateway_ip_configurations, :frontend_ip_configurations, :frontend_ports, :backend_address_pools, :backend_http_settings_list, :http_listeners, :request_routing_rules validate_gateway_ip_configurations(gateway_ip_configurations) unless gateway_ip_configurations.nil? validate_ssl_certificates(ssl_certificates) unless ssl_certificates.nil? validate_frontend_ip_configurations(frontend_ip_configurations) unless frontend_ip_configurations.nil? validate_frontend_ports(frontend_ports) unless frontend_ports.nil? validate_probes(probes) unless probes.nil? validate_backend_address_pools(backend_address_pools) unless backend_address_pools.nil? validate_backend_http_settings_list(backend_http_settings_list) unless backend_http_settings_list.nil? validate_http_listeners(http_listeners) unless http_listeners.nil? validate_url_path_maps(url_path_maps) unless url_path_maps.nil? validate_request_routing_rules(request_routing_rules) unless request_routing_rules.nil? gateway_params = get_gateway_params gateway = service.create_or_update_application_gateway(gateway_params) merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway)) end |
#serialize_sub_resources(gateway_params) ⇒ Object
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 467 def serialize_sub_resources(gateway_params) ip_configurations = [] gateway_params[:gateway_ip_configurations].each do |ip_configuration| hash = {} ip_configuration.attributes.each { |key, value| hash[key] = value } ip_configurations << hash end gateway_params[:gateway_ip_configurations] = ip_configurations ssl_certificates = [] gateway_params[:ssl_certificates].each do |ssl_certificate| hash = {} ssl_certificate.attributes.each { |key, value| hash[key] = value } ssl_certificates << hash end gateway_params[:ssl_certificates] = ssl_certificates frontend_ip_configurations = [] gateway_params[:frontend_ip_configurations].each do |frontend_ip_configuration| hash = {} frontend_ip_configuration.attributes.each { |key, value| hash[key] = value } frontend_ip_configurations << hash end gateway_params[:frontend_ip_configurations] = frontend_ip_configurations frontend_ports = [] gateway_params[:frontend_ports].each do |frontend_port| hash = {} frontend_port.attributes.each { |key, value| hash[key] = value } frontend_ports << hash end gateway_params[:frontend_ports] = frontend_ports probes = [] gateway_params[:probes].each do |probe| hash = {} probe.attributes.each { |key, value| hash[key] = value } probes << hash end gateway_params[:probes] = probes backend_address_pools = [] gateway_params[:backend_address_pools].each do |backend_address_pool| hash = {} backend_address_pool.attributes.each { |key, value| hash[key] = value } backend_address_pools << hash end gateway_params[:backend_address_pools] = backend_address_pools backend_address_ip_addresses = [] gateway_params[:backend_address_pools].each do |backend_address_pool| backend_address_pool[:ip_addresses].each do |ip_address| hash = {} ip_address.instance_variables.each_with_object({}) { |instance_variable| hash[:ipAddress] = ip_address.instance_variable_get(instance_variable) } backend_address_ip_addresses << hash end backend_address_pool[:ip_addresses] = backend_address_ip_addresses end backend_http_settings_list = [] gateway_params[:backend_http_settings_list].each do |backend_http_setting| hash = {} backend_http_setting.attributes.each { |key, value| hash[key] = value } backend_http_settings_list << hash end gateway_params[:backend_http_settings_list] = backend_http_settings_list http_listeners = [] gateway_params[:http_listeners].each do |http_listener| hash = {} http_listener.attributes.each { |key, value| hash[key] = value } http_listeners << hash end gateway_params[:http_listeners] = http_listeners url_path_maps = [] gateway_params[:url_path_maps].each do |url_path_map| hash = {} url_path_map.attributes.each { |key, value| hash[key] = value } url_path_maps << hash end gateway_params[:url_path_maps] = url_path_maps request_routing_rules = [] gateway_params[:request_routing_rules].each do |request_routing_rule| hash = {} request_routing_rule.attributes.each { |key, value| hash[key] = value } request_routing_rules << hash end gateway_params[:request_routing_rules] = request_routing_rules gateway_params end |
#update_gateway_ip_configuration(subnet_id) ⇒ Object
556 557 558 559 560 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 556 def update_gateway_ip_configuration(subnet_id) gateway_hash = serialize_sub_resources(get_gateway_params) gateway = service.update_subnet_id_in_gateway_ip_configuration(gateway_hash, subnet_id) merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway)) end |
#update_sku(sku_name, sku_capacity = nil) ⇒ Object
550 551 552 553 554 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 550 def update_sku(sku_name, sku_capacity = nil) gateway_hash = serialize_sub_resources(get_gateway_params) gateway = service.update_sku_attributes(gateway_hash, sku_name, sku_capacity) merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway)) end |
#validate_backend_address_pool_params(backend_address_pool) ⇒ Object
323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 323 def validate_backend_address_pool_params(backend_address_pool) required_params = [ :name, :ip_addresses ] missing = required_params.select { |p| p unless backend_address_pool.key?(p) } if missing.length == 1 raise(ArgumentError, "#{missing.first} is required for this operation") elsif missing.any? raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation") end end |
#validate_backend_address_pools(backend_address_pools) ⇒ Object
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 305 def validate_backend_address_pools(backend_address_pools) if backend_address_pools.is_a?(Array) if backend_address_pools.any? backend_address_pools.each do |backend_address_pool| if backend_address_pool.is_a?(Hash) validate_backend_address_pool_params(backend_address_pool) else raise(ArgumentError, ':backend_address_pools must be an Array of Hashes') end end else raise(ArgumentError, ':backend_address_pools must not be an empty Array') end else raise(ArgumentError, ':backend_address_pools must be an Array') end end |
#validate_backend_http_settings_list(backend_http_settings_list) ⇒ Object
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 336 def validate_backend_http_settings_list(backend_http_settings_list) if backend_http_settings_list.is_a?(Array) if backend_http_settings_list.any? backend_http_settings_list.each do |backend_http_settings| if backend_http_settings.is_a?(Hash) validate_backend_http_settings_params(backend_http_settings) else raise(ArgumentError, ':backend_http_settings_list must be an Array of Hashes') end end else raise(ArgumentError, ':backend_http_settings_list must not be an empty Array') end else raise(ArgumentError, ':backend_http_settings_list must be an Array') end end |
#validate_backend_http_settings_params(backend_http_settings) ⇒ Object
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 354 def validate_backend_http_settings_params(backend_http_settings) required_params = [ :name, :port, :protocol, :cookie_based_affinity, :request_timeout ] missing = required_params.select { |p| p unless backend_http_settings.key?(p) } if missing.length == 1 raise(ArgumentError, "#{missing.first} is required for this operation") elsif missing.any? raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation") end end |
#validate_frontend_ip_configuration_params(frontend_ip_configuration) ⇒ Object
223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 223 def validate_frontend_ip_configuration_params(frontend_ip_configuration) required_params = [ :name, :public_ip_address_id, :private_ip_allocation_method, :private_ip_address ] missing = required_params.select { |p| p unless frontend_ip_configuration.key?(p) } if missing.length == 1 raise(ArgumentError, "#{missing.first} is required for this operation") elsif missing.any? raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation") end end |
#validate_frontend_ip_configurations(frontend_ip_configurations) ⇒ Object
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 205 def validate_frontend_ip_configurations(frontend_ip_configurations) if frontend_ip_configurations.is_a?(Array) if frontend_ip_configurations.any? frontend_ip_configurations.each do |frontend_ip_configuration| if frontend_ip_configuration.is_a?(Hash) validate_frontend_ip_configuration_params(frontend_ip_configuration) else raise(ArgumentError, ':frontend_ip_configurations must be an Array of Hashes') end end else raise(ArgumentError, ':frontend_ip_configurations must not be an empty Array') end else raise(ArgumentError, ':frontend_ip_configurations must be an Array') end end |
#validate_frontend_port_params(frontend_port) ⇒ Object
256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 256 def validate_frontend_port_params(frontend_port) required_params = [ :name, :port ] missing = required_params.select { |p| p unless frontend_port.key?(p) } if missing.length == 1 raise(ArgumentError, "#{missing.first} is required for this operation") elsif missing.any? raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation") end end |
#validate_frontend_ports(frontend_ports) ⇒ Object
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 238 def validate_frontend_ports(frontend_ports) if frontend_ports.is_a?(Array) if frontend_ports.any? frontend_ports.each do |frontend_port| if frontend_port.is_a?(Hash) validate_frontend_port_params(frontend_port) else raise(ArgumentError, ':frontend_ports must be an Array of Hashes') end end else raise(ArgumentError, ':frontend_ports must not be an empty Array') end else raise(ArgumentError, ':frontend_ports must be an Array') end end |
#validate_gateway_ip_configuration_params(gateway_ip_configuration) ⇒ Object
159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 159 def validate_gateway_ip_configuration_params(gateway_ip_configuration) required_params = [ :name, :subnet_id ] missing = required_params.select { |p| p unless gateway_ip_configuration.key?(p) } if missing.length == 1 raise(ArgumentError, "#{missing.first} is required for this operation") elsif missing.any? raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation") end end |
#validate_gateway_ip_configurations(gateway_ip_configurations) ⇒ Object
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 141 def validate_gateway_ip_configurations(gateway_ip_configurations) if gateway_ip_configurations.is_a?(Array) if gateway_ip_configurations.any? gateway_ip_configurations.each do |gateway_ip_configuration| if gateway_ip_configuration.is_a?(Hash) validate_gateway_ip_configuration_params(gateway_ip_configuration) else raise(ArgumentError, ':gateway_ip_configurations must be an Array of Hashes') end end else raise(ArgumentError, ':gateway_ip_configurations must not be an empty Array') end else raise(ArgumentError, ':gateway_ip_configurations must be an Array') end end |
#validate_http_listener_params(http_listener) ⇒ Object
388 389 390 391 392 393 394 395 396 397 398 399 400 401 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 388 def validate_http_listener_params(http_listener) required_params = [ :name, :frontend_ip_config_id, :frontend_port_id, :protocol ] missing = required_params.select { |p| p unless http_listener.key?(p) } if missing.length == 1 raise(ArgumentError, "#{missing.first} is required for this operation") elsif missing.any? raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation") end end |
#validate_http_listeners(http_listeners) ⇒ Object
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 370 def validate_http_listeners(http_listeners) if http_listeners.is_a?(Array) if http_listeners.any? http_listeners.each do |http_listener| if http_listener.is_a?(Hash) validate_http_listener_params(http_listener) else raise(ArgumentError, ':http_listeners must be an Array of Hashes') end end else raise(ArgumentError, ':http_listeners must not be an empty Array') end else raise(ArgumentError, ':http_listeners must be an Array') end end |
#validate_probe_params(probe) ⇒ Object
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 287 def validate_probe_params(probe) required_params = [ :name, :protocol, :host, :path, :interval, :timeout, :unhealthy_threshold ] missing = required_params.select { |p| p unless probe.key?(p) } if missing.length == 1 raise(ArgumentError, "#{missing.first} is required for this operation") elsif missing.any? raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation") end end |
#validate_probes(probes) ⇒ Object
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 269 def validate_probes(probes) if probes.is_a?(Array) if probes.any? probes.each do |probe| if probe.is_a?(Hash) validate_probe_params(probe) else raise(ArgumentError, ':probes must be an Array of Hashes') end end else raise(ArgumentError, ':probes must not be an empty Array') end else raise(ArgumentError, ':probes must be an Array') end end |
#validate_request_routing_rule_params(request_routing_rule) ⇒ Object
454 455 456 457 458 459 460 461 462 463 464 465 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 454 def validate_request_routing_rule_params(request_routing_rule) required_params = [ :type, :http_listener_id ] missing = required_params.select { |p| p unless request_routing_rule.key?(p) } if missing.length == 1 raise(ArgumentError, "#{missing.first} is required for this operation") elsif missing.any? raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation") end end |
#validate_request_routing_rules(request_routing_rules) ⇒ Object
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 436 def validate_request_routing_rules(request_routing_rules) if request_routing_rules.is_a?(Array) if request_routing_rules.any? request_routing_rules.each do |request_routing_rule| if request_routing_rule.is_a?(Hash) validate_request_routing_rule_params(request_routing_rule) else raise(ArgumentError, ':request_routing_rules must be an Array of Hashes') end end else raise(ArgumentError, ':request_routing_rules must not be an empty Array') end else raise(ArgumentError, ':request_routing_rules must be an Array') end end |
#validate_ssl_certificate_params(ssl_certificate) ⇒ Object
190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 190 def validate_ssl_certificate_params(ssl_certificate) required_params = [ :name, :data, :password, :public_cert_data ] missing = required_params.select { |p| p unless ssl_certificate.key?(p) } if missing.length == 1 raise(ArgumentError, "#{missing.first} is required for this operation") elsif missing.any? raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation") end end |
#validate_ssl_certificates(ssl_certificates) ⇒ Object
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 172 def validate_ssl_certificates(ssl_certificates) if ssl_certificates.is_a?(Array) if ssl_certificates.any? ssl_certificates.each do |ssl_certificate| if ssl_certificate.is_a?(Hash) validate_ssl_certificate_params(ssl_certificate) else raise(ArgumentError, ':ssl_certificates must be an Array of Hashes') end end else raise(ArgumentError, ':ssl_certificates must not be an empty Array') end else raise(ArgumentError, ':ssl_certificates must be an Array') end end |
#validate_url_path_map_params(url_path_map) ⇒ Object
421 422 423 424 425 426 427 428 429 430 431 432 433 434 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 421 def validate_url_path_map_params(url_path_map) required_params = [ :name, :default_backend_address_pool_id, :default_backend_http_settings_id, :path_rules ] missing = required_params.select { |p| p unless url_path_map.key?(p) } if missing.length == 1 raise(ArgumentError, "#{missing.first} is required for this operation") elsif missing.any? raise(ArgumentError, "#{missing[0...-1].join(', ')} and #{missing[-1]} are required for this operation") end end |
#validate_url_path_maps(url_path_maps) ⇒ Object
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 |
# File 'lib/fog/azurerm/models/application_gateway/gateway.rb', line 403 def validate_url_path_maps(url_path_maps) if url_path_maps.is_a?(Array) if url_path_maps.any? url_path_maps.each do |url_path_map| if url_path_map.is_a?(Hash) validate_url_path_map_params(url_path_map) else raise(ArgumentError, ':url_path_maps must be an Array of Hashes') end end else raise(ArgumentError, ':url_path_maps must not be an empty Array') end else raise(ArgumentError, ':url_path_maps must be an Array') end end |