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
@@ -6,24 +6,24 @@ module ApiStub
|
|
6
6
|
def self.list_zones_response(dns_client)
|
7
7
|
body = '{
|
8
8
|
"value": [{
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
9
|
+
"id":"\/subscriptions\/########-####-####-####-############\/resourceGroups\/fog_test_rg\/providers\/Microsoft.Network\/dnszones\/adnaan.com",
|
10
|
+
"name":"adnaan.com",
|
11
|
+
"type":"Microsoft.Network\/dnszones",
|
12
|
+
"etag":"00000011-0000-0000-19f2-3a6c32b0d101",
|
13
|
+
"location":"global",
|
14
|
+
"tags":{},
|
15
|
+
"properties":
|
16
|
+
{
|
17
|
+
"maxNumberOfRecordSets":5000,
|
18
|
+
"nameServers":null,
|
19
|
+
"numberOfRecordSets":2,
|
20
|
+
"parentResourceGroupName":"fog_test_rg"
|
21
|
+
},
|
22
|
+
"resource_group":"fog-test-rg"
|
23
|
+
}]
|
24
|
+
}'
|
25
25
|
zone_mapper = Azure::ARM::Dns::Models::ZoneListResult.mapper
|
26
|
-
dns_client.deserialize(zone_mapper, JSON.
|
26
|
+
dns_client.deserialize(zone_mapper, Fog::JSON.decode(body), 'result.body').value
|
27
27
|
end
|
28
28
|
|
29
29
|
def self.zone_response(dns_client)
|
@@ -44,7 +44,7 @@ module ApiStub
|
|
44
44
|
"resource_group": "fog-test-rg"
|
45
45
|
}'
|
46
46
|
zone_mapper = Azure::ARM::Dns::Models::Zone.mapper
|
47
|
-
dns_client.deserialize(zone_mapper, JSON.
|
47
|
+
dns_client.deserialize(zone_mapper, Fog::JSON.decode(zone), 'result.body')
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
@@ -39,7 +39,7 @@ module ApiStub
|
|
39
39
|
}
|
40
40
|
}'
|
41
41
|
express_route_circuit_mapper = Azure::ARM::Network::Models::ExpressRouteCircuit.mapper
|
42
|
-
network_client.deserialize(express_route_circuit_mapper, JSON.
|
42
|
+
network_client.deserialize(express_route_circuit_mapper, Fog::JSON.decode(body), 'result.body')
|
43
43
|
end
|
44
44
|
|
45
45
|
def self.list_express_route_circuit_response(network_client)
|
@@ -75,7 +75,7 @@ module ApiStub
|
|
75
75
|
]
|
76
76
|
}'
|
77
77
|
express_route_circuit_mapper = Azure::ARM::Network::Models::ExpressRouteCircuitListResult.mapper
|
78
|
-
network_client.deserialize(express_route_circuit_mapper, JSON.
|
78
|
+
network_client.deserialize(express_route_circuit_mapper, Fog::JSON.decode(body), 'result.body').value
|
79
79
|
end
|
80
80
|
|
81
81
|
def self.peerings
|
@@ -13,7 +13,7 @@ module ApiStub
|
|
13
13
|
}
|
14
14
|
}'
|
15
15
|
circuit_auth_mapper = Azure::ARM::Network::Models::ExpressRouteCircuitAuthorization.mapper
|
16
|
-
network_client.deserialize(circuit_auth_mapper, JSON.
|
16
|
+
network_client.deserialize(circuit_auth_mapper, Fog::JSON.decode(authorization), 'result.body')
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.auth_hash
|
@@ -25,7 +25,7 @@ module ApiStub
|
|
25
25
|
}
|
26
26
|
}'
|
27
27
|
express_route_circuit_mapper = Azure::ARM::Network::Models::ExpressRouteCircuitPeering.mapper
|
28
|
-
network_client.deserialize(express_route_circuit_mapper, JSON.
|
28
|
+
network_client.deserialize(express_route_circuit_mapper, Fog::JSON.decode(body), 'result.body')
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.list_express_route_circuit_peering_response(network_client)
|
@@ -54,7 +54,7 @@ module ApiStub
|
|
54
54
|
]
|
55
55
|
}'
|
56
56
|
express_route_circuit_mapper = Azure::ARM::Network::Models::ExpressRouteCircuitPeeringListResult.mapper
|
57
|
-
network_client.deserialize(express_route_circuit_mapper, JSON.
|
57
|
+
network_client.deserialize(express_route_circuit_mapper, Fog::JSON.decode(body), 'result.body').value
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -22,7 +22,7 @@ module ApiStub
|
|
22
22
|
]
|
23
23
|
}'
|
24
24
|
express_route_servcie_provider_mapper = Azure::ARM::Network::Models::ExpressRouteServiceProviderListResult.mapper
|
25
|
-
network_client.deserialize(express_route_servcie_provider_mapper, JSON.
|
25
|
+
network_client.deserialize(express_route_servcie_provider_mapper, Fog::JSON.decode(service_provider), 'result.body').value
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -146,7 +146,7 @@ module ApiStub
|
|
146
146
|
}
|
147
147
|
}'
|
148
148
|
load_balancer_mapper = Azure::ARM::Network::Models::LoadBalancer.mapper
|
149
|
-
network_client.deserialize(load_balancer_mapper, JSON.
|
149
|
+
network_client.deserialize(load_balancer_mapper, Fog::JSON.decode(response), 'result.body')
|
150
150
|
end
|
151
151
|
|
152
152
|
def self.list_load_balancers_response(network_client)
|
@@ -297,7 +297,7 @@ module ApiStub
|
|
297
297
|
]
|
298
298
|
}'
|
299
299
|
load_balancer_mapper = Azure::ARM::Network::Models::LoadBalancerListResult.mapper
|
300
|
-
network_client.deserialize(load_balancer_mapper, JSON.
|
300
|
+
network_client.deserialize(load_balancer_mapper, Fog::JSON.decode(response), 'result.body')
|
301
301
|
end
|
302
302
|
|
303
303
|
def self.delete_load_balancer_response
|
@@ -64,7 +64,7 @@ module ApiStub
|
|
64
64
|
}
|
65
65
|
}'
|
66
66
|
network_interface_mapper = Azure::ARM::Network::Models::NetworkInterface.mapper
|
67
|
-
network_client.deserialize(network_interface_mapper, JSON.
|
67
|
+
network_client.deserialize(network_interface_mapper, Fog::JSON.decode(body), 'result.body')
|
68
68
|
end
|
69
69
|
|
70
70
|
def self.detach_pip_from_nic_response(network_client)
|
@@ -126,7 +126,7 @@ module ApiStub
|
|
126
126
|
}
|
127
127
|
}'
|
128
128
|
network_interface_mapper = Azure::ARM::Network::Models::NetworkInterface.mapper
|
129
|
-
network_client.deserialize(network_interface_mapper, JSON.
|
129
|
+
network_client.deserialize(network_interface_mapper, Fog::JSON.decode(body), 'result.body')
|
130
130
|
end
|
131
131
|
|
132
132
|
def self.detach_nsg_from_nic_response(network_client)
|
@@ -185,7 +185,7 @@ module ApiStub
|
|
185
185
|
}
|
186
186
|
}'
|
187
187
|
network_interface_mapper = Azure::ARM::Network::Models::NetworkInterface.mapper
|
188
|
-
network_client.deserialize(network_interface_mapper, JSON.
|
188
|
+
network_client.deserialize(network_interface_mapper, Fog::JSON.decode(body), 'result.body')
|
189
189
|
end
|
190
190
|
|
191
191
|
def self.list_network_interfaces_response(network_client)
|
@@ -252,7 +252,7 @@ module ApiStub
|
|
252
252
|
} ]
|
253
253
|
}'
|
254
254
|
network_interface_list_mapper = Azure::ARM::Network::Models::NetworkInterfaceListResult.mapper
|
255
|
-
network_client.deserialize(network_interface_list_mapper, JSON.
|
255
|
+
network_client.deserialize(network_interface_list_mapper, Fog::JSON.decode(body), 'result.body')
|
256
256
|
end
|
257
257
|
|
258
258
|
def self.delete_network_interface_response
|
@@ -65,7 +65,7 @@ module ApiStub
|
|
65
65
|
}
|
66
66
|
}'
|
67
67
|
result_mapper = Azure::ARM::Network::Models::NetworkSecurityGroup.mapper
|
68
|
-
network_client.deserialize(result_mapper, JSON.
|
68
|
+
network_client.deserialize(result_mapper, Fog::JSON.decode(nsg), 'result.body')
|
69
69
|
end
|
70
70
|
|
71
71
|
def self.add_security_rules_response(network_client)
|
@@ -144,7 +144,7 @@ module ApiStub
|
|
144
144
|
}
|
145
145
|
}'
|
146
146
|
result_mapper = Azure::ARM::Network::Models::NetworkSecurityGroup.mapper
|
147
|
-
network_client.deserialize(result_mapper, JSON.
|
147
|
+
network_client.deserialize(result_mapper, Fog::JSON.decode(nsg), 'result.body')
|
148
148
|
end
|
149
149
|
|
150
150
|
def self.list_network_security_group_response(network_client)
|
@@ -217,7 +217,7 @@ module ApiStub
|
|
217
217
|
]
|
218
218
|
}'
|
219
219
|
result_mapper = Azure::ARM::Network::Models::NetworkInterfaceListResult.mapper
|
220
|
-
network_client.deserialize(result_mapper, JSON.
|
220
|
+
network_client.deserialize(result_mapper, Fog::JSON.decode(nsg_list), 'result.body')
|
221
221
|
end
|
222
222
|
end
|
223
223
|
end
|
@@ -22,7 +22,7 @@ module ApiStub
|
|
22
22
|
}
|
23
23
|
}'
|
24
24
|
nsr_mapper = Azure::ARM::Network::Models::SecurityRule.mapper
|
25
|
-
network_client.deserialize(nsr_mapper, JSON.
|
25
|
+
network_client.deserialize(nsr_mapper, Fog::JSON.decode(nsr), 'result.body')
|
26
26
|
end
|
27
27
|
|
28
28
|
def self.network_security_rule_paramteres_hash
|
@@ -64,7 +64,7 @@ module ApiStub
|
|
64
64
|
]
|
65
65
|
}'
|
66
66
|
nsr_mapper = Azure::ARM::Network::Models::SecurityRuleListResult.mapper
|
67
|
-
network_client.deserialize(nsr_mapper, JSON.
|
67
|
+
network_client.deserialize(nsr_mapper, Fog::JSON.decode(nsr_list), 'result.body')
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
@@ -28,7 +28,7 @@ module ApiStub
|
|
28
28
|
}
|
29
29
|
}'
|
30
30
|
public_ip_mapper = Azure::ARM::Network::Models::PublicIPAddress.mapper
|
31
|
-
network_client.deserialize(public_ip_mapper, JSON.
|
31
|
+
network_client.deserialize(public_ip_mapper, Fog::JSON.decode(body), 'result.body')
|
32
32
|
end
|
33
33
|
|
34
34
|
def self.list_public_ips_response(network_client)
|
@@ -59,7 +59,7 @@ module ApiStub
|
|
59
59
|
} ]
|
60
60
|
}'
|
61
61
|
public_ip_mapper = Azure::ARM::Network::Models::PublicIPAddressListResult.mapper
|
62
|
-
network_client.deserialize(public_ip_mapper, JSON.
|
62
|
+
network_client.deserialize(public_ip_mapper, Fog::JSON.decode(body), 'result.body')
|
63
63
|
end
|
64
64
|
|
65
65
|
def self.delete_public_ip_response
|
@@ -28,7 +28,7 @@ module ApiStub
|
|
28
28
|
}
|
29
29
|
}'
|
30
30
|
subnet_mapper = Azure::ARM::Network::Models::Subnet.mapper
|
31
|
-
network_client.deserialize(subnet_mapper, JSON.
|
31
|
+
network_client.deserialize(subnet_mapper, Fog::JSON.decode(body), 'result.body')
|
32
32
|
end
|
33
33
|
|
34
34
|
def self.list_subnets_response(network_client)
|
@@ -59,7 +59,7 @@ module ApiStub
|
|
59
59
|
} ]
|
60
60
|
}'
|
61
61
|
subnet_mapper = Azure::ARM::Network::Models::SubnetListResult.mapper
|
62
|
-
network_client.deserialize(subnet_mapper, JSON.
|
62
|
+
network_client.deserialize(subnet_mapper, Fog::JSON.decode(body), 'result.body')
|
63
63
|
end
|
64
64
|
|
65
65
|
def self.delete_subnet_response
|
@@ -54,7 +54,7 @@ module ApiStub
|
|
54
54
|
}
|
55
55
|
}'
|
56
56
|
vnet_mapper = Azure::ARM::Network::Models::VirtualNetwork.mapper
|
57
|
-
network_client.deserialize(vnet_mapper, JSON.
|
57
|
+
network_client.deserialize(vnet_mapper, Fog::JSON.decode(body), 'result.body')
|
58
58
|
end
|
59
59
|
|
60
60
|
def self.list_virtual_networks_response(network_client)
|
@@ -113,7 +113,7 @@ module ApiStub
|
|
113
113
|
} ]
|
114
114
|
}'
|
115
115
|
vnet_mapper = Azure::ARM::Network::Models::VirtualNetworkListResult.mapper
|
116
|
-
network_client.deserialize(vnet_mapper, JSON.
|
116
|
+
network_client.deserialize(vnet_mapper, Fog::JSON.decode(body), 'result.body')
|
117
117
|
end
|
118
118
|
|
119
119
|
def self.delete_virtual_network_response
|
@@ -16,7 +16,7 @@ module ApiStub
|
|
16
16
|
}
|
17
17
|
}'
|
18
18
|
gateway_mapper = Azure::ARM::Network::Models::VirtualNetworkGateway.mapper
|
19
|
-
network_client.deserialize(gateway_mapper, JSON.
|
19
|
+
network_client.deserialize(gateway_mapper, Fog::JSON.decode(network_gateway), 'result.body')
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.list_virtual_network_gateway_response(network_client)
|
@@ -37,7 +37,7 @@ module ApiStub
|
|
37
37
|
]
|
38
38
|
}'
|
39
39
|
gateway_mapper = Azure::ARM::Network::Models::VirtualNetworkGatewayListResult.mapper
|
40
|
-
network_client.deserialize(gateway_mapper, JSON.
|
40
|
+
network_client.deserialize(gateway_mapper, Fog::JSON.decode(network_gateway), 'result.body')
|
41
41
|
end
|
42
42
|
|
43
43
|
def self.delete_virtual_network_gateway_response
|
@@ -23,7 +23,7 @@ module ApiStub
|
|
23
23
|
}
|
24
24
|
}'
|
25
25
|
connection_mapper = Azure::ARM::Network::Models::VirtualNetworkGatewayConnection.mapper
|
26
|
-
network_client.deserialize(connection_mapper, JSON.
|
26
|
+
network_client.deserialize(connection_mapper, Fog::JSON.decode(gateway_connection), 'result.body')
|
27
27
|
end
|
28
28
|
|
29
29
|
def self.list_virtual_network_gateway_connection_response(network_client)
|
@@ -50,13 +50,13 @@ module ApiStub
|
|
50
50
|
]
|
51
51
|
}'
|
52
52
|
connection_mapper = Azure::ARM::Network::Models::VirtualNetworkGatewayConnectionListResult.mapper
|
53
|
-
network_client.deserialize(connection_mapper, JSON.
|
53
|
+
network_client.deserialize(connection_mapper, Fog::JSON.decode(gateway_connection), 'result.body')
|
54
54
|
end
|
55
55
|
|
56
56
|
def self.get_connection_shared_key_response(network_client)
|
57
57
|
shared_key = '{ "value": "hello" }'
|
58
58
|
shared_key_mapper = Azure::ARM::Network::Models::ConnectionSharedKeyResult.mapper
|
59
|
-
network_client.deserialize(shared_key_mapper, JSON.
|
59
|
+
network_client.deserialize(shared_key_mapper, Fog::JSON.decode(shared_key), 'result.body')
|
60
60
|
end
|
61
61
|
|
62
62
|
def self.delete_virtual_network_gateway_connection_response
|
@@ -17,7 +17,7 @@ module ApiStub
|
|
17
17
|
}
|
18
18
|
}'
|
19
19
|
result_mapper = Azure::ARM::Resources::Models::GenericResource.mapper
|
20
|
-
client.deserialize(result_mapper, JSON.
|
20
|
+
client.deserialize(result_mapper, Fog::JSON.decode(body), 'result.body')
|
21
21
|
end
|
22
22
|
|
23
23
|
def self.list_tagged_resources_response(client)
|
@@ -37,7 +37,7 @@ module ApiStub
|
|
37
37
|
"nextLink": "https://management.azure.com/subscriptions/########-####-####-####-############/resourcegroups?api-version=2015-01-01&$skiptoken=######"
|
38
38
|
}'
|
39
39
|
result_mapper = Azure::ARM::Resources::Models::ResourceListResult.mapper
|
40
|
-
client.deserialize(result_mapper, JSON.
|
40
|
+
client.deserialize(result_mapper, Fog::JSON.decode(body), 'result.body')
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -16,7 +16,7 @@ module ApiStub
|
|
16
16
|
}
|
17
17
|
}'
|
18
18
|
result_mapper = Azure::ARM::Resources::Models::ResourceGroup.mapper
|
19
|
-
client.deserialize(result_mapper, JSON.
|
19
|
+
client.deserialize(result_mapper, Fog::JSON.decode(body), 'result.body')
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.list_resource_group_response(client)
|
@@ -35,7 +35,7 @@ module ApiStub
|
|
35
35
|
"nextLink": "https://management.azure.com/subscriptions/########-####-####-####-############/resourcegroups?api-version=2015-01-01&$skiptoken=######"
|
36
36
|
}'
|
37
37
|
result_mapper = Azure::ARM::Resources::Models::ResourceGroupListResult.mapper
|
38
|
-
client.deserialize(result_mapper, JSON.
|
38
|
+
client.deserialize(result_mapper, Fog::JSON.decode(body), 'result.body')
|
39
39
|
end
|
40
40
|
|
41
41
|
def self.list_resource_groups_for_zones
|
@@ -2,17 +2,46 @@ module ApiStub
|
|
2
2
|
module Requests
|
3
3
|
module Storage
|
4
4
|
# Mock class for Deployment Requests
|
5
|
+
# Below data should be as same as those in Mock classes in lib/fog/azurerm/requests/storage/*.rb
|
5
6
|
class Directory
|
6
|
-
def self.
|
7
|
+
def self.container
|
8
|
+
{
|
9
|
+
'name' => 'test_container',
|
10
|
+
'public_access_level' => nil,
|
11
|
+
'metadata' => {},
|
12
|
+
'properties' => {
|
13
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
14
|
+
'etag' => '0x8D3A3B5F017F52D',
|
15
|
+
'lease_status' => 'unlocked',
|
16
|
+
'lease_state' => 'available'
|
17
|
+
}
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.container_lease_id
|
22
|
+
{ 'leaseId' => 'abc123' }
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.container_object
|
7
26
|
container = Azure::Storage::Blob::Container::Container.new
|
8
|
-
container.
|
9
|
-
container.metadata = metadata_response
|
27
|
+
container.public_access_level = 'container'
|
10
28
|
container
|
11
29
|
end
|
12
30
|
|
13
|
-
def self.
|
31
|
+
def self.raw_container_acl
|
32
|
+
[container_object, {}]
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.container_acl
|
36
|
+
[container_object.public_access_level, {}]
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.container_https_url
|
40
|
+
'https://sa.blob.core.windows.net/test_container?comp=list&restype=container'
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.container_metadata
|
14
44
|
{
|
15
|
-
'container-name' => 'Test-container',
|
16
45
|
'created-by' => 'User',
|
17
46
|
'source-machine' => 'Test-machine',
|
18
47
|
'category' => 'guidance',
|
@@ -20,74 +49,39 @@ module ApiStub
|
|
20
49
|
}
|
21
50
|
end
|
22
51
|
|
23
|
-
def self.
|
24
|
-
{
|
25
|
-
'name' => 'testcontainer1',
|
26
|
-
'properties' =>
|
27
|
-
{
|
28
|
-
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
29
|
-
'etag' => '0x8D3A3B5F017F52D'
|
30
|
-
}
|
31
|
-
}
|
32
|
-
end
|
33
|
-
|
34
|
-
def self.list_containers
|
52
|
+
def self.container_list
|
35
53
|
[
|
36
54
|
{
|
37
|
-
'name' => '
|
38
|
-
'
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
'metadata' => {}
|
55
|
+
'name' => 'test_container1',
|
56
|
+
'metadata' => {},
|
57
|
+
'properties' => {
|
58
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
59
|
+
'etag' => '0x8D3A3B5F017F52D',
|
60
|
+
'lease_status' => 'unlocked',
|
61
|
+
'lease_state' => 'available'
|
62
|
+
}
|
46
63
|
},
|
47
64
|
{
|
48
|
-
'name' => '
|
49
|
-
'
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
'metadata' => {}
|
65
|
+
'name' => 'test_container2',
|
66
|
+
'metadata' => {},
|
67
|
+
'properties' => {
|
68
|
+
'last_modified' => 'Tue, 04 Aug 2015 06:01:08 GMT',
|
69
|
+
'etag' => '0x8D29C92176C8352',
|
70
|
+
'lease_status' => 'unlocked',
|
71
|
+
'lease_state' => 'available'
|
72
|
+
}
|
57
73
|
},
|
58
74
|
{
|
59
|
-
'name' => '
|
60
|
-
'
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
'lease_status' => 'unlocked',
|
65
|
-
'lease_state' => 'available'
|
66
|
-
},
|
67
|
-
'metadata' => {}
|
68
|
-
}
|
69
|
-
]
|
70
|
-
end
|
71
|
-
|
72
|
-
def self.get_container_properties
|
73
|
-
{
|
74
|
-
'name' => 'testcontainer1',
|
75
|
-
'properties' =>
|
76
|
-
{
|
77
|
-
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
78
|
-
'etag' => '0x8D3A3B5F017F52D',
|
75
|
+
'name' => 'test_container3',
|
76
|
+
'metadata' => {},
|
77
|
+
'properties' => {
|
78
|
+
'last_modified' => 'Tue, 01 Sep 2015 05:15:36 GMT',
|
79
|
+
'etag' => '0x8D2B28C5EB36458',
|
79
80
|
'lease_status' => 'unlocked',
|
80
81
|
'lease_state' => 'available'
|
81
|
-
}
|
82
|
-
|
83
|
-
|
84
|
-
end
|
85
|
-
|
86
|
-
def self.get_container_access_control_list
|
87
|
-
[{
|
88
|
-
'name' => 'testcontainer1',
|
89
|
-
'public_access_level' => 'blob'
|
90
|
-
}, {}]
|
82
|
+
}
|
83
|
+
}
|
84
|
+
]
|
91
85
|
end
|
92
86
|
end
|
93
87
|
end
|