fog-azure-rm-temp 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/.arclint +8 -0
  3. data/.travis.yml +28 -14
  4. data/CHANGELOG.md +77 -0
  5. data/CONTRIBUTORS.md +4 -0
  6. data/fog-azure-rm.gemspec +3 -2
  7. data/lib/fog/azurerm.rb +1 -0
  8. data/lib/fog/azurerm/async_response.rb +9 -1
  9. data/lib/fog/azurerm/compute.rb +3 -1
  10. data/lib/fog/azurerm/constants.rb +11 -3
  11. data/lib/fog/azurerm/dns.rb +3 -1
  12. data/lib/fog/azurerm/docs/application_gateway.md +119 -117
  13. data/lib/fog/azurerm/docs/compute.md +299 -202
  14. data/lib/fog/azurerm/docs/dns.md +44 -43
  15. data/lib/fog/azurerm/docs/key_vault.md +31 -28
  16. data/lib/fog/azurerm/docs/network.md +407 -404
  17. data/lib/fog/azurerm/docs/resources.md +52 -49
  18. data/lib/fog/azurerm/docs/sql.md +56 -54
  19. data/lib/fog/azurerm/docs/storage.md +92 -157
  20. data/lib/fog/azurerm/docs/traffic_manager.md +55 -53
  21. data/lib/fog/azurerm/models/application_gateway/gateway.rb +5 -1
  22. data/lib/fog/azurerm/models/compute/availability_set.rb +4 -1
  23. data/lib/fog/azurerm/models/compute/managed_disk.rb +0 -1
  24. data/lib/fog/azurerm/models/compute/server.rb +61 -11
  25. data/lib/fog/azurerm/models/compute/servers.rb +2 -2
  26. data/lib/fog/azurerm/models/dns/a_record.rb +15 -0
  27. data/lib/fog/azurerm/models/dns/cname_record.rb +15 -0
  28. data/lib/fog/azurerm/models/dns/record_set.rb +20 -8
  29. data/lib/fog/azurerm/models/key_vault/vault.rb +3 -1
  30. data/lib/fog/azurerm/models/network/load_balancer.rb +3 -1
  31. data/lib/fog/azurerm/models/network/local_network_gateway.rb +3 -1
  32. data/lib/fog/azurerm/models/network/network_interface.rb +3 -1
  33. data/lib/fog/azurerm/models/network/network_security_group.rb +4 -2
  34. data/lib/fog/azurerm/models/network/public_ip.rb +4 -2
  35. data/lib/fog/azurerm/models/network/virtual_network.rb +4 -2
  36. data/lib/fog/azurerm/models/resources/resource_group.rb +3 -1
  37. data/lib/fog/azurerm/models/sql/sql_database.rb +3 -3
  38. data/lib/fog/azurerm/models/sql/sql_server.rb +3 -2
  39. data/lib/fog/azurerm/models/storage/directories.rb +6 -1
  40. data/lib/fog/azurerm/models/storage/file.rb +2 -0
  41. data/lib/fog/azurerm/models/storage/storage_account.rb +4 -1
  42. data/lib/fog/azurerm/models/storage/storage_accounts.rb +7 -0
  43. data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +3 -1
  44. data/lib/fog/azurerm/requests/application_gateway/check_ag_exists.rb +1 -1
  45. data/lib/fog/azurerm/requests/application_gateway/create_or_update_application_gateway.rb +1 -0
  46. data/lib/fog/azurerm/requests/compute/attach_data_disk_to_vm.rb +2 -2
  47. data/lib/fog/azurerm/requests/compute/check_availability_set_exists.rb +1 -1
  48. data/lib/fog/azurerm/requests/compute/check_managed_disk_exists.rb +1 -1
  49. data/lib/fog/azurerm/requests/compute/check_vm_exists.rb +1 -1
  50. data/lib/fog/azurerm/requests/compute/check_vm_extension_exists.rb +2 -2
  51. data/lib/fog/azurerm/requests/compute/create_availability_set.rb +4 -2
  52. data/lib/fog/azurerm/requests/compute/create_image.rb +68 -0
  53. data/lib/fog/azurerm/requests/compute/create_virtual_machine.rb +302 -135
  54. data/lib/fog/azurerm/requests/compute/delete_image.rb +29 -0
  55. data/lib/fog/azurerm/requests/compute/get_image.rb +45 -0
  56. data/lib/fog/azurerm/requests/compute/get_virtual_machine.rb +4 -2
  57. data/lib/fog/azurerm/requests/dns/check_record_set_exists.rb +1 -1
  58. data/lib/fog/azurerm/requests/dns/check_zone_exists.rb +3 -2
  59. data/lib/fog/azurerm/requests/dns/create_or_update_record_set.rb +3 -2
  60. data/lib/fog/azurerm/requests/dns/create_or_update_zone.rb +1 -2
  61. data/lib/fog/azurerm/requests/key_vault/check_vault_exists.rb +1 -1
  62. data/lib/fog/azurerm/requests/key_vault/create_or_update_vault.rb +1 -0
  63. data/lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb +1 -1
  64. data/lib/fog/azurerm/requests/network/check_express_route_circuit_exists.rb +1 -1
  65. data/lib/fog/azurerm/requests/network/check_load_balancer_exists.rb +1 -1
  66. data/lib/fog/azurerm/requests/network/check_local_net_gateway_exists.rb +1 -1
  67. data/lib/fog/azurerm/requests/network/check_net_sec_group_exists.rb +1 -1
  68. data/lib/fog/azurerm/requests/network/check_net_sec_rule_exists.rb +1 -1
  69. data/lib/fog/azurerm/requests/network/check_network_interface_exists.rb +1 -1
  70. data/lib/fog/azurerm/requests/network/check_public_ip_exists.rb +1 -1
  71. data/lib/fog/azurerm/requests/network/check_subnet_exists.rb +1 -1
  72. data/lib/fog/azurerm/requests/network/check_virtual_network_exists.rb +1 -1
  73. data/lib/fog/azurerm/requests/network/check_vnet_gateway_connection_exists.rb +1 -1
  74. data/lib/fog/azurerm/requests/network/check_vnet_gateway_exists.rb +1 -1
  75. data/lib/fog/azurerm/requests/network/create_load_balancer.rb +4 -4
  76. data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit.rb +1 -1
  77. data/lib/fog/azurerm/requests/network/create_or_update_local_network_gateway.rb +1 -2
  78. data/lib/fog/azurerm/requests/network/create_or_update_network_interface.rb +4 -3
  79. data/lib/fog/azurerm/requests/network/create_or_update_network_security_group.rb +4 -3
  80. data/lib/fog/azurerm/requests/network/create_or_update_public_ip.rb +5 -3
  81. data/lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb +4 -3
  82. data/lib/fog/azurerm/requests/network/create_or_update_virtual_network_gateway_connection.rb +1 -1
  83. data/lib/fog/azurerm/requests/resources/check_azure_resource_exists.rb +4 -4
  84. data/lib/fog/azurerm/requests/resources/create_resource_group.rb +2 -1
  85. data/lib/fog/azurerm/requests/resources/delete_resource_tag.rb +4 -4
  86. data/lib/fog/azurerm/requests/resources/tag_resource.rb +4 -4
  87. data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +13 -10
  88. data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +8 -5
  89. data/lib/fog/azurerm/requests/storage/check_storage_account_exists.rb +1 -1
  90. data/lib/fog/azurerm/requests/storage/create_storage_account.rb +4 -2
  91. data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_endpoint_exists.rb +1 -1
  92. data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_profile_exists.rb +1 -1
  93. data/lib/fog/azurerm/requests/traffic_manager/create_or_update_traffic_manager_profile.rb +13 -3
  94. data/lib/fog/azurerm/storage.rb +0 -18
  95. data/lib/fog/azurerm/utilities/general.rb +21 -10
  96. data/lib/fog/azurerm/version.rb +1 -1
  97. data/rake-script.sh +7 -1
  98. data/rakefile +1 -1
  99. data/test/api_stub.rb +19 -2
  100. data/test/api_stub/models/compute/server.rb +21 -5
  101. data/test/api_stub/requests/compute/image.rb +41 -0
  102. data/test/api_stub/requests/compute/virtual_machine.rb +60 -62
  103. data/test/api_stub/requests/resources/resource_group.rb +1 -1
  104. data/test/integration/application_gateway.rb +8 -1
  105. data/test/integration/availability_set.rb +9 -2
  106. data/test/integration/external_load_balancer.rb +2 -1
  107. data/test/integration/internal_load_balancer.rb +2 -1
  108. data/test/integration/key_vault.rb +2 -1
  109. data/test/integration/managed_disk.rb +10 -5
  110. data/test/integration/network_interface.rb +2 -1
  111. data/test/integration/network_security_group.rb +2 -1
  112. data/test/integration/public_ip.rb +2 -1
  113. data/test/integration/record_set.rb +5 -5
  114. data/test/integration/resource_group.rb +5 -2
  115. data/test/integration/resource_tag.rb +4 -2
  116. data/test/integration/server.rb +113 -23
  117. data/test/integration/server_custom_image.rb +120 -20
  118. data/test/integration/sql_server.rb +10 -2
  119. data/test/integration/storage_account.rb +32 -20
  120. data/test/integration/traffic_manager.rb +6 -1
  121. data/test/integration/virtual_network.rb +2 -1
  122. data/test/integration/virtual_network_gateway_connection.rb +3 -3
  123. data/test/models/application_gateway/test_gateway.rb +2 -1
  124. data/test/models/compute/test_availability_set.rb +2 -1
  125. data/test/models/compute/test_managed_disk.rb +2 -1
  126. data/test/models/compute/test_server.rb +13 -4
  127. data/test/models/dns/test_zone.rb +2 -1
  128. data/test/models/key_vault/test_vault.rb +2 -1
  129. data/test/models/network/test_load_balancer.rb +2 -1
  130. data/test/models/network/test_network_interface.rb +2 -1
  131. data/test/models/network/test_network_security_group.rb +2 -1
  132. data/test/models/network/test_public_ip.rb +2 -1
  133. data/test/models/network/test_virtual_network.rb +2 -1
  134. data/test/models/resources/test_resource_group.rb +2 -1
  135. data/test/models/sql/test_database.rb +2 -1
  136. data/test/models/sql/test_sql_server.rb +2 -1
  137. data/test/models/storage/test_storage_account.rb +2 -1
  138. data/test/models/traffic_manager/test_traffic_manager_profile.rb +2 -1
  139. data/test/requests/application_gateway/test_check_ag_exists.rb +11 -4
  140. data/test/requests/compute/test_attach_data_disk_to_vm.rb +2 -2
  141. data/test/requests/compute/test_check_availability_set_exists.rb +9 -2
  142. data/test/requests/compute/test_check_managed_disk_exists.rb +9 -2
  143. data/test/requests/compute/test_check_vm_exists.rb +9 -2
  144. data/test/requests/compute/test_check_vm_extension_exists.rb +9 -2
  145. data/test/requests/compute/test_create_image.rb +27 -0
  146. data/test/requests/compute/test_create_virtual_machine.rb +41 -17
  147. data/test/requests/compute/test_delete_image.rb +23 -0
  148. data/test/requests/compute/test_get_image.rb +23 -0
  149. data/test/requests/dns/test_check_record_set_exists.rb +9 -2
  150. data/test/requests/dns/test_check_zone_exists.rb +16 -2
  151. data/test/requests/key_vault/test_check_vault_exists.rb +9 -2
  152. data/test/requests/network/test_check_express_route_cir_auth_exists.rb +9 -2
  153. data/test/requests/network/test_check_express_route_circuit_exists.rb +9 -2
  154. data/test/requests/network/test_check_load_balancer_exists.rb +9 -2
  155. data/test/requests/network/test_check_local_net_gateway_exists.rb +11 -4
  156. data/test/requests/network/test_check_net_sec_group_exists.rb +9 -2
  157. data/test/requests/network/test_check_net_sec_rule_exists.rb +9 -2
  158. data/test/requests/network/test_check_network_interface_exists.rb +9 -2
  159. data/test/requests/network/test_check_public_ip_exists.rb +9 -2
  160. data/test/requests/network/test_check_subnet_exists.rb +9 -2
  161. data/test/requests/network/test_check_virtual_network_exists.rb +10 -4
  162. data/test/requests/network/test_check_vnet_gateway_connection_exists.rb +9 -2
  163. data/test/requests/network/test_check_vnet_gateway_exists.rb +9 -2
  164. data/test/requests/network/test_create_load_balancer.rb +3 -2
  165. data/test/requests/network/test_create_network_interface.rb +4 -3
  166. data/test/requests/network/test_create_or_update_network_security_group.rb +3 -2
  167. data/test/requests/network/test_create_or_update_virtual_network.rb +5 -3
  168. data/test/requests/network/test_create_public_ip.rb +3 -2
  169. data/test/requests/network/test_update_public_ip.rb +3 -2
  170. data/test/requests/resources/test_create_resource_group.rb +3 -2
  171. data/test/requests/resources/test_delete_resource_tag.rb +3 -3
  172. data/test/requests/resources/test_tag_resource.rb +3 -3
  173. data/test/requests/storage/test_check_storage_account_exists.rb +8 -1
  174. data/test/requests/traffic_manager/test_check_traffic_manager_endpoint_exists.rb +9 -2
  175. data/test/requests/traffic_manager/test_check_traffic_manager_profile_exists.rb +9 -2
  176. data/test/test_helper.rb +5 -14
  177. metadata +67 -75
  178. data/lib/fog/azurerm/models/storage/recovery_vault.rb +0 -50
  179. data/lib/fog/azurerm/models/storage/recovery_vaults.rb +0 -27
  180. data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +0 -54
  181. data/lib/fog/azurerm/requests/storage/delete_recovery_vault.rb +0 -35
  182. data/lib/fog/azurerm/requests/storage/disable_backup_protection.rb +0 -60
  183. data/lib/fog/azurerm/requests/storage/enable_backup_protection.rb +0 -61
  184. data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +0 -56
  185. data/lib/fog/azurerm/requests/storage/get_backup_container.rb +0 -53
  186. data/lib/fog/azurerm/requests/storage/get_backup_item.rb +0 -58
  187. data/lib/fog/azurerm/requests/storage/get_backup_job_for_vm.rb +0 -53
  188. data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +0 -64
  189. data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +0 -49
  190. data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +0 -48
  191. data/lib/fog/azurerm/requests/storage/set_recovery_vault_context.rb +0 -36
  192. data/lib/fog/azurerm/requests/storage/start_backup.rb +0 -54
  193. data/test/api_stub/models/storage/recovery_vault.rb +0 -23
  194. data/test/api_stub/requests/storage/recovery_vault.rb +0 -189
  195. data/test/models/storage/test_recovery_vault.rb +0 -61
  196. data/test/models/storage/test_recovery_vaults.rb +0 -47
  197. data/test/requests/storage/test_create_recovery_vault.rb +0 -35
  198. data/test/requests/storage/test_delete_recovery_vault.rb +0 -34
  199. data/test/requests/storage/test_disable_backup_protection.rb +0 -52
  200. data/test/requests/storage/test_enable_backup_protection.rb +0 -66
  201. data/test/requests/storage/test_get_all_backup_jobs.rb +0 -35
  202. data/test/requests/storage/test_get_backup_container.rb +0 -35
  203. data/test/requests/storage/test_get_backup_item.rb +0 -35
  204. data/test/requests/storage/test_get_backup_job_for_vm.rb +0 -26
  205. data/test/requests/storage/test_get_backup_protection_policy.rb +0 -35
  206. data/test/requests/storage/test_get_recovery_vault.rb +0 -35
  207. data/test/requests/storage/test_list_recovery_vault.rb +0 -35
  208. data/test/requests/storage/test_set_recovery_vault_context.rb +0 -34
  209. data/test/requests/storage/test_start_backup.rb +0 -55
