fog-azure-rm 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/CHANGELOG.md +9 -0
  4. data/lib/fog/azurerm/docs/compute.md +1 -1
  5. data/lib/fog/azurerm/docs/sql.md +39 -0
  6. data/lib/fog/azurerm/docs/storage.md +89 -2
  7. data/lib/fog/azurerm/models/application_gateway/gateways.rb +4 -7
  8. data/lib/fog/azurerm/models/compute/availability_sets.rb +4 -6
  9. data/lib/fog/azurerm/models/compute/servers.rb +5 -8
  10. data/lib/fog/azurerm/models/compute/virtual_machine_extensions.rb +0 -3
  11. data/lib/fog/azurerm/models/dns/record_sets.rb +5 -9
  12. data/lib/fog/azurerm/models/dns/zones.rb +4 -7
  13. data/lib/fog/azurerm/models/network/express_route_circuit_authorizations.rb +0 -3
  14. data/lib/fog/azurerm/models/network/express_route_circuit_peerings.rb +5 -9
  15. data/lib/fog/azurerm/models/network/express_route_circuits.rb +4 -7
  16. data/lib/fog/azurerm/models/network/express_route_service_providers.rb +2 -5
  17. data/lib/fog/azurerm/models/network/load_balancers.rb +4 -7
  18. data/lib/fog/azurerm/models/network/local_network_gateways.rb +0 -3
  19. data/lib/fog/azurerm/models/network/network_interfaces.rb +4 -7
  20. data/lib/fog/azurerm/models/network/network_security_groups.rb +4 -7
  21. data/lib/fog/azurerm/models/network/network_security_rules.rb +2 -6
  22. data/lib/fog/azurerm/models/network/public_ips.rb +4 -7
  23. data/lib/fog/azurerm/models/network/subnets.rb +5 -9
  24. data/lib/fog/azurerm/models/network/virtual_network_gateway_connections.rb +0 -3
  25. data/lib/fog/azurerm/models/network/virtual_network_gateways.rb +4 -7
  26. data/lib/fog/azurerm/models/network/virtual_networks.rb +4 -7
  27. data/lib/fog/azurerm/models/resources/azure_resources.rb +2 -5
  28. data/lib/fog/azurerm/models/resources/deployments.rb +4 -7
  29. data/lib/fog/azurerm/models/resources/resource_groups.rb +4 -7
  30. data/lib/fog/azurerm/models/sql/firewall_rule.rb +52 -0
  31. data/lib/fog/azurerm/models/sql/firewall_rules.rb +28 -0
  32. data/lib/fog/azurerm/models/storage/data_disk.rb +1 -0
  33. data/lib/fog/azurerm/models/storage/directories.rb +1 -4
  34. data/lib/fog/azurerm/models/storage/files.rb +1 -4
  35. data/lib/fog/azurerm/models/storage/recovery_vault.rb +50 -0
  36. data/lib/fog/azurerm/models/storage/recovery_vaults.rb +27 -0
  37. data/lib/fog/azurerm/models/storage/storage_account.rb +23 -4
  38. data/lib/fog/azurerm/models/storage/storage_accounts.rb +5 -7
  39. data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +4 -4
  40. data/lib/fog/azurerm/requests/sql/create_or_update_firewall_rule.rb +56 -0
  41. data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +4 -5
  42. data/lib/fog/azurerm/requests/sql/delete_database.rb +4 -4
  43. data/lib/fog/azurerm/requests/sql/delete_firewall_rule.rb +36 -0
  44. data/lib/fog/azurerm/requests/sql/delete_sql_server.rb +2 -2
  45. data/lib/fog/azurerm/requests/sql/get_database.rb +2 -2
  46. data/lib/fog/azurerm/requests/sql/get_firewall_rule.rb +43 -0
  47. data/lib/fog/azurerm/requests/sql/get_sql_server.rb +2 -2
  48. data/lib/fog/azurerm/requests/sql/list_databases.rb +2 -2
  49. data/lib/fog/azurerm/requests/sql/list_firewall_rules.rb +55 -0
  50. data/lib/fog/azurerm/requests/sql/list_sql_servers.rb +2 -2
  51. data/lib/fog/azurerm/requests/storage/create_disk.rb +36 -0
  52. data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +54 -0
  53. data/lib/fog/azurerm/requests/storage/create_storage_account.rb +13 -2
  54. data/lib/fog/azurerm/requests/storage/delete_disk.rb +5 -9
  55. data/lib/fog/azurerm/requests/storage/delete_recovery_vault.rb +35 -0
  56. data/lib/fog/azurerm/requests/storage/disable_backup_protection.rb +60 -0
  57. data/lib/fog/azurerm/requests/storage/enable_backup_protection.rb +61 -0
  58. data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +56 -0
  59. data/lib/fog/azurerm/requests/storage/get_backup_container.rb +53 -0
  60. data/lib/fog/azurerm/requests/storage/get_backup_item.rb +58 -0
  61. data/lib/fog/azurerm/requests/storage/get_backup_job_for_vm.rb +53 -0
  62. data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +64 -0
  63. data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +49 -0
  64. data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +48 -0
  65. data/lib/fog/azurerm/requests/storage/set_recovery_vault_context.rb +36 -0
  66. data/lib/fog/azurerm/requests/storage/start_backup.rb +54 -0
  67. data/lib/fog/azurerm/requests/storage/update_storage_account.rb +59 -0
  68. data/lib/fog/azurerm/sql.rb +9 -0
  69. data/lib/fog/azurerm/storage.rb +24 -0
  70. data/lib/fog/azurerm/version.rb +1 -1
  71. data/rake-script.sh +8 -0
  72. data/rakefile +11 -3
  73. data/test/api_stub.rb +4 -0
  74. data/test/api_stub/models/sql/sql_firewall_rule.rb +22 -0
  75. data/test/api_stub/models/storage/recovery_vault.rb +23 -0
  76. data/test/api_stub/requests/sql/firewall_rule.rb +46 -0
  77. data/test/api_stub/requests/storage/recovery_vault.rb +189 -0
  78. data/test/api_stub/requests/storage/storageaccount.rb +2 -1
  79. data/test/integration/container.rb +4 -3
  80. data/test/integration/data_disk.rb +77 -0
  81. data/test/integration/express_route_circuit.rb +9 -9
  82. data/test/integration/server.rb +9 -2
  83. data/test/integration/sql_server.rb +35 -0
  84. data/test/integration/storage_account.rb +9 -1
  85. data/test/models/sql/test_firewall_rule.rb +54 -0
  86. data/test/models/sql/test_firewall_rules.rb +41 -0
  87. data/test/models/storage/test_recovery_vault.rb +61 -0
  88. data/test/models/storage/test_recovery_vaults.rb +47 -0
  89. data/test/models/storage/test_storage_account.rb +8 -1
  90. data/test/requests/sql/test_create_or_update_firewall_rule.rb +27 -0
  91. data/test/requests/sql/test_delete_firewall_rule.rb +34 -0
  92. data/test/requests/sql/test_get_firewall_rule.rb +35 -0
  93. data/test/requests/sql/test_list_firewall_rules.rb +35 -0
  94. data/test/requests/storage/test_create_disk.rb +17 -0
  95. data/test/requests/storage/test_create_recovery_vault.rb +35 -0
  96. data/test/requests/storage/test_delete_disk.rb +23 -0
  97. data/test/requests/storage/test_delete_recovery_vault.rb +34 -0
  98. data/test/requests/storage/test_disable_backup_protection.rb +52 -0
  99. data/test/requests/storage/test_enable_backup_protection.rb +66 -0
  100. data/test/requests/storage/test_get_all_backup_jobs.rb +35 -0
  101. data/test/requests/storage/test_get_backup_container.rb +35 -0
  102. data/test/requests/storage/test_get_backup_item.rb +35 -0
  103. data/test/requests/storage/test_get_backup_job_for_vm.rb +26 -0
  104. data/test/requests/storage/test_get_backup_protection_policy.rb +35 -0
  105. data/test/requests/storage/test_get_recovery_vault.rb +35 -0
  106. data/test/requests/storage/test_list_recovery_vault.rb +35 -0
  107. data/test/requests/storage/test_set_recovery_vault_context.rb +34 -0
  108. data/test/requests/storage/test_start_backup.rb +55 -0
  109. data/test/requests/storage/test_update_storage_account.rb +34 -0
  110. data/test/smoke_tests/compute/test_resource_group_smoke.rb +34 -24
  111. data/test/test_helper.rb +26 -0
  112. metadata +55 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d368c1c1b51e0a2ce92cc1791b88c7fc41c05ecc
