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.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +9 -0
- data/lib/fog/azurerm/docs/compute.md +1 -1
- data/lib/fog/azurerm/docs/sql.md +39 -0
- data/lib/fog/azurerm/docs/storage.md +89 -2
- data/lib/fog/azurerm/models/application_gateway/gateways.rb +4 -7
- data/lib/fog/azurerm/models/compute/availability_sets.rb +4 -6
- data/lib/fog/azurerm/models/compute/servers.rb +5 -8
- data/lib/fog/azurerm/models/compute/virtual_machine_extensions.rb +0 -3
- data/lib/fog/azurerm/models/dns/record_sets.rb +5 -9
- data/lib/fog/azurerm/models/dns/zones.rb +4 -7
- data/lib/fog/azurerm/models/network/express_route_circuit_authorizations.rb +0 -3
- data/lib/fog/azurerm/models/network/express_route_circuit_peerings.rb +5 -9
- data/lib/fog/azurerm/models/network/express_route_circuits.rb +4 -7
- data/lib/fog/azurerm/models/network/express_route_service_providers.rb +2 -5
- data/lib/fog/azurerm/models/network/load_balancers.rb +4 -7
- data/lib/fog/azurerm/models/network/local_network_gateways.rb +0 -3
- data/lib/fog/azurerm/models/network/network_interfaces.rb +4 -7
- data/lib/fog/azurerm/models/network/network_security_groups.rb +4 -7
- data/lib/fog/azurerm/models/network/network_security_rules.rb +2 -6
- data/lib/fog/azurerm/models/network/public_ips.rb +4 -7
- data/lib/fog/azurerm/models/network/subnets.rb +5 -9
- data/lib/fog/azurerm/models/network/virtual_network_gateway_connections.rb +0 -3
- data/lib/fog/azurerm/models/network/virtual_network_gateways.rb +4 -7
- data/lib/fog/azurerm/models/network/virtual_networks.rb +4 -7
- data/lib/fog/azurerm/models/resources/azure_resources.rb +2 -5
- data/lib/fog/azurerm/models/resources/deployments.rb +4 -7
- data/lib/fog/azurerm/models/resources/resource_groups.rb +4 -7
- data/lib/fog/azurerm/models/sql/firewall_rule.rb +52 -0
- data/lib/fog/azurerm/models/sql/firewall_rules.rb +28 -0
- data/lib/fog/azurerm/models/storage/data_disk.rb +1 -0
- data/lib/fog/azurerm/models/storage/directories.rb +1 -4
- data/lib/fog/azurerm/models/storage/files.rb +1 -4
- data/lib/fog/azurerm/models/storage/recovery_vault.rb +50 -0
- data/lib/fog/azurerm/models/storage/recovery_vaults.rb +27 -0
- data/lib/fog/azurerm/models/storage/storage_account.rb +23 -4
- data/lib/fog/azurerm/models/storage/storage_accounts.rb +5 -7
- data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +4 -4
- data/lib/fog/azurerm/requests/sql/create_or_update_firewall_rule.rb +56 -0
- data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +4 -5
- data/lib/fog/azurerm/requests/sql/delete_database.rb +4 -4
- data/lib/fog/azurerm/requests/sql/delete_firewall_rule.rb +36 -0
- data/lib/fog/azurerm/requests/sql/delete_sql_server.rb +2 -2
- data/lib/fog/azurerm/requests/sql/get_database.rb +2 -2
- data/lib/fog/azurerm/requests/sql/get_firewall_rule.rb +43 -0
- data/lib/fog/azurerm/requests/sql/get_sql_server.rb +2 -2
- data/lib/fog/azurerm/requests/sql/list_databases.rb +2 -2
- data/lib/fog/azurerm/requests/sql/list_firewall_rules.rb +55 -0
- data/lib/fog/azurerm/requests/sql/list_sql_servers.rb +2 -2
- data/lib/fog/azurerm/requests/storage/create_disk.rb +36 -0
- data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +54 -0
- data/lib/fog/azurerm/requests/storage/create_storage_account.rb +13 -2
- data/lib/fog/azurerm/requests/storage/delete_disk.rb +5 -9
- data/lib/fog/azurerm/requests/storage/delete_recovery_vault.rb +35 -0
- data/lib/fog/azurerm/requests/storage/disable_backup_protection.rb +60 -0
- data/lib/fog/azurerm/requests/storage/enable_backup_protection.rb +61 -0
- data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +56 -0
- data/lib/fog/azurerm/requests/storage/get_backup_container.rb +53 -0
- data/lib/fog/azurerm/requests/storage/get_backup_item.rb +58 -0
- data/lib/fog/azurerm/requests/storage/get_backup_job_for_vm.rb +53 -0
- data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +64 -0
- data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +49 -0
- data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +48 -0
- data/lib/fog/azurerm/requests/storage/set_recovery_vault_context.rb +36 -0
- data/lib/fog/azurerm/requests/storage/start_backup.rb +54 -0
- data/lib/fog/azurerm/requests/storage/update_storage_account.rb +59 -0
- data/lib/fog/azurerm/sql.rb +9 -0
- data/lib/fog/azurerm/storage.rb +24 -0
- data/lib/fog/azurerm/version.rb +1 -1
- data/rake-script.sh +8 -0
- data/rakefile +11 -3
- data/test/api_stub.rb +4 -0
- data/test/api_stub/models/sql/sql_firewall_rule.rb +22 -0
- data/test/api_stub/models/storage/recovery_vault.rb +23 -0
- data/test/api_stub/requests/sql/firewall_rule.rb +46 -0
- data/test/api_stub/requests/storage/recovery_vault.rb +189 -0
- data/test/api_stub/requests/storage/storageaccount.rb +2 -1
- data/test/integration/container.rb +4 -3
- data/test/integration/data_disk.rb +77 -0
- data/test/integration/express_route_circuit.rb +9 -9
- data/test/integration/server.rb +9 -2
- data/test/integration/sql_server.rb +35 -0
- data/test/integration/storage_account.rb +9 -1
- data/test/models/sql/test_firewall_rule.rb +54 -0
- data/test/models/sql/test_firewall_rules.rb +41 -0
- data/test/models/storage/test_recovery_vault.rb +61 -0
- data/test/models/storage/test_recovery_vaults.rb +47 -0
- data/test/models/storage/test_storage_account.rb +8 -1
- data/test/requests/sql/test_create_or_update_firewall_rule.rb +27 -0
- data/test/requests/sql/test_delete_firewall_rule.rb +34 -0
- data/test/requests/sql/test_get_firewall_rule.rb +35 -0
- data/test/requests/sql/test_list_firewall_rules.rb +35 -0
- data/test/requests/storage/test_create_disk.rb +17 -0
- data/test/requests/storage/test_create_recovery_vault.rb +35 -0
- data/test/requests/storage/test_delete_disk.rb +23 -0
- data/test/requests/storage/test_delete_recovery_vault.rb +34 -0
- data/test/requests/storage/test_disable_backup_protection.rb +52 -0
- data/test/requests/storage/test_enable_backup_protection.rb +66 -0
- data/test/requests/storage/test_get_all_backup_jobs.rb +35 -0
- data/test/requests/storage/test_get_backup_container.rb +35 -0
- data/test/requests/storage/test_get_backup_item.rb +35 -0
- data/test/requests/storage/test_get_backup_job_for_vm.rb +26 -0
- data/test/requests/storage/test_get_backup_protection_policy.rb +35 -0
- data/test/requests/storage/test_get_recovery_vault.rb +35 -0
- data/test/requests/storage/test_list_recovery_vault.rb +35 -0
- data/test/requests/storage/test_set_recovery_vault_context.rb +34 -0
- data/test/requests/storage/test_start_backup.rb +55 -0
- data/test/requests/storage/test_update_storage_account.rb +34 -0
- data/test/smoke_tests/compute/test_resource_group_smoke.rb +34 -24
- data/test/test_helper.rb +26 -0
- metadata +55 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcef6aa93014d6ab06b64750d6ab060e209f8d68
|
4
|
+
data.tar.gz: 35bc5f202cb58139facb70944270721c96436ab1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 360d9b598b28e2669f160425a05fd6996d764e52b943cc626ec6df995b2c3754cecc895d404bbade9af4cfa63bb674e6e430cf2b6e284309c4b5c89a407d511b
|
7
|
+
data.tar.gz: 67912e5342afef2657d176406f39a0239377f40d3240e04567641e3c88f5fefa2f513006ce05d9c82780692937ebf47f2c89e5f29b75d75b937b479083045f89
|
data/.travis.yml
CHANGED
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.
|
data/lib/fog/azurerm/docs/sql.md
CHANGED
@@ -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'
|
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('<
|
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
|
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 <<
|
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 =
|
24
|
-
application_gateway.merge_attributes(
|
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
|
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 =
|
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 =
|
28
|
-
availability_set_obj.merge_attributes(
|
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
|
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 <<
|
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
|
-
|
24
|
-
|
25
|
-
|
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/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
|
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 <<
|
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 =
|
29
|
-
record_set_obj.merge_attributes(
|
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
|
7
|
+
model Zone
|
11
8
|
|
12
9
|
def all
|
13
10
|
zones = []
|
14
11
|
service.list_zones.each do |z|
|
15
|
-
zones <<
|
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 =
|
23
|
-
zone_obj.merge_attributes(
|
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,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
|
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 <<
|
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 =
|
26
|
-
express_route_circuit_peering.merge_attributes(
|
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
|
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 <<
|
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 =
|
24
|
-
express_route_circuit.merge_attributes(
|
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
|