@@ -1,6 +1,6 @@
1
1
  # Traffic Manager
2
2
 
3
- This document explains how to get started using Azure Traffic Manager Service with Fog. With this gem you can create/update/list/delete Traffic Manager Profiles and End Points.
3
+ This document explains how to get started using Azure Traffic Manager Service with Fog. With this gem you can create, update, list or delete Traffic Manager Profiles and End Points.
4
4
 
5
5
  ## Usage
6
6
 
@@ -14,19 +14,19 @@ require 'fog/azurerm'
14
14
  Next, create a connection to the Traffic Manager Service:
15
15
 
16
16
  ```ruby
17
- azure_traffic_manager_service = Fog::TrafficManager::AzureRM.new(
18
- tenant_id: '<Tenantid>', # Tenant id of Azure Active Directory Application
19
- client_id: '<Clientid>', # Client id of Azure Active Directory Application
20
- client_secret: '<ClientSecret>', # Client Secret of Azure Active Directory Application
21
- subscription_id: '<Subscriptionid>', # Subscription id of an Azure Account
22
- :environment => '<AzureCloud/AzureChinaCloud/AzureUSGovernment/AzureGermanCloud>' # Azure cloud environment. Default is AzureCloud.
17
+ fog_traffic_manager_service = Fog::TrafficManager::AzureRM.new(
18
+ tenant_id: '<Tenant Id>', # Tenant Id of Azure Active Directory Application
19
+ client_id: '<Client Id>', # Client Id of Azure Active Directory Application
20
+ client_secret: '<Client Secret>', # Client Secret of Azure Active Directory Application
21
+ subscription_id: '<Subscription Id>', # Subscription Id of an Azure Account
22
+ environment: '<AzureCloud/AzureChinaCloud/AzureUSGovernment/AzureGermanCloud>' # Azure cloud environment. Default is AzureCloud.
23
23
  )
24
24
  ```