4
- data.tar.gz: 9d50a7b320080bc990a6e2e54cef9c5144c9e7c5
3
+ metadata.gz: fcef6aa93014d6ab06b64750d6ab060e209f8d68
4
+ data.tar.gz: 35bc5f202cb58139facb70944270721c96436ab1
5
5
  SHA512:
6
- metadata.gz: b397f190098b56507d6cfae71f290c298282ef4de15e122ee59d38dcb3b3fae6759646824e91a25c78640237b18bb9f7bd61315f3a962c11c4f384653e1b8f36
7
- data.tar.gz: 4503e9320364fa79d212cc5872052a5f72c32f4b96ad7cdfdaaf9260c47a524305c19bc5d2a87281c41cb6d01d7308459dd7fd4713969e22db51d7f37803ee32
6
+ metadata.gz: 360d9b598b28e2669f160425a05fd6996d764e52b943cc626ec6df995b2c3754cecc895d404bbade9af4cfa63bb674e6e430cf2b6e284309c4b5c89a407d511b
7
+ data.tar.gz: 67912e5342afef2657d176406f39a0239377f40d3240e04567641e3c88f5fefa2f513006ce05d9c82780692937ebf47f2c89e5f29b75d75b937b479083045f89
data/.travis.yml CHANGED
@@ -5,6 +5,8 @@ before_install:
5
5
  - gem install bundler
