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
@@ -39,62 +39,62 @@ module Fog
|
|
39
39
|
|
40
40
|
hash['gateway_ip_configurations'] = []
|
41
41
|
gateway.gateway_ipconfigurations.each do |ip_configuration|
|
42
|
-
gateway_ip_configuration = IPConfiguration.new
|
43
|
-
hash['gateway_ip_configurations'] << gateway_ip_configuration.merge_attributes(IPConfiguration.parse(ip_configuration))
|
42
|
+
gateway_ip_configuration = Fog::ApplicationGateway::AzureRM::IPConfiguration.new
|
43
|
+
hash['gateway_ip_configurations'] << gateway_ip_configuration.merge_attributes(Fog::ApplicationGateway::AzureRM::IPConfiguration.parse(ip_configuration))
|
44
44
|
end unless gateway.gateway_ipconfigurations.nil?
|
45
45
|
|
46
46
|
hash['ssl_certificates'] = []
|
47
47
|
gateway.ssl_certificates.each do |certificate|
|
48
|
-
ssl_certificate = SslCertificate.new
|
49
|
-
hash['ssl_certificates'] << ssl_certificate.merge_attributes(SslCertificate.parse(certificate))
|
48
|
+
ssl_certificate = Fog::ApplicationGateway::AzureRM::SslCertificate.new
|
49
|
+
hash['ssl_certificates'] << ssl_certificate.merge_attributes(Fog::ApplicationGateway::AzureRM::SslCertificate.parse(certificate))
|
50
50
|
end unless gateway.ssl_certificates.nil?
|
51
51
|
|
52
52
|
hash['frontend_ip_configurations'] = []
|
53
53
|
gateway.frontend_ipconfigurations.each do |frontend_ip_config|
|
54
|
-
frontend_ip_configuration = FrontendIPConfiguration.new
|
55
|
-
hash['frontend_ip_configurations'] << frontend_ip_configuration.merge_attributes(FrontendIPConfiguration.parse(frontend_ip_config))
|
54
|
+
frontend_ip_configuration = Fog::ApplicationGateway::AzureRM::FrontendIPConfiguration.new
|
55
|
+
hash['frontend_ip_configurations'] << frontend_ip_configuration.merge_attributes(Fog::ApplicationGateway::AzureRM::FrontendIPConfiguration.parse(frontend_ip_config))
|
56
56
|
end unless gateway.frontend_ipconfigurations.nil?
|
57
57
|
|
58
58
|
hash['frontend_ports'] = []
|
59
59
|
gateway.frontend_ports.each do |port|
|
60
|
-
frontend_port = FrontendPort.new
|
61
|
-
hash['frontend_ports'] << frontend_port.merge_attributes(FrontendPort.parse(port))
|
60
|
+
frontend_port = Fog::ApplicationGateway::AzureRM::FrontendPort.new
|
61
|
+
hash['frontend_ports'] << frontend_port.merge_attributes(Fog::ApplicationGateway::AzureRM::FrontendPort.parse(port))
|
62
62
|
end unless gateway.frontend_ports.nil?
|
63
63
|
|
64
64
|
hash['probes'] = []
|
65
65
|
gateway.probes.each do |probe|
|
66
|
-
gateway_probe = Probe.new
|
67
|
-
hash['probes'] << gateway_probe.merge_attributes(Probe.parse(probe))
|
66
|
+
gateway_probe = Fog::ApplicationGateway::AzureRM::Probe.new
|
67
|
+
hash['probes'] << gateway_probe.merge_attributes(Fog::ApplicationGateway::AzureRM::Probe.parse(probe))
|
68
68
|
end unless gateway.probes.nil?
|
69
69
|
|
70
70
|
hash['backend_address_pools'] = []
|
71
71
|
gateway.backend_address_pools.each do |address|
|
72
|
-
backend_address_pool = BackendAddressPool.new
|
73
|
-
hash['backend_address_pools'] << backend_address_pool.merge_attributes(BackendAddressPool.parse(address))
|
72
|
+
backend_address_pool = Fog::ApplicationGateway::AzureRM::BackendAddressPool.new
|
73
|
+
hash['backend_address_pools'] << backend_address_pool.merge_attributes(Fog::ApplicationGateway::AzureRM::BackendAddressPool.parse(address))
|
74
74
|
end unless gateway.backend_address_pools.nil?
|
75
75
|
|
76
76
|
hash['backend_http_settings_list'] = []
|
77
77
|
gateway.backend_http_settings_collection.each do |http_setting|
|
78
|
-
backend_http_setting = BackendHttpSetting.new
|
79
|
-
hash['backend_http_settings_list'] << backend_http_setting.merge_attributes(BackendHttpSetting.parse(http_setting))
|
78
|
+
backend_http_setting = Fog::ApplicationGateway::AzureRM::BackendHttpSetting.new
|
79
|
+
hash['backend_http_settings_list'] << backend_http_setting.merge_attributes(Fog::ApplicationGateway::AzureRM::BackendHttpSetting.parse(http_setting))
|
80
80
|
end unless gateway.backend_http_settings_collection.nil?
|
81
81
|
|
82
82
|
hash['http_listeners'] = []
|
83
83
|
gateway.http_listeners.each do |listener|
|
84
|
-
http_listener = HttpListener.new
|
85
|
-
hash['http_listeners'] << http_listener.merge_attributes(HttpListener.parse(listener))
|
84
|
+
http_listener = Fog::ApplicationGateway::AzureRM::HttpListener.new
|
85
|
+
hash['http_listeners'] << http_listener.merge_attributes(Fog::ApplicationGateway::AzureRM::HttpListener.parse(listener))
|
86
86
|
end unless gateway.http_listeners.nil?
|
87
87
|
|
88
88
|
hash['url_path_maps'] = []
|
89
89
|
gateway.url_path_maps.each do |map|
|
90
|
-
url_path_map = UrlPathMap.new
|
91
|
-
hash['url_path_maps'] << url_path_map.merge_attributes(UrlPathMap.parse(map))
|
90
|
+
url_path_map = Fog::ApplicationGateway::AzureRM::UrlPathMap.new
|
91
|
+
hash['url_path_maps'] << url_path_map.merge_attributes(Fog::ApplicationGateway::AzureRM::UrlPathMap.parse(map))
|
92
92
|
end unless gateway.url_path_maps.nil?
|
93
93
|
|
94
94
|
hash['request_routing_rules'] = []
|
95
95
|
gateway.request_routing_rules.each do |rule|
|
96
|
-
request_routing_rule = RequestRoutingRule.new
|
97
|
-
hash['request_routing_rules'] << request_routing_rule.merge_attributes(RequestRoutingRule.parse(rule))
|
96
|
+
request_routing_rule = Fog::ApplicationGateway::AzureRM::RequestRoutingRule.new
|
97
|
+
hash['request_routing_rules'] << request_routing_rule.merge_attributes(Fog::ApplicationGateway::AzureRM::RequestRoutingRule.parse(rule))
|
98
98
|
end unless gateway.request_routing_rules.nil?
|
99
99
|
hash
|
100
100
|
end
|
@@ -112,12 +112,11 @@ module Fog
|
|
112
112
|
validate_http_listeners(http_listeners) unless http_listeners.nil?
|
113
113
|
validate_url_path_maps(url_path_maps) unless url_path_maps.nil?
|
114
114
|
validate_request_routing_rules(request_routing_rules) unless request_routing_rules.nil?
|
115
|
-
|
116
|
-
gateway = service.create_or_update_application_gateway(gateway_params)
|
115
|
+
gateway = service.create_or_update_application_gateway(application_gateway_params)
|
117
116
|
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
118
117
|
end
|
119
118
|
|
120
|
-
def
|
119
|
+
def application_gateway_params
|
121
120
|
{
|
122
121
|
name: name,
|
123
122
|
location: location,
|
@@ -548,54 +547,54 @@ module Fog
|
|
548
547
|
end
|
549
548
|
|
550
549
|
def update_sku(sku_name, sku_capacity = nil)
|
551
|
-
gateway_hash = serialize_sub_resources(
|
550
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
552
551
|
gateway = service.update_sku_attributes(gateway_hash, sku_name, sku_capacity)
|
553
552
|
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
554
553
|
end
|
555
554
|
|
556
555
|
def update_gateway_ip_configuration(subnet_id)
|
557
|
-
gateway_hash = serialize_sub_resources(
|
556
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
558
557
|
gateway = service.update_subnet_id_in_gateway_ip_configuration(gateway_hash, subnet_id)
|
559
558
|
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
560
559
|
end
|
561
560
|
|
562
561
|
def add_ssl_certificate(ssl_certificate_obj)
|
563
|
-
gateway_hash = serialize_sub_resources(
|
562
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
564
563
|
gateway_hash[:ssl_certificates] << ssl_certificate_obj
|
565
564
|
gateway = service.create_or_update_application_gateway(gateway_hash)
|
566
565
|
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
567
566
|
end
|
568
567
|
|
569
568
|
def remove_ssl_certificate(ssl_certificate_obj)
|
570
|
-
gateway_hash = serialize_sub_resources(
|
569
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
571
570
|
gateway_hash[:ssl_certificates].delete(ssl_certificate_obj)
|
572
571
|
gateway = service.create_or_update_application_gateway(gateway_hash)
|
573
572
|
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
574
573
|
end
|
575
574
|
|
576
575
|
def add_frontend_port(frontend_port_obj)
|
577
|
-
gateway_hash = serialize_sub_resources(
|
576
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
578
577
|
gateway_hash[:frontend_ports] << frontend_port_obj
|
579
578
|
gateway = service.create_or_update_application_gateway(gateway_hash)
|
580
579
|
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
581
580
|
end
|
582
581
|
|
583
582
|
def remove_frontend_port(frontend_port_obj)
|
584
|
-
gateway_hash = serialize_sub_resources(
|
583
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
585
584
|
gateway_hash[:frontend_ports].delete(frontend_port_obj)
|
586
585
|
gateway = service.create_or_update_application_gateway(gateway_hash)
|
587
586
|
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
588
587
|
end
|
589
588
|
|
590
589
|
def add_probe(probe_obj)
|
591
|
-
gateway_hash = serialize_sub_resources(
|
590
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
592
591
|
gateway_hash[:probes] << probe_obj
|
593
592
|
gateway = service.create_or_update_application_gateway(gateway_hash)
|
594
593
|
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
595
594
|
end
|
596
595
|
|
597
596
|
def remove_probe(probe_obj)
|
598
|
-
gateway_hash = serialize_sub_resources(
|
597
|
+
gateway_hash = serialize_sub_resources(application_gateway_params)
|
599
598
|
gateway_hash[:probes].delete(probe_obj)
|
600
599
|
gateway = service.create_or_update_application_gateway(gateway_hash)
|
601
600
|
merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
@@ -3,22 +3,22 @@ module Fog
|
|
3
3
|
class AzureRM
|
4
4
|
# Application Gateway collection class for Application Gateway Service
|
5
5
|
class Gateways < Fog::Collection
|
6
|
-
model Gateway
|
6
|
+
model Fog::ApplicationGateway::AzureRM::Gateway
|
7
7
|
attribute :resource_group
|
8
8
|
|
9
9
|
def all
|
10
10
|
requires :resource_group
|
11
11
|
application_gateways = []
|
12
12
|
service.list_application_gateways(resource_group).each do |gateway|
|
13
|
-
application_gateways << Gateway.parse(gateway)
|
13
|
+
application_gateways << Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway)
|
14
14
|
end
|
15
15
|
load(application_gateways)
|
16
16
|
end
|
17
17
|
|
18
18
|
def get(resource_group_name, application_gateway_name)
|
19
19
|
gateway = service.get_application_gateway(resource_group_name, application_gateway_name)
|
20
|
-
application_gateway = Gateway.new(service: service)
|
21
|
-
application_gateway.merge_attributes(Gateway.parse(gateway))
|
20
|
+
application_gateway = Fog::ApplicationGateway::AzureRM::Gateway.new(service: service)
|
21
|
+
application_gateway.merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -4,7 +4,7 @@ module Fog
|
|
4
4
|
# This class is giving implementation of all/list, get and
|
5
5
|
# check name availability for storage account.
|
6
6
|
class AvailabilitySets < Fog::Collection
|
7
|
-
model AvailabilitySet
|
7
|
+
model Fog::Compute::AzureRM::AvailabilitySet
|
8
8
|
attribute :resource_group
|
9
9
|
def all
|
10
10
|
accounts = []
|
@@ -13,7 +13,7 @@ module Fog
|
|
13
13
|
service.list_availability_sets(resource_group)
|
14
14
|
unless list_of_availability_sets.nil?
|
15
15
|
list_of_availability_sets.each do |account|
|
16
|
-
parse_response = AvailabilitySet.parse(account)
|
16
|
+
parse_response = Fog::Compute::AzureRM::AvailabilitySet.parse(account)
|
17
17
|
accounts << parse_response
|
18
18
|
end
|
19
19
|
end
|
@@ -22,8 +22,8 @@ module Fog
|
|
22
22
|
|
23
23
|
def get(resource_group, identity)
|
24
24
|
availability_set = service.get_availability_set(resource_group, identity)
|
25
|
-
|
26
|
-
|
25
|
+
availability_set_fog = Fog::Compute::AzureRM::AvailabilitySet.new(service: service)
|
26
|
+
availability_set_fog.merge_attributes(Fog::Compute::AzureRM::AvailabilitySet.parse(availability_set))
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'fog/azurerm/models/storage/data_disk'
|
2
1
|
module Fog
|
3
2
|
module Compute
|
4
3
|
class AzureRM
|
@@ -37,14 +36,16 @@ module Fog
|
|
37
36
|
hash['name'] = vm.name
|
38
37
|
hash['location'] = vm.location
|
39
38
|
hash['resource_group'] = get_resource_group_from_id(vm.id)
|
40
|
-
hash['vm_size'] = vm.hardware_profile.vm_size
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
39
|
+
hash['vm_size'] = vm.hardware_profile.vm_size unless vm.hardware_profile.vm_size.nil?
|
40
|
+
unless vm.storage_profile.nil?
|
41
|
+
hash['os_disk_name'] = vm.storage_profile.os_disk.name
|
42
|
+
hash['os_disk_vhd_uri'] = vm.storage_profile.os_disk.vhd.uri
|
43
|
+
unless vm.storage_profile.image_reference.nil?
|
44
|
+
hash['publisher'] = vm.storage_profile.image_reference.publisher
|
45
|
+
hash['offer'] = vm.storage_profile.image_reference.offer
|
46
|
+
hash['sku'] = vm.storage_profile.image_reference.sku
|
47
|
+
hash['version'] = vm.storage_profile.image_reference.version
|
48
|
+
end
|
48
49
|
end
|
49
50
|
hash['username'] = vm.os_profile.admin_username
|
50
51
|
hash['custom_data'] = vm.os_profile.custom_data
|
@@ -73,8 +74,7 @@ module Fog
|
|
73
74
|
requires :disable_password_authentication if platform.casecmp('linux').zero?
|
74
75
|
requires :publisher, :offer, :sku, :version if vhd_path.nil?
|
75
76
|
ssh_key_path = "/home/#{username}/.ssh/authorized_keys" unless ssh_key_data.nil?
|
76
|
-
|
77
|
-
vm = service.create_virtual_machine(virtual_machine_params)
|
77
|
+
vm = service.create_virtual_machine(virtual_machine_params(ssh_key_path))
|
78
78
|
merge_attributes(Server.parse(vm))
|
79
79
|
end
|
80
80
|
|
@@ -116,17 +116,17 @@ module Fog
|
|
116
116
|
|
117
117
|
def attach_data_disk(disk_name, disk_size, storage_account_name)
|
118
118
|
vm = service.attach_data_disk_to_vm(resource_group, name, disk_name, disk_size, storage_account_name)
|
119
|
-
merge_attributes(Server.parse(vm))
|
119
|
+
merge_attributes(Fog::Compute::AzureRM::Server.parse(vm))
|
120
120
|
end
|
121
121
|
|
122
122
|
def detach_data_disk(disk_name)
|
123
123
|
vm = service.detach_data_disk_from_vm(resource_group, name, disk_name)
|
124
|
-
merge_attributes(Server.parse(vm))
|
124
|
+
merge_attributes(Fog::Compute::AzureRM::Server.parse(vm))
|
125
125
|
end
|
126
126
|
|
127
127
|
private
|
128
128
|
|
129
|
-
def
|
129
|
+
def virtual_machine_params(ssh_key_path)
|
130
130
|
{
|
131
131
|
resource_group: resource_group,
|
132
132
|
name: name,
|
@@ -5,21 +5,21 @@ module Fog
|
|
5
5
|
# for Server.
|
6
6
|
class Servers < Fog::Collection
|
7
7
|
attribute :resource_group
|
8
|
-
model Server
|
8
|
+
model Fog::Compute::AzureRM::Server
|
9
9
|
|
10
10
|
def all
|
11
11
|
requires :resource_group
|
12
12
|
virtual_machines = []
|
13
13
|
service.list_virtual_machines(resource_group).each do |vm|
|
14
|
-
virtual_machines << Server.parse(vm)
|
14
|
+
virtual_machines << Fog::Compute::AzureRM::Server.parse(vm)
|
15
15
|
end
|
16
16
|
load(virtual_machines)
|
17
17
|
end
|
18
18
|
|
19
19
|
def get(resource_group_name, virtual_machine_name)
|
20
20
|
virtual_machine = service.get_virtual_machine(resource_group_name, virtual_machine_name)
|
21
|
-
|
22
|
-
|
21
|
+
virtual_machine_fog = Fog::Compute::AzureRM::Server.new(service: service)
|
22
|
+
virtual_machine_fog.merge_attributes(Fog::Compute::AzureRM::Server.parse(virtual_machine))
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -33,17 +33,15 @@ module Fog
|
|
33
33
|
|
34
34
|
def save
|
35
35
|
requires :resource_group, :location, :name, :vm_name, :type, :publisher, :type_handler_version, :settings
|
36
|
-
vm_extension_params = get_vm_extension_params
|
37
36
|
vm_extension = service.create_or_update_vm_extension(vm_extension_params)
|
38
|
-
merge_attributes(VirtualMachineExtension.parse(vm_extension))
|
37
|
+
merge_attributes(Fog::Compute::AzureRM::VirtualMachineExtension.parse(vm_extension))
|
39
38
|
end
|
40
39
|
|
41
40
|
def update(vm_extension_input)
|
42
41
|
validate_input(vm_extension_input)
|
43
42
|
merge_attributes(vm_extension_input) unless vm_extension_input.empty?
|
44
|
-
vm_extension_params = get_vm_extension_params
|
45
43
|
vm_extension = service.create_or_update_vm_extension(vm_extension_params)
|
46
|
-
merge_attributes(VirtualMachineExtension.parse(vm_extension))
|
44
|
+
merge_attributes(Fog::Compute::AzureRM::VirtualMachineExtension.parse(vm_extension))
|
47
45
|
end
|
48
46
|
|
49
47
|
def destroy
|
@@ -58,7 +56,7 @@ module Fog
|
|
58
56
|
raise 'Cannot modify the given attribute(s)' unless result.empty?
|
59
57
|
end
|
60
58
|
|
61
|
-
def
|
59
|
+
def vm_extension_params
|
62
60
|
{
|
63
61
|
resource_group: resource_group,
|
64
62
|
location: location,
|
@@ -3,23 +3,23 @@ module Fog
|
|
3
3
|
class AzureRM
|
4
4
|
# This class gives the implementation for get for virtual machine extension
|
5
5
|
class VirtualMachineExtensions < Fog::Collection
|
6
|
-
model VirtualMachineExtension
|
6
|
+
model Fog::Compute::AzureRM::VirtualMachineExtension
|
7
7
|
attribute :resource_group
|
8
8
|
attribute :vm_name
|
9
9
|
|
10
10
|
def all
|
11
11
|
requires :resource_group, :vm_name
|
12
12
|
vm_extensions = []
|
13
|
-
service.get_virtual_machine(resource_group, vm_name).resources.each do |extension|
|
14
|
-
vm_extensions << VirtualMachineExtension.parse(extension)
|
13
|
+
service.get_virtual_machine(resource_group, vm_name).resources.compact.each do |extension|
|
14
|
+
vm_extensions << Fog::Compute::AzureRM::VirtualMachineExtension.parse(extension)
|
15
15
|
end
|
16
16
|
load(vm_extensions)
|
17
17
|
end
|
18
18
|
|
19
19
|
def get(resource_group_name, virtual_machine_name, vm_extension_name)
|
20
20
|
vm_extension = service.get_vm_extension(resource_group_name, virtual_machine_name, vm_extension_name)
|
21
|
-
|
22
|
-
|
21
|
+
vm_extension_fog = Fog::Compute::AzureRM::VirtualMachineExtension.new(service: service)
|
22
|
+
vm_extension_fog.merge_attributes(Fog::Compute::AzureRM::VirtualMachineExtension.parse(vm_extension))
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -8,21 +8,21 @@ module Fog
|
|
8
8
|
attribute :zone_name
|
9
9
|
attribute :type
|
10
10
|
|
11
|
-
model RecordSet
|
11
|
+
model Fog::DNS::AzureRM::RecordSet
|
12
12
|
|
13
13
|
def all
|
14
14
|
requires :resource_group, :zone_name
|
15
15
|
record_sets = []
|
16
16
|
service.list_record_sets(resource_group, zone_name).each do |r|
|
17
|
-
record_sets << RecordSet.parse(r)
|
17
|
+
record_sets << Fog::DNS::AzureRM::RecordSet.parse(r)
|
18
18
|
end
|
19
19
|
load(record_sets)
|
20
20
|
end
|
21
21
|
|
22
22
|
def get(resource_group, name, zone_name, record_type)
|
23
23
|
record_set = service.get_record_set(resource_group, name, zone_name, record_type)
|
24
|
-
|
25
|
-
|
24
|
+
record_set_fog = Fog::DNS::AzureRM::RecordSet.new(service: service)
|
25
|
+
record_set_fog.merge_attributes(Fog::DNS::AzureRM::RecordSet.parse(record_set))
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -4,20 +4,20 @@ module Fog
|
|
4
4
|
# This class is giving implementation of
|
5
5
|
# all/get for Zones.
|
6
6
|
class Zones < Fog::Collection
|
7
|
-
model Zone
|
7
|
+
model Fog::DNS::AzureRM::Zone
|
8
8
|
|
9
9
|
def all
|
10
10
|
zones = []
|
11
11
|
service.list_zones.each do |z|
|
12
|
-
zones << Zone.parse(z)
|
12
|
+
zones << Fog::DNS::AzureRM::Zone.parse(z)
|
13
13
|
end
|
14
14
|
load(zones)
|
15
15
|
end
|
16
16
|
|
17
17
|
def get(resource_group, name)
|
18
18
|
zone = service.get_zone(resource_group, name)
|
19
|
-
|
20
|
-
|
19
|
+
zone_fog = Fog::DNS::AzureRM::Zone.new(service: service)
|
20
|
+
zone_fog.merge_attributes(Fog::DNS::AzureRM::Zone.parse(zone))
|
21
21
|
end
|
22
22
|
|
23
23
|
def check_for_zone(resource_group, name)
|
@@ -29,7 +29,6 @@ module Fog
|
|
29
29
|
express_route_circuit['service_key'] = circuit.service_key
|
30
30
|
express_route_circuit['service_provider_notes'] = circuit.service_provider_notes
|
31
31
|
express_route_circuit['resource_group'] = get_resource_group_from_id(circuit.id)
|
32
|
-
express_route_circuit['resource_group'] = circuit.id.split('/')[4]
|
33
32
|
express_route_circuit['tags'] = circuit.tags
|
34
33
|
sku = circuit.sku
|
35
34
|
unless sku.nil?
|
@@ -56,8 +55,7 @@ module Fog
|
|
56
55
|
|
57
56
|
def save
|
58
57
|
requires :location, :tags, :resource_group, :service_provider_name, :peering_location, :bandwidth_in_mbps
|
59
|
-
|
60
|
-
circuit = service.create_or_update_express_route_circuit(express_route_parameters)
|
58
|
+
circuit = service.create_or_update_express_route_circuit(express_route_circuit_params)
|
61
59
|
merge_attributes(Fog::Network::AzureRM::ExpressRouteCircuit.parse(circuit))
|
62
60
|
end
|
63
61
|
|
@@ -68,7 +66,7 @@ module Fog
|
|
68
66
|
private
|
69
67
|
|
70
68
|
def express_route_circuit_params
|
71
|
-
|
69
|
+
{
|
72
70
|
resource_group_name: resource_group,
|
73
71
|
circuit_name: name,
|
74
72
|
location: location,
|
@@ -81,7 +79,6 @@ module Fog
|
|
81
79
|
bandwidth_in_mbps: bandwidth_in_mbps,
|
82
80
|
peerings: peerings
|
83
81
|
}
|
84
|
-
express_route_parameters
|
85
82
|
end
|
86
83
|
end
|
87
84
|
end
|