25
25
 
26
26
  ## Check Traffic Manager Profile Existence
27
27
 
28
28
  ```ruby
29
- azure_traffic_manager_service.traffic_manager_profiles.check_traffic_manager_profile_exists(<Resource Group Name>, <Profile Name>)
29
+ fog_traffic_manager_service.traffic_manager_profiles.check_traffic_manager_profile_exists('<Resource Group Name>', '<Profile Name>')
30
30
  ```
31
31
 
32
32
  ## Create Traffic Manager Profile
@@ -34,16 +34,17 @@ azure_traffic_manager_service.traffic_manager_profiles.check_traffic_manager_pro
34
34
  Create a new Traffic Manager Profile. The parameter 'traffic_routing_method' can be 'Performance', 'Weighted' or 'Priority'.
35
35
 
36
36
  ```ruby
37
- profile = azure_traffic_manager_service.traffic_manager_profiles.create(
37
+ profile = fog_traffic_manager_service.traffic_manager_profiles.create(
38
38
  name: '<Profile Name>',
39
39
  resource_group: '<Resource Group Name>',
40
- traffic_routing_method: 'Performance',
40
+ traffic_routing_method: '<Routing Method Name>',
41
41
  relative_name: '<Profile Relative Name>',
42
- ttl: '30',
43
- protocol: 'http',
44
- port: '80',
45
- path: '/monitorpage.aspx'
46
- )
42
+ ttl: '<TTL>',
43
+ protocol: '<Protocol Name>',
44
+ port: '<Port Number>',
45
+ path: '<Path>',
46
+ tags: { key1: 'value1', key2: 'value2', keyN: 'valueN' } # [Optional]
47
+ )
47
48
  ```
