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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15dd6d696881e8c4cee014dda7af43a3d8cc764f
|
4
|
+
data.tar.gz: 4b5d62e0d1e723cc7eb3a972caf1b291d59ad5d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afc8b7054bd8b01ff6d47caae60f4482aede6bdb4c2e01cb70cf273b615e0867c013fdf5260d79a1f7fdff077096d61680f218c7dac41c7785418e54157d8fa0
|
7
|
+
data.tar.gz: d9c876d9da40fd246df634beb2d6eb35e696e7f90f0f7c1aa8715cfd816c1adeae0ca490490b625224f93d7afc7e2ad8abbd4f3945607a2555a7f6dae9548929
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
## 0.1.1
|
2
|
+
|
3
|
+
**Added:**
|
4
|
+
- Storage Service - Multi-thread support for uploading blobs
|
5
|
+
- Added support for all Azure locations(Global, China, Gov and Germany)
|
6
|
+
|
7
|
+
**Changed:**
|
8
|
+
* Updated fog-azure-rm runtime gem dependencies to latest:
|
9
|
+
* azure_mgmt_compute 0.7.0
|
10
|
+
* azure_mgmt_network 0.7.0
|
11
|
+
* azure_mgmt_resources 0.7.0
|
12
|
+
* azure_mgmt_storage 0.7.0
|
13
|
+
* azure_mgmt_dns 0.7.0
|
14
|
+
* azure_mgmt_traffic_manager 0.7.0
|
15
|
+
* azure-storage 0.11.3.preview'
|
16
|
+
* Provided same storage interfaces as other providers (PR: 204)
|
17
|
+
* Updated Data Disk operations (PR: 220)
|
18
|
+
* Updated namespaces
|
19
|
+
* Updated integration scripts
|
20
|
+
|
1
21
|
## 0.1.0
|
2
22
|
|
3
23
|
**Added:**
|
data/README.md
CHANGED
@@ -33,7 +33,8 @@ Or install it yourself as:
|
|
33
33
|
## Usage
|
34
34
|
|
35
35
|
You can use this gem against the Microsoft Azure Resource Manager Services in the cloud. Of course, to use the Microsoft Azure Resource Manager Services in the cloud, you need to first [create a Microsoft Azure account](http://www.azure.com/en-us/pricing/free-trial/).
|
36
|
-
|
36
|
+
* Set 'CLOUD' constant from 'Azure', 'AzureChina', 'AzureGermanCloud' or 'AzureUSGovernment' in [config.rb] (https://github.com/fog/fog-azure-rm/blob/master/lib/fog/azurerm/config.rb) file. By default it will be 'Azure' (Azure Global).
|
37
|
+
* Set 'LOCATION' constant based on the Azure cloud you are using in [config.rb] (https://github.com/fog/fog-azure-rm/blob/master/lib/fog/azurerm/config.rb) file. By default it will be 'eastus'.
|
37
38
|
|
38
39
|
### Authentication
|
39
40
|
|
data/fog-azure-rm.gemspec
CHANGED
@@ -20,15 +20,17 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.post_install_message = 'Thanks for installing!'
|
21
21
|
spec.add_development_dependency 'rake', '~> 10.0'
|
22
22
|
spec.add_development_dependency 'minitest', '~> 5.8.4'
|
23
|
-
spec.add_development_dependency 'simplecov'
|
24
|
-
spec.add_development_dependency 'codeclimate-test-reporter'
|
23
|
+
spec.add_development_dependency 'simplecov'
|
24
|
+
spec.add_development_dependency 'codeclimate-test-reporter' , '~> 1.0.0'
|
25
25
|
spec.add_dependency 'fog-core', '~> 1.43.0'
|
26
|
+
spec.add_dependency 'fog-json', '~> 1.0'
|
26
27
|
spec.add_dependency 'rest-client', '~> 2.0.0'
|
27
|
-
spec.add_dependency 'azure_mgmt_compute', '~> 0.
|
28
|
-
spec.add_dependency 'azure_mgmt_resources', '~> 0.
|
29
|
-
spec.add_dependency 'azure_mgmt_storage', '~> 0.
|
30
|
-
spec.add_dependency 'azure_mgmt_network', '~> 0.
|
31
|
-
spec.add_dependency 'azure_mgmt_dns', '~> 0.
|
32
|
-
spec.add_dependency 'azure_mgmt_traffic_manager', '~> 0.
|
33
|
-
spec.add_dependency 'azure-storage', '~> 0.11.
|
28
|
+
spec.add_dependency 'azure_mgmt_compute', '~> 0.7.0'
|
29
|
+
spec.add_dependency 'azure_mgmt_resources', '~> 0.7.0'
|
30
|
+
spec.add_dependency 'azure_mgmt_storage', '~> 0.7.0'
|
31
|
+
spec.add_dependency 'azure_mgmt_network', '~> 0.7.0'
|
32
|
+
spec.add_dependency 'azure_mgmt_dns', '~> 0.7.0'
|
33
|
+
spec.add_dependency 'azure_mgmt_traffic_manager', '~> 0.7.0'
|
34
|
+
spec.add_dependency 'azure-storage', '~> 0.11.3.preview'
|
35
|
+
spec.add_dependency 'vhd', '0.0.4'
|
34
36
|
end
|
data/lib/fog/azurerm.rb
CHANGED
data/lib/fog/azurerm/compute.rb
CHANGED
@@ -49,7 +49,7 @@ module Fog
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
52
|
-
# This class provides the actual
|
52
|
+
# This class provides the actual implementation for service calls.
|
53
53
|
class Real
|
54
54
|
def initialize(options)
|
55
55
|
begin
|
@@ -62,9 +62,9 @@ module Fog
|
|
62
62
|
end
|
63
63
|
|
64
64
|
credentials = Fog::Credentials::AzureRM.get_credentials(options[:tenant_id], options[:client_id], options[:client_secret])
|
65
|
-
@compute_mgmt_client = ::Azure::ARM::Compute::ComputeManagementClient.new(credentials)
|
65
|
+
@compute_mgmt_client = ::Azure::ARM::Compute::ComputeManagementClient.new(credentials, resource_manager_endpoint_url)
|
66
66
|
@compute_mgmt_client.subscription_id = options[:subscription_id]
|
67
|
-
@storage_mgmt_client = ::Azure::ARM::Storage::StorageManagementClient.new(credentials)
|
67
|
+
@storage_mgmt_client = ::Azure::ARM::Storage::StorageManagementClient.new(credentials, resource_manager_endpoint_url)
|
68
68
|
@storage_mgmt_client.subscription_id = options[:subscription_id]
|
69
69
|
@storage_service = Fog::Storage::AzureRM.new(tenant_id: options[:tenant_id], client_id: options[:client_id], client_secret: options[:client_secret], subscription_id: options[:subscription_id])
|
70
70
|
end
|
data/lib/fog/azurerm/config.rb
CHANGED
@@ -20,3 +20,36 @@ AZURE_ENDPOINTS = 'azureEndpoints'.freeze
|
|
20
20
|
EXTERNAL_ENDPOINTS = 'externalEndpoints'.freeze
|
21
21
|
NESTED_ENDPOINTS = 'nestedEndpoints'.freeze
|
22
22
|
GLOBAL = 'global'.freeze
|
23
|
+
UPLOAD_BLOB_WORKER_THREAD_COUNT = 8
|
24
|
+
VM_NAME_POSITION = 8
|
25
|
+
|
26
|
+
# Set a CLOUD value from 'Azure', 'AzureChina', 'AzureGermanCloud' and 'AzureUSGovernment'
|
27
|
+
CLOUD = 'Azure'.freeze
|
28
|
+
|
29
|
+
AZURE_GLOBAL_RM_ENDPOINT_URL = 'https://management.azure.com/'.freeze
|
30
|
+
AZURE_CHINA_RM_ENDPOINT_URL = 'https://management.chinacloudapi.cn'.freeze
|
31
|
+
GERMAN_CLOUD_RM_ENDPOINT_URL = 'https://management.microsoftazure.de'.freeze
|
32
|
+
US_GOVERNMENT_RM_ENDPOINT_URL = 'https://management.usgovcloudapi.net'.freeze
|
33
|
+
|
34
|
+
LOCATION = 'eastus'.freeze
|
35
|
+
|
36
|
+
# State of the copy operation
|
37
|
+
COPY_STATUS = {
|
38
|
+
# The copy completed successfully.
|
39
|
+
SUCCESS: 'success',
|
40
|
+
# The copy is in progress
|
41
|
+
PENDING: 'pending'
|
42
|
+
}.freeze
|
43
|
+
|
44
|
+
# https://msdn.microsoft.com/en-us/library/azure/dd179451.aspx
|
45
|
+
# The maximum size for a block blob created via Put Blob is 64 MB. But for better performance, this size should be 32 MB.
|
46
|
+
# If your blob is larger than 32 MB, you must upload it as a set of blocks.
|
47
|
+
SINGLE_BLOB_PUT_THRESHOLD = 32 * 1024 * 1024
|
48
|
+
|
49
|
+
# Block blob: https://msdn.microsoft.com/en-us/library/azure/dd135726.aspx
|
50
|
+
# Page blob: https://msdn.microsoft.com/en-us/library/azure/ee691975.aspx
|
51
|
+
# Each block/page can be a different size, up to a maximum of 4 MB
|
52
|
+
MAXIMUM_CHUNK_SIZE = 4 * 1024 * 1024
|
53
|
+
|
54
|
+
# The hash value of 4MB empty content
|
55
|
+
HASH_OF_4MB_EMPTY_CONTENT = 'b5cfa9d6c8febd618f91ac2843d50a1c'.freeze
|
@@ -20,7 +20,7 @@ module Fog
|
|
20
20
|
@client_id = client_id
|
21
21
|
@client_secret = client_secret
|
22
22
|
return if @tenant_id.nil? || @client_id.nil? || @client_secret.nil?
|
23
|
-
@token_provider = MsRestAzure::ApplicationTokenProvider.new(@tenant_id, @client_id, @client_secret)
|
23
|
+
@token_provider = MsRestAzure::ApplicationTokenProvider.new(@tenant_id, @client_id, @client_secret, active_directory_service_settings)
|
24
24
|
@credentials = MsRest::TokenCredentials.new(@token_provider)
|
25
25
|
@credentials
|
26
26
|
end
|
data/lib/fog/azurerm/dns.rb
CHANGED
@@ -31,7 +31,7 @@ module Fog
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
# This class provides the actual
|
34
|
+
# This class provides the actual implementation for service calls.
|
35
35
|
class Real
|
36
36
|
def initialize(options)
|
37
37
|
begin
|
@@ -42,7 +42,7 @@ module Fog
|
|
42
42
|
end
|
43
43
|
|
44
44
|
credentials = Fog::Credentials::AzureRM.get_credentials(options[:tenant_id], options[:client_id], options[:client_secret])
|
45
|
-
@dns_client = ::Azure::ARM::Dns::DnsManagementClient.new(credentials)
|
45
|
+
@dns_client = ::Azure::ARM::Dns::DnsManagementClient.new(credentials, resource_manager_endpoint_url)
|
46
46
|
@dns_client.subscription_id = options[:subscription_id]
|
47
47
|
@tenant_id = options[:tenant_id]
|
48
48
|
@client_id = options[:client_id]
|
@@ -163,10 +163,11 @@ azure_storage_service.delete_disk('<Data Disk Name>')
|
|
163
163
|
Create a storage container in the current storage account.
|
164
164
|
|
165
165
|
```ruby
|
166
|
-
|
167
|
-
|
166
|
+
directory = azure_storage_service.directories.create(
|
167
|
+
key: '<container name>',
|
168
|
+
public: true
|
168
169
|
)
|
169
|
-
puts
|
170
|
+
puts directory.key
|
170
171
|
```
|
171
172
|
|
172
173
|
## List storage containers
|
@@ -175,18 +176,39 @@ List all the storage containers in the current storage accounts.
|
|
175
176
|
|
176
177
|
```ruby
|
177
178
|
azure_storage_service.directories.each do |directory|
|
178
|
-
puts
|
179
|
+
puts directory.key
|
179
180
|
end
|
180
181
|
```
|
181
182
|
|
182
|
-
## Get the access control
|
183
|
+
## Get the access control level of the storage container
|
183
184
|
|
184
185
|
Get the permissions for the specified container. The permissions indicate whether container data may be accessed publicly.
|
185
186
|
|
186
187
|
```ruby
|
187
|
-
directory = azure_storage_service.directories.get('<
|
188
|
-
|
189
|
-
|
188
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
189
|
+
puts directory.acl
|
190
|
+
```
|
191
|
+
|
192
|
+
## Set the access control level of the storage container
|
193
|
+
|
194
|
+
Set the permissions for the specified container. The permissions indicate whether container data may be accessed publicly. The container permissions provide the following options for managing container access:
|
195
|
+
|
196
|
+
- container
|
197
|
+
|
198
|
+
Full public read access. Container and blob data can be read via anonymous request. Clients can enumerate blobs within the container via anonymous request, but cannot enumerate containers within the storage account.
|
199
|
+
|
200
|
+
- blob
|
201
|
+
|
202
|
+
Public read access for blobs only. Blob data within this container can be read via anonymous request, but container data is not available. Clients cannot enumerate blobs within the container via anonymous request.
|
203
|
+
|
204
|
+
- nil
|
205
|
+
|
206
|
+
No public read access. Container and blob data can be read by the account owner only.
|
207
|
+
|
208
|
+
```ruby
|
209
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
210
|
+
directory.acl = 'container'
|
211
|
+
directory.save(is_create: false)
|
190
212
|
```
|
191
213
|
|
192
214
|
## Delete the storage container
|
@@ -194,91 +216,117 @@ puts "#{access_control_list.inspect}"
|
|
194
216
|
Mark the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection.
|
195
217
|
|
196
218
|
```ruby
|
197
|
-
directory = azure_storage_service.directories.get('<
|
198
|
-
|
199
|
-
puts "#{result}"
|
219
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
220
|
+
puts directory.destroy
|
200
221
|
```
|
201
222
|
|
202
|
-
## Upload
|
223
|
+
## Upload data as a block blob
|
203
224
|
```ruby
|
204
|
-
|
205
|
-
|
225
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
226
|
+
options = {
|
227
|
+
key: '<Blob Name>',
|
228
|
+
body: '<Blob Content>'
|
229
|
+
}
|
230
|
+
new_block_blob = directory.files.create(options)
|
231
|
+
puts new_block_blob.inspect
|
206
232
|
```
|
207
233
|
|
208
|
-
##
|
234
|
+
## Upload a local file as a block blob
|
209
235
|
```ruby
|
210
|
-
|
236
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
237
|
+
File.open('<File Path>') do |file|
|
238
|
+
options = {
|
239
|
+
key: '<Blob Name>',
|
240
|
+
body: file
|
241
|
+
}
|
242
|
+
new_block_blob = directory.files.create(options)
|
243
|
+
puts new_block_blob.inspect
|
244
|
+
end
|
211
245
|
```
|
212
246
|
|
213
|
-
##
|
247
|
+
## Upload VHD data as a page blob
|
214
248
|
```ruby
|
215
|
-
|
216
|
-
|
217
|
-
|
249
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
250
|
+
options = {
|
251
|
+
key: '<Blob Name>',
|
252
|
+
body: '<Blob Content>',
|
253
|
+
blob_type: 'PageBlob'
|
254
|
+
}
|
255
|
+
new_page_blob = directory.files.create(options)
|
256
|
+
puts new_page_blob.inspect
|
218
257
|
```
|
219
258
|
|
220
|
-
##
|
221
|
-
|
222
|
-
Mark the specified blob for deletion. The blob is later deleted during garbage collection.
|
223
|
-
|
259
|
+
## Upload a local VHD as a page blob
|
224
260
|
```ruby
|
225
|
-
|
226
|
-
|
227
|
-
|
261
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
262
|
+
File.open('<File Path>') do |file|
|
263
|
+
options = {
|
264
|
+
key: '<Blob Name>',
|
265
|
+
body: file,
|
266
|
+
blob_type: 'PageBlob'
|
267
|
+
}
|
268
|
+
new_page_blob = directory.files.create(options)
|
269
|
+
puts new_page_blob.inspect
|
270
|
+
end
|
228
271
|
```
|
229
272
|
|
230
|
-
|
231
|
-
|
273
|
+
## Copy Blob from one container to another
|
232
274
|
```ruby
|
233
|
-
|
234
|
-
|
235
|
-
puts
|
236
|
-
|
237
|
-
result = cloud_file.destroy
|
238
|
-
puts "#{result}"
|
275
|
+
directory = azure_storage_service.directories.get('<Source Container Name>', max_results: 1)
|
276
|
+
copied_blob = directory.files.head('<Source Blob Name>').copy('<Destination Container Name>', '<Destination Blob Name>')
|
277
|
+
puts copied_blob.inspect
|
239
278
|
```
|
240
279
|
|
241
|
-
|
242
|
-
|
280
|
+
## Copy Blob from one uri to self
|
243
281
|
```ruby
|
244
|
-
|
245
|
-
|
246
|
-
|
282
|
+
directory = azure_storage_service.directories.get('<Destination Container Name>', max_results: 1)
|
283
|
+
copied_blob = directory.files.new(key: '<Destination Blob Name>')
|
284
|
+
copied_blob.copy_from_uri('<Source Blob Uri>')
|
285
|
+
puts copied_blob.inspect
|
247
286
|
```
|
248
287
|
|
249
|
-
##
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
288
|
+
## Download a small blob to a local file
|
289
|
+
```ruby
|
290
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
291
|
+
blob = directory.files.get('<Blob Name>')
|
292
|
+
File.open('<File Path>', 'wb') do |file|
|
293
|
+
file.write(blob.body)
|
294
|
+
end
|
295
|
+
puts "File Size: #{::File.size <File Path>}"
|
296
|
+
```
|
254
297
|
|
298
|
+
## Download a large blob to a local file
|
255
299
|
```ruby
|
256
|
-
directory = azure_storage_service.directories.get('<
|
257
|
-
|
258
|
-
|
300
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
301
|
+
File.open('<File Path>', 'wb') do |file|
|
302
|
+
directory.files.get('<Blob Name>') do |chunk, remaining_bytes, total_bytes|
|
303
|
+
puts "remaining_bytes: #{remaining_bytes}, total_bytes: #{total_bytes}"
|
304
|
+
file.write(chunk)
|
305
|
+
end
|
306
|
+
end
|
307
|
+
puts "File Size: #{::File.size <File Path>}"
|
259
308
|
```
|
260
309
|
|
261
|
-
|
310
|
+
## Delete the storage blob
|
262
311
|
|
263
|
-
|
312
|
+
Mark the specified blob for deletion. The blob is later deleted during garbage collection.
|
264
313
|
|
265
314
|
```ruby
|
266
|
-
|
267
|
-
|
268
|
-
puts
|
315
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
316
|
+
blob = directory.files.head('<Blob Name>')
|
317
|
+
puts blob.destroy
|
269
318
|
```
|
270
319
|
|
271
320
|
### Set storage blob properties
|
272
321
|
|
273
|
-
Set the storage blob properties.
|
322
|
+
Set the storage blob properties.
|
274
323
|
|
275
324
|
```ruby
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
cloud_file.set_properties(properties)
|
325
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
326
|
+
blob = directory.files.head('<Blob Name>')
|
327
|
+
blob.content_language = "English"
|
328
|
+
blob.content_disposition = "attachment"
|
329
|
+
blob.save(update_body: false)
|
282
330
|
```
|
283
331
|
|
284
332
|
## Metadata
|
@@ -288,35 +336,41 @@ Metadata allows us to provide descriptive information about specific containers
|
|
288
336
|
### Get Blob Metadata
|
289
337
|
|
290
338
|
```ruby
|
291
|
-
azure_storage_service.
|
339
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
340
|
+
blob = directory.files.head('<Blob Name>')
|
341
|
+
puts blob.metadata
|
292
342
|
```
|
293
343
|
|
294
344
|
### Set Blob Metadata
|
295
345
|
|
296
346
|
```ruby
|
297
|
-
|
347
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
348
|
+
blob = directory.files.head('<Blob Name>')
|
349
|
+
blob.metadata = {
|
298
350
|
"Category" => "Images",
|
299
351
|
"Resolution" => "High"
|
300
352
|
}
|
301
|
-
|
353
|
+
blob.save(update_body: false)
|
302
354
|
```
|
303
355
|
|
304
356
|
### Get Container Metadata
|
305
357
|
|
306
358
|
```ruby
|
307
|
-
azure_storage_service.directories.
|
359
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
360
|
+
puts directory.metadata
|
308
361
|
```
|
309
362
|
|
310
363
|
### Set Container Metadata
|
311
364
|
|
312
365
|
```ruby
|
313
|
-
|
366
|
+
directory = azure_storage_service.directories.get('<Container Name>', max_results: 1)
|
367
|
+
directory.metadata = {
|
314
368
|
"CreatedBy" => "User",
|
315
369
|
"SourceMachine" => "Mymachine",
|
316
370
|
"category" => "guidance",
|
317
371
|
"docType" => "textDocuments"
|
318
372
|
}
|
319
|
-
|
373
|
+
directory.save(is_create: false)
|
320
374
|
```
|
321
375
|
|
322
376
|
### Create Recovery Vault
|