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,366 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Requests
|
3
|
+
module Network
|
4
|
+
class LoadBalancer
|
5
|
+
def self.create_load_balancer_response
|
6
|
+
response = '{"name":"mylb1",
|
7
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1",
|
8
|
+
"location":"North US",
|
9
|
+
"tags":{
|
10
|
+
"key":"value"
|
11
|
+
},
|
12
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
13
|
+
"properties":{
|
14
|
+
"resourceGuid":"6ECBD4C1-0DC1-4D86-9F6E-4A58F83C9023",
|
15
|
+
"provisioningState":"Succeeded",
|
16
|
+
"frontendIPConfigurations":[{
|
17
|
+
"name":"myip1",
|
18
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/frontendIPConfigurations/myip1",
|
19
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
20
|
+
"properties":{
|
21
|
+
"provisioningState":"Succeeded",
|
22
|
+
"subnet":{
|
23
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myvnet1/subnets/mysubnet1"
|
24
|
+
},
|
25
|
+
"privateIPAddress":"10.0.0.10",
|
26
|
+
"privateIPAllocationMethod":"Static",
|
27
|
+
"publicIPAddress":{
|
28
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/myip1"
|
29
|
+
},
|
30
|
+
"loadBalancingRules":[
|
31
|
+
{
|
32
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/loadBalancingRules/rule1"
|
33
|
+
}
|
34
|
+
],
|
35
|
+
"inboundNatRules":[
|
36
|
+
{
|
37
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/inboundNatRules/rule1"
|
38
|
+
}
|
39
|
+
]
|
40
|
+
}
|
41
|
+
}],
|
42
|
+
"backendAddressPools":[
|
43
|
+
{
|
44
|
+
"name":"pool1",
|
45
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/backendAddressPools/pool1",
|
46
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
47
|
+
"properties":{
|
48
|
+
"provisioningState":"Succeeded",
|
49
|
+
"backendIPConfigurations":[
|
50
|
+
{
|
51
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/vm1nic1/ipConfigurations/ip1"
|
52
|
+
}
|
53
|
+
],
|
54
|
+
"loadBalancingRules":[
|
55
|
+
{
|
56
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/loadBalancingRules/rule1"
|
57
|
+
}
|
58
|
+
]
|
59
|
+
}
|
60
|
+
}
|
61
|
+
],
|
62
|
+
"loadBalancingRules":[
|
63
|
+
{
|
64
|
+
"name":"HTTP Traffic",
|
65
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/loadBalancingRules/rule1",
|
66
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
67
|
+
"properties":{
|
68
|
+
"provisioningState":"Succeeded",
|
69
|
+
"frontendIPConfiguration":{
|
70
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/frontendIPConfigurations/ip1"
|
71
|
+
},
|
72
|
+
"backendAddressPool":{
|
73
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/backendAddressPool/pool1"
|
74
|
+
},
|
75
|
+
"protocol":"Tcp",
|
76
|
+
"frontendPort":80,
|
77
|
+
"backendPort":8080,
|
78
|
+
"probe":{
|
79
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/probes/probe1"
|
80
|
+
},
|
81
|
+
"enableFloatingIP":true,
|
82
|
+
"idleTimeoutInMinutes":4,
|
83
|
+
"loadDistribution":"Default"
|
84
|
+
|
85
|
+
}
|
86
|
+
}
|
87
|
+
],
|
88
|
+
"probes":[
|
89
|
+
{
|
90
|
+
"name":"my probe 1",
|
91
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/probes/my probe 1",
|
92
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
93
|
+
"properties":{
|
94
|
+
"provisioningState":"Succeeded",
|
95
|
+
"protocol":"Tcp",
|
96
|
+
"port":8080,
|
97
|
+
"requestPath":"myprobeapp1/myprobe1.svc",
|
98
|
+
"intervalInSeconds":5,
|
99
|
+
"numberOfProbes":16,
|
100
|
+
"loadBalancingRules":[
|
101
|
+
{
|
102
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/loadBalancingRules/rule1"
|
103
|
+
}
|
104
|
+
]
|
105
|
+
}
|
106
|
+
}
|
107
|
+
],
|
108
|
+
"inboundNatRules":[
|
109
|
+
{
|
110
|
+
"name":"RDP Traffic",
|
111
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/inboundNatRules/RDP Traffic",
|
112
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
113
|
+
"properties":{
|
114
|
+
"provisioningState":"Succeeded",
|
115
|
+
"frontendIPConfiguration":{
|
116
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/frontendIPConfigurations/ip1"
|
117
|
+
},
|
118
|
+
"backendIPConfiguration":{
|
119
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/vm1nic1/ipConfigurations/ip1"
|
120
|
+
},
|
121
|
+
"protocol":"Tcp",
|
122
|
+
"frontendPort":3389,
|
123
|
+
"backendPort":3389
|
124
|
+
}
|
125
|
+
}
|
126
|
+
],
|
127
|
+
"inboundNatPools":[
|
128
|
+
{
|
129
|
+
"name": "RDPForVMSS1",
|
130
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers /Microsoft.Network/loadBalancers/myLB1/inboundNatRules/RDPForVMSS1",
|
131
|
+
"etag": "W/\"00000000-0000-0000-0000-000000000000\"",
|
132
|
+
"properties": {
|
133
|
+
"provisioningState": "Updating|Deleting|Failed|Succeeded",
|
134
|
+
"frontendIPConfiguration": {
|
135
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/frontendIPConfigurations/ip1"
|
136
|
+
},
|
137
|
+
"protocol": "Tcp",
|
138
|
+
"frontendPortRangeStart": 50000,
|
139
|
+
"frontendPortRangeEnd": 50500,
|
140
|
+
"backendPort": 3389
|
141
|
+
}
|
142
|
+
}
|
143
|
+
]
|
144
|
+
}
|
145
|
+
}'
|
146
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
147
|
+
result.body = Azure::ARM::Network::Models::LoadBalancer.deserialize_object(JSON.load(response))
|
148
|
+
result
|
149
|
+
end
|
150
|
+
|
151
|
+
def self.list_load_balancers_response
|
152
|
+
response = '{
|
153
|
+
"value": [{
|
154
|
+
"name": "mylb1",
|
155
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1",
|
156
|
+
"location": "North US",
|
157
|
+
"tags": {
|
158
|
+
"key": "value"
|
159
|
+
},
|
160
|
+
"etag": "W/\"00000000-0000-0000-0000-000000000000\"",
|
161
|
+
"properties": {
|
162
|
+
"resourceGuid": "6ECBD4C1-0DC1-4D86-9F6E-4A58F83C9023",
|
163
|
+
"provisioningState": "Succeeded",
|
164
|
+
"frontendIPConfigurations": [{
|
165
|
+
"name": "myip1",
|
166
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/frontendIPConfigurations/myip1",
|
167
|
+
"etag": "W/\"00000000-0000-0000-0000-000000000000\"",
|
168
|
+
"properties": {
|
169
|
+
"provisioningState": "Succeeded",
|
170
|
+
"subnet": {
|
171
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myvnet1/subnets/mysubnet1"
|
172
|
+
},
|
173
|
+
"privateIPAddress": "10.0.0.10",
|
174
|
+
"privateIPAllocationMethod": "Static",
|
175
|
+
"publicIPAddress": {
|
176
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/myip1"
|
177
|
+
},
|
178
|
+
"loadBalancingRules": [{
|
179
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/loadBalancingRules/rule1"
|
180
|
+
}],
|
181
|
+
"inboundNatRules": [{
|
182
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/inboundNatRules/rule1"
|
183
|
+
}]
|
184
|
+
}
|
185
|
+
}],
|
186
|
+
"backendAddressPools": [{
|
187
|
+
"name": "pool1",
|
188
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/backendAddressPools/pool1",
|
189
|
+
"etag": "W/\"00000000-0000-0000-0000-000000000000\"",
|
190
|
+
"properties": {
|
191
|
+
"provisioningState": "Succeeded",
|
192
|
+
"backendIPConfigurations": [{
|
193
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/vm1nic1/ipConfigurations/ip1"
|
194
|
+
}],
|
195
|
+
"loadBalancingRules": [{
|
196
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/loadBalancingRules/rule1"
|
197
|
+
}]
|
198
|
+
}
|
199
|
+
}],
|
200
|
+
"loadBalancingRules": [{
|
201
|
+
"name": "HTTP Traffic",
|
202
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/loadBalancingRules/rule1",
|
203
|
+
"etag": "W/\"00000000-0000-0000-0000-000000000000\"",
|
204
|
+
"properties": {
|
205
|
+
"provisioningState": "Succeeded",
|
206
|
+
"frontendIPConfiguration": {
|
207
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/frontendIPConfigurations/ip1"
|
208
|
+
},
|
209
|
+
"backendAddressPool": {
|
210
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/backendAddressPool/pool1"
|
211
|
+
},
|
212
|
+
"protocol": "Tcp",
|
213
|
+
"frontendPort": 80,
|
214
|
+
"backendPort": 8080,
|
215
|
+
"probe": {
|
216
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/probes/probe1"
|
217
|
+
},
|
218
|
+
"enableFloatingIP": true,
|
219
|
+
"idleTimeoutInMinutes": 4,
|
220
|
+
"loadDistribution": "Default"
|
221
|
+
|
222
|
+
}
|
223
|
+
}],
|
224
|
+
"probes": [{
|
225
|
+
"name": "my probe 1",
|
226
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/probes/my probe 1",
|
227
|
+
"etag": "W/\"00000000-0000-0000-0000-000000000000\"",
|
228
|
+
"properties": {
|
229
|
+
"provisioningState": "Succeeded",
|
230
|
+
"protocol": "Tcp",
|
231
|
+
"port": 8080,
|
232
|
+
"requestPath": "myprobeapp1/myprobe1.svc",
|
233
|
+
"intervalInSeconds": 5,
|
234
|
+
"numberOfProbes": 16,
|
235
|
+
"loadBalancingRules": [{
|
236
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/loadBalancingRules/rule1"
|
237
|
+
}]
|
238
|
+
|
239
|
+
}
|
240
|
+
}],
|
241
|
+
"inboundNatRules": [{
|
242
|
+
"name": "RDP Traffic",
|
243
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/inboundNatRules/RDP Traffic",
|
244
|
+
"etag": "W/\"00000000-0000-0000-0000-000000000000\"",
|
245
|
+
"properties": {
|
246
|
+
"provisioningState": "Succeeded",
|
247
|
+
"frontendIPConfiguration": {
|
248
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/frontendIPConfigurations/ip1"
|
249
|
+
},
|
250
|
+
"backendIPConfiguration": {
|
251
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/vm1nic1/ipConfigurations/ip1"
|
252
|
+
},
|
253
|
+
"protocol": "Tcp",
|
254
|
+
"frontendPort": 3389,
|
255
|
+
"backendPort": 3389
|
256
|
+
}
|
257
|
+
}],
|
258
|
+
"inboundNatPools": [{
|
259
|
+
"name": "RDPForVMSS1",
|
260
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers /Microsoft.Network/loadBalancers/myLB1/inboundNatRules/RDPForVMSS1",
|
261
|
+
"etag": "W/\"00000000-0000-0000-0000-000000000000\"",
|
262
|
+
"properties": {
|
263
|
+
"provisioningState": "Updating|Deleting|Failed|Succeeded",
|
264
|
+
"frontendIPConfiguration": {
|
265
|
+
"id": "/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/frontendIPConfigurations/ip1"
|
266
|
+
},
|
267
|
+
"protocol": "Tcp",
|
268
|
+
"frontendPortRangeStart": 50000,
|
269
|
+
"frontendPortRangeEnd": 50500,
|
270
|
+
"backendPort": 3389
|
271
|
+
}
|
272
|
+
}]
|
273
|
+
}
|
274
|
+
}]
|
275
|
+
}'
|
276
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
277
|
+
result.body = Azure::ARM::Network::Models::LoadBalancerListResult.deserialize_object(JSON.load(response))
|
278
|
+
result
|
279
|
+
end
|
280
|
+
|
281
|
+
def self.delete_load_balancer_response
|
282
|
+
MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
283
|
+
end
|
284
|
+
|
285
|
+
def self.frontend_ip_config
|
286
|
+
fic =
|
287
|
+
[
|
288
|
+
{
|
289
|
+
name: 'fic',
|
290
|
+
private_ipallocation_method: 'Dynamic',
|
291
|
+
public_ipaddress_id: '/subscriptions/{guid}/resourcegroups/fogRM-rg/providers/Microsoft.Network/publicIPAddresses/pip',
|
292
|
+
subnet_id: '/subscriptions/{guid}/resourcegroups/fogRM-rg/providers/Microsoft.Network/virtualNetworks/vnet/subnets/sb1'
|
293
|
+
}
|
294
|
+
]
|
295
|
+
fic
|
296
|
+
end
|
297
|
+
|
298
|
+
def self.backend_address_pool
|
299
|
+
bap =
|
300
|
+
%w(pool1 pool2)
|
301
|
+
bap
|
302
|
+
end
|
303
|
+
|
304
|
+
def self.probe
|
305
|
+
prb =
|
306
|
+
[
|
307
|
+
{
|
308
|
+
name: 'probe1',
|
309
|
+
protocol: 'Tcp',
|
310
|
+
port: 8080,
|
311
|
+
request_path: 'myprobeapp1/myprobe1.svc',
|
312
|
+
interval_in_seconds: 5,
|
313
|
+
number_of_probes: 16
|
314
|
+
}
|
315
|
+
]
|
316
|
+
prb
|
317
|
+
end
|
318
|
+
|
319
|
+
def self.load_balancing_rule
|
320
|
+
lbr =
|
321
|
+
[
|
322
|
+
{
|
323
|
+
name: 'lb_rule_1',
|
324
|
+
frontend_ip_configuration_id: '/subscriptions/{guid}/resourceGroups/fogRM-rg/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fic',
|
325
|
+
backend_address_pool_id: '/subscriptions/{guid}/resourceGroups/fogRM-rg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/pool1',
|
326
|
+
protocol: 'Tcp',
|
327
|
+
probe_id: '/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/myLB1/probes/probe1',
|
328
|
+
frontend_port: '80',
|
329
|
+
backend_port: '8080',
|
330
|
+
enable_floating_ip: false,
|
331
|
+
idle_timeout_in_minutes: 4,
|
332
|
+
load_distribution: 'Default'
|
333
|
+
}
|
334
|
+
]
|
335
|
+
lbr
|
336
|
+
end
|
337
|
+
|
338
|
+
def self.inbound_nat_rule
|
339
|
+
inr = [
|
340
|
+
{
|
341
|
+
name: 'RDP-Traffic',
|
342
|
+
frontend_ip_configuration_id: '/subscriptions/{guid}/resourceGroups/fogRM-rg/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fic',
|
343
|
+
protocol: 'Tcp',
|
344
|
+
frontend_port: 3389,
|
345
|
+
backend_port: 3389
|
346
|
+
}
|
347
|
+
]
|
348
|
+
inr
|
349
|
+
end
|
350
|
+
|
351
|
+
def self.inbound_nat_pool
|
352
|
+
inp = [
|
353
|
+
{
|
354
|
+
name: 'RDPForVMSS1',
|
355
|
+
protocol: 'Tcp',
|
356
|
+
frontend_port_range_start: 500,
|
357
|
+
frontend_port_range_end: 505,
|
358
|
+
backend_port: 3389
|
359
|
+
}
|
360
|
+
]
|
361
|
+
inp
|
362
|
+
end
|
363
|
+
end
|
364
|
+
end
|
365
|
+
end
|
366
|
+
end
|
@@ -0,0 +1,268 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Requests
|
3
|
+
module Network
|
4
|
+
class NetworkInterface
|
5
|
+
def self.create_network_interface_response
|
6
|
+
body = '{
|
7
|
+
"name":"fog-test-network-interface",
|
8
|
+
"id":"/subscriptions/{guid}/resourceGroups/fog-test-rg/providers/Microsoft.Network/networkInterfaces/fog-test-network-interface",
|
9
|
+
"location":"West US",
|
10
|
+
"tags":{
|
11
|
+
"key":"value"
|
12
|
+
},
|
13
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
14
|
+
"properties":{
|
15
|
+
"resourceGuid":"5ED47B81-9F1C-4ACE-97A5-7B8CE08C5002",
|
16
|
+
"provisioningState":"Succeeded",
|
17
|
+
"virtualMachine":{
|
18
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/vm1"
|
19
|
+
},
|
20
|
+
"macAddress":"00-00-00-00-00-00",
|
21
|
+
"networkSecurityGroup":{
|
22
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/myNSG1"
|
23
|
+
},
|
24
|
+
"ipConfigurations":[
|
25
|
+
{
|
26
|
+
"name":"myip1",
|
27
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/vm1mynic1/ipConfigurations/myip1",
|
28
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
29
|
+
"properties":{
|
30
|
+
"provisioningState":"Succeeded",
|
31
|
+
"subnet":{
|
32
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myvnet1/subnets/mysub1"
|
33
|
+
},
|
34
|
+
"privateIPAddress":"10.0.0.8",
|
35
|
+
"privateIPAllocationMethod":"Static",
|
36
|
+
"publicIPAddress":{
|
37
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/mypip1"
|
38
|
+
},
|
39
|
+
"loadBalancerBackendAddressPools":[
|
40
|
+
{
|
41
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/backendAddressPools/pool1"
|
42
|
+
}
|
43
|
+
],
|
44
|
+
"loadBalancerInboundNatRules":[
|
45
|
+
{
|
46
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/inboundNatRules/rdp for myvm1"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/inboundNatRules/powershell for myvm1"
|
50
|
+
}
|
51
|
+
]
|
52
|
+
}
|
53
|
+
}
|
54
|
+
],
|
55
|
+
"dnsSettings":{
|
56
|
+
"dnsServers":[
|
57
|
+
"10.0.0.4",
|
58
|
+
"10.0.0.5"
|
59
|
+
],
|
60
|
+
"appliedDnsServers": ["1.0.0.1", "2.0.0.2", "3.0.0.3"],
|
61
|
+
"internalDnsNameLabel": "IdnsVm1",
|
62
|
+
"internalFqdn": "IdnsVm1.a2ftlxfjn2iezihj3udx1wfn4d.hx.internal.cloudapp.net"
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}'
|
66
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
67
|
+
result.body = Azure::ARM::Network::Models::NetworkInterface.deserialize_object(JSON.load(body))
|
68
|
+
result
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.detach_pip_from_nic_response
|
72
|
+
body = '{
|
73
|
+
"name":"fog-test-network-interface",
|
74
|
+
"id":"/subscriptions/{guid}/resourceGroups/fog-test-rg/providers/Microsoft.Network/networkInterfaces/fog-test-network-interface",
|
75
|
+
"location":"West US",
|
76
|
+
"tags":{
|
77
|
+
"key":"value"
|
78
|
+
},
|
79
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
80
|
+
"properties":{
|
81
|
+
"resourceGuid":"5ED47B81-9F1C-4ACE-97A5-7B8CE08C5002",
|
82
|
+
"provisioningState":"Succeeded",
|
83
|
+
"virtualMachine":{
|
84
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/vm1"
|
85
|
+
},
|
86
|
+
"macAddress":"00-00-00-00-00-00",
|
87
|
+
"networkSecurityGroup":{
|
88
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/myNSG1"
|
89
|
+
},
|
90
|
+
"ipConfigurations":[
|
91
|
+
{
|
92
|
+
"name":"myip1",
|
93
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/vm1mynic1/ipConfigurations/myip1",
|
94
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
95
|
+
"properties":{
|
96
|
+
"provisioningState":"Succeeded",
|
97
|
+
"subnet":{
|
98
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myvnet1/subnets/mysub1"
|
99
|
+
},
|
100
|
+
"privateIPAddress":"10.0.0.8",
|
101
|
+
"privateIPAllocationMethod":"Static",
|
102
|
+
"loadBalancerBackendAddressPools":[
|
103
|
+
{
|
104
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/backendAddressPools/pool1"
|
105
|
+
}
|
106
|
+
],
|
107
|
+
"loadBalancerInboundNatRules":[
|
108
|
+
{
|
109
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/inboundNatRules/rdp for myvm1"
|
110
|
+
},
|
111
|
+
{
|
112
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/inboundNatRules/powershell for myvm1"
|
113
|
+
}
|
114
|
+
]
|
115
|
+
}
|
116
|
+
}
|
117
|
+
],
|
118
|
+
"dnsSettings":{
|
119
|
+
"dnsServers":[
|
120
|
+
"10.0.0.4",
|
121
|
+
"10.0.0.5"
|
122
|
+
],
|
123
|
+
"appliedDnsServers": ["1.0.0.1", "2.0.0.2", "3.0.0.3"],
|
124
|
+
"internalDnsNameLabel": "IdnsVm1",
|
125
|
+
"internalFqdn": "IdnsVm1.a2ftlxfjn2iezihj3udx1wfn4d.hx.internal.cloudapp.net"
|
126
|
+
}
|
127
|
+
}
|
128
|
+
}'
|
129
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
130
|
+
result.body = Azure::ARM::Network::Models::NetworkInterface.deserialize_object(JSON.load(body))
|
131
|
+
result
|
132
|
+
end
|
133
|
+
|
134
|
+
def self.detach_nsg_from_nic_response
|
135
|
+
body = '{
|
136
|
+
"name":"fog-test-network-interface",
|
137
|
+
"id":"/subscriptions/{guid}/resourceGroups/fog-test-rg/providers/Microsoft.Network/networkInterfaces/fog-test-network-interface",
|
138
|
+
"location":"West US",
|
139
|
+
"tags":{
|
140
|
+
"key":"value"
|
141
|
+
},
|
142
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
143
|
+
"properties":{
|
144
|
+
"resourceGuid":"5ED47B81-9F1C-4ACE-97A5-7B8CE08C5002",
|
145
|
+
"provisioningState":"Succeeded",
|
146
|
+
"virtualMachine":{
|
147
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/vm1"
|
148
|
+
},
|
149
|
+
"macAddress":"00-00-00-00-00-00",
|
150
|
+
"ipConfigurations":[
|
151
|
+
{
|
152
|
+
"name":"myip1",
|
153
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/vm1mynic1/ipConfigurations/myip1",
|
154
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
155
|
+
"properties":{
|
156
|
+
"provisioningState":"Succeeded",
|
157
|
+
"subnet":{
|
158
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myvnet1/subnets/mysub1"
|
159
|
+
},
|
160
|
+
"privateIPAddress":"10.0.0.8",
|
161
|
+
"privateIPAllocationMethod":"Static",
|
162
|
+
"loadBalancerBackendAddressPools":[
|
163
|
+
{
|
164
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/backendAddressPools/pool1"
|
165
|
+
}
|
166
|
+
],
|
167
|
+
"loadBalancerInboundNatRules":[
|
168
|
+
{
|
169
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/inboundNatRules/rdp for myvm1"
|
170
|
+
},
|
171
|
+
{
|
172
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/inboundNatRules/powershell for myvm1"
|
173
|
+
}
|
174
|
+
]
|
175
|
+
}
|
176
|
+
}
|
177
|
+
],
|
178
|
+
"dnsSettings":{
|
179
|
+
"dnsServers":[
|
180
|
+
"10.0.0.4",
|
181
|
+
"10.0.0.5"
|
182
|
+
],
|
183
|
+
"appliedDnsServers": ["1.0.0.1", "2.0.0.2", "3.0.0.3"],
|
184
|
+
"internalDnsNameLabel": "IdnsVm1",
|
185
|
+
"internalFqdn": "IdnsVm1.a2ftlxfjn2iezihj3udx1wfn4d.hx.internal.cloudapp.net"
|
186
|
+
}
|
187
|
+
}
|
188
|
+
}'
|
189
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
190
|
+
result.body = Azure::ARM::Network::Models::NetworkInterface.deserialize_object(JSON.load(body))
|
191
|
+
result
|
192
|
+
end
|
193
|
+
|
194
|
+
def self.list_network_interfaces_response
|
195
|
+
body = '{
|
196
|
+
"value": [ {
|
197
|
+
"name":"mynic1",
|
198
|
+
"id":"/subscriptions/{guid}/resourceGroups/myrg1/providers/Microsoft.Network/networkInterfaces/vm1mynic1",
|
199
|
+
"location":"North US",
|
200
|
+
"tags":{
|
201
|
+
"key":"value"
|
202
|
+
},
|
203
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
204
|
+
"properties":{
|
205
|
+
"resourceGuid":"5ED47B81-9F1C-4ACE-97A5-7B8CE08C5002",
|
206
|
+
"provisioningState":"Succeeded",
|
207
|
+
"virtualMachine":{
|
208
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/vm1"
|
209
|
+
},
|
210
|
+
"macAddress":"00-00-00-00-00-00",
|
211
|
+
"networkSecurityGroup":{
|
212
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/myNSG1"
|
213
|
+
},
|
214
|
+
"ipConfigurations":[
|
215
|
+
{
|
216
|
+
"name":"myip1",
|
217
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/vm1mynic1/ipConfigurations/myip1",
|
218
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
219
|
+
"properties":{
|
220
|
+
"provisioningState":"Succeeded",
|
221
|
+
"subnet":{
|
222
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myvnet1/subnets/mysub1"
|
223
|
+
},
|
224
|
+
"privateIPAddress":"10.0.0.8",
|
225
|
+
"privateIPAllocationMethod":"Static",
|
226
|
+
"publicIPAddress":{
|
227
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/mypip1"
|
228
|
+
},
|
229
|
+
"loadBalancerBackendAddressPools":[
|
230
|
+
{
|
231
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/backendAddressPools/pool1"
|
232
|
+
}
|
233
|
+
],
|
234
|
+
"loadBalancerInboundNatRules":[
|
235
|
+
{
|
236
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/inboundNatRules/rdp for myvm1"
|
237
|
+
},
|
238
|
+
{
|
239
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/mylb1/inboundNatRules/powershell for myvm1"
|
240
|
+
}
|
241
|
+
]
|
242
|
+
}
|
243
|
+
}
|
244
|
+
],
|
245
|
+
"dnsSettings":{
|
246
|
+
"dnsServers":[
|
247
|
+
"10.0.0.4",
|
248
|
+
"10.0.0.5"
|
249
|
+
],
|
250
|
+
"appliedDnsServers": ["1.0.0.1", "2.0.0.2", "3.0.0.3"],
|
251
|
+
"internalDnsNameLabel": "IdnsVm1",
|
252
|
+
"internalFqdn": "IdnsVm1.a2ftlxfjn2iezihj3udx1wfn4d.hx.internal.cloudapp.net"
|
253
|
+
}
|
254
|
+
}
|
255
|
+
} ]
|
256
|
+
}'
|
257
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
258
|
+
result.body = Azure::ARM::Network::Models::NetworkInterfaceListResult.deserialize_object(JSON.load(body))
|
259
|
+
result
|
260
|
+
end
|
261
|
+
|
262
|
+
def self.delete_network_interface_response
|
263
|
+
MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
268
|
+
end
|