48
49
 
49
50
  ## List Traffic Manager Profiles
@@ -51,10 +52,10 @@ Create a new Traffic Manager Profile. The parameter 'traffic_routing_method' can
51
52
  List Traffic Manager Profiles in a resource group
52
53
 
53
54
  ```ruby
54
- profiles = azure_traffic_manager_service.traffic_manager_profiles(resource_group: '<Resource Group name>')
55
- profiles.each do |profile|
56
- puts "#{profile.name}"
57
- end
55
+ profiles = fog_traffic_manager_service.traffic_manager_profiles(resource_group: '<Resource Group Name>')
56
+ profiles.each do |profile|
57
+ puts "#{profile.name}"
58
+ end
58
59
  ```
59
60
 
60
61
  ## Retrieve a single Traffic Manager Profile
@@ -62,10 +63,10 @@ List Traffic Manager Profiles in a resource group
62
63
  Get a single record of Traffic Manager Profile
63
64
 
64
65
  ```ruby
65
- profile = azure_traffic_manager_service
66
- .traffic_manager_profiles
67
- .get('<Resource Group name>', '<Profile name>')
68
- puts "#{profile.name}"
66
+ profile = fog_traffic_manager_service
67
+ .traffic_manager_profiles
68
+ .get('<Resource Group Name>', '<Profile Name>')
69
+ puts "#{profile.name}"
69
70
  ```
