Class: Fog::ApplicationGateway::AzureRM::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/azurerm/application_gateway.rb,
lib/fog/azurerm/requests/application_gateway/check_ag_exists.rb,
lib/fog/azurerm/requests/application_gateway/update_sku_attributes.rb,
lib/fog/azurerm/requests/application_gateway/get_application_gateway.rb,
lib/fog/azurerm/requests/application_gateway/stop_application_gateway.rb,
lib/fog/azurerm/requests/application_gateway/list_application_gateways.rb,
lib/fog/azurerm/requests/application_gateway/start_application_gateway.rb,
lib/fog/azurerm/requests/application_gateway/delete_application_gateway.rb,
lib/fog/azurerm/requests/application_gateway/create_or_update_application_gateway.rb,
lib/fog/azurerm/requests/application_gateway/update_subnet_id_in_gateway_ip_configuration.rb

Overview

Mock class for Application Gateway Request

Instance Method Summary collapse

Constructor Details

#initialize(_options = {}) ⇒ Mock

Returns a new instance of Mock.



38
39
40
41
42
43
44
45
# 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

Instance Method Details

#check_ag_existsObject



25
26
27
# File 'lib/fog/azurerm/requests/application_gateway/check_ag_exists.rb', line 25

def check_ag_exists(*)
  true
end

#create_or_update_application_gatewayObject



297
298
# File 'lib/fog/azurerm/requests/application_gateway/create_or_update_application_gateway.rb', line 297

def create_or_update_application_gateway(*)
end

#delete_application_gateway(_resource_group, _name) ⇒ Object



21
22
# File 'lib/fog/azurerm/requests/application_gateway/delete_application_gateway.rb', line 21

def delete_application_gateway(_resource_group, _name)
end

#get_application_gatewayObject



21
22
23
24
25
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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
# 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+QTANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCUEsxDzANBgNVBAgTBlB1bmphYjEPMA0GA1UEBxMGTGFob3JlMQ8wDQYDVQQKEwZDb25maXoxDDAKBgNVBAsTA0RldjEPMA0GA1UEAxMGaGFpZGVyMSQwIgYJKoZIhvcNAQkBFhVoYWlkZXIuYWxpQGNvbmZpei5jb20wHhcNMTYwMzAyMTE0NTM2WhcNMTcwMzAyMTE0NTM2WjCBhTELMAkGA1UEBhMCUEsxDzANBgNVBAgTBlB1bmphYjEPMA0GA1UEBxMGTGFob3JlMQ8wDQYDVQQKEwZDb25maXoxDDAKBgNVBAsTA0RldjEPMA0GA1UEAxMGaGFpZGVyMSQwIgYJKoZIhvcNAQkBFhVoYWlkZXIuYWxpQGNvbmZpei5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCuJrPbvOG+4oXQRamkOALlpdK98m+atJue9zOcCCagY8IJI4quYL13d8VItmrZf7erA+siqpYlWEuk1+lmmUY7T4AWAL8mXeR2vc7hWF601WDUjeVPK19+IcC8emMLOlBpvjXC9nbvADLQuR0PGitfjCqFoG66EOqJmLDNBsyHWmy+qhb8J4WXitruNAJDPe/20h6L23vD6z4tvwBjh4zkrfskGlKCNcAuvG1NI0FAS8261Jvs3lf+8oFyI+oSXGtknrkeQv3PbXyeEe3KO5a/M61Uebo04Uwd4yCvdu6H0sF+YYA4bfFdanuFmrZvf9cZSwknQid+vOdzyGkTHTPFAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAKtPhYpfvn5OxP+BcChsWaQA4KZQj0THGdiAjHsvfjsgteFvhkzqZBkhKYtsAWV5tB5/GDl+o4c6PQJ2/TXhOJn3pSNaUzrCJIGtKS5DknbqTQxCwVlxyBtPHLAYWqKcPMlH282rw3VY0OYTL96XOgZ/WZjcN6A7ku+uWsNCql443FoWL+N3Gpaab45OyIluFUOH+yc0ToHNlP3iOpI3rVpi2xwmGrSyUKsGUma3nrBq7TWjkDE1E+oJoybaMNZzgXGIPSJC1HYIF1U8GSoFkZpAFxXecD0FinXWDRwUP6K54iti3i6a/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) ⇒ Object



20
21
22
23
24
25
# 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_gatewayObject



20
21
22
23
# 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_gatewayObject



20
21
22
23
# 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_attributesObject



23
24
# File 'lib/fog/azurerm/requests/application_gateway/update_sku_attributes.rb', line 23

def update_sku_attributes(*)
end

#update_subnet_id_in_gateway_ip_configurationObject



24
25
# 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