6
6
  - gem update bundler
7
7
 
8
+ script: sh rake-script.sh
9
+
8
10
  matrix:
9
11
  fast_finish: true
10
12
  include:
data/CHANGELOG.md CHANGED
@@ -1,7 +1,16 @@
1
+ ## 0.1.0
2
+
3
+ **Added:**
4
+ - Azure SQL Service - Added support for SQL Server Firewall Rules.
5
+ - Azure Recovery Vault - Added support for Azure Recovery Vault.
6
+ - Azure Storage Service - Encryption support for storage account and Added support to create new data disk.
7
+
8
+
1
9
  ## 0.0.9
2
10
 
3
11
  **Added:**
4
12
  - Azure SQL Service - Added support for SQL Server, SQL Databases and Data warehouse.
13
+ - Updated fog-azure-rm runtime gem dependencies to latest.
5
14
 
6
15
  **Changed:**
7
16
  - DNS Service - DNS Service moved from API calls to Azure latest SDK.
@@ -93,7 +93,7 @@ Get a single record of Server
93
93
  ```ruby
94
94
  server = azure_compute_service
95
95
  .servers(resource_group: '<Resource Group name>')
96
- .get('Server name>')
96
+ .get('<Resource Group name>', 'Server name>')
97
97
  puts "#{server.name}"
98
98
  ```
99
99
 
@@ -125,6 +125,45 @@ Get SQL Database object from the get method(described above) and destroy that Da
125
125
  database.destroy