70
71
 
71
72
  ## Update a Traffic Manager Profile
@@ -73,13 +74,13 @@ Get a single record of Traffic Manager Profile
73
74
  Get a Traffic Manager Profile object from the get method and then update that Traffic Manager Profile. You can update the Traffic Manager Profile by passing the modifiable attributes in the form of a hash.
74
75
 
75
76
  ```ruby
76
- profile.update(
77
- traffic_routing_method: 'Weighted',
78
- ttl: '35',
79
- protocol: 'https',
80
- port: '90',
81
- path: '/monitorpage1.aspx'
82
- )
77
+ profile.update(
78
+ traffic_routing_method: '<Routing Method Name>',
79
+ ttl: '<TTL>',
80
+ protocol: '<Protocol Name>',
81
+ port: '<Port Number>',
82
+ path: '<Path>'
83
+ )
83
84
  ```
84
85
 
85
86
  ## Destroy a single Traffic Manager Profile
@@ -87,18 +88,18 @@ Get a Traffic Manager Profile object from the get method and then update that Tr
87
88
  Get a Traffic Manager Profile object from the get method and then destroy that Traffic Manager Profile.
88
89
 
89
90
  ```ruby
90
- profile.destroy
91
+ profile.destroy
91
92
  ```
92
93
 
93
94
  ## Check Traffic Manager Endpoint Existence
94
95
 
95
96
  ```ruby
96
- azure_network_service.traffic_manager_end_points.check_traffic_manager_endpoint_exists(
97
- <Resource Group Name>,
98
- <Profile Name>,
99
- <Endpoint Name>,
100
- <Type(externalEndpoints)>
101
- )
97
+ azure_network_service.traffic_manager_end_points.check_traffic_manager_endpoint_exists(
98
+ '<Resource Group Name>',
99
+ '<Profile Name>',
100
+ '<Endpoint Name>',
101
+ '<Type(<Endpoint Type>)>'
102
+ )
102
103
  ```
103
104
 
104
105
  ## Create Traffic Manager Endpoint
@@ -106,14 +107,14 @@ Get a Traffic Manager Profile object from the get method and then destroy that T
106
107
  Traffic Manager Profile is pre-requisite of Traffic Manager Endpoint. Create a new Traffic Manager Endpoint. The parameter 'type' can be 'externalEndpoints, 'azureEndpoints' or 'nestedEndpoints'.
107
108
 
