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
@@ -40,79 +40,88 @@ network = Fog::Network::AzureRM.new(
|
|
40
40
|
###################### Prerequisites ######################
|
41
41
|
########################################################################################################################
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
43
|
+
begin
|
44
|
+
resource_group = rs.resource_groups.create(
|
45
|
+
name: 'TestRG-VM',
|
46
|
+
location: LOCATION
|
47
|
+
)
|
48
|
+
|
49
|
+
storage_account_name = "fog#{get_time}storageac"
|
50
|
+
|
51
|
+
storage.storage_accounts.create(
|
52
|
+
name: storage_account_name,
|
53
|
+
location: LOCATION,
|
54
|
+
resource_group: 'TestRG-VM',
|
55
|
+
account_type: 'Standard',
|
56
|
+
replication: 'LRS'
|
57
|
+
)
|
58
|
+
|
59
|
+
network.virtual_networks.create(
|
60
|
+
name: 'testVnet',
|
61
|
+
location: LOCATION,
|
62
|
+
resource_group: 'TestRG-VM',
|
63
|
+
network_address_list: '10.1.0.0/16,10.2.0.0/16'
|
64
|
+
)
|
65
|
+
|
66
|
+
network.subnets.create(
|
67
|
+
name: 'mysubnet',
|
68
|
+
resource_group: 'TestRG-VM',
|
69
|
+
virtual_network_name: 'testVnet',
|
70
|
+
address_prefix: '10.2.0.0/24'
|
71
|
+
)
|
72
|
+
|
73
|
+
network.network_interfaces.create(
|
74
|
+
name: 'NetInt',
|
75
|
+
resource_group: 'TestRG-VM',
|
76
|
+
location: LOCATION,
|
77
|
+
subnet_id: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-VM/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/mysubnet",
|
78
|
+
ip_configuration_name: 'testIpConfiguration',
|
79
|
+
private_ip_allocation_method: 'Dynamic'
|
80
|
+
)
|
81
|
+
|
82
|
+
########################################################################################################################
|
83
|
+
###################### Create Server ######################
|
84
|
+
########################################################################################################################
|
85
|
+
|
86
|
+
custom_image_virtual_machine = compute.servers.create(
|
87
|
+
name: 'TestVM',
|
88
|
+
location: LOCATION,
|
89
|
+
resource_group: 'TestRG-VM',
|
90
|
+
vm_size: 'Basic_A0',
|
91
|
+
storage_account_name: storage_account_name,
|
92
|
+
username: 'testuser',
|
93
|
+
password: 'Confiz=123',
|
94
|
+
disable_password_authentication: false,
|
95
|
+
network_interface_card_id: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-VM/providers/Microsoft.Network/networkInterfaces/NetInt",
|
96
|
+
platform: 'linux',
|
97
|
+
vhd_path: 'https://custimagestorage.blob.core.windows.net/newcustomvhd/trusty-server-cloudimg-amd64-disk1-zeeshan.vhd'
|
98
|
+
)
|
99
|
+
puts "Created custom image virtual machine: #{custom_image_virtual_machine.name}"
|
100
|
+
|
101
|
+
########################################################################################################################
|
102
|
+
###################### Get and Delete Server ######################
|
103
|
+
########################################################################################################################
|
104
|
+
|
105
|
+
custom_image_virtual_machine = compute.servers.get('TestRG-VM', 'TestVM')
|
106
|
+
puts "Get custom image virtual machine: #{custom_image_virtual_machine.name}"
|
107
|
+
puts "Deleted custom image virtual machine: #{custom_image_virtual_machine.destroy}"
|
108
|
+
|
109
|
+
########################################################################################################################
|
110
|
+
###################### CleanUp ######################
|
111
|
+
########################################################################################################################
|
112
|
+
|
113
|
+
nic = network.network_interfaces.get('TestRG-VM', 'NetInt')
|
114
|
+
nic.destroy
|
115
|
+
|
116
|
+
vnet = network.virtual_networks.get('TestRG-VM', 'testVnet')
|
117
|
+
vnet.destroy
|
118
|
+
|
119
|
+
storage = storage.storage_accounts.get('TestRG-VM', storage_account_name)
|
120
|
+
storage.destroy
|
121
|
+
|
122
|
+
resource_group = rs.resource_groups.get('TestRG-VM')
|
123
|
+
resource_group.destroy
|
124
|
+
rescue
|
125
|
+
puts 'Integration Test for custom image virtual machine is failing'
|
126
|
+
resource_group.destroy unless resource_group.nil?
|
127
|
+
end
|
@@ -26,121 +26,134 @@ azure_sql_service = Fog::Sql::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
|
-
|
29
|
+
begin
|
30
|
+
resource_group = resources.resource_groups.create(
|
31
|
+
name: 'TestRG-SQL',
|
32
|
+
location: LOCATION
|
33
|
+
)
|
34
|
+
|
35
|
+
########################################################################################################################
|
36
|
+
###################### Create Sql Server ######################
|
37
|
+
########################################################################################################################
|
38
|
+
|
39
|
+
server_name = rand(0...999_99)
|
40
|
+
|
41
|
+
sql_server = azure_sql_service.sql_servers.create(
|
42
|
+
name: server_name,
|
43
|
+
resource_group: 'TestRG-SQL',
|
44
|
+
location: LOCATION,
|
45
|
+
version: '2.0',
|
46
|
+
administrator_login: 'testserveradmin',
|
47
|
+
administrator_login_password: 'db@admin=123'
|
48
|
+
)
|
49
|
+
puts "Created sql server: #{sql_server.name}"
|
50
|
+
|
51
|
+
########################################################################################################################
|
52
|
+
###################### Create Sql Database ######################
|
53
|
+
########################################################################################################################
|
54
|
+
database_name = rand(0...999_99)
|
55
|
+
|
56
|
+
sql_database = azure_sql_service.sql_databases.create(
|
57
|
+
resource_group: 'TestRG-SQL',
|
58
|
+
location: LOCATION,
|
59
|
+
server_name: server_name,
|
60
|
+
name: database_name
|
61
|
+
)
|
62
|
+
puts "Created sql database: #{sql_database.name}"
|
63
|
+
|
64
|
+
########################################################################################################################
|
65
|
+
###################### Get Sql Database ######################
|
66
|
+
########################################################################################################################
|
67
|
+
|
68
|
+
sleep 60
|
69
|
+
database = azure_sql_service.sql_databases.get('TestRG-SQL', server_name, database_name)
|
70
|
+
puts "Get sql database: #{database.name}"
|
71
|
+
|
72
|
+
########################################################################################################################
|
73
|
+
###################### List Sql Database ######################
|
74
|
+
########################################################################################################################
|
75
|
+
|
76
|
+
databases = azure_sql_service.sql_databases(resource_group: 'TestRG-SQL', server_name: server_name)
|
77
|
+
puts 'List databases:'
|
78
|
+
databases.each do |a_database|
|
79
|
+
puts a_database.name
|
80
|
+
end
|
81
|
+
|
82
|
+
########################################################################################################################
|
83
|
+
###################### Get and Destroy Sql Database ######################
|
84
|
+
########################################################################################################################
|
85
|
+
|
86
|
+
database = azure_sql_service.sql_databases.get('TestRG-SQL', server_name, database_name)
|
87
|
+
puts "Deleted sql database: #{database.destroy}"
|
88
|
+
|
89
|
+
########################################################################################################################
|
90
|
+
###################### Create Sql Firewall Rule ######################
|
91
|
+
########################################################################################################################
|
92
|
+
|
93
|
+
firewall_rule = azure_sql_service.firewall_rules.create(
|
94
|
+
resource_group: 'TestRG-SQL',
|
95
|
+
server_name: server_name,
|
96
|
+
name: 'test-rule-name',
|
97
|
+
start_ip: '10.10.10.10',
|
98
|
+
end_ip: '10.10.10.11'
|
99
|
+
)
|
100
|
+
puts "Created firewall rule: #{firewall_rule.name}"
|
101
|
+
|
102
|
+
########################################################################################################################
|
103
|
+
###################### Get Sql Firewall Rule ######################
|
104
|
+
########################################################################################################################
|
105
|
+
|
106
|
+
firewall_rule = azure_sql_service.firewall_rules.get('TestRG-SQL', server_name, 'test-rule-name')
|
107
|
+
puts "Get Firewall Rule: #{firewall_rule.name}"
|
108
|
+
|
109
|
+
########################################################################################################################
|
110
|
+
###################### List Sql Firewall Rules ######################
|
111
|
+
########################################################################################################################
|
112
|
+
|
113
|
+
firewall_rules = azure_sql_service.firewall_rules(resource_group: 'TestRG-SQL', server_name: server_name, name: 'test-rule-name')
|
114
|
+
puts 'List firewall rules:'
|
115
|
+
firewall_rules.each do |a_firewall_rule|
|
116
|
+
puts a_firewall_rule.name
|
117
|
+
end
|
118
|
+
|
119
|
+
########################################################################################################################
|
120
|
+
###################### Get and Destroy Sql Firewall Rule ######################
|
121
|
+
########################################################################################################################
|
122
|
+
|
123
|
+
firewall_rule = azure_sql_service.firewall_rules.get('TestRG-SQL', server_name, 'test-rule-name')
|
124
|
+
puts "Deleted firewall rule: #{firewall_rule.destroy}"
|
125
|
+
|
126
|
+
########################################################################################################################
|
127
|
+
###################### Get Sql Server ######################
|
128
|
+
########################################################################################################################
|
129
|
+
|
130
|
+
server = azure_sql_service.sql_servers.get('TestRG-SQL', server_name)
|
131
|
+
puts "Get sql server: #{server.name}"
|
132
|
+
|
133
|
+
########################################################################################################################
|
134
|
+
###################### List Sql Servers ######################
|
135
|
+
########################################################################################################################
|
136
|
+
|
137
|
+
servers = azure_sql_service.sql_servers(resource_group: 'TestRG-SQL')
|
138
|
+
puts 'List sql servers:'
|
139
|
+
servers.each do |a_server|
|
140
|
+
puts a_server.name
|
141
|
+
end
|
142
|
+
|
143
|
+
########################################################################################################################
|
144
|
+
###################### Get and Destroy Sql Servers ######################
|
145
|
+
########################################################################################################################
|
146
|
+
|
147
|
+
server = azure_sql_service.sql_servers.get('TestRG-SQL', server_name)
|
148
|
+
puts "Deleted sql server: #{server.destroy}"
|
149
|
+
|
150
|
+
########################################################################################################################
|
151
|
+
###################### CleanUp ######################
|
152
|
+
########################################################################################################################
|
153
|
+
|
154
|
+
resource_group = resources.resource_groups.get('TestRG-SQL')
|
155
|
+
resource_group.destroy
|
156
|
+
rescue
|
157
|
+
puts 'Integration Test for sql server is failing'
|
158
|
+
resource_group.destroy unless resource_group.nil?
|
74
159
|
end
|
75
|
-
|
76
|
-
########################################################################################################################
|
77
|
-
###################### Get and Destroy Sql Database ######################
|
78
|
-
########################################################################################################################
|
79
|
-
|
80
|
-
database = azure_sql_service.sql_databases.get('TestRG-SQL', server_name, database_name)
|
81
|
-
database.destroy
|
82
|
-
|
83
|
-
########################################################################################################################
|
84
|
-
###################### Create Sql Firewall Rule ######################
|
85
|
-
########################################################################################################################
|
86
|
-
|
87
|
-
azure_sql_service.firewall_rules.create(
|
88
|
-
resource_group: 'TestRG-SQL',
|
89
|
-
server_name: server_name,
|
90
|
-
name: 'test-rule-name',
|
91
|
-
start_ip: '10.10.10.10',
|
92
|
-
end_ip: '10.10.10.11'
|
93
|
-
)
|
94
|
-
|
95
|
-
########################################################################################################################
|
96
|
-
###################### Get Sql Firewall Rule ######################
|
97
|
-
########################################################################################################################
|
98
|
-
|
99
|
-
firewall_rule = azure_sql_service.firewall_rules.get('TestRG-SQL', server_name, 'test-rule-name')
|
100
|
-
Fog::Logger.debug "GET Firewall Rule: #{firewall_rule.name}"
|
101
|
-
|
102
|
-
########################################################################################################################
|
103
|
-
###################### List Sql Firewall Rules ######################
|
104
|
-
########################################################################################################################
|
105
|
-
|
106
|
-
firewall_rules = azure_sql_service.firewall_rules(resource_group: 'TestRG-SQL', server_name: server_name, name: 'test-rule-name')
|
107
|
-
firewall_rules.each do |a_firewall_rule|
|
108
|
-
Fog::Logger.debug "List Firewall Rule: #{a_firewall_rule.name}"
|
109
|
-
end
|
110
|
-
|
111
|
-
########################################################################################################################
|
112
|
-
###################### Get and Destroy Sql Firewall Rule ######################
|
113
|
-
########################################################################################################################
|
114
|
-
|
115
|
-
firewall_rule = azure_sql_service.firewall_rules.get('TestRG-SQL', server_name, 'test-rule-name')
|
116
|
-
firewall_rule.destroy
|
117
|
-
|
118
|
-
########################################################################################################################
|
119
|
-
###################### Get Sql Server ######################
|
120
|
-
########################################################################################################################
|
121
|
-
|
122
|
-
server = azure_sql_service.sql_servers.get('TestRG-SQL', server_name)
|
123
|
-
Fog::Logger.debug "GET Server: #{server.name}"
|
124
|
-
|
125
|
-
########################################################################################################################
|
126
|
-
###################### List Sql Servers ######################
|
127
|
-
########################################################################################################################
|
128
|
-
|
129
|
-
servers = azure_sql_service.sql_servers(resource_group: 'TestRG-SQL')
|
130
|
-
servers.each do |a_server|
|
131
|
-
Fog::Logger.debug "List Serves : #{a_server.name}"
|
132
|
-
end
|
133
|
-
|
134
|
-
########################################################################################################################
|
135
|
-
###################### Get and Destroy Sql Servers ######################
|
136
|
-
########################################################################################################################
|
137
|
-
|
138
|
-
server = azure_sql_service.sql_servers.get('TestRG-SQL', server_name)
|
139
|
-
server.destroy
|
140
|
-
|
141
|
-
########################################################################################################################
|
142
|
-
###################### CleanUp ######################
|
143
|
-
########################################################################################################################
|
144
|
-
|
145
|
-
resource_group = resources.resource_groups.get('TestRG-SQL')
|
146
|
-
resource_group.destroy
|
@@ -26,73 +26,85 @@ storage = Fog::Storage::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
|
-
storage
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
29
|
+
begin
|
30
|
+
resource_group = rs.resource_groups.create(
|
31
|
+
name: 'TestRG-SA',
|
32
|
+
location: LOCATION
|
33
|
+
)
|
34
|
+
|
35
|
+
########################################################################################################################
|
36
|
+
###################### Check Storage Account name Availability ######################
|
37
|
+
########################################################################################################################
|
38
|
+
|
39
|
+
storage_account_avail = storage.storage_accounts.check_name_availability('test-storage')
|
40
|
+
puts 'Storage account available' if storage_account_avail
|
41
|
+
puts 'Storage account unavailale' unless storage_account_avail
|
42
|
+
|
43
|
+
########################################################################################################################
|
44
|
+
############### Create A Standard Storage Account of Replication: LRS (Locally-redundant storage) ###############
|
45
|
+
########################################################################################################################
|
46
|
+
|
47
|
+
storage_account = storage.storage_accounts.create(
|
48
|
+
name: 'fogstandardsalrs',
|
49
|
+
location: LOCATION,
|
50
|
+
resource_group: 'TestRG-SA'
|
51
|
+
)
|
52
|
+
puts "Created storage account for standard lrs replication: #{storage_account.name}"
|
53
|
+
|
54
|
+
########################################################################################################################
|
55
|
+
############### Create A Standard Storage Account of Replication: GRS (Geo-redundant storage) #################
|
56
|
+
########################################################################################################################
|
57
|
+
|
58
|
+
storage_account = storage.storage_accounts.create(
|
59
|
+
name: 'fogstandardsagrs',
|
60
|
+
location: LOCATION,
|
61
|
+
resource_group: 'TestRG-SA',
|
62
|
+
sku_name: 'Standard',
|
63
|
+
replication: 'GRS',
|
64
|
+
encryption: true
|
65
|
+
)
|
66
|
+
puts "Created storage account for standard grs replication: #{storage_account.name}"
|
67
|
+
|
68
|
+
########################################################################################################################
|
69
|
+
########### Create A Premium(SSD) Storage Account of its only Replication: LRS (Locally-redundant storage) ##########
|
70
|
+
########################################################################################################################
|
71
|
+
|
72
|
+
storage_account = storage.storage_accounts.create(
|
73
|
+
name: 'fogpremiumsa',
|
74
|
+
location: LOCATION,
|
75
|
+
resource_group: 'TestRG-SA',
|
76
|
+
sku_name: 'Premium',
|
77
|
+
replication: 'LRS'
|
78
|
+
)
|
79
|
+
puts "Created storage account for premium lrs replication: #{storage_account.name}"
|
80
|
+
|
81
|
+
########################################################################################################################
|
82
|
+
###################### Get and Update Storage Account ######################
|
83
|
+
########################################################################################################################
|
84
|
+
|
85
|
+
premium_storage_account = storage.storage_accounts.get('TestRG-SA', 'fogpremiumsa')
|
86
|
+
puts "Get storage account: #{premium_storage_account.name}"
|
87
|
+
premium_storage_account.update(encryption: true)
|
88
|
+
puts 'Updated encrytion of storage account'
|
89
|
+
|
90
|
+
########################################################################################################################
|
91
|
+
###################### Get and Delete Storage Account ######################
|
92
|
+
########################################################################################################################
|
93
|
+
|
94
|
+
standard_storage_account = storage.storage_accounts.get('TestRG-SA', 'fogstandardsalrs')
|
95
|
+
puts "Deleted storage account for standard lrs replication: #{standard_storage_account.destroy}"
|
96
|
+
standard_storage_account = storage.storage_accounts.get('TestRG-SA', 'fogstandardsagrs')
|
97
|
+
puts "Deleted storage account for standard grs replication: #{standard_storage_account.destroy}"
|
98
|
+
premium_storage_account = storage.storage_accounts.get('TestRG-SA', 'fogpremiumsa')
|
99
|
+
puts "Deleted storage account for premium lrs replication: #{premium_storage_account.destroy}"
|
100
|
+
|
101
|
+
########################################################################################################################
|
102
|
+
###################### CleanUp ######################
|
103
|
+
########################################################################################################################
|
104
|
+
|
105
|
+
resource_group = rs.resource_groups.get('TestRG-SA')
|
106
|
+
resource_group.destroy
|
107
|
+
rescue
|
108
|
+
puts 'Integration Test for storage account is failing'
|
109
|
+
resource_group.destroy unless resource_group.nil?
|
110
|
+
end
|