test/integration/traffic_manager.rb in fog-azure-rm-0.0.4 vs test/integration/traffic_manager.rb in fog-azure-rm-0.0.5
- old
+ new
@@ -6,38 +6,38 @@
###################### Keep it Uncommented! ######################
########################################################################################################################
azure_credentials = YAML.load_file('credentials/azure.yml')
-rs = Fog::Resources::AzureRM.new(
+resources = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
client_id: azure_credentials['client_id'],
client_secret: azure_credentials['client_secret'],
subscription_id: azure_credentials['subscription_id']
)
-network = Fog::Network::AzureRM.new(
+traffic_manager = Fog::TrafficManager::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
client_id: azure_credentials['client_id'],
client_secret: azure_credentials['client_secret'],
subscription_id: azure_credentials['subscription_id']
)
########################################################################################################################
###################### Prerequisites ######################
########################################################################################################################
-rs.resource_groups.create(
+resources.resource_groups.create(
name: 'TestRG-TM',
location: 'eastus'
)
########################################################################################################################
###################### Create Traffic Manager Profile ######################
########################################################################################################################
-network.traffic_manager_profiles.create(
+traffic_manager.traffic_manager_profiles.create(
name: 'test-tmp',
resource_group: 'TestRG-TM',
traffic_routing_method: 'Performance',
relative_name: 'testapp',
ttl: '30',
@@ -48,34 +48,34 @@
########################################################################################################################
###################### Create Traffic Manager Endpoint ######################
########################################################################################################################
-network.traffic_manager_end_points.create(
+traffic_manager.traffic_manager_end_points.create(
name: 'myendpoint',
traffic_manager_profile_name: 'test-tmp',
resource_group: 'TestRG-TM',
- type: 'external',
+ type: 'externalEndpoints',
target: 'test-app.com',
endpoint_location: 'eastus'
)
########################################################################################################################
###################### Get and Destroy Traffic Manager Endpoint ######################
########################################################################################################################
-ep = network.traffic_manager_end_points(resource_group: 'TestRG-TM', traffic_manager_profile_name: 'test-tmp').get('myendpoint')
-ep.destroy
+end_point = traffic_manager.traffic_manager_end_points.get('TestRG-TM', 'test-tmp', 'myendpoint', 'externalEndpoints')
+end_point.destroy
########################################################################################################################
###################### Get and Destroy Traffic Manager Profile ######################
########################################################################################################################
-tmp = network.traffic_manager_profiles(resource_group: 'TestRG-TM').get('test-tmp')
-tmp.destroy
+traffic_manager_profile = traffic_manager.traffic_manager_profiles.get('TestRG-TM', 'test-tmp')
+traffic_manager_profile.destroy
########################################################################################################################
###################### CleanUp ######################
########################################################################################################################
-rg = rs.resource_groups.get('TestRG-TM')
-rg.destroy
+resource_group = resources.resource_groups.get('TestRG-TM')
+resource_group.destroy