108
109
  ```ruby
109
- endpoint = azure_network_service.traffic_manager_end_points.create(
110
+ endpoint = azure_network_service.traffic_manager_end_points.create(
110
111
  name: '<Endpoint Name>',
111
112
  traffic_manager_profile_name: '<Profile Name>',
112
113
  resource_group: '<Resource Group Name>',
113
- type: 'externalEndpoints',
114
- target: 'test.com',
115
- endpoint_location: 'West US'
116
- )
114
+ type: '<Endpoint Type>',
115
+ target: '<Target URL>',
116
+ endpoint_location: '<Location>'
117
+ )
117
118
  ```
118
119
 
119
120
  ## List Traffic Manager Endpoints
@@ -121,10 +122,10 @@ Traffic Manager Profile is pre-requisite of Traffic Manager Endpoint. Create a n
121
122
  List Traffic Manager Endpoints in a resource group.
122
123
 
123
124
  ```ruby
124
- endpoints = azure_traffic_manager_service.traffic_manager_end_points(resource_group: '<Resource Group name>', traffic_manager_profile_name: '<Profile Name>')
125
- endpoints.each do |endpoint|
126
- puts "#{endpoint.name}"
127
- end
125
+ endpoints = fog_traffic_manager_service.traffic_manager_end_points(resource_group: '<Resource Group Name>', traffic_manager_profile_name: '<Profile Name>')
126
+ endpoints.each do |endpoint|
127
+ puts "#{endpoint.name}"
128
+ end
128
129
  ```
129
130
 
130
131
  ## Retrieve a single Traffic Manager Endpoint
@@ -132,19 +133,20 @@ List Traffic Manager Endpoints in a resource group.
132
133
  Get a single Traffic Manager Endpoint.
133
134
 
134
135
  ```ruby
135
- endpoint = azure_traffic_manager_service
136
+ endpoint = fog_traffic_manager_service
136
137
  .traffic_manager_end_points
137
- .get('<Resource Group name>', '<Profile Name>', '<Endpoint name>', '<Endpoint type>')
138
- puts "#{endpoint.name}"
138
+ .get('<Resource Group Name>', '<Profile Name>', '<Endpoint name>', '<Endpoint Type>')
139
+ puts "#{endpoint.name}"
139
140
  ```
140
141
  ## Update a Traffic Manager Endpoint
141
142
 
142
143
  Get a Traffic Manager Endpoint object from the get method and then update that Traffic Manager Endpoint. You can update the Traffic Manager Endpoint by passing the modifiable attributes in the form of a hash.
143
144
 
144
145
  ```ruby
145
- endpoint.update(type: 'externalEndpoints',
146
- target: 'test1.com',
147
- endpoint_location: 'Central US')
146
+ endpoint.update(type: '<Endpoint Type>',
147
+ target: '<Target URL>',
148
+ endpoint_location: '<Location>'
149
+ )
148
150
  ```
149
151
 
150
152
  ## Destroy a single Traffic Manager Endpoint
@@ -152,7 +154,7 @@ Get a Traffic Manager Endpoint object from the get method and then update that T
152
154
  Get a Traffic Manager Endpoint object from the get method and then destroy that Traffic Manager Endpoint.
153
155
 
154
156
  ```ruby
155
- endpoint.destroy
157
+ endpoint.destroy
156
158
  ```
157
159
 
158
160
  ## Support and Feedback
@@ -22,6 +22,7 @@ module Fog
22
22
  attribute :http_listeners
23
23
  attribute :url_path_maps
24
24
  attribute :request_routing_rules
25
+ attribute :tags
25
26
 
26
27
  def self.parse(gateway)
27
28
  hash = {}
@@ -96,6 +97,8 @@ module Fog
96
97
  request_routing_rule = Fog::ApplicationGateway::AzureRM::RequestRoutingRule.new
97
98
  hash['request_routing_rules'] << request_routing_rule.merge_attributes(Fog::ApplicationGateway::AzureRM::RequestRoutingRule.parse(rule))
98
99
  end unless gateway.request_routing_rules.nil?
100
+
101
+ hash['tags'] = gateway.tags
99
102
  hash
100
103
  end
101
104
 
@@ -133,7 +136,8 @@ module Fog
133
136
  backend_http_settings_list: backend_http_settings_list,
134
137
  http_listeners: http_listeners,
135
138
  url_path_maps: url_path_maps,
136
- request_routing_rules: request_routing_rules
139
+ request_routing_rules: request_routing_rules,
140
+ tags: tags
137
141
  }
138
142
  end
139
143
 
@@ -13,6 +13,7 @@ module Fog
13
13
  attribute :platform_fault_domain_count
14
14
  attribute :use_managed_disk
15
15
  attribute :sku_name
16
+ attribute :tags
16
17
 
17
18
  def self.parse(availability_set)
18
19
  hash = {}