126
126
  ```
127
127
 
128
+ ## Create Firewall Rule
129
+
130
+ Create a new Firewall Rule
131
+
132
+ ```ruby
133
+ azure_sql_service.firewall_rules.create(
134
+ name: '<Firewall Rule Name>',
135
+ resource_group: '<Resource Group Name>',
136
+ server_location: '<Server Name>',
137
+ start_ip: '<Start IP Address>', # Specifies the starting IP address to allow through the firewall.
138
+ end_ip: '<End IP Address>', # Specifies the ending IP address to allow through the firewall.
139
+
140
+ )
141
+ ```
142
+
143
+ ## List Firewall Rules
144
+ Get a list of Firewall Rules on a SQL Server in given resource group
145
+ ```ruby
146
+ firewall_rules = azure_sql_service.firewall_rules(resource_group: '<Resource Group Name>', server_name: '<Server Name>')
147
+ firewall_rules.each do |firewall_rule|
148
+ puts "Listing : #{firewall_rule.name}"
149
+ end
150
+ ```
151
+
152
+ ## Retrieve a single Firewall Rule
153
+ Get a single record of Firewall rule on SQL Server
154
+ ```ruby
155
+ firewall_rule = azure_sql_service.firewall_rules
156
+ .get('<Resource Group Name>', '<Server Name>', '<Firewall Rule Name>')
157
+ puts "Get: Firewall Rule Name: #{firewall_rule.name}"
158
+ ```
159
+
160
+ ## Destroy a Firewall Rule
161
+ Get Firewall Rule object from the get method(described above) and destroy that Firewall Rule.
162
+
163
+ ```ruby
164
+ firewall_rule.destroy
165
+ ```
166
+
128
167
 
129
168
  ## Support and Feedback
130
169
  Your feedback is appreciated! If you have specific issues with the fog ARM, you should file an issue via Github.
@@ -74,7 +74,8 @@ azure_storage_service.storage_accounts.create(
74
74
  :location => 'West US',
75
75
  :resource_group => '<Resource Group name>',
76
76
  :account_type => '<Standard/Premium>' # Optional. Default value 'Standard'. Allowed values can only be Standard or Premium
77
- :replication => 'LRS' # Optional. Default value 'LRS'
77
+ :replication => 'LRS', # Optional. Default value 'LRS'
78
+ :encryption => true # Optional. If you want to enable encryption. Default value is 'false'
78
79
  )
79
80
  ```
