fog-azure-rm 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/README.md +2 -1
- data/fog-azure-rm.gemspec +11 -9
- data/lib/fog/azurerm.rb +1 -0
- data/lib/fog/azurerm/compute.rb +3 -3
- data/lib/fog/azurerm/config.rb +33 -0
- data/lib/fog/azurerm/credentials.rb +1 -1
- data/lib/fog/azurerm/dns.rb +2 -2
- data/lib/fog/azurerm/docs/storage.md +120 -66
- data/lib/fog/azurerm/models/application_gateway/gateway.rb +30 -31
- data/lib/fog/azurerm/models/application_gateway/gateways.rb +4 -4
- data/lib/fog/azurerm/models/compute/availability_sets.rb +4 -4
- data/lib/fog/azurerm/models/compute/server.rb +14 -14
- data/lib/fog/azurerm/models/compute/servers.rb +4 -4
- data/lib/fog/azurerm/models/compute/virtual_machine_extension.rb +3 -5
- data/lib/fog/azurerm/models/compute/virtual_machine_extensions.rb +5 -5
- data/lib/fog/azurerm/models/dns/record_sets.rb +4 -4
- data/lib/fog/azurerm/models/dns/zones.rb +4 -4
- data/lib/fog/azurerm/models/network/express_route_circuit.rb +2 -5
- data/lib/fog/azurerm/models/network/express_route_circuit_authorization.rb +1 -1
- data/lib/fog/azurerm/models/network/express_route_circuit_authorizations.rb +4 -4
- data/lib/fog/azurerm/models/network/express_route_circuit_peering.rb +3 -5
- data/lib/fog/azurerm/models/network/express_route_circuit_peerings.rb +4 -4
- data/lib/fog/azurerm/models/network/express_route_circuits.rb +4 -4
- data/lib/fog/azurerm/models/network/express_route_service_providers.rb +2 -2
- data/lib/fog/azurerm/models/network/load_balancers.rb +5 -5
- data/lib/fog/azurerm/models/network/local_network_gateway.rb +1 -1
- data/lib/fog/azurerm/models/network/local_network_gateways.rb +4 -4
- data/lib/fog/azurerm/models/network/network_interfaces.rb +5 -5
- data/lib/fog/azurerm/models/network/network_security_groups.rb +5 -5
- data/lib/fog/azurerm/models/network/network_security_rule.rb +3 -4
- data/lib/fog/azurerm/models/network/network_security_rules.rb +4 -4
- data/lib/fog/azurerm/models/network/public_ips.rb +4 -4
- data/lib/fog/azurerm/models/network/subnets.rb +4 -4
- data/lib/fog/azurerm/models/network/virtual_network_gateway.rb +6 -7
- data/lib/fog/azurerm/models/network/virtual_network_gateway_connection.rb +5 -5
- data/lib/fog/azurerm/models/network/virtual_network_gateway_connections.rb +4 -4
- data/lib/fog/azurerm/models/network/virtual_network_gateways.rb +4 -4
- data/lib/fog/azurerm/models/network/virtual_networks.rb +4 -4
- data/lib/fog/azurerm/models/resources/azure_resources.rb +2 -2
- data/lib/fog/azurerm/models/resources/deployments.rb +4 -4
- data/lib/fog/azurerm/models/resources/resource_groups.rb +4 -4
- data/lib/fog/azurerm/models/sql/firewall_rule.rb +1 -1
- data/lib/fog/azurerm/models/sql/firewall_rules.rb +4 -4
- data/lib/fog/azurerm/models/sql/sql_database.rb +28 -24
- data/lib/fog/azurerm/models/sql/sql_databases.rb +5 -6
- data/lib/fog/azurerm/models/sql/sql_servers.rb +4 -4
- data/lib/fog/azurerm/models/storage/directories.rb +49 -24
- data/lib/fog/azurerm/models/storage/directory.rb +126 -40
- data/lib/fog/azurerm/models/storage/file.rb +226 -114
- data/lib/fog/azurerm/models/storage/files.rb +168 -13
- data/lib/fog/azurerm/models/storage/recovery_vault.rb +1 -1
- data/lib/fog/azurerm/models/storage/recovery_vaults.rb +4 -4
- data/lib/fog/azurerm/models/storage/storage_account.rb +5 -5
- data/lib/fog/azurerm/models/storage/storage_accounts.rb +4 -4
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_end_point.rb +1 -1
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_end_points.rb +4 -4
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +4 -4
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profiles.rb +4 -4
- data/lib/fog/azurerm/network.rb +1 -1
- data/lib/fog/azurerm/requests/compute/create_virtual_machine.rb +17 -13
- data/lib/fog/azurerm/requests/network/list_virtual_networks.rb +1 -1
- data/lib/fog/azurerm/requests/resources/create_deployment.rb +1 -1
- data/lib/fog/azurerm/requests/resources/create_resource_group.rb +1 -1
- data/lib/fog/azurerm/requests/resources/delete_deployment.rb +1 -1
- data/lib/fog/azurerm/requests/resources/delete_resource_group.rb +1 -1
- data/lib/fog/azurerm/requests/resources/get_deployment.rb +1 -1
- data/lib/fog/azurerm/requests/resources/get_resource_group.rb +1 -1
- data/lib/fog/azurerm/requests/resources/list_deployments.rb +1 -1
- data/lib/fog/azurerm/requests/resources/list_resource_groups.rb +1 -1
- data/lib/fog/azurerm/requests/resources/list_tagged_resources.rb +1 -1
- data/lib/fog/azurerm/requests/resources/tag_resource.rb +1 -1
- data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +3 -3
- data/lib/fog/azurerm/requests/sql/create_or_update_firewall_rule.rb +3 -3
- data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +3 -3
- data/lib/fog/azurerm/requests/sql/delete_database.rb +2 -2
- data/lib/fog/azurerm/requests/sql/delete_firewall_rule.rb +4 -4
- data/lib/fog/azurerm/requests/sql/delete_sql_server.rb +4 -4
- data/lib/fog/azurerm/requests/sql/get_database.rb +3 -3
- data/lib/fog/azurerm/requests/sql/get_firewall_rule.rb +3 -3
- data/lib/fog/azurerm/requests/sql/get_sql_server.rb +3 -3
- data/lib/fog/azurerm/requests/sql/list_databases.rb +3 -3
- data/lib/fog/azurerm/requests/sql/list_firewall_rules.rb +3 -3
- data/lib/fog/azurerm/requests/sql/list_sql_servers.rb +3 -3
- data/lib/fog/azurerm/requests/storage/acquire_blob_lease.rb +5 -2
- data/lib/fog/azurerm/requests/storage/acquire_container_lease.rb +5 -2
- data/lib/fog/azurerm/requests/storage/commit_blob_blocks.rb +30 -0
- data/lib/fog/azurerm/requests/storage/compare_container_blobs.rb +148 -0
- data/lib/fog/azurerm/requests/storage/copy_blob.rb +8 -8
- data/lib/fog/azurerm/requests/storage/copy_blob_from_uri.rb +8 -8
- data/lib/fog/azurerm/requests/storage/create_block_blob.rb +108 -0
- data/lib/fog/azurerm/requests/storage/create_container.rb +12 -10
- data/lib/fog/azurerm/requests/storage/create_disk.rb +45 -19
- data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +2 -2
- data/lib/fog/azurerm/requests/storage/create_page_blob.rb +31 -0
- data/lib/fog/azurerm/requests/storage/create_storage_account.rb +2 -2
- data/lib/fog/azurerm/requests/storage/delete_blob.rb +10 -5
- data/lib/fog/azurerm/requests/storage/delete_container.rb +6 -2
- data/lib/fog/azurerm/requests/storage/delete_disk.rb +19 -16
- data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +2 -2
- data/lib/fog/azurerm/requests/storage/get_backup_container.rb +2 -2
- data/lib/fog/azurerm/requests/storage/get_backup_item.rb +2 -2
- data/lib/fog/azurerm/requests/storage/get_backup_job_for_vm.rb +1 -1
- data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +2 -2
- data/lib/fog/azurerm/requests/storage/get_blob.rb +163 -0
- data/lib/fog/azurerm/requests/storage/get_blob_http_url.rb +39 -0
- data/lib/fog/azurerm/requests/storage/get_blob_https_url.rb +39 -0
- data/lib/fog/azurerm/requests/storage/get_blob_properties.rb +37 -35
- data/lib/fog/azurerm/requests/storage/get_blob_url.rb +28 -0
- data/lib/fog/azurerm/requests/storage/get_container_acl.rb +30 -0
- data/lib/fog/azurerm/requests/storage/get_container_properties.rb +16 -12
- data/lib/fog/azurerm/requests/storage/get_container_url.rb +34 -0
- data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +2 -2
- data/lib/fog/azurerm/requests/storage/get_storage_access_keys.rb +4 -3
- data/lib/fog/azurerm/requests/storage/get_storage_account.rb +2 -2
- data/lib/fog/azurerm/requests/storage/list_blobs.rb +110 -24
- data/lib/fog/azurerm/requests/storage/list_containers.rb +46 -23
- data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +2 -2
- data/lib/fog/azurerm/requests/storage/list_storage_account_for_rg.rb +2 -2
- data/lib/fog/azurerm/requests/storage/list_storage_accounts.rb +2 -2
- data/lib/fog/azurerm/requests/storage/multipart_save_block_blob.rb +110 -0
- data/lib/fog/azurerm/requests/storage/put_blob_block.rb +30 -0
- data/lib/fog/azurerm/requests/storage/{set_blob_metadata.rb → put_blob_metadata.rb} +7 -3
- data/lib/fog/azurerm/requests/storage/put_blob_pages.rb +30 -0
- data/lib/fog/azurerm/requests/storage/put_blob_properties.rb +31 -0
- data/lib/fog/azurerm/requests/storage/put_container_acl.rb +31 -0
- data/lib/fog/azurerm/requests/storage/{set_container_metadata.rb → put_container_metadata.rb} +7 -3
- data/lib/fog/azurerm/requests/storage/release_blob_lease.rb +4 -1
- data/lib/fog/azurerm/requests/storage/release_container_lease.rb +4 -1
- data/lib/fog/azurerm/requests/storage/save_page_blob.rb +111 -0
- data/lib/fog/azurerm/requests/storage/start_backup.rb +1 -1
- data/lib/fog/azurerm/requests/storage/wait_blob_copy_operation_to_finish.rb +56 -0
- data/lib/fog/azurerm/resources.rb +2 -2
- data/lib/fog/azurerm/storage.rb +33 -19
- data/lib/fog/azurerm/traffic_manager.rb +1 -1
- data/lib/fog/azurerm/utilities/general.rb +70 -3
- data/lib/fog/azurerm/version.rb +1 -1
- data/rake-script.sh +5 -2
- data/test/api_stub/models/application_gateway/gateway.rb +1 -1
- data/test/api_stub/models/compute/server.rb +1 -1
- data/test/api_stub/models/dns/record_set.rb +2 -2
- data/test/api_stub/models/dns/zone.rb +1 -1
- data/test/api_stub/models/network/express_route_circuit.rb +1 -1
- data/test/api_stub/models/network/express_route_circuit_authorization.rb +1 -1
- data/test/api_stub/models/network/express_route_circuit_peering.rb +1 -1
- data/test/api_stub/models/network/express_route_service_provider.rb +1 -1
- data/test/api_stub/models/network/load_balancer.rb +1 -1
- data/test/api_stub/models/network/network_interface.rb +1 -1
- data/test/api_stub/models/network/network_security_group.rb +1 -1
- data/test/api_stub/models/network/network_security_rule.rb +1 -1
- data/test/api_stub/models/network/public_ip.rb +1 -1
- data/test/api_stub/models/network/subnet.rb +1 -1
- data/test/api_stub/models/network/virtual_network.rb +1 -1
- data/test/api_stub/models/network/virtual_network_gateway.rb +1 -1
- data/test/api_stub/models/network/virtual_network_gateway_connection.rb +1 -1
- data/test/api_stub/models/resources/resource.rb +2 -2
- data/test/api_stub/models/resources/resource_group.rb +1 -1
- data/test/api_stub/models/storage/directory.rb +148 -62
- data/test/api_stub/models/storage/file.rb +122 -119
- data/test/api_stub/models/traffic_manager/traffic_manager_end_point.rb +1 -1
- data/test/api_stub/models/traffic_manager/traffic_manager_profile.rb +1 -1
- data/test/api_stub/requests/application_gateway/gateway.rb +2 -2
- data/test/api_stub/requests/compute/availability_set.rb +3 -3
- data/test/api_stub/requests/compute/virtual_machine.rb +9 -9
- data/test/api_stub/requests/dns/record_set.rb +3 -3
- data/test/api_stub/requests/dns/zone.rb +18 -18
- data/test/api_stub/requests/network/express_route_circuit.rb +2 -2
- data/test/api_stub/requests/network/express_route_circuit_authorization.rb +1 -1
- data/test/api_stub/requests/network/express_route_circuit_peering.rb +2 -2
- data/test/api_stub/requests/network/express_route_service_provider.rb +1 -1
- data/test/api_stub/requests/network/load_balancer.rb +2 -2
- data/test/api_stub/requests/network/network_interface.rb +4 -4
- data/test/api_stub/requests/network/network_security_group.rb +3 -3
- data/test/api_stub/requests/network/network_security_rule.rb +2 -2
- data/test/api_stub/requests/network/public_ip.rb +2 -2
- data/test/api_stub/requests/network/subnet.rb +2 -2
- data/test/api_stub/requests/network/virtual_network.rb +2 -2
- data/test/api_stub/requests/network/virtual_network_gateway.rb +2 -2
- data/test/api_stub/requests/network/virtual_network_gateway_connection.rb +3 -3
- data/test/api_stub/requests/resources/resource.rb +2 -2
- data/test/api_stub/requests/resources/resource_group.rb +2 -2
- data/test/api_stub/requests/storage/directory.rb +59 -65
- data/test/api_stub/requests/storage/file.rb +183 -113
- data/test/api_stub/requests/storage/storageaccount.rb +1 -1
- data/test/api_stub/requests/traffic_manager/traffic_manager_endpoint.rb +1 -1
- data/test/api_stub/requests/traffic_manager/traffic_manager_profile.rb +2 -2
- data/test/integration/Virtual_network_gateway_connection.rb +189 -182
- data/test/integration/application_gateway.rb +208 -183
- data/test/integration/availability_set.rb +44 -27
- data/test/integration/blob.rb +293 -169
- data/test/integration/container.rb +93 -42
- data/test/integration/data_disk.rb +57 -46
- data/test/integration/deployment.rb +40 -32
- data/test/integration/express_route_circuit.rb +86 -82
- data/test/integration/external_load_balancer.rb +108 -100
- data/test/integration/internal_load_balancer.rb +115 -106
- data/test/integration/local_network_gateway.rb +46 -39
- data/test/integration/network_interface.rb +119 -107
- data/test/integration/network_security_group.rb +86 -74
- data/test/integration/network_security_rule.rb +65 -57
- data/test/integration/public_ip.rb +50 -42
- data/test/integration/record_set.rb +90 -78
- data/test/integration/resource_group.rb +26 -14
- data/test/integration/resource_tag.rb +56 -45
- data/test/integration/server.rb +152 -135
- data/test/integration/server_custom_image.rb +85 -76
- data/test/integration/sql_server.rb +130 -117
- data/test/integration/storage_account.rb +82 -70
- data/test/integration/subnet.rb +87 -74
- data/test/integration/traffic_manager.rb +86 -74
- data/test/integration/virtual_machine_extension.rb +115 -106
- data/test/integration/virtual_network.rb +121 -100
- data/test/integration/virtual_network_gateway.rb +86 -79
- data/test/integration/virtual_network_gateway_connection_to_express_route.rb +94 -87
- data/test/integration/zone.rb +36 -28
- data/test/models/storage/test_directories.rb +26 -71
- data/test/models/storage/test_directory.rb +111 -58
- data/test/models/storage/test_file.rb +179 -143
- data/test/models/storage/test_files.rb +197 -30
- data/test/models/storage/test_storage_account.rb +1 -1
- data/test/requests/compute/test_attach_data_disk_to_vm.rb +15 -17
- data/test/requests/storage/test_acquire_blob_lease.rb +23 -4
- data/test/requests/storage/test_acquire_container_lease.rb +24 -5
- data/test/requests/storage/test_commit_blob_blocks.rb +34 -0
- data/test/requests/storage/test_compare_container_blobs.rb +36 -0
- data/test/requests/storage/test_copy_blob.rb +22 -3
- data/test/requests/storage/test_copy_blob_from_uri.rb +23 -4
- data/test/requests/storage/test_create_block_blob.rb +80 -0
- data/test/requests/storage/test_create_container.rb +18 -13
- data/test/requests/storage/test_create_disk.rb +57 -4
- data/test/requests/storage/test_create_page_blob.rb +34 -0
- data/test/requests/storage/test_delete_blob.rb +25 -5
- data/test/requests/storage/test_delete_container.rb +21 -9
- data/test/requests/storage/test_delete_disk.rb +14 -7
- data/test/requests/storage/test_get_blob.rb +141 -0
- data/test/requests/storage/test_get_blob_http_url.rb +30 -0
- data/test/requests/storage/test_get_blob_https_url.rb +30 -0
- data/test/requests/storage/test_get_blob_properties.rb +29 -7
- data/test/requests/storage/test_get_blob_url.rb +33 -0
- data/test/requests/storage/test_get_container_acl.rb +37 -0
- data/test/requests/storage/test_get_container_properties.rb +25 -11
- data/test/requests/storage/test_get_container_url.rb +33 -0
- data/test/requests/storage/test_list_blobs.rb +77 -0
- data/test/requests/storage/test_list_containers.rb +38 -7
- data/test/requests/storage/test_multipart_save_block_blob.rb +105 -0
- data/test/requests/storage/test_put_blob_block.rb +34 -0
- data/test/requests/storage/test_put_blob_metadata.rb +36 -0
- data/test/requests/storage/test_put_blob_pages.rb +34 -0
- data/test/requests/storage/test_put_blob_properties.rb +39 -0
- data/test/requests/storage/test_put_container_acl.rb +34 -0
- data/test/requests/storage/test_put_container_metadata.rb +36 -0
- data/test/requests/storage/test_release_blob_lease.rb +20 -2
- data/test/requests/storage/test_release_container_lease.rb +21 -3
- data/test/requests/storage/test_save_page_blob.rb +115 -0
- data/test/requests/storage/test_wait_blob_copy_operation_to_finish.rb +148 -0
- data/test/test_helper.rb +34 -21
- metadata +92 -46
- data/lib/fog/azurerm/requests/storage/check_blob_exist.rb +0 -25
- data/lib/fog/azurerm/requests/storage/compare_blob.rb +0 -73
- data/lib/fog/azurerm/requests/storage/download_blob_to_file.rb +0 -56
- data/lib/fog/azurerm/requests/storage/get_blob_metadata.rb +0 -59
- data/lib/fog/azurerm/requests/storage/get_container_access_control_list.rb +0 -30
- data/lib/fog/azurerm/requests/storage/get_container_metadata.rb +0 -32
- data/lib/fog/azurerm/requests/storage/set_blob_properties.rb +0 -26
- data/lib/fog/azurerm/requests/storage/upload_block_blob_from_file.rb +0 -60
- data/test/requests/storage/test_check_blob_exist.rb +0 -17
- data/test/requests/storage/test_compare_blob.rb +0 -17
- data/test/requests/storage/test_download_blob_to_file.rb +0 -25
- data/test/requests/storage/test_get_blob_metadata.rb +0 -18
- data/test/requests/storage/test_get_container_access_control_list.rb +0 -31
- data/test/requests/storage/test_get_container_metadata.rb +0 -18
- data/test/requests/storage/test_list_blobs_in_container.rb +0 -23
- data/test/requests/storage/test_set_blob_metadata.rb +0 -17
- data/test/requests/storage/test_set_blob_properties.rb +0 -16
- data/test/requests/storage/test_set_container_metadata.rb +0 -17
- data/test/requests/storage/test_upload_block_blob_from_file.rb +0 -23
@@ -2,35 +2,134 @@ module ApiStub
|
|
2
2
|
module Requests
|
3
3
|
module Storage
|
4
4
|
# Mock class for Deployment Requests
|
5
|
+
# Below data should be as same as those in Mock classes in lib/fog/azurerm/requests/storage/*.rb
|
5
6
|
class File
|
6
|
-
def self.
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
def self.blob
|
8
|
+
{
|
9
|
+
'name' => 'test_blob',
|
10
|
+
'metadata' => {},
|
11
|
+
'properties' => {
|
12
|
+
'last_modified' => 'Mon, 04 Jul 2016 09:30:31 GMT',
|
13
|
+
'etag' => '0x8D3A3EDD7C2B777',
|
14
|
+
'lease_status' => 'unlocked',
|
15
|
+
'lease_state' => 'available',
|
16
|
+
'lease_duration' => nil,
|
17
|
+
'content_length' => 4_194_304,
|
18
|
+
'content_type' => 'application/octet-stream',
|
19
|
+
'content_encoding' => nil,
|
20
|
+
'content_language' => nil,
|
21
|
+
'content_disposition' => nil,
|
22
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
23
|
+
'cache_control' => nil,
|
24
|
+
'sequence_number' => 0,
|
25
|
+
'blob_type' => 'PageBlob',
|
26
|
+
'copy_id' => '095adc3b-e277-4c3d-97e0-0abca881f60c',
|
27
|
+
'copy_status' => 'success',
|
28
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/testblob/4m?snapshot=2016-02-04T08%3A35%3A50.3157696Z',
|
29
|
+
'copy_progress' => '4194304/4194304',
|
30
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:35:52 GMT',
|
31
|
+
'copy_status_description' => nil,
|
32
|
+
'accept_ranges' => 0
|
33
|
+
}
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.blob_https_url
|
38
|
+
'https://sa.blob.core.windows.net/test_container/test_blob'
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.blob_url_token
|
42
|
+
'token'
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.blob_lease_id
|
46
|
+
{
|
47
|
+
'leaseId' => 'abc123'
|
48
|
+
}
|
11
49
|
end
|
12
50
|
|
13
|
-
def self.
|
51
|
+
def self.blob_metadata
|
14
52
|
{
|
15
|
-
'
|
16
|
-
'
|
17
|
-
'category' => '
|
18
|
-
'
|
53
|
+
'created-by' => 'User',
|
54
|
+
'source-machine' => 'Test-machine',
|
55
|
+
'category' => 'guidance',
|
56
|
+
'doctype' => 'textDocuments'
|
19
57
|
}
|
20
58
|
end
|
21
59
|
|
22
|
-
def self.
|
60
|
+
def self.blob_copy_result
|
61
|
+
# copy_id, copy_status
|
62
|
+
%w(abc123 pending)
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.block_blob
|
23
66
|
{
|
24
|
-
'name' => '
|
25
|
-
'snapshot' => nil,
|
67
|
+
'name' => 'test_blob',
|
26
68
|
'metadata' => {},
|
27
|
-
'properties' =>
|
28
|
-
|
29
|
-
|
30
|
-
|
69
|
+
'properties' => {
|
70
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
71
|
+
'etag' => '0x8D3A3B5F017F52D',
|
72
|
+
'lease_status' => 'unlocked',
|
73
|
+
'lease_state' => 'available',
|
74
|
+
'content_length' => 4_194_304,
|
75
|
+
'content_type' => 'application/octet-stream',
|
76
|
+
'content_encoding' => nil,
|
77
|
+
'content_language' => nil,
|
78
|
+
'content_disposition' => nil,
|
79
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
80
|
+
'cache_control' => nil,
|
81
|
+
'sequence_number' => 0,
|
82
|
+
'blob_type' => 'BlockBlob',
|
83
|
+
'copy_id' => '095adc3b-e277-4c3d-97e0-0abca881f60c',
|
84
|
+
'copy_status' => 'success',
|
85
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/test_container/test_blob?snapshot=2016-02-04T08%3A35%3A50.3256874Z',
|
86
|
+
'copy_progress' => '4194304/4194304',
|
87
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:35:52 GMT',
|
88
|
+
'copy_status_description' => nil,
|
89
|
+
'accept_ranges' => 0
|
90
|
+
}
|
91
|
+
}
|
92
|
+
end
|
93
|
+
|
94
|
+
def self.emtpy_block_blob
|
95
|
+
{
|
96
|
+
'name' => 'test_blob',
|
97
|
+
'metadata' => {},
|
98
|
+
'properties' => {
|
99
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
100
|
+
'etag' => '0x8D3A3B5F017F52D',
|
101
|
+
'lease_status' => nil,
|
102
|
+
'lease_state' => nil,
|
103
|
+
'content_length' => 0,
|
104
|
+
'content_type' => 'application/octet-stream',
|
105
|
+
'content_encoding' => nil,
|
106
|
+
'content_language' => nil,
|
107
|
+
'content_disposition' => nil,
|
108
|
+
'content_md5' => nil,
|
109
|
+
'cache_control' => nil,
|
110
|
+
'sequence_number' => 0,
|
111
|
+
'blob_type' => 'BlockBlob',
|
112
|
+
'copy_id' => nil,
|
113
|
+
'copy_status' => nil,
|
114
|
+
'copy_source' => nil,
|
115
|
+
'copy_progress' => nil,
|
116
|
+
'copy_completion_time' => nil,
|
117
|
+
'copy_status_description' => nil,
|
118
|
+
'accept_ranges' => 0
|
119
|
+
}
|
120
|
+
}
|
121
|
+
end
|
122
|
+
|
123
|
+
def self.blob_list
|
124
|
+
[
|
125
|
+
{
|
126
|
+
'name' => 'test_blob1',
|
127
|
+
'metadata' => {},
|
128
|
+
'properties' => {
|
129
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
130
|
+
'etag' => '0x8D3A3B5F017F52D',
|
31
131
|
'lease_status' => 'unlocked',
|
32
132
|
'lease_state' => 'available',
|
33
|
-
'lease_duration' => nil,
|
34
133
|
'content_length' => 4_194_304,
|
35
134
|
'content_type' => 'application/octet-stream',
|
36
135
|
'content_encoding' => nil,
|
@@ -42,119 +141,90 @@ module ApiStub
|
|
42
141
|
'blob_type' => 'PageBlob',
|
43
142
|
'copy_id' => '095adc3b-e277-4c3d-97e0-0abca881f60c',
|
44
143
|
'copy_status' => 'success',
|
45
|
-
'copy_source' => 'https://testaccount.blob.core.windows.net/
|
144
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/test_container/test_blob?snapshot=2016-02-04T08%3A35%3A50.3256874Z',
|
46
145
|
'copy_progress' => '4194304/4194304',
|
47
146
|
'copy_completion_time' => 'Thu, 04 Feb 2016 08:35:52 GMT',
|
48
147
|
'copy_status_description' => nil,
|
49
148
|
'accept_ranges' => 0
|
50
149
|
}
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
{
|
59
|
-
'last_modified' => 'Thu, 28 Jul 2016 06:53:05 GMT',
|
60
|
-
'etag' => '0x8D3B6B3D353FFCA',
|
61
|
-
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw=='
|
62
|
-
}
|
63
|
-
}
|
64
|
-
end
|
65
|
-
|
66
|
-
def self.download_blob_to_file
|
67
|
-
{
|
68
|
-
'name' => 'testblob1',
|
69
|
-
'metadata' => {},
|
70
|
-
'properties' =>
|
71
|
-
{
|
72
|
-
'last_modified' => 'Thu, 28 Jul 2016 06:53:05 GMT',
|
73
|
-
'etag' => '0x8D3B6B3D353FFCA',
|
150
|
+
},
|
151
|
+
{
|
152
|
+
'name' => 'test_blob2',
|
153
|
+
'metadata' => {},
|
154
|
+
'properties' => {
|
155
|
+
'last_modified' => 'Tue, 04 Aug 2015 06:02:08 GMT',
|
156
|
+
'etag' => '0x8D29C92173526C8',
|
74
157
|
'lease_status' => 'unlocked',
|
75
158
|
'lease_state' => 'available',
|
76
|
-
'lease_duration' => nil,
|
77
159
|
'content_length' => 4_194_304,
|
78
|
-
'content_type' => 'application/
|
79
|
-
'content_encoding' =>
|
160
|
+
'content_type' => 'application/octet-stream',
|
161
|
+
'content_encoding' => nil,
|
80
162
|
'content_language' => nil,
|
81
163
|
'content_disposition' => nil,
|
82
164
|
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
83
165
|
'cache_control' => nil,
|
84
|
-
'
|
85
|
-
'
|
86
|
-
'
|
87
|
-
'
|
88
|
-
'
|
89
|
-
'
|
166
|
+
'sequence_number' => 0,
|
167
|
+
'blob_type' => 'PageBlob',
|
168
|
+
'copy_id' => '0abcdc3b-4c3d-e277-97e0-0abca881f60c',
|
169
|
+
'copy_status' => 'success',
|
170
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/test_container/test_blob?snapshot=2016-02-04T08%3A35%3A55.3157696Z',
|
171
|
+
'copy_progress' => '4194304/4194304',
|
172
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:40:52 GMT',
|
90
173
|
'copy_status_description' => nil,
|
91
174
|
'accept_ranges' => 0
|
92
175
|
}
|
93
|
-
|
94
|
-
end
|
95
|
-
|
96
|
-
def self.copy_blob
|
97
|
-
{
|
98
|
-
'copyId' => 'abc123',
|
99
|
-
'copyStatus' => 'pending'
|
100
|
-
}
|
101
|
-
end
|
102
|
-
|
103
|
-
def self.list_blobs_response
|
104
|
-
[
|
176
|
+
},
|
105
177
|
{
|
106
|
-
'name' => '
|
107
|
-
'
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
'metadata' => {}
|
178
|
+
'name' => 'test_blob3',
|
179
|
+
'metadata' => {},
|
180
|
+
'properties' => {
|
181
|
+
'last_modified' => 'Tue, 04 Aug 2015 06:02:08 GMT',
|
182
|
+
'etag' => '0x8D29C92173526C8',
|
183
|
+
'lease_status' => 'unlocked',
|
184
|
+
'lease_state' => 'available',
|
185
|
+
'content_length' => 4_194_304,
|
186
|
+
'content_type' => 'application/octet-stream',
|
187
|
+
'content_encoding' => nil,
|
188
|
+
'content_language' => nil,
|
189
|
+
'content_disposition' => nil,
|
190
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
191
|
+
'cache_control' => nil,
|
192
|
+
'sequence_number' => 0,
|
193
|
+
'blob_type' => 'PageBlob',
|
194
|
+
'copy_id' => '0abcdc3b-4c3d-e277-97e0-0abca881f60c',
|
195
|
+
'copy_status' => 'success',
|
196
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/test_container/test_blob?snapshot=2016-02-04T08%3A35%3A55.3157696Z',
|
197
|
+
'copy_progress' => '4194304/4194304',
|
198
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:40:52 GMT',
|
199
|
+
'copy_status_description' => nil,
|
200
|
+
'accept_ranges' => 0
|
201
|
+
}
|
131
202
|
},
|
132
203
|
{
|
133
|
-
'name' => '
|
134
|
-
'
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
'metadata' => {}
|
204
|
+
'name' => 'test_blob4',
|
205
|
+
'metadata' => {},
|
206
|
+
'properties' => {
|
207
|
+
'last_modified' => 'Tue, 04 Aug 2015 06:02:08 GMT',
|
208
|
+
'etag' => '0x8D29C92173526C8',
|
209
|
+
'lease_status' => 'unlocked',
|
210
|
+
'lease_state' => 'available',
|
211
|
+
'content_length' => 4_194_304,
|
212
|
+
'content_type' => 'application/octet-stream',
|
213
|
+
'content_encoding' => nil,
|
214
|
+
'content_language' => nil,
|
215
|
+
'content_disposition' => nil,
|
216
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
217
|
+
'cache_control' => nil,
|
218
|
+
'sequence_number' => 0,
|
219
|
+
'blob_type' => 'PageBlob',
|
220
|
+
'copy_id' => '0abcdc3b-4c3d-e277-97e0-0abca881f60c',
|
221
|
+
'copy_status' => 'success',
|
222
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/test_container/test_blob?snapshot=2016-02-04T08%3A35%3A55.3157696Z',
|
223
|
+
'copy_progress' => '4194304/4194304',
|
224
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:40:52 GMT',
|
225
|
+
'copy_status_description' => nil,
|
226
|
+
'accept_ranges' => 0
|
227
|
+
}
|
158
228
|
}
|
159
229
|
]
|
160
230
|
end
|
@@ -114,7 +114,7 @@ module ApiStub
|
|
114
114
|
def self.list_keys_response
|
115
115
|
key1 = Azure::ARM::Storage::Models::StorageAccountKey.new
|
116
116
|
key1.key_name = 'key1'
|
117
|
-
key1.value = '
|
117
|
+
key1.value = 'YWNjZXNzLWtleQ=='
|
118
118
|
key1.permissions = 'Full'
|
119
119
|
storage_account_key_list = Azure::ARM::Storage::Models::StorageAccountListKeysResult.new
|
120
120
|
storage_account_key_list.keys = [key1]
|
@@ -18,7 +18,7 @@ module ApiStub
|
|
18
18
|
}
|
19
19
|
}'
|
20
20
|
endpoint_mapper = Azure::ARM::TrafficManager::Models::Endpoint.mapper
|
21
|
-
traffic_manager_client.deserialize(endpoint_mapper, JSON.
|
21
|
+
traffic_manager_client.deserialize(endpoint_mapper, Fog::JSON.decode(body), 'result.body')
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.endpoint_hash
|
@@ -66,7 +66,7 @@ module ApiStub
|
|
66
66
|
}
|
67
67
|
}'
|
68
68
|
profile_mapper = Azure::ARM::TrafficManager::Models::Profile.mapper
|
69
|
-
traffic_manager_client.deserialize(profile_mapper, JSON.
|
69
|
+
traffic_manager_client.deserialize(profile_mapper, Fog::JSON.decode(body), 'result.body')
|
70
70
|
end
|
71
71
|
|
72
72
|
def self.list_traffic_manager_profiles_response(traffic_manager_client)
|
@@ -134,7 +134,7 @@ module ApiStub
|
|
134
134
|
}]
|
135
135
|
}'
|
136
136
|
profile_mapper = Azure::ARM::TrafficManager::Models::ProfileListResult.mapper
|
137
|
-
traffic_manager_client.deserialize(profile_mapper, JSON.
|
137
|
+
traffic_manager_client.deserialize(profile_mapper, Fog::JSON.decode(body), 'result.body')
|
138
138
|
end
|
139
139
|
|
140
140
|
def self.profile_hash
|
@@ -26,187 +26,194 @@ network = Fog::Network::AzureRM.new(
|
|
26
26
|
###################### Prerequisites ######################
|
27
27
|
########################################################################################################################
|
28
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
|
-
location: 'eastus',
|
94
|
-
tags: {
|
95
|
-
key1: 'value1',
|
96
|
-
key2: 'value2'
|
97
|
-
},
|
98
|
-
ip_configurations: [
|
99
|
-
{
|
100
|
-
name: 'default',
|
101
|
-
private_ipallocation_method: 'Dynamic',
|
102
|
-
public_ipaddress_id: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-GC/providers/Microsoft.Network/publicIPAddresses/mypubip",
|
103
|
-
subnet_id: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-GC/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/GatewaySubnet",
|
104
|
-
private_ipaddress: nil
|
105
|
-
}
|
106
|
-
],
|
107
|
-
resource_group: 'TestRG-GC',
|
108
|
-
sku_name: 'Standard',
|
109
|
-
sku_tier: 'Standard',
|
110
|
-
sku_capacity: 2,
|
111
|
-
gateway_type: 'vpn',
|
112
|
-
enable_bgp: true,
|
113
|
-
gateway_size: nil,
|
114
|
-
asn: 100,
|
115
|
-
bgp_peering_address: nil,
|
116
|
-
peer_weight: 3,
|
117
|
-
vpn_type: 'RouteBased',
|
118
|
-
vpn_client_address_pool: [],
|
119
|
-
gateway_default_site: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-GC/providers/Microsoft.Network/localNetworkGateways/testlocalnetworkgateway"
|
120
|
-
)
|
121
|
-
|
122
|
-
network.virtual_network_gateways.create(
|
123
|
-
name: 'testnetworkgateway2',
|
124
|
-
location: 'eastus',
|
125
|
-
tags: {
|
126
|
-
key1: 'value1',
|
127
|
-
key2: 'value2'
|
128
|
-
},
|
129
|
-
ip_configurations: [
|
130
|
-
{
|
131
|
-
name: 'default',
|
132
|
-
private_ipallocation_method: 'Dynamic',
|
133
|
-
public_ipaddress_id: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-GC/providers/Microsoft.Network/publicIPAddresses/mypubip2",
|
134
|
-
subnet_id: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-GC/providers/Microsoft.Network/virtualNetworks/testVnet2/subnets/GatewaySubnet",
|
135
|
-
private_ipaddress: nil
|
136
|
-
}
|
137
|
-
],
|
138
|
-
resource_group: 'TestRG-GC',
|
139
|
-
sku_name: 'Standard',
|
140
|
-
sku_tier: 'Standard',
|
141
|
-
sku_capacity: 2,
|
142
|
-
gateway_type: 'vpn',
|
143
|
-
enable_bgp: true,
|
144
|
-
gateway_size: nil,
|
145
|
-
asn: 100,
|
146
|
-
bgp_peering_address: nil,
|
147
|
-
peer_weight: 3,
|
148
|
-
vpn_type: 'RouteBased',
|
149
|
-
vpn_client_address_pool: [],
|
150
|
-
gateway_default_site: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-GC/providers/Microsoft.Network/localNetworkGateways/testlocalnetworkgateway"
|
151
|
-
)
|
152
|
-
|
153
|
-
########################################################################################################################
|
154
|
-
###################### Create Virtual Network Gateway Connection ###########
|
155
|
-
########################################################################################################################
|
156
|
-
|
157
|
-
network.virtual_network_gateway_connections.create(
|
158
|
-
name: 'testnetworkgateway2-to-testnetworkgateway',
|
159
|
-
location: 'eastus',
|
160
|
-
resource_group: 'TestRG-GC',
|
161
|
-
virtual_network_gateway1: {
|
162
|
-
name: 'testnetworkgateway2',
|
163
|
-
resource_group: 'TestRG-GC'
|
164
|
-
},
|
165
|
-
virtual_network_gateway2: {
|
29
|
+
begin
|
30
|
+
resource_group = resource.resource_groups.create(
|
31
|
+
name: 'TestRG-GC',
|
32
|
+
location: LOCATION
|
33
|
+
)
|
34
|
+
|
35
|
+
network.virtual_networks.create(
|
36
|
+
name: 'testVnet',
|
37
|
+
location: LOCATION,
|
38
|
+
resource_group: 'TestRG-GC',
|
39
|
+
address_prefixes: %w(10.1.0.0/16 10.2.0.0/16)
|
40
|
+
)
|
41
|
+
|
42
|
+
network.virtual_networks.create(
|
43
|
+
name: 'testVnet2',
|
44
|
+
location: LOCATION,
|
45
|
+
resource_group: 'TestRG-GC',
|
46
|
+
address_prefixes: %w(10.3.0.0/16 10.4.0.0/16)
|
47
|
+
)
|
48
|
+
|
49
|
+
network.subnets.create(
|
50
|
+
name: 'GatewaySubnet',
|
51
|
+
resource_group: 'TestRG-GC',
|
52
|
+
virtual_network_name: 'testVnet',
|
53
|
+
address_prefix: '10.2.0.0/24'
|
54
|
+
)
|
55
|
+
|
56
|
+
network.subnets.create(
|
57
|
+
name: 'GatewaySubnet',
|
58
|
+
resource_group: 'TestRG-GC',
|
59
|
+
virtual_network_name: 'testVnet2',
|
60
|
+
address_prefix: '10.3.0.0/24'
|
61
|
+
)
|
62
|
+
|
63
|
+
network.public_ips.create(
|
64
|
+
name: 'mypubip',
|
65
|
+
resource_group: 'TestRG-GC',
|
66
|
+
location: LOCATION,
|
67
|
+
public_ip_allocation_method: 'Dynamic'
|
68
|
+
)
|
69
|
+
|
70
|
+
network.public_ips.create(
|
71
|
+
name: 'mypubip2',
|
72
|
+
resource_group: 'TestRG-GC',
|
73
|
+
location: LOCATION,
|
74
|
+
public_ip_allocation_method: 'Dynamic'
|
75
|
+
)
|
76
|
+
|
77
|
+
network.local_network_gateways.create(
|
78
|
+
name: 'testlocalnetworkgateway',
|
79
|
+
location: LOCATION,
|
80
|
+
tags: {
|
81
|
+
key1: 'value1',
|
82
|
+
key2: 'value2'
|
83
|
+
},
|
84
|
+
resource_group: 'TestRG-GC',
|
85
|
+
gateway_ip_address: '192.168.1.1',
|
86
|
+
local_network_address_space_prefixes: [],
|
87
|
+
asn: 100,
|
88
|
+
bgp_peering_address: '192.168.1.2',
|
89
|
+
peer_weight: 3
|
90
|
+
)
|
91
|
+
|
92
|
+
network.virtual_network_gateways.create(
|
166
93
|
name: 'testnetworkgateway',
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
94
|
+
location: LOCATION,
|
95
|
+
tags: {
|
96
|
+
key1: 'value1',
|
97
|
+
key2: 'value2'
|
98
|
+
},
|
99
|
+
ip_configurations: [
|
100
|
+
{
|
101
|
+
name: 'default',
|
102
|
+
private_ipallocation_method: 'Dynamic',
|
103
|
+
public_ipaddress_id: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-GC/providers/Microsoft.Network/publicIPAddresses/mypubip",
|
104
|
+
subnet_id: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-GC/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/GatewaySubnet",
|
105
|
+
private_ipaddress: nil
|
106
|
+
}
|
107
|
+
],
|
108
|
+
resource_group: 'TestRG-GC',
|
109
|
+
sku_name: 'Standard',
|
110
|
+
sku_tier: 'Standard',
|
111
|
+
sku_capacity: 2,
|
112
|
+
gateway_type: 'vpn',
|
113
|
+
enable_bgp: true,
|
114
|
+
gateway_size: nil,
|
115
|
+
asn: 100,
|
116
|
+
bgp_peering_address: nil,
|
117
|
+
peer_weight: 3,
|
118
|
+
vpn_type: 'RouteBased',
|
119
|
+
vpn_client_address_pool: [],
|
120
|
+
gateway_default_site: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-GC/providers/Microsoft.Network/localNetworkGateways/testlocalnetworkgateway"
|
121
|
+
)
|
122
|
+
|
123
|
+
network.virtual_network_gateways.create(
|
124
|
+
name: 'testnetworkgateway2',
|
125
|
+
location: LOCATION,
|
126
|
+
tags: {
|
127
|
+
key1: 'value1',
|
128
|
+
key2: 'value2'
|
129
|
+
},
|
130
|
+
ip_configurations: [
|
131
|
+
{
|
132
|
+
name: 'default',
|
133
|
+
private_ipallocation_method: 'Dynamic',
|
134
|
+
public_ipaddress_id: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-GC/providers/Microsoft.Network/publicIPAddresses/mypubip2",
|
135
|
+
subnet_id: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-GC/providers/Microsoft.Network/virtualNetworks/testVnet2/subnets/GatewaySubnet",
|
136
|
+
private_ipaddress: nil
|
137
|
+
}
|
138
|
+
],
|
139
|
+
resource_group: 'TestRG-GC',
|
140
|
+
sku_name: 'Standard',
|
141
|
+
sku_tier: 'Standard',
|
142
|
+
sku_capacity: 2,
|
143
|
+
gateway_type: 'vpn',
|
144
|
+
enable_bgp: true,
|
145
|
+
gateway_size: nil,
|
146
|
+
asn: 100,
|
147
|
+
bgp_peering_address: nil,
|
148
|
+
peer_weight: 3,
|
149
|
+
vpn_type: 'RouteBased',
|
150
|
+
vpn_client_address_pool: [],
|
151
|
+
gateway_default_site: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-GC/providers/Microsoft.Network/localNetworkGateways/testlocalnetworkgateway"
|
152
|
+
)
|
153
|
+
|
154
|
+
########################################################################################################################
|
155
|
+
###################### Create Virtual Network Gateway Connection ###########
|
156
|
+
########################################################################################################################
|
157
|
+
|
158
|
+
virtual_network_gateway_connection = network.virtual_network_gateway_connections.create(
|
159
|
+
name: 'testnetworkgateway2-to-testnetworkgateway',
|
160
|
+
location: LOCATION,
|
161
|
+
resource_group: 'TestRG-GC',
|
162
|
+
virtual_network_gateway1: {
|
163
|
+
name: 'testnetworkgateway2',
|
164
|
+
resource_group: 'TestRG-GC'
|
165
|
+
},
|
166
|
+
virtual_network_gateway2: {
|
167
|
+
name: 'testnetworkgateway',
|
168
|
+
resource_group: 'TestRG-GC'
|
169
|
+
},
|
170
|
+
connection_type: 'Vnet2Vnet'
|
171
|
+
)
|
172
|
+
puts "Created virtual network gateway connection: #{virtual_network_gateway_connection.name}"
|
173
|
+
|
174
|
+
########################################################################################################################
|
175
|
+
###################### List Virtual Network Gateway Connections ###########
|
176
|
+
########################################################################################################################
|
177
|
+
|
178
|
+
gateway_connections = network.virtual_network_gateway_connections(resource_group: 'TestRG-GC')
|
179
|
+
puts 'List virtual_network_gateway_connections:'
|
180
|
+
gateway_connections.each do |connection|
|
181
|
+
puts connection.name
|
182
|
+
end
|
183
|
+
|
184
|
+
########################################################################################################################
|
185
|
+
###################### Get Virtual Network Gateway Connection and CleanUp ###########
|
186
|
+
########################################################################################################################
|
187
|
+
|
188
|
+
gateway_connection = network.virtual_network_gateway_connections.get('TestRG-GC', 'testnetworkgateway2-to-testnetworkgateway')
|
189
|
+
puts "Get virtual network gateway connection: #{gateway_connection.name}"
|
190
|
+
|
191
|
+
puts "Deleted virtual network gateway connection: #{gateway_connection.destroy}"
|
192
|
+
|
193
|
+
network_gateway = network.virtual_network_gateways.get('TestRG-GC', 'testnetworkgateway')
|
194
|
+
network_gateway.destroy
|
195
|
+
|
196
|
+
network_gateway = network.virtual_network_gateways.get('TestRG-GC', 'testnetworkgateway2')
|
197
|
+
network_gateway.destroy
|
198
|
+
|
199
|
+
local_network_gateway = network.local_network_gateways.get('TestRG-GC', 'testlocalnetworkgateway')
|
200
|
+
local_network_gateway.destroy
|
201
|
+
|
202
|
+
pubip = network.public_ips.get('TestRG-GC', 'mypubip')
|
203
|
+
pubip.destroy
|
204
|
+
|
205
|
+
pubip = network.public_ips.get('TestRG-GC', 'mypubip2')
|
206
|
+
pubip.destroy
|
207
|
+
|
208
|
+
vnet = network.virtual_networks.get('TestRG-GC', 'testVnet')
|
209
|
+
vnet.destroy
|
210
|
+
|
211
|
+
vnet = network.virtual_networks.get('TestRG-GC', 'testVnet2')
|
212
|
+
vnet.destroy
|
213
|
+
|
214
|
+
resource_group = resource.resource_groups.get('TestRG-GC')
|
215
|
+
resource_group.destroy
|
216
|
+
rescue
|
217
|
+
puts 'Integration Test for virtual network gateway connection is failing'
|
218
|
+
resource_group.destroy unless resource_group.nil?
|
179
219
|
end
|
180
|
-
|
181
|
-
########################################################################################################################
|
182
|
-
###################### Get Virtual Network Gateway Connection and CleanUp ###########
|
183
|
-
########################################################################################################################
|
184
|
-
|
185
|
-
gateway_connection = network.virtual_network_gateway_connections.get('TestRG-GC', 'testnetworkgateway2-to-testnetworkgateway')
|
186
|
-
puts gateway_connection.name
|
187
|
-
|
188
|
-
gateway_connection.destroy
|
189
|
-
|
190
|
-
network_gateway = network.virtual_network_gateways.get('TestRG-GC', 'testnetworkgateway')
|
191
|
-
network_gateway.destroy
|
192
|
-
|
193
|
-
network_gateway = network.virtual_network_gateways.get('TestRG-GC', 'testnetworkgateway2')
|
194
|
-
network_gateway.destroy
|
195
|
-
|
196
|
-
local_network_gateway = network.local_network_gateways.get('TestRG-GC', 'testlocalnetworkgateway')
|
197
|
-
local_network_gateway.destroy
|
198
|
-
|
199
|
-
pubip = network.public_ips.get('TestRG-GC', 'mypubip')
|
200
|
-
pubip.destroy
|
201
|
-
|
202
|
-
pubip = network.public_ips.get('TestRG-GC', 'mypubip2')
|
203
|
-
pubip.destroy
|
204
|
-
|
205
|
-
vnet = network.virtual_networks.get('TestRG-GC', 'testVnet')
|
206
|
-
vnet.destroy
|
207
|
-
|
208
|
-
vnet = network.virtual_networks.get('TestRG-GC', 'testVnet2')
|
209
|
-
vnet.destroy
|
210
|
-
|
211
|
-
resource_group = resource.resource_groups.get('TestRG-GC')
|
212
|
-
resource_group.destroy
|