fog-azure-rm 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +17 -0
- data/.gitignore +6 -0
- data/.hound.yml +2 -0
- data/.rubocop.yml +36 -0
- data/.travis.yml +14 -0
- data/CHANGELOG.md +28 -0
- data/CONTRIBUTING.md +2 -0
- data/CONTRIBUTORS.md +2 -0
- data/Gemfile +3 -0
- data/fog-azure-rm.gemspec +34 -0
- data/lib/fog/azurerm.rb +1 -0
- data/lib/fog/azurerm/compute.rb +0 -1
- data/lib/fog/azurerm/config.rb +4 -0
- data/lib/fog/azurerm/credentials.rb +10 -3
- data/lib/fog/azurerm/docs/compute.md +172 -0
- data/lib/fog/azurerm/docs/dns.md +112 -0
- data/lib/fog/azurerm/docs/network.md +794 -0
- data/lib/fog/azurerm/docs/resources.md +155 -0
- data/lib/fog/azurerm/docs/storage.md +222 -0
- data/lib/fog/azurerm/docs/structure.md +53 -0
- data/lib/fog/azurerm/models/compute/server.rb +3 -2
- data/lib/fog/azurerm/models/network/frontend_ip_configuration.rb +5 -1
- data/lib/fog/azurerm/models/network/network_interface.rb +49 -4
- data/lib/fog/azurerm/models/network/network_interfaces.rb +4 -2
- data/lib/fog/azurerm/models/network/network_security_group.rb +27 -4
- data/lib/fog/azurerm/models/network/network_security_groups.rb +4 -2
- data/lib/fog/azurerm/models/network/network_security_rule.rb +1 -1
- data/lib/fog/azurerm/models/network/subnet.rb +26 -6
- data/lib/fog/azurerm/models/network/subnets.rb +4 -2
- data/lib/fog/azurerm/models/network/virtual_network.rb +72 -10
- data/lib/fog/azurerm/models/network/virtual_networks.rb +4 -2
- data/lib/fog/azurerm/models/resources/azure_resource.rb +25 -0
- data/lib/fog/azurerm/models/resources/azure_resources.rb +31 -0
- data/lib/fog/azurerm/models/resources/dependency.rb +27 -0
- data/lib/fog/azurerm/models/resources/deployment.rb +65 -0
- data/lib/fog/azurerm/models/resources/deployments.rb +27 -0
- data/lib/fog/azurerm/models/resources/provider.rb +27 -0
- data/lib/fog/azurerm/models/resources/provider_resource_type.rb +22 -0
- data/lib/fog/azurerm/models/storage/blob.rb +13 -0
- data/lib/fog/azurerm/models/storage/blobs.rb +22 -0
- data/lib/fog/azurerm/models/storage/container.rb +65 -0
- data/lib/fog/azurerm/models/storage/containers.rb +44 -0
- data/lib/fog/azurerm/models/storage/data_disk.rb +26 -0
- data/lib/fog/azurerm/models/storage/storage_account.rb +4 -0
- data/lib/fog/azurerm/network.rb +21 -3
- data/lib/fog/azurerm/requests/network/add_address_prefixes_in_virtual_network.rb +68 -0
- data/lib/fog/azurerm/requests/network/add_dns_servers_in_virtual_network.rb +74 -0
- data/lib/fog/azurerm/requests/network/add_security_rules.rb +152 -0
- data/lib/fog/azurerm/requests/network/add_subnets_in_virtual_network.rb +69 -0
- data/lib/fog/azurerm/requests/network/attach_network_security_group_to_subnet.rb +59 -0
- data/lib/fog/azurerm/requests/network/attach_resource_to_nic.rb +88 -0
- data/lib/fog/azurerm/requests/network/attach_route_table_to_subnet.rb +59 -0
- data/lib/fog/azurerm/requests/network/create_load_balancer.rb +4 -4
- data/lib/fog/azurerm/requests/network/{create_network_interface.rb → create_or_update_network_interface.rb} +14 -13
- data/lib/fog/azurerm/requests/network/{create_network_security_group.rb → create_or_update_network_security_group.rb} +17 -35
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb +116 -0
- data/lib/fog/azurerm/requests/network/create_subnet.rb +28 -14
- data/lib/fog/azurerm/requests/network/detach_network_security_group_from_subnet.rb +53 -0
- data/lib/fog/azurerm/requests/network/detach_resource_from_nic.rb +80 -0
- data/lib/fog/azurerm/requests/network/detach_route_table_from_subnet.rb +53 -0
- data/lib/fog/azurerm/requests/network/get_network_interface.rb +60 -0
- data/lib/fog/azurerm/requests/network/get_network_security_group.rb +161 -0
- data/lib/fog/azurerm/requests/network/get_subnet.rb +36 -0
- data/lib/fog/azurerm/requests/network/get_virtual_network.rb +64 -0
- data/lib/fog/azurerm/requests/network/remove_address_prefixes_from_virtual_network.rb +67 -0
- data/lib/fog/azurerm/requests/network/remove_dns_servers_from_virtual_network.rb +67 -0
- data/lib/fog/azurerm/requests/network/remove_security_rule.rb +155 -0
- data/lib/fog/azurerm/requests/network/remove_subnets_from_virtual_network.rb +57 -0
- data/lib/fog/azurerm/requests/resources/create_deployment.rb +90 -0
- data/lib/fog/azurerm/requests/resources/delete_deployment.rb +28 -0
- data/lib/fog/azurerm/requests/resources/delete_resource_tag.rb +48 -0
- data/lib/fog/azurerm/requests/resources/list_deployments.rb +75 -0
- data/lib/fog/azurerm/requests/resources/list_tagged_resources.rb +46 -0
- data/lib/fog/azurerm/requests/resources/tag_resource.rb +46 -0
- data/lib/fog/azurerm/requests/storage/create_container.rb +37 -0
- data/lib/fog/azurerm/requests/storage/delete_container.rb +26 -0
- data/lib/fog/azurerm/requests/storage/delete_disk.rb +36 -0
- data/lib/fog/azurerm/requests/storage/get_blob_metadata.rb +30 -0
- data/lib/fog/azurerm/requests/storage/get_container_access_control_list.rb +29 -0
- data/lib/fog/azurerm/requests/storage/get_container_metadata.rb +31 -0
- data/lib/fog/azurerm/requests/storage/get_container_properties.rb +36 -0
- data/lib/fog/azurerm/requests/storage/get_storage_access_keys.rb +31 -0
- data/lib/fog/azurerm/requests/storage/list_containers.rb +49 -0
- data/lib/fog/azurerm/requests/storage/list_storage_account_for_rg.rb +0 -1
- data/lib/fog/azurerm/requests/storage/set_blob_metadata.rb +26 -0
- data/lib/fog/azurerm/requests/storage/set_container_metadata.rb +26 -0
- data/lib/fog/azurerm/resources.rb +13 -0
- data/lib/fog/azurerm/storage.rb +46 -6
- data/lib/fog/azurerm/utilities/general.rb +18 -0
- data/lib/fog/azurerm/version.rb +1 -1
- data/rakefile +21 -0
- data/test/api_stub.rb +44 -0
- data/test/api_stub/models/compute/availability_set.rb +21 -0
- data/test/api_stub/models/compute/server.rb +191 -0
- data/test/api_stub/models/dns/record_set.rb +59 -0
- data/test/api_stub/models/dns/zone.rb +47 -0
- data/test/api_stub/models/network/application_gateway.rb +135 -0
- data/test/api_stub/models/network/load_balancer.rb +132 -0
- data/test/api_stub/models/network/network_interface.rb +71 -0
- data/test/api_stub/models/network/network_security_group.rb +94 -0
- data/test/api_stub/models/network/public_ip.rb +35 -0
- data/test/api_stub/models/network/subnet.rb +35 -0
- data/test/api_stub/models/network/traffic_manager_end_point.rb +26 -0
- data/test/api_stub/models/network/traffic_manager_profile.rb +74 -0
- data/test/api_stub/models/network/virtual_network.rb +61 -0
- data/test/api_stub/models/resources/deployment.rb +110 -0
- data/test/api_stub/models/resources/resource.rb +40 -0
- data/test/api_stub/models/resources/resource_group.rb +38 -0
- data/test/api_stub/models/storage/blob.rb +17 -0
- data/test/api_stub/models/storage/container.rb +92 -0
- data/test/api_stub/models/storage/data_disk.rb +30 -0
- data/test/api_stub/models/storage/storageaccount.rb +29 -0
- data/test/api_stub/requests/compute/availability_set.rb +46 -0
- data/test/api_stub/requests/compute/virtual_machine.rb +654 -0
- data/test/api_stub/requests/dns/record_set.rb +105 -0
- data/test/api_stub/requests/dns/zone.rb +67 -0
- data/test/api_stub/requests/network/application_gateway.rb +433 -0
- data/test/api_stub/requests/network/load_balancer.rb +366 -0
- data/test/api_stub/requests/network/network_interface.rb +268 -0
- data/test/api_stub/requests/network/network_security_group.rb +240 -0
- data/test/api_stub/requests/network/public_ip.rb +73 -0
- data/test/api_stub/requests/network/subnet.rb +73 -0
- data/test/api_stub/requests/network/traffic_manager_endpoint.rb +25 -0
- data/test/api_stub/requests/network/traffic_manager_profile.rb +140 -0
- data/test/api_stub/requests/network/virtual_network.rb +127 -0
- data/test/api_stub/requests/resources/deployment.rb +23 -0
- data/test/api_stub/requests/resources/resource.rb +47 -0
- data/test/api_stub/requests/resources/resource_group.rb +53 -0
- data/test/api_stub/requests/storage/blob.rb +24 -0
- data/test/api_stub/requests/storage/container.rb +95 -0
- data/test/api_stub/requests/storage/storageaccount.rb +112 -0
- data/test/integration/README.md +14 -0
- data/test/integration/application_gateway.rb +129 -0
- data/test/integration/availability_set.rb +56 -0
- data/test/integration/container.rb +81 -0
- data/test/integration/credentials/azure.yml +4 -0
- data/test/integration/external_load_balancer.rb +119 -0
- data/test/integration/internal_load_balancer.rb +126 -0
- data/test/integration/network_interface.rb +135 -0
- data/test/integration/network_security_group.rb +104 -0
- data/test/integration/public_ip.rb +63 -0
- data/test/integration/record_set.rb +88 -0
- data/test/integration/server.rb +139 -0
- data/test/integration/storage_account.rb +62 -0
- data/test/integration/subnet.rb +91 -0
- data/test/integration/traffic_manager.rb +81 -0
- data/test/integration/virtual_network.rb +124 -0
- data/test/integration/zone.rb +64 -0
- data/test/models/compute/test_availability_set.rb +53 -0
- data/test/models/compute/test_availability_sets.rb +41 -0
- data/test/models/compute/test_server.rb +143 -0
- data/test/models/compute/test_servers.rb +49 -0
- data/test/models/dns/test_record_set.rb +59 -0
- data/test/models/dns/test_record_sets.rb +51 -0
- data/test/models/dns/test_zone.rb +49 -0
- data/test/models/dns/test_zones.rb +49 -0
- data/test/models/network/test_application_gateway.rb +62 -0
- data/test/models/network/test_application_gateways.rb +42 -0
- data/test/models/network/test_load_balancer.rb +56 -0
- data/test/models/network/test_load_balancers.rb +42 -0
- data/test/models/network/test_network_interface.rb +106 -0
- data/test/models/network/test_network_interfaces.rb +41 -0
- data/test/models/network/test_network_security_group.rb +88 -0
- data/test/models/network/test_network_security_groups.rb +40 -0
- data/test/models/network/test_network_security_rule.rb +30 -0
- data/test/models/network/test_public_ip.rb +58 -0
- data/test/models/network/test_public_ips.rb +55 -0
- data/test/models/network/test_subnet.rb +84 -0
- data/test/models/network/test_subnets.rb +42 -0
- data/test/models/network/test_traffic_manager_end_point.rb +53 -0
- data/test/models/network/test_traffic_manager_end_points.rb +42 -0
- data/test/models/network/test_traffic_manager_profile.rb +54 -0
- data/test/models/network/test_traffic_manager_profiles.rb +41 -0
- data/test/models/network/test_virtual_network.rb +112 -0
- data/test/models/network/test_virtual_networks.rb +54 -0
- data/test/models/resources/test_deployment.rb +54 -0
- data/test/models/resources/test_deployments.rb +37 -0
- data/test/models/resources/test_resource.rb +22 -0
- data/test/models/resources/test_resource_group.rb +43 -0
- data/test/models/resources/test_resource_groups.rb +37 -0
- data/test/models/resources/test_resources.rb +38 -0
- data/test/models/storage/test_blobs.rb +32 -0
- data/test/models/storage/test_container.rb +67 -0
- data/test/models/storage/test_containers.rb +56 -0
- data/test/models/storage/test_data_disk.rb +29 -0
- data/test/models/storage/test_storage_account.rb +62 -0
- data/test/models/storage/test_storage_accounts.rb +65 -0
- data/test/requests/compute/test_attach_data_disk_to_vm.rb +175 -0
- data/test/requests/compute/test_create_availability_set.rb +30 -0
- data/test/requests/compute/test_create_virtual_machine.rb +50 -0
- data/test/requests/compute/test_deallocate_virtual_machine.rb +29 -0
- data/test/requests/compute/test_delete_availability_set.rb +29 -0
- data/test/requests/compute/test_delete_virtual_machine.rb +29 -0
- data/test/requests/compute/test_detach_data_disk_from_vm.rb +53 -0
- data/test/requests/compute/test_generalize_virtual_machine.rb +29 -0
- data/test/requests/compute/test_get_virtual_machine.rb +31 -0
- data/test/requests/compute/test_get_vm_status.rb +31 -0
- data/test/requests/compute/test_list_availability_sets.rb +30 -0
- data/test/requests/compute/test_list_available_sizes_for_virtual_machine.rb +31 -0
- data/test/requests/compute/test_list_virtual_machines.rb +30 -0
- data/test/requests/compute/test_power_off_virtual_machine.rb +29 -0
- data/test/requests/compute/test_redeploy_virtual_machine.rb +29 -0
- data/test/requests/compute/test_restart_virtual_machine.rb +29 -0
- data/test/requests/compute/test_start_virtual_machine.rb +29 -0
- data/test/requests/dns/test_check_for_zone.rb +52 -0
- data/test/requests/dns/test_create_record_set.rb +45 -0
- data/test/requests/dns/test_create_zone.rb +36 -0
- data/test/requests/dns/test_delete_record_set.rb +35 -0
- data/test/requests/dns/test_delete_zone.rb +35 -0
- data/test/requests/dns/test_get_records_from_record_set.rb +55 -0
- data/test/requests/dns/test_list_record_sets.rb +36 -0
- data/test/requests/dns/test_list_zones.rb +40 -0
- data/test/requests/network/test_add_address_prefixes_in_virtual_network.rb +45 -0
- data/test/requests/network/test_add_dns_servers_in_virtual_network.rb +45 -0
- data/test/requests/network/test_add_security_rules.rb +63 -0
- data/test/requests/network/test_add_subnets_in_virtual_network.rb +45 -0
- data/test/requests/network/test_attach_network_security_group_to_subnet.rb +33 -0
- data/test/requests/network/test_attach_resource_to_nic.rb +65 -0
- data/test/requests/network/test_attach_route_table_to_subnet.rb +33 -0
- data/test/requests/network/test_check_for_public_ip.rb +38 -0
- data/test/requests/network/test_check_for_virtual_network.rb +38 -0
- data/test/requests/network/test_create_application_gateway.rb +61 -0
- data/test/requests/network/test_create_load_balancer.rb +56 -0
- data/test/requests/network/test_create_network_interface.rb +54 -0
- data/test/requests/network/test_create_network_security_group.rb +45 -0
- data/test/requests/network/test_create_or_update_virtual_network.rb +63 -0
- data/test/requests/network/test_create_public_ip.rb +44 -0
- data/test/requests/network/test_create_subnet.rb +44 -0
- data/test/requests/network/test_create_traffic_manager_endpoint.rb +32 -0
- data/test/requests/network/test_create_traffic_manager_profile.rb +32 -0
- data/test/requests/network/test_delete_application_gateway.rb +30 -0
- data/test/requests/network/test_delete_load_balancer.rb +30 -0
- data/test/requests/network/test_delete_network_interface.rb +30 -0
- data/test/requests/network/test_delete_network_security_group.rb +32 -0
- data/test/requests/network/test_delete_public_ip.rb +30 -0
- data/test/requests/network/test_delete_subnet.rb +30 -0
- data/test/requests/network/test_delete_traffic_manager_endpoint.rb +28 -0
- data/test/requests/network/test_delete_traffic_manager_profile.rb +28 -0
- data/test/requests/network/test_delete_virtual_network.rb +30 -0
- data/test/requests/network/test_detach_network_security_group_from_subnet.rb +33 -0
- data/test/requests/network/test_detach_resource_from_nic.rb +60 -0
- data/test/requests/network/test_detach_route_table_from_subnet.rb +33 -0
- data/test/requests/network/test_get_network_interface.rb +31 -0
- data/test/requests/network/test_get_network_security_group.rb +33 -0
- data/test/requests/network/test_get_subnet.rb +33 -0
- data/test/requests/network/test_get_traffic_manager_profile.rb +29 -0
- data/test/requests/network/test_list_application_gateways.rb +31 -0
- data/test/requests/network/test_list_load_balancers.rb +31 -0
- data/test/requests/network/test_list_network_interfaces.rb +31 -0
- data/test/requests/network/test_list_network_security_groups.rb +33 -0
- data/test/requests/network/test_list_public_ips.rb +31 -0
- data/test/requests/network/test_list_subnets.rb +31 -0
- data/test/requests/network/test_list_traffic_manager_profiles.rb +29 -0
- data/test/requests/network/test_list_virtual_networks.rb +31 -0
- data/test/requests/network/test_remove_address_prefixes_from_virtual_network.rb +45 -0
- data/test/requests/network/test_remove_dns_servers_from_virtual_network.rb +45 -0
- data/test/requests/network/test_remove_security_rule.rb +49 -0
- data/test/requests/network/test_remove_subnets_from_virtual_network.rb +45 -0
- data/test/requests/resources/test_create_deployment.rb +49 -0
- data/test/requests/resources/test_create_resource_group.rb +31 -0
- data/test/requests/resources/test_delete_deployment.rb +31 -0
- data/test/requests/resources/test_delete_resource_group.rb +30 -0
- data/test/requests/resources/test_delete_resource_tag.rb +51 -0
- data/test/requests/resources/test_list_deployments.rb +32 -0
- data/test/requests/resources/test_list_resource_groups.rb +31 -0
- data/test/requests/resources/test_list_tagged_resources.rb +31 -0
- data/test/requests/resources/test_tag_resource.rb +51 -0
- data/test/requests/storage/test_check_storage_account_name_availability.rb +59 -0
- data/test/requests/storage/test_create_container.rb +31 -0
- data/test/requests/storage/test_create_storage_account.rb +56 -0
- data/test/requests/storage/test_delete_container.rb +30 -0
- data/test/requests/storage/test_delete_storage_account.rb +34 -0
- data/test/requests/storage/test_get_blob_metadata.rb +18 -0
- data/test/requests/storage/test_get_container_access_control_list.rb +31 -0
- data/test/requests/storage/test_get_container_metadata.rb +18 -0
- data/test/requests/storage/test_get_container_properties.rb +31 -0
- data/test/requests/storage/test_get_storage_access_keys.rb +31 -0
- data/test/requests/storage/test_list_containers.rb +23 -0
- data/test/requests/storage/test_list_storage_accounts.rb +47 -0
- data/test/requests/storage/test_list_storage_accounts_for_rg.rb +51 -0
- data/test/requests/storage/test_set_blob_metadata.rb +17 -0
- data/test/requests/storage/test_set_container_metadata.rb +17 -0
- data/test/test_credentials.rb +39 -0
- data/test/test_helper.rb +428 -0
- metadata +273 -14
- data/lib/fog/azurerm/models/compute/data_disk.rb +0 -26
- data/lib/fog/azurerm/requests/network/create_virtual_network.rb +0 -115
@@ -0,0 +1,105 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Requests
|
3
|
+
module DNS
|
4
|
+
# Mock class for Record Set
|
5
|
+
class RecordSet
|
6
|
+
def self.rest_client_put_method_for_record_set_a_type_response
|
7
|
+
'{
|
8
|
+
"id":"\/subscriptions\/67f2116d-4ea2-4c6c-b20a-f92183dbe3cb\/resourceGroups\/Fog_test_rg\/providers\/Microsoft.Network\/dnszones\/fog-test-zone.com\/CNAME\/fog-test-record_set",
|
9
|
+
"name":"fog-test-record_set",
|
10
|
+
"type":"Microsoft.Network\/dnszones\/A",
|
11
|
+
"etag":"2cce3e93-fc64-43e4-835c-27581c28502b",
|
12
|
+
"location":"global",
|
13
|
+
"tags":{},
|
14
|
+
"properties":
|
15
|
+
{
|
16
|
+
"metadata":{},
|
17
|
+
"fqdn":"fog-test-record_set.fog-test-zone.com.",
|
18
|
+
"TTL":60,
|
19
|
+
"ARecords":[{"ipv4Address":"1.2.3.4"},{"ipv4Address":"1.2.3.3"}]
|
20
|
+
}
|
21
|
+
}'
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.rest_client_put_method_for_record_set_cname_type_response
|
25
|
+
'{
|
26
|
+
"id":"\/subscriptions\/67f2116d-4ea2-4c6c-b20a-f92183dbe3cb\/resourceGroups\/Fog_test_rg\/providers\/Microsoft.Network\/dnszones\/fog-test-zone.com\/CNAME\/fog-test-record_set",
|
27
|
+
"name":"fog-test-record_set",
|
28
|
+
"type":"Microsoft.Network\/dnszones\/CNAME",
|
29
|
+
"etag":"2cce3e93-fc64-43e4-835c-27581c28502b",
|
30
|
+
"location":"global",
|
31
|
+
"tags":{},
|
32
|
+
"properties":
|
33
|
+
{
|
34
|
+
"metadata":{},
|
35
|
+
"fqdn":"fog-test-record_set.fog-test-zone.com.",
|
36
|
+
"TTL":60,
|
37
|
+
"CNAMERecord":{"cname":"1.2.3.4"}
|
38
|
+
}
|
39
|
+
}'
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.list_record_sets_response
|
43
|
+
'{
|
44
|
+
"value": [{
|
45
|
+
"id":"\/subscriptions\/67f2116d-4ea2-4c6c-b20a-f92183dbe3cb\/resourceGroups\/Fog_test_rg\/providers\/Microsoft.Network\/dnszones\/fog-test-zone.com\/CNAME\/fog-test-record_set",
|
46
|
+
"name":"fog-test-record_set",
|
47
|
+
"type":"Microsoft.Network\/dnszones\/A",
|
48
|
+
"etag":"2cce3e93-fc64-43e4-835c-27581c28502b",
|
49
|
+
"location":"global",
|
50
|
+
"tags":{},
|
51
|
+
"properties":
|
52
|
+
{
|
53
|
+
"metadata":{},
|
54
|
+
"fqdn":"fog-test-record_set.fog-test-zone.com.",
|
55
|
+
"TTL":60,
|
56
|
+
"ARecords":[{"ipv4Address":"1.2.3.4"},{"ipv4Address":"1.2.3.3"}]
|
57
|
+
}
|
58
|
+
}]
|
59
|
+
}'
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.record_set_response_for_a_type_response
|
63
|
+
'{
|
64
|
+
"id": "/subscriptions/6bb4a28a-db84-4e8a-b1dc-fabf7bd9f0b2/resourceGroups/EdgeMonitoring2/providers/Microsoft.Network/dnszones/edgemonitoring2.com./A/www",
|
65
|
+
"location": "global",
|
66
|
+
"name": "www",
|
67
|
+
"tags": {},
|
68
|
+
"type": "Microsoft.Network/dnszones/A",
|
69
|
+
"etag": "5b83020b-b59c-44be-8f19-a052ebe80fe7",
|
70
|
+
"properties": {
|
71
|
+
"TTL": 3600,
|
72
|
+
"ARecords": [
|
73
|
+
{
|
74
|
+
"ipv4Address": "4.3.2.1"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"ipv4Address": "5.3.2.1"
|
78
|
+
}
|
79
|
+
]
|
80
|
+
}
|
81
|
+
}'
|
82
|
+
end
|
83
|
+
|
84
|
+
def self.record_set_response_for_cname_type
|
85
|
+
'{
|
86
|
+
"id": "/subscriptions/6bb4a28a-db84-4e8a-b1dc-fabf7bd9f0b2/resourceGroups/EdgeMonitoring2/providers/Microsoft.Network/dnszones/edgemonitoring2.com./A/www",
|
87
|
+
"location": "global",
|
88
|
+
"name": "www",
|
89
|
+
"tags": {},
|
90
|
+
"type": "Microsoft.Network/dnszones/A",
|
91
|
+
"etag": "5b83020b-b59c-44be-8f19-a052ebe80fe7",
|
92
|
+
"properties": {
|
93
|
+
"metadata": "nil",
|
94
|
+
"fqdn": "fog-test-record_set.fog-test-zone.com.",
|
95
|
+
"TTL": "60",
|
96
|
+
"CNAMERecord": {
|
97
|
+
"cname": "test.fog.com"
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}'
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Requests
|
3
|
+
module DNS
|
4
|
+
# Mock class for Zone
|
5
|
+
class Zone
|
6
|
+
def self.rest_client_put_method_for_zone_resonse
|
7
|
+
'{
|
8
|
+
"id":"\/subscriptions\/67f2116d-4ea2-4c6c-b20a-f92183dbe3cb\/resourceGroups\/fog_test_rg\/providers\/Microsoft.Network\/dnszones\/adnaan.com",
|
9
|
+
"name":"adnaan.com",
|
10
|
+
"type":"Microsoft.Network\/dnszones",
|
11
|
+
"etag":"00000011-0000-0000-19f2-3a6c32b0d101",
|
12
|
+
"location":"global",
|
13
|
+
"tags":{},
|
14
|
+
"properties":
|
15
|
+
{
|
16
|
+
"maxNumberOfRecordSets":5000,
|
17
|
+
"nameServers":null,
|
18
|
+
"numberOfRecordSets":2,
|
19
|
+
"parentResourceGroupName":"fog_test_rg"
|
20
|
+
},
|
21
|
+
"resource_group":"fog-test-rg"
|
22
|
+
}'
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.list_zones_response
|
26
|
+
'{
|
27
|
+
"value": [{
|
28
|
+
"id":"\/subscriptions\/67f2116d-4ea2-4c6c-b20a-f92183dbe3cb\/resourceGroups\/fog_test_rg\/providers\/Microsoft.Network\/dnszones\/adnaan.com",
|
29
|
+
"name":"adnaan.com",
|
30
|
+
"type":"Microsoft.Network\/dnszones",
|
31
|
+
"etag":"00000011-0000-0000-19f2-3a6c32b0d101",
|
32
|
+
"location":"global",
|
33
|
+
"tags":{},
|
34
|
+
"properties":
|
35
|
+
{
|
36
|
+
"maxNumberOfRecordSets":5000,
|
37
|
+
"nameServers":null,
|
38
|
+
"numberOfRecordSets":2,
|
39
|
+
"parentResourceGroupName":"fog_test_rg"
|
40
|
+
},
|
41
|
+
"resource_group":"fog-test-rg"
|
42
|
+
}]
|
43
|
+
}'
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.zone_response
|
47
|
+
{
|
48
|
+
'id' => '/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.Network/dnszones/fog-test-zone.com',
|
49
|
+
'name' => 'fog-test-zone.com',
|
50
|
+
'type' => 'Microsoft.Network/dnszones',
|
51
|
+
'etag' => '00000003-0000-0000-bd66-02b337a4d101',
|
52
|
+
'location' => 'global',
|
53
|
+
'tags' => {},
|
54
|
+
'properties' =>
|
55
|
+
{
|
56
|
+
'maxNumberOfRecordSets' => 100_00,
|
57
|
+
'nameServers' => nil,
|
58
|
+
'numberOfRecordSets' => 2,
|
59
|
+
'parentResourceGroupName' => 'fog-test-rg'
|
60
|
+
},
|
61
|
+
'resource_group' => 'fog-test-rg'
|
62
|
+
}
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,433 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Requests
|
3
|
+
module Network
|
4
|
+
class ApplicationGateway
|
5
|
+
def self.create_application_gateway_response
|
6
|
+
response = '{
|
7
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway",
|
8
|
+
"name": "gateway",
|
9
|
+
"type": "Microsoft.Network/applicationGateways",
|
10
|
+
"location": "eastus",
|
11
|
+
"properties": {
|
12
|
+
"sku": {
|
13
|
+
"name": "Standard_Medium",
|
14
|
+
"tier": "Standard",
|
15
|
+
"capacity": 2
|
16
|
+
},
|
17
|
+
"gatewayIPConfigurations": [
|
18
|
+
{
|
19
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/gatewayIPConfigurations/ag-GatewayIP",
|
20
|
+
"properties": {
|
21
|
+
"subnet": {
|
22
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/vnet/subnets/GatewaySubnet"
|
23
|
+
},
|
24
|
+
"provisioningState": "Succeeded"
|
25
|
+
},
|
26
|
+
"name": "ag-GatewayIP"
|
27
|
+
}
|
28
|
+
],
|
29
|
+
"sslCertificates": [
|
30
|
+
{
|
31
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/sslCertificates/ssl_certificate",
|
32
|
+
"properties": {
|
33
|
+
"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=",
|
34
|
+
"provisioningState": "Succeeded"
|
35
|
+
},
|
36
|
+
"name": "ssl_certificate"
|
37
|
+
}
|
38
|
+
],
|
39
|
+
"frontendIPConfigurations": [
|
40
|
+
{
|
41
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/frontendIPConfigurations/frontend_ip_config",
|
42
|
+
"properties": {
|
43
|
+
"privateIPAllocationMethod": "Dynamic",
|
44
|
+
"publicIPAddress": {
|
45
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/ag_publicip-672835"
|
46
|
+
},
|
47
|
+
"provisioningState": "Succeeded"
|
48
|
+
},
|
49
|
+
"name": "frontend_ip_config"
|
50
|
+
}
|
51
|
+
],
|
52
|
+
"frontendPorts": [
|
53
|
+
{
|
54
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/frontendPorts/gateway_front_port",
|
55
|
+
"properties": {
|
56
|
+
"port": 443,
|
57
|
+
"provisioningState": "Succeeded"
|
58
|
+
},
|
59
|
+
"name": "gateway_front_port"
|
60
|
+
}
|
61
|
+
],
|
62
|
+
"probes": [],
|
63
|
+
"backendAddressPools": [
|
64
|
+
{
|
65
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/backendAddressPools/AG-BackEndAddressPool",
|
66
|
+
"properties": {
|
67
|
+
"backendAddresses": [
|
68
|
+
{
|
69
|
+
"ipAddress": "10.0.0.4"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"ipAddress": "10.0.0.5"
|
73
|
+
}
|
74
|
+
],
|
75
|
+
"provisioningState": "Succeeded"
|
76
|
+
},
|
77
|
+
"name": "AG-BackEndAddressPool"
|
78
|
+
}
|
79
|
+
],
|
80
|
+
"backendHttpSettingsCollection": [
|
81
|
+
{
|
82
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/backendHttpSettingsCollection/gateway_settings",
|
83
|
+
"properties": {
|
84
|
+
"port": 80,
|
85
|
+
"protocol": "Http",
|
86
|
+
"cookieBasedAffinity": "Enabled",
|
87
|
+
"requestTimeout": 30,
|
88
|
+
"provisioningState": "Succeeded"
|
89
|
+
},
|
90
|
+
"name": "gateway_settings"
|
91
|
+
}
|
92
|
+
],
|
93
|
+
"httpListeners": [
|
94
|
+
{
|
95
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/httpListeners/gateway_listener",
|
96
|
+
"properties": {
|
97
|
+
"frontendIPConfiguration": {
|
98
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/frontendIPConfigurations/frontend_ip_config"
|
99
|
+
},
|
100
|
+
"frontendPort": {
|
101
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/frontendPorts/gateway_front_port"
|
102
|
+
},
|
103
|
+
"protocol": "Https",
|
104
|
+
"sslCertificate": {
|
105
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/sslCertificates/ssl_certificate"
|
106
|
+
},
|
107
|
+
"requireServerNameIndication": false,
|
108
|
+
"provisioningState": "Succeeded"
|
109
|
+
},
|
110
|
+
"name": "gateway_listener"
|
111
|
+
}
|
112
|
+
],
|
113
|
+
"urlPathMaps": [],
|
114
|
+
"requestRoutingRules": [
|
115
|
+
{
|
116
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/requestRoutingRules/gateway_request_route_rule",
|
117
|
+
"properties": {
|
118
|
+
"ruleType": "Basic",
|
119
|
+
"backendAddressPool": {
|
120
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/backendAddressPools/AG-BackEndAddressPool"
|
121
|
+
},
|
122
|
+
"backendHttpSettings": {
|
123
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/backendHttpSettingsCollection/gateway_settings"
|
124
|
+
},
|
125
|
+
"httpListener": {
|
126
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/httpListeners/gateway_listener"
|
127
|
+
},
|
128
|
+
"provisioningState": "Succeeded"
|
129
|
+
},
|
130
|
+
"name": "gateway_request_route_rule"
|
131
|
+
}
|
132
|
+
],
|
133
|
+
"resourceGuid": "b3db5ebf-10f8-4666-9596-d1459530f64b",
|
134
|
+
"provisioningState": "Succeeded"
|
135
|
+
}
|
136
|
+
}'
|
137
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
138
|
+
result.body = Azure::ARM::Network::Models::ApplicationGateway.deserialize_object(JSON.load(response))
|
139
|
+
result
|
140
|
+
end
|
141
|
+
|
142
|
+
def self.list_application_gateway_response
|
143
|
+
response = '{
|
144
|
+
"value": [{
|
145
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway",
|
146
|
+
"name": "gateway",
|
147
|
+
"type": "Microsoft.Network/applicationGateways",
|
148
|
+
"location": "eastus",
|
149
|
+
"properties": {
|
150
|
+
"sku": {
|
151
|
+
"name": "Standard_Medium",
|
152
|
+
"tier": "Standard",
|
153
|
+
"capacity": 2
|
154
|
+
},
|
155
|
+
"gatewayIPConfigurations": [
|
156
|
+
{
|
157
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/gatewayIPConfigurations/ag-GatewayIP",
|
158
|
+
"properties": {
|
159
|
+
"subnet": {
|
160
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/vnet/subnets/GatewaySubnet"
|
161
|
+
},
|
162
|
+
"provisioningState": "Succeeded"
|
163
|
+
},
|
164
|
+
"name": "ag-GatewayIP"
|
165
|
+
}
|
166
|
+
],
|
167
|
+
"sslCertificates": [
|
168
|
+
{
|
169
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/sslCertificates/ssl_certificate",
|
170
|
+
"properties": {
|
171
|
+
"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=",
|
172
|
+
"provisioningState": "Succeeded"
|
173
|
+
},
|
174
|
+
"name": "ssl_certificate"
|
175
|
+
}
|
176
|
+
],
|
177
|
+
"frontendIPConfigurations": [
|
178
|
+
{
|
179
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/frontendIPConfigurations/frontend_ip_config",
|
180
|
+
"properties": {
|
181
|
+
"privateIPAllocationMethod": "Dynamic",
|
182
|
+
"publicIPAddress": {
|
183
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/ag_publicip-672835"
|
184
|
+
},
|
185
|
+
"provisioningState": "Succeeded"
|
186
|
+
},
|
187
|
+
"name": "frontend_ip_config"
|
188
|
+
}
|
189
|
+
],
|
190
|
+
"frontendPorts": [
|
191
|
+
{
|
192
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/frontendPorts/gateway_front_port",
|
193
|
+
"properties": {
|
194
|
+
"port": 443,
|
195
|
+
"provisioningState": "Succeeded"
|
196
|
+
},
|
197
|
+
"name": "gateway_front_port"
|
198
|
+
}
|
199
|
+
],
|
200
|
+
"probes": [],
|
201
|
+
"backendAddressPools": [
|
202
|
+
{
|
203
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/backendAddressPools/AG-BackEndAddressPool",
|
204
|
+
"properties": {
|
205
|
+
"backendAddresses": [
|
206
|
+
{
|
207
|
+
"ipAddress": "10.0.0.4"
|
208
|
+
},
|
209
|
+
{
|
210
|
+
"ipAddress": "10.0.0.5"
|
211
|
+
}
|
212
|
+
],
|
213
|
+
"provisioningState": "Succeeded"
|
214
|
+
},
|
215
|
+
"name": "AG-BackEndAddressPool"
|
216
|
+
}
|
217
|
+
],
|
218
|
+
"backendHttpSettingsCollection": [
|
219
|
+
{
|
220
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/backendHttpSettingsCollection/gateway_settings",
|
221
|
+
"properties": {
|
222
|
+
"port": 80,
|
223
|
+
"protocol": "Http",
|
224
|
+
"cookieBasedAffinity": "Enabled",
|
225
|
+
"requestTimeout": 30,
|
226
|
+
"provisioningState": "Succeeded"
|
227
|
+
},
|
228
|
+
"name": "gateway_settings"
|
229
|
+
}
|
230
|
+
],
|
231
|
+
"httpListeners": [
|
232
|
+
{
|
233
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/httpListeners/gateway_listener",
|
234
|
+
"properties": {
|
235
|
+
"frontendIPConfiguration": {
|
236
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/frontendIPConfigurations/frontend_ip_config"
|
237
|
+
},
|
238
|
+
"frontendPort": {
|
239
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/frontendPorts/gateway_front_port"
|
240
|
+
},
|
241
|
+
"protocol": "Https",
|
242
|
+
"sslCertificate": {
|
243
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/sslCertificates/ssl_certificate"
|
244
|
+
},
|
245
|
+
"requireServerNameIndication": false,
|
246
|
+
"provisioningState": "Succeeded"
|
247
|
+
},
|
248
|
+
"name": "gateway_listener"
|
249
|
+
}
|
250
|
+
],
|
251
|
+
"urlPathMaps": [],
|
252
|
+
"requestRoutingRules": [
|
253
|
+
{
|
254
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/requestRoutingRules/gateway_request_route_rule",
|
255
|
+
"properties": {
|
256
|
+
"ruleType": "Basic",
|
257
|
+
"backendAddressPool": {
|
258
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/backendAddressPools/AG-BackEndAddressPool"
|
259
|
+
},
|
260
|
+
"backendHttpSettings": {
|
261
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/backendHttpSettingsCollection/gateway_settings"
|
262
|
+
},
|
263
|
+
"httpListener": {
|
264
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/httpListeners/gateway_listener"
|
265
|
+
},
|
266
|
+
"provisioningState": "Succeeded"
|
267
|
+
},
|
268
|
+
"name": "gateway_request_route_rule"
|
269
|
+
}
|
270
|
+
],
|
271
|
+
"resourceGuid": "b3db5ebf-10f8-4666-9596-d1459530f64b",
|
272
|
+
"provisioningState": "Succeeded"
|
273
|
+
}
|
274
|
+
}]
|
275
|
+
}'
|
276
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
277
|
+
result.body = Azure::ARM::Network::Models::ApplicationGatewayListResult.deserialize_object(JSON.load(response))
|
278
|
+
result
|
279
|
+
end
|
280
|
+
|
281
|
+
def self.delete_application_gateway_response
|
282
|
+
MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
283
|
+
end
|
284
|
+
|
285
|
+
def self.gateway_ip_configurations
|
286
|
+
gateway_ip_config =
|
287
|
+
[
|
288
|
+
{
|
289
|
+
name: 'gatewayIpConfigName',
|
290
|
+
subnet_id: '/subscriptions/{guid}/resourcegroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnetName'
|
291
|
+
}
|
292
|
+
]
|
293
|
+
gateway_ip_config
|
294
|
+
end
|
295
|
+
|
296
|
+
def self.ssl_certificates
|
297
|
+
certificates =
|
298
|
+
[
|
299
|
+
{
|
300
|
+
name: 'certificate',
|
301
|
+
data: 'data',
|
302
|
+
password: '123',
|
303
|
+
public_cert_data: 'MIIDiDCCAnACCQCwYkR0Mxy+QTANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCUEsxDzANBgNVBAgTBlB1bmphYjEPMA0GA1UEBxMGTGFob3JlMQ8wDQYDVQQKEwZDb25maXoxDDAKBgNVBAsTA0RldjEPMA0GA1UEAxMGaGFpZGVyMSQwIgYJKoZIhvcNAQkBFhVoYWlkZXIuYWxpQGNvbmZpei5jb20wHhcNMTYwMzAyMTE0NTM2WhcNMTcwMzAyMTE0NTM2WjCBhTELMAkGA1UEBhMCUEsxDzANBgNVBAgTBlB1bmphYjEPMA0GA1UEBxMGTGFob3JlMQ8wDQYDVQQKEwZDb25maXoxDDAKBgNVBAsTA0RldjEPMA0GA1UEAxMGaGFpZGVyMSQwIgYJKoZIhvcNAQkBFhVoYWlkZXIuYWxpQGNvbmZpei5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCuJrPbvOG+4oXQRamkOALlpdK98m+atJue9zOcCCagY8IJI4quYL13d8VItmrZf7erA+siqpYlWEuk1+lmmUY7T4AWAL8mXeR2vc7hWF601WDUjeVPK19+IcC8emMLOlBpvjXC9nbvADLQuR0PGitfjCqFoG66EOqJmLDNBsyHWmy+qhb8J4WXitruNAJDPe/20h6L23vD6z4tvwBjh4zkrfskGlKCNcAuvG1NI0FAS8261Jvs3lf+8oFyI+oSXGtknrkeQv3PbXyeEe3KO5a/M61Uebo04Uwd4yCvdu6H0sF+YYA4bfFdanuFmrZvf9cZSwknQid+vOdzyGkTHTPFAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAKtPhYpfvn5OxP+BcChsWaQA4KZQj0THGdiAjHsvfjsgteFvhkzqZBkhKYtsAWV5tB5/GDl+o4c6PQJ2/TXhOJn3pSNaUzrCJIGtKS5DknbqTQxCwVlxyBtPHLAYWqKcPMlH282rw3VY0OYTL96XOgZ/WZjcN6A7ku+uWsNCql443FoWL+N3Gpaab45OyIluFUOH+yc0ToHNlP3iOpI3rVpi2xwmGrSyUKsGUma3nrBq7TWjkDE1E+oJoybaMNZzgXGIPSJC1HYIF1U8GSoFkZpAFxXecD0FinXWDRwUP6K54iti3i6a/Ox73WhwfI4mVCqsOy1WYWtKYhMVe6Kj4Nw='
|
304
|
+
}
|
305
|
+
]
|
306
|
+
certificates
|
307
|
+
end
|
308
|
+
|
309
|
+
def self.frontend_ip_configurations
|
310
|
+
frontend_ip_config =
|
311
|
+
[
|
312
|
+
{
|
313
|
+
name: 'frontendIpConfig',
|
314
|
+
private_ip_allocation_method: 'Dynamic',
|
315
|
+
public_ip_address_id: '/subscriptions/{guid}/resourcegroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/publicIp',
|
316
|
+
private_ip_address: '10.0.1.5'
|
317
|
+
}
|
318
|
+
]
|
319
|
+
frontend_ip_config
|
320
|
+
end
|
321
|
+
|
322
|
+
def self.frontend_ports
|
323
|
+
ports =
|
324
|
+
[
|
325
|
+
{
|
326
|
+
name: 'frontendPort',
|
327
|
+
port: 443
|
328
|
+
}
|
329
|
+
]
|
330
|
+
ports
|
331
|
+
end
|
332
|
+
|
333
|
+
def self.probes
|
334
|
+
probes =
|
335
|
+
[
|
336
|
+
{
|
337
|
+
name: 'probe1',
|
338
|
+
protocol: 'tcp',
|
339
|
+
host: 'localhost',
|
340
|
+
path: '/usr/',
|
341
|
+
interval: 30,
|
342
|
+
timeout: 20,
|
343
|
+
unhealthy_threshold: 20
|
344
|
+
}
|
345
|
+
]
|
346
|
+
probes
|
347
|
+
end
|
348
|
+
|
349
|
+
def self.backend_address_pools
|
350
|
+
address_pool =
|
351
|
+
[
|
352
|
+
{
|
353
|
+
name: 'backendAddressPool',
|
354
|
+
ip_addresses: [
|
355
|
+
{
|
356
|
+
ipAddress: '10.0.1.6'
|
357
|
+
}
|
358
|
+
]
|
359
|
+
}
|
360
|
+
]
|
361
|
+
address_pool
|
362
|
+
end
|
363
|
+
|
364
|
+
def self.backend_http_settings_list
|
365
|
+
http_setting =
|
366
|
+
[
|
367
|
+
{
|
368
|
+
name: 'gateway_settings',
|
369
|
+
port: 80,
|
370
|
+
protocol: 'Http',
|
371
|
+
cookie_based_affinity: 'Enabled',
|
372
|
+
request_timeout: '30',
|
373
|
+
probe: ''
|
374
|
+
}
|
375
|
+
]
|
376
|
+
http_setting
|
377
|
+
end
|
378
|
+
|
379
|
+
def self.http_listeners
|
380
|
+
listener =
|
381
|
+
[
|
382
|
+
{
|
383
|
+
name: 'gateway_listener',
|
384
|
+
frontend_ip_config_id: '/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/frontendIPConfigurations/frontend_ip_config',
|
385
|
+
frontend_port_id: '/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/frontendPorts/gateway_front_port',
|
386
|
+
protocol: 'Https',
|
387
|
+
host_name: '',
|
388
|
+
ssl_certificate_id: '/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/sslCertificates/ssl_certificate',
|
389
|
+
require_server_name_indication: 'false'
|
390
|
+
}
|
391
|
+
]
|
392
|
+
listener
|
393
|
+
end
|
394
|
+
|
395
|
+
def self.url_path_maps
|
396
|
+
path_map =
|
397
|
+
[
|
398
|
+
{
|
399
|
+
name: 'map1',
|
400
|
+
default_backend_address_pool_id: '/subscriptions/########-####-####-####-############/resourceGroups/fogRM-rg/providers/Microsoft.Network/applicationGateways/gateway/backendAddressPools/AG-BackEndAddressPool',
|
401
|
+
default_backend_http_settings_id: '/subscriptions/########-####-####-####-############/resourceGroups/fogRM-rg/providers/Microsoft.Network/applicationGateways/gateway/backendHttpSettingsCollection/gateway_settings',
|
402
|
+
path_rules: [
|
403
|
+
{
|
404
|
+
backend_address_pool_id: '/subscriptions/########-####-####-####-############/resourceGroups/fogRM-rg/providers/Microsoft.Network/applicationGateways/gateway/backendAddressPools/AG-BackEndAddressPool',
|
405
|
+
backend_http_settings_id: '/subscriptions/########-####-####-####-############/resourceGroups/fogRM-rg/providers/Microsoft.Network/applicationGateways/gateway/backendHttpSettingsCollection/gateway_settings',
|
406
|
+
paths: [
|
407
|
+
%w('/usr', '/etc')
|
408
|
+
]
|
409
|
+
}
|
410
|
+
]
|
411
|
+
}
|
412
|
+
]
|
413
|
+
path_map
|
414
|
+
end
|
415
|
+
|
416
|
+
def self.request_routing_rules
|
417
|
+
routing_rule =
|
418
|
+
[
|
419
|
+
{
|
420
|
+
name: 'gateway_request_route_rule',
|
421
|
+
type: 'Basic',
|
422
|
+
http_listener_id: '/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/httpListeners/gateway_listener',
|
423
|
+
backend_address_pool_id: '/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/backendAddressPools/AG-BackEndAddressPool',
|
424
|
+
backend_http_settings_id: '/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/gateway/backendHttpSettingsCollection/gateway_settings',
|
425
|
+
url_path_map: ''
|
426
|
+
}
|
427
|
+
]
|
428
|
+
routing_rule
|
429
|
+
end
|
430
|
+
end
|
431
|
+
end
|
432
|
+
end
|
433
|
+
end
|