@@ -29,6 +30,7 @@ module Fog
29
30
  hash['use_managed_disk'] = availability_set.sku.name.eql?(AS_SKU_ALIGNED)
30
31
  end
31
32
 
33
+ hash['tags'] = availability_set.tags
32
34
  hash
33
35
  end
34
36
 
@@ -55,7 +57,8 @@ module Fog
55
57
  resource_group: resource_group,
56
58
  platform_fault_domain_count: platform_fault_domain_count,
57
59
  platform_update_domain_count: platform_update_domain_count,
58
- use_managed_disk: use_managed_disk
60
+ use_managed_disk: use_managed_disk,
61
+ tags: tags
59
62
  }
60
63
  end
61
64
  end
@@ -16,7 +16,6 @@ module Fog
16
16
  attribute :tags
17
17
  attribute :time_created
18
18
  attribute :creation_data
19
-
20
19
  attribute :os_type
21
20
  attribute :encryption_settings
22
21
 
@@ -31,6 +31,11 @@ module Fog
31
31
  attribute :custom_data
32
32
  attribute :vhd_path
33
33
  attribute :managed_disk_storage_type
34
+ attribute :os_disk_size
35
+ attribute :tags
36
+ attribute :platform_update_domain
37
+ attribute :platform_fault_domain
38
+ attribute :image_ref
34
39
 
35
40
  def self.parse(vm)
36
41
  hash = {}
@@ -41,7 +46,7 @@ module Fog
41
46
  hash['vm_size'] = vm.hardware_profile.vm_size unless vm.hardware_profile.vm_size.nil?
42
47
  unless vm.storage_profile.nil?
43
48
  hash['os_disk_name'] = vm.storage_profile.os_disk.name
44
-
49
+ hash['os_disk_size'] = vm.storage_profile.os_disk.disk_size_gb
45
50
  if vm.storage_profile.os_disk.vhd.nil?
46
51
  hash['managed_disk_storage_type'] = vm.storage_profile.os_disk.managed_disk.storage_account_type
47
52
  else
@@ -76,14 +81,21 @@ module Fog
76
81
  end
77
82
  hash['network_interface_card_ids'] = vm.network_profile.network_interfaces.map(&:id)
78
83
  hash['availability_set_id'] = vm.availability_set.id unless vm.availability_set.nil?
84
+ hash['tags'] = vm.tags
85
+
86
+ unless vm.instance_view.nil?
87
+ hash['platform_update_domain'] = vm.instance_view.platform_update_domain
88
+ hash['platform_fault_domain'] = vm.instance_view.platform_fault_domain
89
+ end
79
90
 
80
91
  hash
81
92
  end
82
93
 
83
94
  def save(async = false)
84
- requires :name, :location, :resource_group, :vm_size, :storage_account_name,
85
- :username, :network_interface_card_ids
86
- requires :publisher, :offer, :sku, :version if vhd_path.nil? && managed_disk_storage_type.nil?
95
+ requires :name, :location, :resource_group, :vm_size, :username, :network_interface_card_ids
96
+ requires :publisher, :offer, :sku, :version if vhd_path.nil? && image_ref.nil?
97
+ requires :storage_account_name if managed_disk_storage_type.nil?
98
+ requires :managed_disk_storage_type if storage_account_name.nil?
87
99
 
88
100
  if platform_is_linux?(platform)
89
101
  requires :disable_password_authentication
@@ -97,6 +109,7 @@ module Fog
97
109
  service.create_virtual_machine(virtual_machine_params(ssh_key_path), true)
98
110
  else
99
111
  vm = service.create_virtual_machine(virtual_machine_params(ssh_key_path))
112
+ vm = service.get_virtual_machine(resource_group, name, false)
100
113
  merge_attributes(Fog::Compute::AzureRM::Server.parse(vm))
101
114
  end
102
115
  end
@@ -155,25 +168,37 @@ module Fog
155
168
  async ? create_fog_async_response(response) : merge_attributes(Fog::Compute::AzureRM::Server.parse(response))
156
169
  end
157
170
 
158
- def attach_managed_disk(disk_name, disk_resource_group, async=false)
171
+ def attach_managed_disk(disk_name, disk_resource_group, async = false)
159
172
  response = service.attach_data_disk_to_vm(data_disk_params(disk_name, nil, nil, disk_resource_group), async)
160
173
  async ? create_fog_async_response(response) : merge_attributes(Fog::Compute::AzureRM::Server.parse(response))
161
174
  end
162
175
 
163
- def detach_managed_disk(disk_name, async=false)
176
+ def detach_managed_disk(disk_name, async = false)
164
177
  response = service.detach_data_disk_from_vm(resource_group, name, disk_name, async)