80
81
  Premium Storage account store data on solid state drives (SSDs). For more details on standard and premium storage accounts, see [Introduction to Microsoft Azure Storage](https://azure.microsoft.com/en-us/documentation/articles/storage-introduction/) and [Premium Storage: High-Performance Storage for Azure Virtual Machine Workloads](https://azure.microsoft.com/en-us/documentation/articles/storage-premium-storage/).
@@ -110,6 +111,18 @@ storage_acc = azure_storage_service
110
111
  puts "#{storage_acc.name}"
111
112
  ```
112
113
 
114
+ ## Enable encryption on Storage Account
115
+
116
+ Get a single record of Storage Account and enable encryption on that Storage Account
117
+
118
+ ```ruby
119
+ storage_acc = azure_storage_service
120
+ .storage_accounts
121
+ .get('<Resource Group name>', '<Storage Account name>')
122
+
123
+ storage_acc.update(encryption: true)
124
+ ```
125
+
113
126
  ## Get Access Keys
114
127
 
115
128
  Get access keys of a storage account
@@ -129,12 +142,20 @@ Get storage account object from the get method and then destroy that storage acc
129
142
  storage_acc.destroy
130
143
  ```
131
144
 
145
+ ## Create a Disk
146
+
147
+ Create a Disk in storage account.
148
+
149
+ ```ruby
150
+ azure_storage_service.create_disk('<Data Disk Name>', options = {})
151
+ ```
152
+
132
153
  ## Delete a Disk
133
154
 
134
155
  Delete a Disk from a storage account. Disk must be in unlocked state i.e detached from server(virtual machine) to successfully perform this action.
135
156
 
136
157
  ```ruby
137
- azure_storage_service.delete_disk('<Resource Group name>', '<Storage Account name>', '<Data Disk Name>')
158
+ azure_storage_service.delete_disk('<Data Disk Name>')
138
159
  ```
139
160
 
140
161
  ## Create a storage container
@@ -298,6 +319,72 @@ metadata = {
298
319
  azure_storage_service.directories.set_metadata('<Container name>', metadata)
299
320
  ```
300
321
 
322
+ ### Create Recovery Vault
323
+
324
+ Create a new Recovery Vault object
325
+
326
+ ```ruby
327
+ azure_storage_service.recovery_vaults.create(
328
+ name: '<vault_name>',
329
+ location: '<location>',
330
+ resource_group: '<resource_group_name>'
331
+ ```
332
+
333
+ ### Get Recovery Vault
334
+
335
+ Retrieves a Recovery Vault object
336
+
337
+ ```ruby
338
+ recovery_vault = azure_storage_service.recovery_vaults.get(
339
+ 'Vault Name',
340
+ 'Vault Resource Group'
341
+ )
342
+ ```
343
+
344
+ ### List Recovery Vaults
345
+
346
+ List the Recovery Vaults in a resource group
347
+
348
+ ```ruby
349
+ azure_storage_service.recovery_vaults('Resource Group Name').each do |recovery_vault|
350
+ puts recovery_vault.inspect
351
+ end
352
+ ```
353
+
354
+ ### Enable Backup Protection
355
+
356
+ Enables backup protection for a virtual machine in the recovery vault. Backup protection for a virtual machine must be enabled before running backup.
357
+
358
+ ```ruby
359
+ recovery_vault.enable_backup_protection('Virtual Machine Name', 'Virtual Machine Resource Group')
360
+ ```
361
+
362
+ ### Disable Backup Protection
363
+
364
+ Disables backup protection for a virtual machine in the recovery vault.
365
+
366
+ ```ruby
367
+ recovery_vault.disable_backup_protection('Virtual Machine Name', 'Virtual Machine Resource Group')
368
+ ```
369
+
370
+ ### Start Backup
371
+
372
+ Starts the backup process for a given virtual machine
373
+
374
+ ```ruby
375
+ recovery_vault.start_backup('Virtual Machine Name', 'Virtual Machine Resource Group')
376
+ ```
377
+
378
+ ### Destroy Recovery Vault
379
+
380
+ Destroys the Recovery Vault
381
+
382
+ ```ruby
383
+ recovery_vault.destroy
384
+ ```
385
+
386
+ Note that a Recovery Vault must not contain any backup protectable items or tasks running in order for you to delete it. If any item is present, it must be deleted from the portal first before running this command.
387
+
301
388
  ## Support and Feedback
302
389
  Your feedback is appreciated! If you have specific issues with the fog ARM, you should file an issue via Github.
303
390
 
@@ -1,27 +1,24 @@
1
- require 'fog/core/collection'
2
- require 'fog/azurerm/models/application_gateway/gateway'
3
-
4
1
  module Fog
5
2
  module ApplicationGateway
6
3
  class AzureRM
7
4
  # Application Gateway collection class for Application Gateway Service
8
5
  class Gateways < Fog::Collection
9
- model Fog::ApplicationGateway::AzureRM::Gateway
6
+ model Gateway
10
7
  attribute :resource_group
11
8
 
12
9
  def all
13
10
  requires :resource_group
14
11
  application_gateways = []
15
12
  service.list_application_gateways(resource_group).each do |gateway|
16
- application_gateways << Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway)
13
+ application_gateways << Gateway.parse(gateway)
17
14
  end
18
15
  load(application_gateways)
19
16
  end
20
17
 
21
18
  def get(resource_group_name, application_gateway_name)
22
19
  gateway = service.get_application_gateway(resource_group_name, application_gateway_name)
23
- application_gateway = Fog::ApplicationGateway::AzureRM::Gateway.new(service: service)
24
- application_gateway.merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
20
+ application_gateway = Gateway.new(service: service)
21
+ application_gateway.merge_attributes(Gateway.parse(gateway))
25
22
  end
26
23
  end
27
24
  end
@@ -1,12 +1,10 @@
1
- require 'fog/core/collection'
2
- require 'fog/azurerm/models/compute/availability_set'
3
1
  module Fog
4
2
  module Compute
5
3
  class AzureRM
6
4
  # This class is giving implementation of all/list, get and
7
5
  # check name availability for storage account.
8
6
  class AvailabilitySets < Fog::Collection
9
- model Fog::Compute::AzureRM::AvailabilitySet
7
+ model AvailabilitySet
10
8
  attribute :resource_group
11
9
  def all
12
10
  accounts = []
@@ -15,7 +13,7 @@ module Fog
15
13
  service.list_availability_sets(resource_group)
16
14
  unless list_of_availability_sets.nil?
17
15
  list_of_availability_sets.each do |account|
18
- parse_response = Fog::Compute::AzureRM::AvailabilitySet.parse(account)
16
+ parse_response = AvailabilitySet.parse(account)
19
17
  accounts << parse_response
20
18
  end
21
19
  end
@@ -24,8 +22,8 @@ module Fog
24
22
 
25
23
  def get(resource_group, identity)
26
24
  availability_set = service.get_availability_set(resource_group, identity)
27
- availability_set_obj = Fog::Compute::AzureRM::AvailabilitySet.new(service: service)
28
- availability_set_obj.merge_attributes(Fog::Compute::AzureRM::AvailabilitySet.parse(availability_set))
25
+ availability_set_obj = AvailabilitySet.new(service: service)
26
+ availability_set_obj.merge_attributes(AvailabilitySet.parse(availability_set))
29
27
  end
30
28
  end
31
29
  end
@@ -1,6 +1,3 @@
1
- require 'fog/core/collection'
2
- require 'fog/azurerm/models/compute/server'
3
-
4
1
  module Fog
5
2
  module Compute
6
3
  class AzureRM
@@ -8,21 +5,21 @@ module Fog
8
5
  # for Server.
9
6
  class Servers < Fog::Collection
10
7
  attribute :resource_group
11
- model Fog::Compute::AzureRM::Server
8
+ model Server
12
9
 
13
10
  def all
14
11
  requires :resource_group
15
12
  virtual_machines = []
16
13
  service.list_virtual_machines(resource_group).each do |vm|
17
- virtual_machines << Fog::Compute::AzureRM::Server.parse(vm)
14
+ virtual_machines << Server.parse(vm)
18
15
  end
19
16
  load(virtual_machines)
20
17
  end
21
18
 
22
19
  def get(resource_group_name, virtual_machine_name)
23
- storage_account = service.get_virtual_machine(resource_group_name, virtual_machine_name)
24
- storage_account_obj = Fog::Compute::AzureRM::Server.new(service: service)
25
- storage_account_obj.merge_attributes(Fog::Compute::AzureRM::Server.parse(storage_account))
20
+ virtual_machine = service.get_virtual_machine(resource_group_name, virtual_machine_name)
21
+ virtual_machine_obj = Server.new(service: service)
22
+ virtual_machine_obj.merge_attributes(Server.parse(virtual_machine))
26
23
  end
27
24
  end
28
25
  end
@@ -1,6 +1,3 @@
1
- require 'fog/core/collection'
2
- require 'fog/azurerm/models/compute/virtual_machine_extension'
3
-
4
1
  module Fog
5
2
  module Compute
6
3
  class AzureRM
@@ -1,6 +1,3 @@
1
- require 'fog/core/collection'
2
- require 'fog/azurerm/models/dns/record_set'
3
-
4
1
  module Fog
5
2
  module DNS
6
3
  class AzureRM
@@ -11,22 +8,21 @@ module Fog
11
8
  attribute :zone_name
12
9
  attribute :type
13
10
 
14
- model Fog::DNS::AzureRM::RecordSet
11
+ model RecordSet
15
12
 
16
13
  def all
17
- requires :resource_group
18
- requires :zone_name
14
+ requires :resource_group, :zone_name
19
15
  record_sets = []
20
16
  service.list_record_sets(resource_group, zone_name).each do |r|
21
- record_sets << Fog::DNS::AzureRM::RecordSet.parse(r)
17
+ record_sets << RecordSet.parse(r)
22
18
  end
23
19
  load(record_sets)
24
20
  end
25
21
 
26
22
  def get(resource_group, name, zone_name, record_type)
27
23
  record_set = service.get_record_set(resource_group, name, zone_name, record_type)
28
- record_set_obj = Fog::DNS::AzureRM::RecordSet.new(service: service)
29
- record_set_obj.merge_attributes(Fog::DNS::AzureRM::RecordSet.parse(record_set))
24
+ record_set_obj = RecordSet.new(service: service)
25
+ record_set_obj.merge_attributes(RecordSet.parse(record_set))
30
26
  end
31
27
  end
32
28
  end
@@ -1,26 +1,23 @@
1
- require 'fog/core/collection'
2
- require 'fog/azurerm/models/dns/zone'
3
-
4
1
  module Fog
5
2
  module DNS
6
3
  class AzureRM
7
4
  # This class is giving implementation of
8
5
  # all/get for Zones.
9
6
  class Zones < Fog::Collection
10
- model Fog::DNS::AzureRM::Zone
7
+ model Zone
11
8
 
12
9
  def all
13
10
  zones = []
14
11
  service.list_zones.each do |z|
15
- zones << Fog::DNS::AzureRM::Zone.parse(z)
12
+ zones << Zone.parse(z)
16
13
  end
17
14
  load(zones)
18
15
  end
19
16
 
20
17
  def get(resource_group, name)
21
18
  zone = service.get_zone(resource_group, name)
22
- zone_obj = Fog::DNS::AzureRM::Zone.new(service: service)
23
- zone_obj.merge_attributes(Fog::DNS::AzureRM::Zone.parse(zone))
19
+ zone_obj = Zone.new(service: service)
20
+ zone_obj.merge_attributes(Zone.parse(zone))
24
21
  end
25
22
 
26
23
  def check_for_zone(resource_group, name)
@@ -1,6 +1,3 @@
1
- require 'fog/core/collection'
2
- require 'fog/azurerm/models/network/express_route_circuit_authorization'
3
-
4
1
  module Fog
5
2
  module Network
6
3
  class AzureRM
@@ -1,29 +1,25 @@
1
- require 'fog/core/collection'
2
- require 'fog/azurerm/models/network/express_route_circuit_peering'
3
-
4
1
  module Fog
5
2
  module Network
6
3
  class AzureRM
7
4
  # ExpressRouteCircuitPeering collection class for Network Service
8
5
  class ExpressRouteCircuitPeerings < Fog::Collection
9
- model Fog::Network::AzureRM::ExpressRouteCircuitPeering
6
+ model ExpressRouteCircuitPeering
10
7
  attribute :resource_group
11
8
  attribute :circuit_name
12
9
 
13
10
  def all
14
- requires :resource_group
15
- requires :circuit_name
11
+ requires :resource_group, :circuit_name
16
12
  circuit_peerings = []
17
13
  service.list_express_route_circuit_peerings(resource_group, circuit_name).each do |circuit_peering|
18
- circuit_peerings << Fog::Network::AzureRM::ExpressRouteCircuitPeering.parse(circuit_peering)
14
+ circuit_peerings << ExpressRouteCircuitPeering.parse(circuit_peering)
19
15
  end
20
16
  load(circuit_peerings)
21
17
  end
22
18
 
23
19
  def get(resource_group_name, peering_name, circuit_name)
24
20
  circuit_peering = service.get_express_route_circuit_peering(resource_group_name, peering_name, circuit_name)
25
- express_route_circuit_peering = Fog::Network::AzureRM::ExpressRouteCircuitPeering.new(service: service)
26
- express_route_circuit_peering.merge_attributes(Fog::Network::AzureRM::ExpressRouteCircuitPeering.parse(circuit_peering))
21
+ express_route_circuit_peering = ExpressRouteCircuitPeering.new(service: service)
22
+ express_route_circuit_peering.merge_attributes(ExpressRouteCircuitPeering.parse(circuit_peering))
27
23
  end
28
24
  end
29
25
  end
@@ -1,27 +1,24 @@
1
- require 'fog/core/collection'
2
- require 'fog/azurerm/models/network/express_route_circuit'
3
-
4
1
  module Fog
5
2
  module Network
6
3
  class AzureRM
7
4
  # ExpressRouteCircuit collection class for Network Service
8
5
  class ExpressRouteCircuits < Fog::Collection
9
- model Fog::Network::AzureRM::ExpressRouteCircuit
6
+ model ExpressRouteCircuit
10
7
  attribute :resource_group
11
8
 
12
9
  def all
13
10
  requires :resource_group
14
11
  express_route_circuits = []
15
12
  service.list_express_route_circuits(resource_group).each do |circuit|
16
- express_route_circuits << Fog::Network::AzureRM::ExpressRouteCircuit.parse(circuit)
13
+ express_route_circuits << ExpressRouteCircuit.parse(circuit)
17
14
  end
18
15
  load(express_route_circuits)
19
16
  end
20
17
 
21
18
  def get(resource_group_name, name)
22
19
  circuit = service.get_express_route_circuit(resource_group_name, name)
23
- express_route_circuit = Fog::Network::AzureRM::ExpressRouteCircuit.new(service: service)
24
- express_route_circuit.merge_attributes(Fog::Network::AzureRM::ExpressRouteCircuit.parse(circuit))
20
+ express_route_circuit = ExpressRouteCircuit.new(service: service)
21
+ express_route_circuit.merge_attributes(ExpressRouteCircuit.parse(circuit))
25
22
  end
26
23
  end
27
24
  end