fog-azure-rm 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/Gemfile +1 -1
- data/README.md +0 -1
- data/fog-azure-rm.gemspec +4 -1
- data/lib/fog/azurerm.rb +7 -0
- data/lib/fog/azurerm/application_gateway.rb +10 -2
- data/lib/fog/azurerm/compute.rb +14 -4
- data/lib/fog/azurerm/config.rb +0 -51
- data/lib/fog/azurerm/constants.rb +51 -0
- data/lib/fog/azurerm/dns.rb +12 -4
- data/lib/fog/azurerm/docs/application_gateway.md +38 -4
- data/lib/fog/azurerm/docs/compute.md +23 -4
- data/lib/fog/azurerm/docs/dns.md +18 -4
- data/lib/fog/azurerm/docs/key_vault.md +88 -0
- data/lib/fog/azurerm/docs/network.md +98 -9
- data/lib/fog/azurerm/docs/resources.md +24 -4
- data/lib/fog/azurerm/docs/sql.md +5 -6
- data/lib/fog/azurerm/docs/storage.md +12 -0
- data/lib/fog/azurerm/docs/traffic_manager.md +22 -4
- data/lib/fog/azurerm/key_vault.rb +51 -0
- data/lib/fog/azurerm/models/application_gateway/backend_address_pool.rb +2 -0
- data/lib/fog/azurerm/models/application_gateway/backend_http_setting.rb +2 -0
- data/lib/fog/azurerm/models/application_gateway/frontend_ip_configuration.rb +4 -0
- data/lib/fog/azurerm/models/application_gateway/frontend_port.rb +2 -0
- data/lib/fog/azurerm/models/application_gateway/gateway.rb +2 -6
- data/lib/fog/azurerm/models/application_gateway/gateways.rb +4 -0
- data/lib/fog/azurerm/models/application_gateway/http_listener.rb +2 -0
- data/lib/fog/azurerm/models/application_gateway/ip_configuration.rb +3 -0
- data/lib/fog/azurerm/models/application_gateway/probe.rb +2 -0
- data/lib/fog/azurerm/models/application_gateway/request_routing_rule.rb +2 -0
- data/lib/fog/azurerm/models/application_gateway/ssl_certificate.rb +2 -0
- data/lib/fog/azurerm/models/application_gateway/url_path_map.rb +2 -0
- data/lib/fog/azurerm/models/compute/availability_sets.rb +4 -0
- data/lib/fog/azurerm/models/compute/servers.rb +4 -0
- data/lib/fog/azurerm/models/compute/virtual_machine_extensions.rb +4 -0
- data/lib/fog/azurerm/models/dns/record_sets.rb +4 -0
- data/lib/fog/azurerm/models/dns/zones.rb +2 -2
- data/lib/fog/azurerm/models/key_vault/access_policy_entry.rb +31 -0
- data/lib/fog/azurerm/models/key_vault/vault.rb +76 -0
- data/lib/fog/azurerm/models/key_vault/vaults.rb +27 -0
- data/lib/fog/azurerm/models/network/express_route_circuit_authorizations.rb +4 -0
- data/lib/fog/azurerm/models/network/express_route_circuits.rb +4 -0
- data/lib/fog/azurerm/models/network/load_balancers.rb +12 -2
- data/lib/fog/azurerm/models/network/local_network_gateways.rb +4 -0
- data/lib/fog/azurerm/models/network/network_interfaces.rb +4 -0
- data/lib/fog/azurerm/models/network/network_security_groups.rb +4 -0
- data/lib/fog/azurerm/models/network/network_security_rules.rb +4 -0
- data/lib/fog/azurerm/models/network/public_ips.rb +2 -9
- data/lib/fog/azurerm/models/network/subnets.rb +4 -0
- data/lib/fog/azurerm/models/network/virtual_network_gateway_connections.rb +4 -0
- data/lib/fog/azurerm/models/network/virtual_network_gateways.rb +4 -0
- data/lib/fog/azurerm/models/network/virtual_networks.rb +9 -11
- data/lib/fog/azurerm/models/resources/azure_resources.rb +4 -0
- data/lib/fog/azurerm/models/resources/deployments.rb +4 -0
- data/lib/fog/azurerm/models/resources/resource_groups.rb +4 -0
- data/lib/fog/azurerm/models/sql/firewall_rule.rb +5 -17
- data/lib/fog/azurerm/models/sql/firewall_rules.rb +4 -0
- data/lib/fog/azurerm/models/sql/sql_database.rb +4 -21
- data/lib/fog/azurerm/models/sql/sql_databases.rb +4 -0
- data/lib/fog/azurerm/models/sql/sql_server.rb +5 -18
- data/lib/fog/azurerm/models/sql/sql_servers.rb +4 -0
- data/lib/fog/azurerm/models/storage/directories.rb +4 -0
- data/lib/fog/azurerm/models/storage/storage_accounts.rb +4 -0
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_end_points.rb +4 -0
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profiles.rb +4 -0
- data/lib/fog/azurerm/network.rb +22 -4
- data/lib/fog/azurerm/requests/application_gateway/check_ag_exists.rb +31 -0
- data/lib/fog/azurerm/requests/application_gateway/create_or_update_application_gateway.rb +6 -0
- data/lib/fog/azurerm/requests/compute/check_availability_set_exists.rb +31 -0
- data/lib/fog/azurerm/requests/compute/check_vm_exists.rb +31 -0
- data/lib/fog/azurerm/requests/compute/check_vm_extension_exists.rb +31 -0
- data/lib/fog/azurerm/requests/dns/check_record_set_exists.rb +31 -0
- data/lib/fog/azurerm/requests/dns/{check_for_zone.rb → check_zone_exists.rb} +4 -2
- data/lib/fog/azurerm/requests/dns/list_record_sets.rb +1 -1
- data/lib/fog/azurerm/requests/dns/list_zones.rb +2 -2
- data/lib/fog/azurerm/requests/key_vault/check_vault_exists.rb +31 -0
- data/lib/fog/azurerm/requests/key_vault/create_or_update_vault.rb +105 -0
- data/lib/fog/azurerm/requests/key_vault/delete_vault.rb +28 -0
- data/lib/fog/azurerm/requests/key_vault/get_vault.rb +54 -0
- data/lib/fog/azurerm/requests/key_vault/list_vaults.rb +56 -0
- data/lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb +31 -0
- data/lib/fog/azurerm/requests/network/check_express_route_circuit_exists.rb +31 -0
- data/lib/fog/azurerm/requests/network/check_load_balancer_exists.rb +31 -0
- data/lib/fog/azurerm/requests/network/check_local_net_gateway_exists.rb +31 -0
- data/lib/fog/azurerm/requests/network/check_net_sec_group_exists.rb +31 -0
- data/lib/fog/azurerm/requests/network/check_net_sec_rule_exists.rb +31 -0
- data/lib/fog/azurerm/requests/network/check_network_interface_exists.rb +31 -0
- data/lib/fog/azurerm/requests/network/{check_for_public_ip.rb → check_public_ip_exists.rb} +12 -5
- data/lib/fog/azurerm/requests/network/check_subnet_exists.rb +32 -0
- data/lib/fog/azurerm/requests/network/{check_for_virtual_network.rb → check_virtual_network_exists.rb} +11 -6
- data/lib/fog/azurerm/requests/network/check_vnet_gateway_connection_exists.rb +32 -0
- data/lib/fog/azurerm/requests/network/check_vnet_gateway_exists.rb +32 -0
- data/lib/fog/azurerm/requests/network/list_load_balancers_in_subscription.rb +31 -0
- data/lib/fog/azurerm/requests/network/list_virtual_networks_in_subscription.rb +74 -0
- data/lib/fog/azurerm/requests/resources/check_azure_resource_exists.rb +40 -0
- data/lib/fog/azurerm/requests/resources/check_deployment_exists.rb +30 -0
- data/lib/fog/azurerm/requests/resources/check_resource_group_exists.rb +30 -0
- data/lib/fog/azurerm/requests/sql/check_database_exists.rb +21 -0
- data/lib/fog/azurerm/requests/sql/check_firewall_rule_exists.rb +21 -0
- data/lib/fog/azurerm/requests/sql/check_sql_server_exists.rb +21 -0
- data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +26 -32
- data/lib/fog/azurerm/requests/sql/create_or_update_firewall_rule.rb +8 -22
- data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +14 -24
- data/lib/fog/azurerm/requests/sql/delete_database.rb +2 -9
- data/lib/fog/azurerm/requests/sql/delete_firewall_rule.rb +2 -9
- data/lib/fog/azurerm/requests/sql/delete_sql_server.rb +3 -9
- data/lib/fog/azurerm/requests/sql/get_database.rb +4 -10
- data/lib/fog/azurerm/requests/sql/get_firewall_rule.rb +4 -10
- data/lib/fog/azurerm/requests/sql/get_sql_server.rb +3 -10
- data/lib/fog/azurerm/requests/sql/list_databases.rb +3 -10
- data/lib/fog/azurerm/requests/sql/list_firewall_rules.rb +4 -10
- data/lib/fog/azurerm/requests/sql/list_sql_servers.rb +3 -10
- data/lib/fog/azurerm/requests/storage/check_container_exists.rb +30 -0
- data/lib/fog/azurerm/requests/storage/check_storage_account_exists.rb +31 -0
- data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +1 -1
- data/lib/fog/azurerm/requests/storage/delete_recovery_vault.rb +1 -1
- data/lib/fog/azurerm/requests/storage/disable_backup_protection.rb +1 -1
- data/lib/fog/azurerm/requests/storage/enable_backup_protection.rb +1 -1
- data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +1 -1
- data/lib/fog/azurerm/requests/storage/get_backup_container.rb +1 -1
- data/lib/fog/azurerm/requests/storage/get_backup_item.rb +1 -1
- data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +1 -1
- data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +1 -1
- data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +1 -1
- data/lib/fog/azurerm/requests/storage/set_recovery_vault_context.rb +1 -1
- data/lib/fog/azurerm/requests/storage/start_backup.rb +1 -1
- data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_endpoint_exists.rb +31 -0
- data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_profile_exists.rb +31 -0
- data/lib/fog/azurerm/resources.rb +10 -2
- data/lib/fog/azurerm/sql.rb +18 -10
- data/lib/fog/azurerm/storage.rb +4 -0
- data/lib/fog/azurerm/traffic_manager.rb +9 -2
- data/lib/fog/azurerm/version.rb +1 -1
- data/rake-script.sh +3 -10
- data/test/api_stub.rb +8 -0
- data/test/api_stub/models/key_vault/vault.rb +39 -0
- data/test/api_stub/models/sql/sql_database.rb +18 -16
- data/test/api_stub/models/sql/sql_firewall_rule.rb +12 -10
- data/test/api_stub/models/sql/sql_server.rb +12 -10
- data/test/api_stub/requests/key_vault/vault.rb +95 -0
- data/test/api_stub/requests/sql/database.rb +8 -6
- data/test/api_stub/requests/sql/firewall_rule.rb +8 -4
- data/test/api_stub/requests/sql/sql_server.rb +8 -4
- data/test/integration/Virtual_network_gateway_connection.rb +7 -0
- data/test/integration/application_gateway.rb +8 -0
- data/test/integration/availability_set.rb +13 -2
- data/test/integration/blob.rb +0 -6
- data/test/integration/container.rb +7 -0
- data/test/integration/deployment.rb +7 -0
- data/test/integration/express_route_circuit.rb +16 -0
- data/test/integration/external_load_balancer.rb +18 -0
- data/test/integration/key_vault.rb +98 -0
- data/test/integration/local_network_gateway.rb +8 -0
- data/test/integration/network_interface.rb +8 -0
- data/test/integration/network_security_group.rb +8 -0
- data/test/integration/network_security_rule.rb +8 -0
- data/test/integration/public_ip.rb +3 -2
- data/test/integration/record_set.rb +8 -0
- data/test/integration/resource_group.rb +12 -4
- data/test/integration/resource_tag.rb +7 -0
- data/test/integration/server.rb +8 -0
- data/test/integration/sql_server.rb +23 -3
- data/test/integration/storage_account.rb +8 -1
- data/test/integration/subnet.rb +7 -0
- data/test/integration/traffic_manager.rb +14 -0
- data/test/integration/virtual_machine_extension.rb +8 -0
- data/test/integration/virtual_network.rb +13 -4
- data/test/integration/virtual_network_gateway.rb +7 -0
- data/test/integration/zone.rb +8 -0
- data/test/models/application_gateway/test_gateway.rb +1 -0
- data/test/models/application_gateway/test_gateways.rb +14 -1
- data/test/models/compute/test_availability_sets.rb +14 -1
- data/test/models/compute/test_servers.rb +14 -1
- data/test/models/compute/test_virtual_machine_extensions.rb +14 -1
- data/test/models/dns/test_record_sets.rb +14 -1
- data/test/models/dns/test_zones.rb +7 -7
- data/test/models/key_vault/test_vault.rb +39 -0
- data/test/models/key_vault/test_vaults.rb +55 -0
- data/test/models/network/test_express_route_circuit_authorizations.rb +14 -1
- data/test/models/network/test_express_route_circuits.rb +14 -1
- data/test/models/network/test_load_balancers.rb +14 -1
- data/test/models/network/test_local_network_gateways.rb +14 -1
- data/test/models/network/test_network_interfaces.rb +14 -1
- data/test/models/network/test_network_security_groups.rb +14 -1
- data/test/models/network/test_network_security_rules.rb +14 -1
- data/test/models/network/test_public_ips.rb +6 -6
- data/test/models/network/test_subnets.rb +14 -1
- data/test/models/network/test_virtual_network_gateway_connections.rb +14 -1
- data/test/models/network/test_virtual_network_gateways.rb +14 -1
- data/test/models/network/test_virtual_networks.rb +20 -8
- data/test/models/resources/test_deployments.rb +14 -1
- data/test/models/resources/test_resource_groups.rb +14 -1
- data/test/models/resources/test_resources.rb +16 -3
- data/test/models/sql/test_database.rb +3 -4
- data/test/models/sql/test_databases.rb +5 -5
- data/test/models/sql/test_firewall_rule.rb +2 -1
- data/test/models/sql/test_firewall_rules.rb +3 -2
- data/test/models/sql/test_sql_server.rb +2 -1
- data/test/models/sql/test_sql_servers.rb +5 -5
- data/test/models/storage/test_directories.rb +14 -1
- data/test/models/storage/test_storage_accounts.rb +14 -1
- data/test/models/traffic_manager/test_traffic_manager_end_points.rb +14 -1
- data/test/models/traffic_manager/test_traffic_manager_profiles.rb +14 -1
- data/test/requests/application_gateway/test_check_ag_exists.rb +31 -0
- data/test/requests/compute/test_check_availability_set_exists.rb +31 -0
- data/test/requests/compute/test_check_vm_exists.rb +31 -0
- data/test/requests/compute/test_check_vm_extension_exists.rb +31 -0
- data/test/requests/dns/test_check_record_set_exists.rb +31 -0
- data/test/requests/dns/test_check_zone_exists.rb +35 -0
- data/test/requests/dns/test_list_record_sets.rb +35 -0
- data/test/requests/dns/{test_check_for_zone.rb → test_list_zones.rb} +10 -8
- data/test/requests/key_vault/test_check_vault_exists.rb +31 -0
- data/test/requests/key_vault/test_create_or_update_vault.rb +25 -0
- data/test/requests/key_vault/test_delete_vault.rb +23 -0
- data/test/requests/key_vault/test_get_vault.rb +24 -0
- data/test/requests/key_vault/test_list_vaults.rb +24 -0
- data/test/requests/network/test_check_express_route_cir_auth_exists.rb +31 -0
- data/test/requests/network/test_check_express_route_circuit_exists.rb +31 -0
- data/test/requests/network/test_check_load_balancer_exists.rb +31 -0
- data/test/requests/network/test_check_local_net_gateway_exists.rb +31 -0
- data/test/requests/network/test_check_net_sec_group_exists.rb +31 -0
- data/test/requests/network/test_check_net_sec_rule_exists.rb +31 -0
- data/test/requests/network/test_check_network_interface_exists.rb +31 -0
- data/test/requests/network/{test_check_for_public_ip.rb → test_check_public_ip_exists.rb} +8 -8
- data/test/requests/network/test_check_subnet_exists.rb +31 -0
- data/test/requests/network/{test_check_for_virtual_network.rb → test_check_virtual_network_exists.rb} +8 -8
- data/test/requests/network/test_check_vnet_gateway_connection_exists.rb +31 -0
- data/test/requests/network/test_check_vnet_gateway_exists.rb +31 -0
- data/test/requests/network/test_list_virtual_networks_in_subscription.rb +24 -0
- data/test/requests/resources/test_check_azure_resource_exists.rb +22 -0
- data/test/requests/resources/test_check_deployment_exists.rb +29 -0
- data/test/requests/resources/test_check_resource_group_exists.rb +29 -0
- data/test/requests/sql/test_create_or_update_database.rb +9 -12
- data/test/requests/sql/test_create_or_update_firewall_rule.rb +9 -11
- data/test/requests/sql/test_create_or_update_sql_server.rb +9 -12
- data/test/requests/sql/test_delete_database.rb +6 -17
- data/test/requests/sql/test_delete_firewall_rule.rb +6 -17
- data/test/requests/sql/test_delete_sql_server.rb +6 -17
- data/test/requests/sql/test_get_database.rb +7 -18
- data/test/requests/sql/test_get_firewall_rule.rb +7 -18
- data/test/requests/sql/test_get_sql_server.rb +7 -18
- data/test/requests/sql/test_list_databases.rb +7 -18
- data/test/requests/sql/test_list_firewall_rules.rb +7 -18
- data/test/requests/sql/test_list_sql_servers.rb +7 -18
- data/test/requests/storage/test_check_container_exists.rb +18 -0
- data/test/requests/storage/test_check_storage_account_exists.rb +32 -0
- data/test/requests/traffic_manager/test_check_traffic_manager_endpoint_exists.rb +31 -0
- data/test/requests/traffic_manager/test_check_traffic_manager_profile_exists.rb +31 -0
- data/test/test_helper.rb +39 -4
- metadata +125 -10
@@ -3,8 +3,8 @@ module ApiStub
|
|
3
3
|
module Sql
|
4
4
|
# Mock class for Database
|
5
5
|
class SqlDatabase
|
6
|
-
def self.create_database_response
|
7
|
-
'{
|
6
|
+
def self.create_database_response(sql_manager_client)
|
7
|
+
body = '{
|
8
8
|
"name" : "{database-name}",
|
9
9
|
"server_name" : "{server-name}",
|
10
10
|
"location" : "{database-location}",
|
@@ -21,10 +21,12 @@ module ApiStub
|
|
21
21
|
"elasticPoolName" : "{elastic-pool-name}"
|
22
22
|
}
|
23
23
|
}'
|
24
|
+
database_mapper = Azure::ARM::SQL::Models::Database.mapper
|
25
|
+
sql_manager_client.deserialize(database_mapper, Fog::JSON.decode(body), 'result.body')
|
24
26
|
end
|
25
27
|
|
26
|
-
def self.list_database_response
|
27
|
-
'{
|
28
|
+
def self.list_database_response(sql_manager_client)
|
29
|
+
body = '{
|
28
30
|
"value": [{
|
29
31
|
"name" : "{database-name}",
|
30
32
|
"server_name" : "{server-name}",
|
@@ -43,6 +45,8 @@ module ApiStub
|
|
43
45
|
}
|
44
46
|
}]
|
45
47
|
}'
|
48
|
+
database_mapper = Azure::ARM::SQL::Models::DatabaseListResult.mapper
|
49
|
+
sql_manager_client.deserialize(database_mapper, Fog::JSON.decode(body), 'result.body')
|
46
50
|
end
|
47
51
|
|
48
52
|
def self.database_hash
|
@@ -57,8 +61,6 @@ module ApiStub
|
|
57
61
|
collation: 'collation',
|
58
62
|
max_size_bytes: 'max_size_bytes',
|
59
63
|
requested_service_objective_name: 'requested_service_objective_name',
|
60
|
-
restore_point_in_time: 'restore_point_in_time',
|
61
|
-
source_database_deletion_date: 'source_database_deletion_date',
|
62
64
|
elastic_pool_name: 'elastic_pool_name',
|
63
65
|
requested_service_objective_id: 'requested_service_objective_id'
|
64
66
|
}
|
@@ -3,8 +3,8 @@ module ApiStub
|
|
3
3
|
module Sql
|
4
4
|
# Mock class for Firewall Rule
|
5
5
|
class FirewallRule
|
6
|
-
def self.create_firewall_rule_response
|
7
|
-
'{
|
6
|
+
def self.create_firewall_rule_response(sql_manager_client)
|
7
|
+
body = '{
|
8
8
|
"id": "{uri-of-firewall-rule}",
|
9
9
|
"name": "{rule-name}",
|
10
10
|
"type": "{rule-type}",
|
@@ -14,10 +14,12 @@ module ApiStub
|
|
14
14
|
"endIpAddress": "{end-ip-address}"
|
15
15
|
}
|
16
16
|
}'
|
17
|
+
firewall_mapper = Azure::ARM::SQL::Models::ServerFirewallRule.mapper
|
18
|
+
sql_manager_client.deserialize(firewall_mapper, Fog::JSON.decode(body), 'result.body')
|
17
19
|
end
|
18
20
|
|
19
|
-
def self.list_firewall_rule_response
|
20
|
-
'{
|
21
|
+
def self.list_firewall_rule_response(sql_manager_client)
|
22
|
+
body = '{
|
21
23
|
"value": [{
|
22
24
|
"id": "{uri-of-firewall-rule}",
|
23
25
|
"name": "{rule-name}",
|
@@ -29,6 +31,8 @@ module ApiStub
|
|
29
31
|
}
|
30
32
|
}]
|
31
33
|
}'
|
34
|
+
firewall_mapper = Azure::ARM::SQL::Models::ServerFirewallRuleListResult.mapper
|
35
|
+
sql_manager_client.deserialize(firewall_mapper, Fog::JSON.decode(body), 'result.body')
|
32
36
|
end
|
33
37
|
|
34
38
|
def self.firewall_rule_hash
|
@@ -3,8 +3,8 @@ module ApiStub
|
|
3
3
|
module Sql
|
4
4
|
# Mock class for Sql Server
|
5
5
|
class SqlServer
|
6
|
-
def self.create_sql_server_response
|
7
|
-
'{
|
6
|
+
def self.create_sql_server_response(sql_manager_client)
|
7
|
+
body = '{
|
8
8
|
"location" : "{server-location}",
|
9
9
|
"properties" : {
|
10
10
|
"version" : "{server-version}",
|
@@ -12,10 +12,12 @@ module ApiStub
|
|
12
12
|
"administratorLoginPassword" : "{admin-password}"
|
13
13
|
}
|
14
14
|
}'
|
15
|
+
server_mapper = Azure::ARM::SQL::Models::Server.mapper
|
16
|
+
sql_manager_client.deserialize(server_mapper, Fog::JSON.decode(body), 'result.body')
|
15
17
|
end
|
16
18
|
|
17
|
-
def self.list_sql_server_response
|
18
|
-
'{
|
19
|
+
def self.list_sql_server_response(sql_manager_client)
|
20
|
+
body = '{
|
19
21
|
"value": [{
|
20
22
|
"name" : "{database-name}",
|
21
23
|
"server_name" : "{server-name}",
|
@@ -27,6 +29,8 @@ module ApiStub
|
|
27
29
|
}
|
28
30
|
}]
|
29
31
|
}'
|
32
|
+
server_mapper = Azure::ARM::SQL::Models::ServerListResult.mapper
|
33
|
+
sql_manager_client.deserialize(server_mapper, Fog::JSON.decode(body), 'result.body')
|
30
34
|
end
|
31
35
|
|
32
36
|
def self.sql_server_hash
|
@@ -151,6 +151,13 @@ begin
|
|
151
151
|
gateway_default_site: "/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-GC/providers/Microsoft.Network/localNetworkGateways/testlocalnetworkgateway"
|
152
152
|
)
|
153
153
|
|
154
|
+
########################################################################################################################
|
155
|
+
###################### Check Virtual Network Gateway Connection Exists ######################
|
156
|
+
########################################################################################################################
|
157
|
+
|
158
|
+
flag = network.virtual_network_gateway_connections.check_vnet_gateway_connection_exists('TestRG-GC', 'testnetworkgateway2-to-testnetworkgateway')
|
159
|
+
puts "Virtual Network Gateway Connection doesn't exist." unless flag
|
160
|
+
|
154
161
|
########################################################################################################################
|
155
162
|
###################### Create Virtual Network Gateway Connection ###########
|
156
163
|
########################################################################################################################
|
@@ -71,6 +71,13 @@ begin
|
|
71
71
|
public_ip_allocation_method: 'Dynamic'
|
72
72
|
)
|
73
73
|
|
74
|
+
########################################################################################################################
|
75
|
+
###################### Check for Application Gateway ######################
|
76
|
+
########################################################################################################################
|
77
|
+
|
78
|
+
flag = application_gateway.gateways.check_application_gateway_exists(resource_group_name, app_gateway_name)
|
79
|
+
puts "Application Gateway doesn't exist." unless flag
|
80
|
+
|
74
81
|
#######################################################################################################################
|
75
82
|
##################### Create Application Gateway ######################
|
76
83
|
#######################################################################################################################
|
@@ -239,6 +246,7 @@ begin
|
|
239
246
|
|
240
247
|
resource_group = resource.resource_groups.get(resource_group_name)
|
241
248
|
resource_group.destroy
|
249
|
+
puts 'Integration Test for application gateway ran successfully'
|
242
250
|
rescue
|
243
251
|
puts 'Integration Test for application gateway is failing'
|
244
252
|
resource_group.destroy unless resource_group.nil?
|
@@ -12,14 +12,16 @@ rs = Fog::Resources::AzureRM.new(
|
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
13
13
|
client_id: azure_credentials['client_id'],
|
14
14
|
client_secret: azure_credentials['client_secret'],
|
15
|
-
subscription_id: azure_credentials['subscription_id']
|
15
|
+
subscription_id: azure_credentials['subscription_id'],
|
16
|
+
environment: azure_credentials['environment']
|
16
17
|
)
|
17
18
|
|
18
19
|
compute = Fog::Compute::AzureRM.new(
|
19
20
|
tenant_id: azure_credentials['tenant_id'],
|
20
21
|
client_id: azure_credentials['client_id'],
|
21
22
|
client_secret: azure_credentials['client_secret'],
|
22
|
-
subscription_id: azure_credentials['subscription_id']
|
23
|
+
subscription_id: azure_credentials['subscription_id'],
|
24
|
+
environment: azure_credentials['environment']
|
23
25
|
)
|
24
26
|
|
25
27
|
########################################################################################################################
|
@@ -40,6 +42,14 @@ begin
|
|
40
42
|
location: LOCATION
|
41
43
|
)
|
42
44
|
|
45
|
+
|
46
|
+
########################################################################################################################
|
47
|
+
###################### Check for Availability set ######################
|
48
|
+
########################################################################################################################
|
49
|
+
|
50
|
+
flag = compute.availability_sets.check_availability_set_exists(resource_group_name, availability_set_name)
|
51
|
+
puts "Availability set doesn't exist." unless flag
|
52
|
+
|
43
53
|
########################################################################################################################
|
44
54
|
###################### Create Availability Set ######################
|
45
55
|
########################################################################################################################
|
@@ -73,6 +83,7 @@ begin
|
|
73
83
|
|
74
84
|
rg = rs.resource_groups.get(resource_group_name)
|
75
85
|
rg.destroy
|
86
|
+
puts 'Integration Test for availability set ran successfully'
|
76
87
|
rescue
|
77
88
|
puts 'Integration Test for availability set is failing'
|
78
89
|
resource_group.destroy unless resource_group.nil?
|
data/test/integration/blob.rb
CHANGED
@@ -163,12 +163,6 @@ begin
|
|
163
163
|
File.delete(large_page_blob_file_name) if File.exist?(large_page_blob_file_name)
|
164
164
|
end
|
165
165
|
|
166
|
-
########################################################################################################################
|
167
|
-
###################### Blob Exist #####################
|
168
|
-
########################################################################################################################
|
169
|
-
|
170
|
-
puts 'Blob exist' if container.files.head(small_blob_name)
|
171
|
-
|
172
166
|
########################################################################################################################
|
173
167
|
###################### Copy Blob ########################
|
174
168
|
########################################################################################################################
|
@@ -60,6 +60,13 @@ begin
|
|
60
60
|
environment: azure_credentials['environment']
|
61
61
|
)
|
62
62
|
|
63
|
+
########################################################################################################################
|
64
|
+
###################### Check Container Exists ######################
|
65
|
+
########################################################################################################################
|
66
|
+
|
67
|
+
flag = storage_data.directories.check_container_exists(container_name)
|
68
|
+
puts "Container doesn't exist." unless flag
|
69
|
+
|
63
70
|
########################################################################################################################
|
64
71
|
###################### Create Container ######################
|
65
72
|
########################################################################################################################
|
@@ -25,6 +25,13 @@ begin
|
|
25
25
|
location: LOCATION
|
26
26
|
)
|
27
27
|
|
28
|
+
########################################################################################################################
|
29
|
+
###################### Check Deployment Exists ######################
|
30
|
+
########################################################################################################################
|
31
|
+
|
32
|
+
flag = resources.deployments.check_deployment_exists('TestRG-ZN', 'testdeployment')
|
33
|
+
puts "Deployment doesn't exist." unless flag
|
34
|
+
|
28
35
|
########################################################################################################################
|
29
36
|
###################### Create Deployment ############################
|
30
37
|
########################################################################################################################
|
@@ -32,6 +32,14 @@ begin
|
|
32
32
|
location: LOCATION
|
33
33
|
)
|
34
34
|
Fog::Logger.debug 'Resource Group created!'
|
35
|
+
|
36
|
+
########################################################################################################################
|
37
|
+
###################### Check Express Route Circuit Exists? ######################
|
38
|
+
########################################################################################################################
|
39
|
+
|
40
|
+
flag = network.express_route_circuits.check_express_route_circuit_exists('TestRG-ER', 'testERCircuit')
|
41
|
+
puts "Express Route Circuit doesn't exist." unless flag
|
42
|
+
|
35
43
|
########################################################################################################################
|
36
44
|
################ Create Express Route Circuit #################
|
37
45
|
########################################################################################################################
|
@@ -73,6 +81,13 @@ begin
|
|
73
81
|
puts circuit.name
|
74
82
|
end
|
75
83
|
|
84
|
+
########################################################################################################################
|
85
|
+
###################### Check Express Route Circuit Authorization Exists? ######################
|
86
|
+
########################################################################################################################
|
87
|
+
|
88
|
+
flag = network.express_route_circuit_authorizations.check_express_route_cir_auth_exists('TestRG-ER', 'testERCircuit', 'Test-Auth')
|
89
|
+
puts "Express Route Circuit Authorization doesn't exist." unless flag
|
90
|
+
|
76
91
|
########################################################################################################################
|
77
92
|
###################### Create Express Route Circuit Authorizations ####################
|
78
93
|
########################################################################################################################
|
@@ -117,6 +132,7 @@ begin
|
|
117
132
|
########################################################################################################################
|
118
133
|
resource_group = resources.resource_groups.get('TestRG-ER')
|
119
134
|
resource_group.destroy
|
135
|
+
puts 'Integration Test for express route circuit ran successfully'
|
120
136
|
rescue
|
121
137
|
puts 'Integration Test for express route circuit is failing'
|
122
138
|
resource_group.destroy unless resource_group.nil?
|
@@ -54,6 +54,13 @@ begin
|
|
54
54
|
public_ip_allocation_method: 'Dynamic'
|
55
55
|
)
|
56
56
|
|
57
|
+
########################################################################################################################
|
58
|
+
###################### Check Load Balancer Exists? ######################
|
59
|
+
########################################################################################################################
|
60
|
+
|
61
|
+
flag = network.load_balancers.check_load_balancer_exists('TestRG-LB', 'lb')
|
62
|
+
puts "Load Balancer doesn't exist." unless flag
|
63
|
+
|
57
64
|
########################################################################################################################
|
58
65
|
###################### Create Load Balancer ######################
|
59
66
|
########################################################################################################################
|
@@ -111,6 +118,16 @@ begin
|
|
111
118
|
puts a_load_balancer.name
|
112
119
|
end
|
113
120
|
|
121
|
+
########################################################################################################################
|
122
|
+
###################### List External Load Balancers in Subscription ######################
|
123
|
+
########################################################################################################################
|
124
|
+
|
125
|
+
load_balancers = network.load_balancers
|
126
|
+
puts 'List external load balancers in subscription:'
|
127
|
+
load_balancers.each do |a_load_balancer|
|
128
|
+
puts a_load_balancer.name
|
129
|
+
end
|
130
|
+
|
114
131
|
########################################################################################################################
|
115
132
|
###################### Get and Destroy Load Balancer ######################
|
116
133
|
########################################################################################################################
|
@@ -131,6 +148,7 @@ begin
|
|
131
148
|
|
132
149
|
resource_group = rs.resource_groups.get('TestRG-LB')
|
133
150
|
resource_group.destroy
|
151
|
+
puts 'Integration Test for external load balancer ran successfully'
|
134
152
|
rescue
|
135
153
|
puts 'Integration Test for external load balancer is failing'
|
136
154
|
resource_group.destroy unless resource_group.nil?
|
@@ -0,0 +1,98 @@
|
|
1
|
+
require 'fog/azurerm'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
########################################################################################################################
|
5
|
+
###################### Services object required by all actions ######################
|
6
|
+
###################### Keep it Uncommented! ######################
|
7
|
+
########################################################################################################################
|
8
|
+
|
9
|
+
azure_credentials = YAML.load_file('credentials/azure.yml')
|
10
|
+
|
11
|
+
resources = Fog::Resources::AzureRM.new(
|
12
|
+
tenant_id: azure_credentials['tenant_id'],
|
13
|
+
client_id: azure_credentials['client_id'],
|
14
|
+
client_secret: azure_credentials['client_secret'],
|
15
|
+
subscription_id: azure_credentials['subscription_id']
|
16
|
+
)
|
17
|
+
|
18
|
+
key_vault = Fog::KeyVault::AzureRM.new(
|
19
|
+
tenant_id: azure_credentials['tenant_id'],
|
20
|
+
client_id: azure_credentials['client_id'],
|
21
|
+
client_secret: azure_credentials['client_secret'],
|
22
|
+
subscription_id: azure_credentials['subscription_id']
|
23
|
+
)
|
24
|
+
|
25
|
+
########################################################################################################################
|
26
|
+
###################### Prerequisites ######################
|
27
|
+
########################################################################################################################
|
28
|
+
|
29
|
+
begin
|
30
|
+
resources.resource_groups.create(
|
31
|
+
name: 'TestRG-KV',
|
32
|
+
location: 'eastus'
|
33
|
+
)
|
34
|
+
|
35
|
+
########################################################################################################################
|
36
|
+
###################### Check Key Vault Exists? ######################
|
37
|
+
########################################################################################################################
|
38
|
+
|
39
|
+
flag = key_vault.vaults.check_vault_exists('TestRG-KV', 'test-tmp')
|
40
|
+
puts "Key vault doesn't exist." unless flag
|
41
|
+
|
42
|
+
########################################################################################################################
|
43
|
+
###################### Create Vault ######################
|
44
|
+
########################################################################################################################
|
45
|
+
|
46
|
+
access_policies_arr = [
|
47
|
+
{
|
48
|
+
tenant_id: azure_credentials['tenant_id'],
|
49
|
+
object_id: azure_credentials['tenant_id'],
|
50
|
+
permissions: {
|
51
|
+
keys: ['all'],
|
52
|
+
secrets: ['all']
|
53
|
+
}
|
54
|
+
}
|
55
|
+
]
|
56
|
+
|
57
|
+
key_vault.vaults.create(
|
58
|
+
name: 'test-tmp',
|
59
|
+
resource_group: 'TestRG-KV',
|
60
|
+
location: 'eastus',
|
61
|
+
tenant_id: azure_credentials['tenant_id'],
|
62
|
+
sku_family: 'A',
|
63
|
+
sku_name: 'standard',
|
64
|
+
access_policies: access_policies_arr
|
65
|
+
)
|
66
|
+
|
67
|
+
########################################################################################################################
|
68
|
+
###################### List Vault ######################
|
69
|
+
########################################################################################################################
|
70
|
+
|
71
|
+
vaults = key_vault.vaults(resource_group: 'TestRG-KV')
|
72
|
+
vaults.each do |vault|
|
73
|
+
puts vault.name.to_s
|
74
|
+
end
|
75
|
+
|
76
|
+
########################################################################################################################
|
77
|
+
###################### Get Single Vault ######################
|
78
|
+
########################################################################################################################
|
79
|
+
|
80
|
+
vault = key_vault.vaults.get('TestRG-KV', 'test-tmp')
|
81
|
+
|
82
|
+
########################################################################################################################
|
83
|
+
###################### Destroy Vault ######################
|
84
|
+
########################################################################################################################
|
85
|
+
|
86
|
+
vault.destroy
|
87
|
+
|
88
|
+
########################################################################################################################
|
89
|
+
###################### CleanUp ######################
|
90
|
+
########################################################################################################################
|
91
|
+
|
92
|
+
resource_group = resources.resource_groups.get('TestRG-KV')
|
93
|
+
resource_group.destroy
|
94
|
+
puts 'Integration Test for key vault ran successfully'
|
95
|
+
rescue
|
96
|
+
puts 'Integration Test for key vault is failing'
|
97
|
+
resource_group.destroy unless resource_group.nil?
|
98
|
+
end
|
@@ -32,6 +32,13 @@ begin
|
|
32
32
|
location: LOCATION
|
33
33
|
)
|
34
34
|
|
35
|
+
########################################################################################################################
|
36
|
+
###################### Check Local Network Gateway Exists? ######################
|
37
|
+
########################################################################################################################
|
38
|
+
|
39
|
+
flag = network.local_network_gateways.check_local_net_gateway_exists('TestRG-LNG', 'testlocalnetworkgateway')
|
40
|
+
puts "Local Network Gateway doesn't exist." unless flag
|
41
|
+
|
35
42
|
########################################################################################################################
|
36
43
|
###################### Create Local Network Gateway ######################
|
37
44
|
########################################################################################################################
|
@@ -77,6 +84,7 @@ begin
|
|
77
84
|
|
78
85
|
resource_group = resource.resource_groups.get('TestRG-LNG')
|
79
86
|
resource_group.destroy
|
87
|
+
puts 'Integration Test for local network gateway ran successfully'
|
80
88
|
rescue
|
81
89
|
puts 'Integration Test for local network gateway is failing'
|
82
90
|
resource_group.destroy unless resource_group.nil?
|
@@ -87,6 +87,13 @@ begin
|
|
87
87
|
]
|
88
88
|
)
|
89
89
|
|
90
|
+
########################################################################################################################
|
91
|
+
###################### Check Network Interface Exists? ######################
|
92
|
+
########################################################################################################################
|
93
|
+
|
94
|
+
flag = network.network_interfaces.check_network_interface_exists('TestRG-NI', 'NetInt')
|
95
|
+
puts "Network Interface doesn't exist." unless flag
|
96
|
+
|
90
97
|
########################################################################################################################
|
91
98
|
###################### Create Network Interface ######################
|
92
99
|
########################################################################################################################
|
@@ -141,6 +148,7 @@ begin
|
|
141
148
|
|
142
149
|
rg = rs.resource_groups.get('TestRG-NI')
|
143
150
|
rg.destroy
|
151
|
+
puts 'Integration Test for network interface ran successfully'
|
144
152
|
rescue
|
145
153
|
puts 'Integration Test for network interface is failing'
|
146
154
|
resource_group.destroy unless resource_group.nil?
|