class Fog::ApplicationGateway::AzureRM::Mock
Mock
class for Application Gateway
Service
This class provides the mock implementation for unit tests.
Mock
class for Network
Request
Mock
class for Network
Request
Mock
class for Application Gateway
Request
Mock
class for Network
Request
Public Class Methods
new(_options = {})
click to toggle source
# File lib/fog/azurerm/application_gateway.rb, line 38 def initialize(_options = {}) begin require 'azure_mgmt_network' rescue LoadError => e retry if require('rubygems') raise e.message end end
Public Instance Methods
check_ag_exists(*)
click to toggle source
# File lib/fog/azurerm/requests/application_gateway/check_ag_exists.rb, line 25 def check_ag_exists(*) true end
create_or_update_application_gateway(*)
click to toggle source
# File lib/fog/azurerm/requests/application_gateway/create_or_update_application_gateway.rb, line 296 def create_or_update_application_gateway(*) end
delete_application_gateway(_resource_group, _name)
click to toggle source
# File lib/fog/azurerm/requests/application_gateway/delete_application_gateway.rb, line 21 def delete_application_gateway(_resource_group, _name) end
get_application_gateway(*)
click to toggle source
# File lib/fog/azurerm/requests/application_gateway/get_application_gateway.rb, line 21 def get_application_gateway(*) response = '{ "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway", "name": "gateway", "type": "Microsoft.Network/applicationGateways", "location": "eastus", "properties": { "sku": { "name": "Standard_Medium", "tier": "Standard", "capacity": 2 }, "gatewayIPConfigurations": [ { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/gatewayIPConfigurations/ag-GatewayIP", "properties": { "subnet": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/vnet/subnets/GatewaySubnet" }, "provisioningState": "Succeeded" }, "name": "ag-GatewayIP" } ], "sslCertificates": [ { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/sslCertificates/ssl_certificate", "properties": { "publicCertData": "MIIDiDCCAnACCQCwYkR0Mxy+QTANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMC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FxXecD0FinXWDRwUP6K54iti3i6a/Ox73WhwfI4mVCqsOy1WYWtKYhMVe6Kj4Nw=", "provisioningState": "Succeeded" }, "name": "ssl_certificate" } ], "frontendIPConfigurations": [ { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/frontendIPConfigurations/frontend_ip_config", "properties": { "privateIPAllocationMethod": "Dynamic", "publicIPAddress": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/ag_publicip-672835" }, "provisioningState": "Succeeded" }, "name": "frontend_ip_config" } ], "frontendPorts": [ { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/frontendPorts/gateway_front_port", "properties": { "port": 443, "provisioningState": "Succeeded" }, "name": "gateway_front_port" } ], "probes": [], "backendAddressPools": [ { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/backendAddressPools/AG-BackEndAddressPool", "properties": { "backendAddresses": [ { "ipAddress": "10.0.0.4" }, { "ipAddress": "10.0.0.5" } ], "provisioningState": "Succeeded" }, "name": "AG-BackEndAddressPool" } ], "backendHttpSettingsCollection": [ { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/backendHttpSettingsCollection/gateway_settings", "properties": { "port": 80, "protocol": "Http", "cookieBasedAffinity": "Enabled", "requestTimeout": 30, "provisioningState": "Succeeded" }, "name": "gateway_settings" } ], "httpListeners": [ { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/httpListeners/gateway_listener", "properties": { "frontendIPConfiguration": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/frontendIPConfigurations/frontend_ip_config" }, "frontendPort": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/frontendPorts/gateway_front_port" }, "protocol": "Https", "sslCertificate": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/sslCertificates/ssl_certificate" }, "requireServerNameIndication": false, "provisioningState": "Succeeded" }, "name": "gateway_listener" } ], "urlPathMaps": [], "requestRoutingRules": [ { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/requestRoutingRules/gateway_request_route_rule", "properties": { "ruleType": "Basic", "backendAddressPool": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/backendAddressPools/AG-BackEndAddressPool" }, "backendHttpSettings": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/backendHttpSettingsCollection/gateway_settings" }, "httpListener": { "id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/httpListeners/gateway_listener" }, "provisioningState": "Succeeded" }, "name": "gateway_request_route_rule" } ], "resourceGuid": "b3db5ebf-10f8-4666-9596-d1459530f64b", "provisioningState": "Succeeded" } }' gateway_mapper = Azure::ARM::Network::Models::ApplicationGateway.mapper @network_client.deserialize(gateway_mapper, JSON.load(response), 'result.body') end
list_application_gateways(_resource_group)
click to toggle source
# File lib/fog/azurerm/requests/application_gateway/list_application_gateways.rb, line 20 def list_application_gateways(_resource_group) ag = Azure::ARM::Network::Models::ApplicationGateway.new ag.name = 'fogtestgateway' ag.location = 'East US' [ag] end
start_application_gateway(*)
click to toggle source
# File lib/fog/azurerm/requests/application_gateway/start_application_gateway.rb, line 20 def start_application_gateway(*) Fog::Logger.debug 'Successfully started Application Gateway {name} in Resource Group {resource_group}' true end
stop_application_gateway(*)
click to toggle source
# File lib/fog/azurerm/requests/application_gateway/stop_application_gateway.rb, line 20 def stop_application_gateway(*) Fog::Logger.debug 'Successfully stopped Application Gateway {name} in Resource Group {resource_group}' true end
update_sku_attributes(*)
click to toggle source
# File lib/fog/azurerm/requests/application_gateway/update_sku_attributes.rb, line 23 def update_sku_attributes(*) end
update_subnet_id_in_gateway_ip_configuration(*)
click to toggle source
# File lib/fog/azurerm/requests/application_gateway/update_subnet_id_in_gateway_ip_configuration.rb, line 24 def update_subnet_id_in_gateway_ip_configuration(*) end