165
178
  async ? create_fog_async_response(response) : merge_attributes(Fog::Compute::AzureRM::Server.parse(response))
166
179
  end
167
180
 
181
+ def delete_extra_resources
182
+ unless vhd_path.nil? || !managed_disk_storage_type.nil?
183
+ service.delete_image(resource_group, name)
184
+ delete_storage_account_or_container(resource_group, storage_account_name, name)
185
+ end
186
+ end
187
+
188
+ def update_attributes
189
+ vm = service.get_virtual_machine(resource_group, name, false)
190
+ merge_attributes(Fog::Compute::AzureRM::Server.parse(vm))
191
+ end
192
+
168
193
  private
169
194
 
170
195
  def platform_is_linux?(platform)
171
196
  platform.strip.casecmp(PLATFORM_LINUX).zero?
172
197
  end
173
198
 
174
- def create_fog_async_response(response)
199
+ def create_fog_async_response(response, delete_extra_resource = false)
175
200
  server = Fog::Compute::AzureRM::Server.new(service: service)
176
- Fog::AzureRM::AsyncResponse.new(server, response)
201
+ Fog::AzureRM::AsyncResponse.new(server, response, delete_extra_resource)
177
202
  end
178
203
 
179
204
  def virtual_machine_params(ssh_key_path)
@@ -200,11 +225,16 @@ module Fog
200
225
  custom_data: custom_data,
201
226
  vhd_path: vhd_path,
202
227
  os_disk_caching: os_disk_caching,
203
- managed_disk_storage_type: managed_disk_storage_type
228
+ managed_disk_storage_type: managed_disk_storage_type,
229
+ os_disk_size: os_disk_size,
230
+ tags: tags,
231
+ image_ref: image_ref,
232
+ os_disk_name: os_disk_name,
233
+ os_disk_vhd_uri: os_disk_vhd_uri
204
234
  }
205
235
  end
206
-
207
- def data_disk_params(disk_name, disk_size=nil, storage_account=nil, disk_resource_group=nil)
236
+
237
+ def data_disk_params(disk_name, disk_size = nil, storage_account = nil, disk_resource_group = nil)
208
238
  {
209
239
  vm_name: name,
210
240
  vm_resource_group: resource_group,
@@ -214,6 +244,26 @@ module Fog
214
244
  disk_resource_group: disk_resource_group
215
245
  }
216
246
  end
247
+
248
+ def delete_storage_account_or_container(resource_group, storage_account_name, vm_name)
249
+ if storage_account_name.nil?
250
+ delete_storage_account(resource_group)
251
+ else
252
+ delete_storage_container(resource_group, storage_account_name, vm_name)
253
+ end
254
+ end
255
+
256
+ def delete_storage_container(resource_group, storage_account_name, vm_name)
257
+ @storage_service = service.instance_variable_get(:@storage_service)
258
+ access_key = @storage_service.get_storage_access_keys(resource_group, storage_account_name).first.value
259
+ container_name = "customvhd-#{vm_name.downcase}-os-image"
260
+ @storage_service.directories.delete_temporary_container(storage_account_name, access_key, container_name)
261
+ end
262
+
263
+ def delete_storage_account(resource_group)
264
+ @storage_service = service.instance_variable_get(:@storage_service)
265
+ @storage_service.storage_accounts.delete_storage_account_from_tag(resource_group, TEMPORARY_STORAGE_ACCOUNT_TAG_KEY, TEMPORARY_STORAGE_ACCOUNT_TAG_VALUE)
266
+ end
217
267
  end
218
268
  end
219
269
  end
@@ -18,8 +18,8 @@ module Fog
18
18
 
19
19
  def create_async(attributes = {})
20
20
  server = new(attributes)
21
- async_response = server.save(true)
22
- Fog::AzureRM::AsyncResponse.new(server, async_response)
21
+ promise = server.save(true)
22
+ Fog::AzureRM::AsyncResponse.new(server, promise, true, 'update_attributes')
23
23
  end
24
24
 
25
25
  def get(resource_group_name, virtual_machine_name, async = false)
@@ -0,0 +1,15 @@
1
+ module Fog
2
+ module DNS
3
+ class AzureRM
4
+ # This class is giving an implementation of 'A' RecordSet type
5
+ class ARecord < Fog::Model
6
+ attribute :ipv4address
7
+
8
+ def self.parse(arecord)
9
+ hash = get_hash_from_object(arecord)
10
+ hash
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module Fog
2
+ module DNS
3
+ class AzureRM
4
+ # This class is giving an implementation of 'CNAME' RecordSet type
5
+ class CnameRecord < Fog::Model
6
+ attribute :cname
7
+
8
+ def self.parse(cnamerecord)
9
+ hash = get_hash_from_object(cnamerecord)
10
+ hash
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end