fog-azure-rm 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.arclint +8 -0
- data/CHANGELOG.md +10 -0
- data/CONTRIBUTORS.md +4 -0
- data/lib/fog/azurerm/compute.rb +1 -0
- data/lib/fog/azurerm/docs/application_gateway.md +6 -7
- data/lib/fog/azurerm/docs/compute.md +45 -11
- data/lib/fog/azurerm/docs/dns.md +4 -1
- data/lib/fog/azurerm/docs/key_vault.md +3 -0
- data/lib/fog/azurerm/docs/network.md +18 -13
- data/lib/fog/azurerm/docs/resources.md +11 -8
- data/lib/fog/azurerm/docs/sql.md +18 -16
- data/lib/fog/azurerm/docs/storage.md +13 -78
- data/lib/fog/azurerm/docs/traffic_manager.md +7 -6
- data/lib/fog/azurerm/models/application_gateway/gateway.rb +5 -1
- data/lib/fog/azurerm/models/compute/availability_set.rb +4 -1
- data/lib/fog/azurerm/models/compute/creation_data.rb +4 -2
- data/lib/fog/azurerm/models/compute/data_disk.rb +26 -0
- data/lib/fog/azurerm/models/compute/managed_disk.rb +4 -4
- data/lib/fog/azurerm/models/compute/server.rb +31 -5
- data/lib/fog/azurerm/models/key_vault/vault.rb +3 -1
- data/lib/fog/azurerm/models/network/load_balancer.rb +3 -1
- data/lib/fog/azurerm/models/network/local_network_gateway.rb +3 -1
- data/lib/fog/azurerm/models/network/network_interface.rb +3 -1
- data/lib/fog/azurerm/models/network/network_security_group.rb +4 -2
- data/lib/fog/azurerm/models/network/public_ip.rb +4 -2
- data/lib/fog/azurerm/models/network/virtual_network.rb +4 -2
- data/lib/fog/azurerm/models/resources/resource_group.rb +3 -1
- data/lib/fog/azurerm/models/sql/sql_database.rb +3 -3
- data/lib/fog/azurerm/models/sql/sql_server.rb +3 -2
- data/lib/fog/azurerm/models/storage/storage_account.rb +4 -1
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +3 -1
- data/lib/fog/azurerm/requests/application_gateway/create_or_update_application_gateway.rb +1 -0
- data/lib/fog/azurerm/requests/compute/attach_data_disk_to_vm.rb +49 -13
- data/lib/fog/azurerm/requests/compute/create_availability_set.rb +4 -2
- data/lib/fog/azurerm/requests/compute/create_virtual_machine.rb +38 -36
- data/lib/fog/azurerm/requests/compute/detach_data_disk_from_vm.rb +1 -2
- data/lib/fog/azurerm/requests/dns/create_or_update_zone.rb +1 -2
- data/lib/fog/azurerm/requests/key_vault/create_or_update_vault.rb +1 -0
- data/lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/create_load_balancer.rb +4 -4
- data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit.rb +1 -1
- data/lib/fog/azurerm/requests/network/create_or_update_local_network_gateway.rb +1 -2
- data/lib/fog/azurerm/requests/network/create_or_update_network_interface.rb +4 -3
- data/lib/fog/azurerm/requests/network/create_or_update_network_security_group.rb +4 -3
- data/lib/fog/azurerm/requests/network/create_or_update_public_ip.rb +5 -3
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb +4 -3
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network_gateway_connection.rb +1 -1
- data/lib/fog/azurerm/requests/resources/check_azure_resource_exists.rb +1 -1
- data/lib/fog/azurerm/requests/resources/create_resource_group.rb +2 -1
- data/lib/fog/azurerm/requests/resources/delete_resource_tag.rb +4 -4
- data/lib/fog/azurerm/requests/resources/tag_resource.rb +4 -4
- data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +13 -10
- data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +8 -5
- data/lib/fog/azurerm/requests/storage/create_storage_account.rb +4 -2
- data/lib/fog/azurerm/requests/traffic_manager/create_or_update_traffic_manager_profile.rb +13 -3
- data/lib/fog/azurerm/storage.rb +0 -19
- data/lib/fog/azurerm/version.rb +1 -1
- data/test/api_stub.rb +0 -2
- data/test/api_stub/models/compute/server.rb +62 -0
- data/test/api_stub/requests/compute/virtual_machine.rb +75 -0
- data/test/api_stub/requests/resources/resource_group.rb +1 -1
- data/test/integration/application_gateway.rb +8 -1
- data/test/integration/availability_set.rb +9 -2
- data/test/integration/external_load_balancer.rb +2 -1
- data/test/integration/internal_load_balancer.rb +2 -1
- data/test/integration/key_vault.rb +2 -1
- data/test/integration/managed_disk.rb +10 -5
- data/test/integration/network_interface.rb +2 -1
- data/test/integration/network_security_group.rb +2 -1
- data/test/integration/public_ip.rb +2 -1
- data/test/integration/resource_group.rb +5 -2
- data/test/integration/resource_tag.rb +4 -2
- data/test/integration/server.rb +81 -3
- data/test/integration/sql_server.rb +10 -2
- data/test/integration/storage_account.rb +32 -20
- data/test/integration/traffic_manager.rb +6 -1
- data/test/integration/virtual_network.rb +2 -1
- data/test/integration/virtual_network_gateway_connection.rb +3 -3
- data/test/models/application_gateway/test_gateway.rb +2 -1
- data/test/models/compute/test_availability_set.rb +2 -1
- data/test/models/{storage → compute}/test_data_disk.rb +2 -2
- data/test/models/compute/test_managed_disk.rb +2 -1
- data/test/models/compute/test_server.rb +31 -2
- data/test/models/dns/test_zone.rb +2 -1
- data/test/models/key_vault/test_vault.rb +2 -1
- data/test/models/network/test_load_balancer.rb +2 -1
- data/test/models/network/test_network_interface.rb +2 -1
- data/test/models/network/test_network_security_group.rb +2 -1
- data/test/models/network/test_public_ip.rb +2 -1
- data/test/models/network/test_virtual_network.rb +2 -1
- data/test/models/resources/test_resource_group.rb +2 -1
- data/test/models/sql/test_database.rb +2 -1
- data/test/models/sql/test_sql_server.rb +2 -1
- data/test/models/storage/test_storage_account.rb +2 -1
- data/test/models/traffic_manager/test_traffic_manager_profile.rb +2 -1
- data/test/requests/compute/test_attach_data_disk_to_vm.rb +21 -6
- data/test/requests/network/test_check_express_route_cir_auth_exists.rb +1 -1
- data/test/requests/network/test_create_load_balancer.rb +3 -2
- data/test/requests/network/test_create_network_interface.rb +4 -3
- data/test/requests/network/test_create_or_update_network_security_group.rb +3 -2
- data/test/requests/network/test_create_or_update_virtual_network.rb +5 -3
- data/test/requests/network/test_create_public_ip.rb +3 -2
- data/test/requests/network/test_update_public_ip.rb +3 -2
- data/test/requests/resources/test_create_resource_group.rb +3 -2
- data/test/requests/resources/test_delete_resource_tag.rb +3 -3
- data/test/requests/resources/test_tag_resource.rb +3 -3
- data/test/test_helper.rb +0 -14
- metadata +5 -36
- data/lib/fog/azurerm/models/storage/data_disk.rb +0 -27
- data/lib/fog/azurerm/models/storage/recovery_vault.rb +0 -50
- data/lib/fog/azurerm/models/storage/recovery_vaults.rb +0 -27
- data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +0 -54
- data/lib/fog/azurerm/requests/storage/delete_recovery_vault.rb +0 -35
- data/lib/fog/azurerm/requests/storage/disable_backup_protection.rb +0 -60
- data/lib/fog/azurerm/requests/storage/enable_backup_protection.rb +0 -61
- data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +0 -56
- data/lib/fog/azurerm/requests/storage/get_backup_container.rb +0 -53
- data/lib/fog/azurerm/requests/storage/get_backup_item.rb +0 -58
- data/lib/fog/azurerm/requests/storage/get_backup_job_for_vm.rb +0 -53
- data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +0 -64
- data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +0 -49
- data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +0 -48
- data/lib/fog/azurerm/requests/storage/set_recovery_vault_context.rb +0 -36
- data/lib/fog/azurerm/requests/storage/start_backup.rb +0 -54
- data/test/api_stub/models/storage/recovery_vault.rb +0 -23
- data/test/api_stub/requests/storage/recovery_vault.rb +0 -189
- data/test/models/storage/test_recovery_vault.rb +0 -61
- data/test/models/storage/test_recovery_vaults.rb +0 -47
- data/test/requests/storage/test_create_recovery_vault.rb +0 -35
- data/test/requests/storage/test_delete_recovery_vault.rb +0 -34
- data/test/requests/storage/test_disable_backup_protection.rb +0 -52
- data/test/requests/storage/test_enable_backup_protection.rb +0 -66
- data/test/requests/storage/test_get_all_backup_jobs.rb +0 -35
- data/test/requests/storage/test_get_backup_container.rb +0 -35
- data/test/requests/storage/test_get_backup_item.rb +0 -35
- data/test/requests/storage/test_get_backup_job_for_vm.rb +0 -26
- data/test/requests/storage/test_get_backup_protection_policy.rb +0 -35
- data/test/requests/storage/test_get_recovery_vault.rb +0 -35
- data/test/requests/storage/test_list_recovery_vault.rb +0 -35
- data/test/requests/storage/test_set_recovery_vault_context.rb +0 -34
- data/test/requests/storage/test_start_backup.rb +0 -55
@@ -15,11 +15,11 @@ Next, create a connection to the Traffic Manager Service:
|
|
15
15
|
|
16
16
|
```ruby
|
17
17
|
azure_traffic_manager_service = Fog::TrafficManager::AzureRM.new(
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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.
|
23
23
|
)
|
24
24
|
```
|
25
25
|
|
@@ -42,7 +42,8 @@ Create a new Traffic Manager Profile. The parameter 'traffic_routing_method' can
|
|
42
42
|
ttl: '30',
|
43
43
|
protocol: 'http',
|
44
44
|
port: '80',
|
45
|
-
path: '/monitorpage.aspx'
|
45
|
+
path: '/monitorpage.aspx',
|
46
|
+
tags: { key1: "value1", key2: "value2", keyN: "valueN" } # [Optional]
|
46
47
|
)
|
47
48
|
```
|
48
49
|
|
@@ -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
|
@@ -11,8 +11,10 @@ module Fog
|
|
11
11
|
|
12
12
|
def self.parse(creation_data)
|
13
13
|
data = get_hash_from_object(creation_data)
|
14
|
-
|
15
|
-
|
14
|
+
unless creation_data.image_reference.nil?
|
15
|
+
image_reference = Fog::Compute::AzureRM::ImageDiskReference.new
|
16
|
+
data['image_reference'] = image_reference.merge_attributes(Fog::Compute::AzureRM::ImageDiskReference.parse(creation_data.image_reference))
|
17
|
+
end
|
16
18
|
data
|
17
19
|
end
|
18
20
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class AzureRM
|
4
|
+
# DataDisk Model for Compute Service
|
5
|
+
class DataDisk < Fog::Model
|
6
|
+
identity :name
|
7
|
+
attribute :disk_size_gb
|
8
|
+
attribute :lun
|
9
|
+
attribute :caching
|
10
|
+
attribute :create_option
|
11
|
+
# For these composite objects we ONLY need one field
|
12
|
+
attribute :vhd_uri
|
13
|
+
attribute :image_uri
|
14
|
+
attribute :managed_disk_id
|
15
|
+
|
16
|
+
def self.parse(disk)
|
17
|
+
disk_hash = get_hash_from_object(disk)
|
18
|
+
disk_hash['vhd_uri'] = disk.vhd.uri if disk.vhd
|
19
|
+
disk_hash['image_uri'] = disk.image.uri if disk.image
|
20
|
+
disk_hash['managed_disk_id'] = disk.managed_disk.id if disk.managed_disk
|
21
|
+
disk_hash
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -6,17 +6,17 @@ module Fog
|
|
6
6
|
class ManagedDisk < Fog::Model
|
7
7
|
attribute :id
|
8
8
|
identity :name
|
9
|
-
attribute :resource_group_name
|
10
9
|
attribute :type
|
11
10
|
attribute :location
|
11
|
+
attribute :resource_group_name
|
12
12
|
attribute :account_type
|
13
|
-
attribute :time_created
|
14
|
-
attribute :os_type
|
15
13
|
attribute :disk_size_gb
|
16
14
|
attribute :owner_id
|
17
15
|
attribute :provisioning_state
|
18
16
|
attribute :tags
|
17
|
+
attribute :time_created
|
19
18
|
attribute :creation_data
|
19
|
+
attribute :os_type
|
20
20
|
attribute :encryption_settings
|
21
21
|
|
22
22
|
def self.parse(managed_disk)
|
@@ -39,7 +39,7 @@ module Fog
|
|
39
39
|
|
40
40
|
def save
|
41
41
|
requires :name, :location, :resource_group_name, :creation_data
|
42
|
-
requires :disk_size_gb
|
42
|
+
requires :disk_size_gb, :account_type
|
43
43
|
validate_creation_data_params(creation_data)
|
44
44
|
|
45
45
|
disk = service.create_or_update_managed_disk(managed_disk_params)
|
@@ -31,6 +31,8 @@ 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
|
34
36
|
|
35
37
|
def self.parse(vm)
|
36
38
|
hash = {}
|
@@ -41,7 +43,7 @@ module Fog
|
|
41
43
|
hash['vm_size'] = vm.hardware_profile.vm_size unless vm.hardware_profile.vm_size.nil?
|
42
44
|
unless vm.storage_profile.nil?
|
43
45
|
hash['os_disk_name'] = vm.storage_profile.os_disk.name
|
44
|
-
|
46
|
+
hash['os_disk_size'] = vm.storage_profile.os_disk.disk_size_gb
|
45
47
|
if vm.storage_profile.os_disk.vhd.nil?
|
46
48
|
hash['managed_disk_storage_type'] = vm.storage_profile.os_disk.managed_disk.storage_account_type
|
47
49
|
else
|
@@ -63,8 +65,8 @@ module Fog
|
|
63
65
|
|
64
66
|
unless vm.storage_profile.data_disks.nil?
|
65
67
|
vm.storage_profile.data_disks.each do |disk|
|
66
|
-
data_disk = Fog::
|
67
|
-
hash['data_disks'] << data_disk.merge_attributes(Fog::
|
68
|
+
data_disk = Fog::Compute::AzureRM::DataDisk.new
|
69
|
+
hash['data_disks'] << data_disk.merge_attributes(Fog::Compute::AzureRM::DataDisk.parse(disk))
|
68
70
|
end
|
69
71
|
end
|
70
72
|
|
@@ -76,6 +78,7 @@ module Fog
|
|
76
78
|
end
|
77
79
|
hash['network_interface_card_ids'] = vm.network_profile.network_interfaces.map(&:id)
|
78
80
|
hash['availability_set_id'] = vm.availability_set.id unless vm.availability_set.nil?
|
81
|
+
hash['tags'] = vm.tags
|
79
82
|
|
80
83
|
hash
|
81
84
|
end
|
@@ -146,7 +149,7 @@ module Fog
|
|
146
149
|
end
|
147
150
|
|
148
151
|
def attach_data_disk(disk_name, disk_size, storage_account_name, async = false)
|
149
|
-
response = service.attach_data_disk_to_vm(
|
152
|
+
response = service.attach_data_disk_to_vm(data_disk_params(disk_name, disk_size, storage_account_name), async)
|
150
153
|
async ? create_fog_async_response(response) : merge_attributes(Fog::Compute::AzureRM::Server.parse(response))
|
151
154
|
end
|
152
155
|
|
@@ -155,6 +158,16 @@ module Fog
|
|
155
158
|
async ? create_fog_async_response(response) : merge_attributes(Fog::Compute::AzureRM::Server.parse(response))
|
156
159
|
end
|
157
160
|
|
161
|
+
def attach_managed_disk(disk_name, disk_resource_group, async = false)
|
162
|
+
response = service.attach_data_disk_to_vm(data_disk_params(disk_name, nil, nil, disk_resource_group), async)
|
163
|
+
async ? create_fog_async_response(response) : merge_attributes(Fog::Compute::AzureRM::Server.parse(response))
|
164
|
+
end
|
165
|
+
|
166
|
+
def detach_managed_disk(disk_name, async = false)
|
167
|
+
response = service.detach_data_disk_from_vm(resource_group, name, disk_name, async)
|
168
|
+
async ? create_fog_async_response(response) : merge_attributes(Fog::Compute::AzureRM::Server.parse(response))
|
169
|
+
end
|
170
|
+
|
158
171
|
private
|
159
172
|
|
160
173
|
def platform_is_linux?(platform)
|
@@ -190,7 +203,20 @@ module Fog
|
|
190
203
|
custom_data: custom_data,
|
191
204
|
vhd_path: vhd_path,
|
192
205
|
os_disk_caching: os_disk_caching,
|
193
|
-
managed_disk_storage_type: managed_disk_storage_type
|
206
|
+
managed_disk_storage_type: managed_disk_storage_type,
|
207
|
+
os_disk_size: os_disk_size,
|
208
|
+
tags: tags
|
209
|
+
}
|
210
|
+
end
|
211
|
+
|
212
|
+
def data_disk_params(disk_name, disk_size = nil, storage_account = nil, disk_resource_group = nil)
|
213
|
+
{
|
214
|
+
vm_name: name,
|
215
|
+
vm_resource_group: resource_group,
|
216
|
+
disk_name: disk_name,
|
217
|
+
disk_size_gb: disk_size,
|
218
|
+
storage_account_name: storage_account,
|
219
|
+
disk_resource_group: disk_resource_group
|
194
220
|
}
|
195
221
|
end
|
196
222
|
end
|
@@ -15,6 +15,7 @@ module Fog
|
|
15
15
|
attribute :enabled_for_deployment
|
16
16
|
attribute :enabled_for_disk_encryption
|
17
17
|
attribute :enabled_for_template_deployment
|
18
|
+
attribute :tags
|
18
19
|
|
19
20
|
def self.parse(vault)
|
20
21
|
vault_hash = get_hash_from_object(vault)
|
@@ -67,7 +68,8 @@ module Fog
|
|
67
68
|
tenant_id: tenant_id,
|
68
69
|
sku_family: sku_family,
|
69
70
|
sku_name: sku_name,
|
70
|
-
access_policies: access_policies
|
71
|
+
access_policies: access_policies,
|
72
|
+
tags: tags
|
71
73
|
}
|
72
74
|
end
|
73
75
|
end
|
@@ -13,6 +13,7 @@ module Fog
|
|
13
13
|
attribute :probes
|
14
14
|
attribute :inbound_nat_rules
|
15
15
|
attribute :inbound_nat_pools
|
16
|
+
attribute :tags
|
16
17
|
|
17
18
|
# @param [Object] load_balancer
|
18
19
|
def self.parse(load_balancer)
|
@@ -22,6 +23,7 @@ module Fog
|
|
22
23
|
hash['location'] = load_balancer.location
|
23
24
|
hash['resource_group'] = get_resource_group_from_id(load_balancer.id)
|
24
25
|
hash['backend_address_pool_names'] = load_balancer.backend_address_pools.map(&:id) unless load_balancer.backend_address_pools.nil?
|
26
|
+
hash['tags'] = load_balancer.tags
|
25
27
|
|
26
28
|
hash['frontend_ip_configurations'] = []
|
27
29
|
load_balancer.frontend_ipconfigurations.each do |fic|
|
@@ -65,7 +67,7 @@ module Fog
|
|
65
67
|
validate_inbound_nat_rules(inbound_nat_rules) unless inbound_nat_rules.nil?
|
66
68
|
validate_inbound_nat_pools(inbound_nat_pools) unless inbound_nat_pools.nil?
|
67
69
|
|
68
|
-
load_balancer = service.create_load_balancer(name, location, resource_group, frontend_ip_configurations, backend_address_pool_names, load_balancing_rules, probes, inbound_nat_rules, inbound_nat_pools)
|
70
|
+
load_balancer = service.create_load_balancer(name, location, resource_group, frontend_ip_configurations, backend_address_pool_names, load_balancing_rules, probes, inbound_nat_rules, inbound_nat_pools, tags)
|
69
71
|
|
70
72
|
merge_attributes(Fog::Network::AzureRM::LoadBalancer.parse(load_balancer))
|
71
73
|
end
|
@@ -15,6 +15,7 @@ module Fog
|
|
15
15
|
attribute :bgp_peering_address
|
16
16
|
attribute :peer_weight
|
17
17
|
attribute :provisioning_state
|
18
|
+
attribute :tags
|
18
19
|
|
19
20
|
def self.parse(local_network_gateway)
|
20
21
|
local_network_gateway_hash = get_hash_from_object(local_network_gateway)
|
@@ -51,7 +52,8 @@ module Fog
|
|
51
52
|
gateway_ip_address: gateway_ip_address,
|
52
53
|
asn: asn,
|
53
54
|
bgp_peering_address: bgp_peering_address,
|
54
|
-
peer_weight: peer_weight
|
55
|
+
peer_weight: peer_weight,
|
56
|
+
tags: tags
|
55
57
|
}
|
56
58
|
end
|
57
59
|
end
|
@@ -22,6 +22,7 @@ module Fog
|
|
22
22
|
attribute :applied_dns_servers
|
23
23
|
attribute :internal_dns_name_label
|
24
24
|
attribute :internal_fqd
|
25
|
+
attribute :tags
|
25
26
|
|
26
27
|
def self.parse(nic)
|
27
28
|
hash = {}
|
@@ -33,6 +34,7 @@ module Fog
|
|
33
34
|
hash['mac_address'] = nic.mac_address unless nic.mac_address.nil?
|
34
35
|
hash['network_security_group_id'] = nil
|
35
36
|
hash['network_security_group_id'] = nic.network_security_group.id unless nic.network_security_group.nil?
|
37
|
+
hash['tags'] = nic.tags
|
36
38
|
ip_configuration = nic.ip_configurations[0] unless nic.ip_configurations.nil?
|
37
39
|
unless ip_configuration.nil?
|
38
40
|
hash['ip_configuration_name'] = ip_configuration.name
|
@@ -62,7 +64,7 @@ module Fog
|
|
62
64
|
requires :subnet_id
|
63
65
|
requires :ip_configuration_name
|
64
66
|
requires :private_ip_allocation_method
|
65
|
-
nic = service.create_or_update_network_interface(resource_group, name, location, subnet_id, public_ip_address_id, network_security_group_id, ip_configuration_name, private_ip_allocation_method, private_ip_address, load_balancer_backend_address_pools_ids, load_balancer_inbound_nat_rules_ids)
|
67
|
+
nic = service.create_or_update_network_interface(resource_group, name, location, subnet_id, public_ip_address_id, network_security_group_id, ip_configuration_name, private_ip_allocation_method, private_ip_address, load_balancer_backend_address_pools_ids, load_balancer_inbound_nat_rules_ids, tags)
|
66
68
|
merge_attributes(Fog::Network::AzureRM::NetworkInterface.parse(nic))
|
67
69
|
end
|
68
70
|
|
@@ -11,6 +11,7 @@ module Fog
|
|
11
11
|
attribute :subnets_ids
|
12
12
|
attribute :security_rules
|
13
13
|
attribute :default_security_rules
|
14
|
+
attribute :tags
|
14
15
|
|
15
16
|
def self.parse(nsg)
|
16
17
|
hash = {}
|
@@ -22,6 +23,7 @@ module Fog
|
|
22
23
|
hash['subnets_ids'] = nsg.subnets.map(&:id) unless nsg.subnets.nil?
|
23
24
|
hash['security_rules'] = []
|
24
25
|
hash['default_security_rules'] = []
|
26
|
+
hash['tags'] = nsg.tags
|
25
27
|
|
26
28
|
nsg.security_rules.each do |sr|
|
27
29
|
security_rule = Fog::Network::AzureRM::NetworkSecurityRule.new
|
@@ -40,7 +42,7 @@ module Fog
|
|
40
42
|
requires :name, :location, :resource_group
|
41
43
|
|
42
44
|
validate_security_rules(security_rules) unless security_rules.nil?
|
43
|
-
nsg = service.create_or_update_network_security_group(resource_group, name, location, security_rules)
|
45
|
+
nsg = service.create_or_update_network_security_group(resource_group, name, location, security_rules, tags)
|
44
46
|
merge_attributes(Fog::Network::AzureRM::NetworkSecurityGroup.parse(nsg))
|
45
47
|
end
|
46
48
|
|
@@ -54,7 +56,7 @@ module Fog
|
|
54
56
|
if !security_rule_hash[:security_rules].nil? && security_rule_hash.length == 1
|
55
57
|
validate_security_rules(security_rule_hash[:security_rules])
|
56
58
|
merge_attributes(security_rule_hash)
|
57
|
-
nsg = service.create_or_update_network_security_group(resource_group, name, location, security_rules)
|
59
|
+
nsg = service.create_or_update_network_security_group(resource_group, name, location, security_rules, tags)
|
58
60
|
return merge_attributes(Fog::Network::AzureRM::NetworkSecurityGroup.parse(nsg))
|
59
61
|
end
|
60
62
|
raise 'Invalid hash key.'
|
@@ -14,6 +14,7 @@ module Fog
|
|
14
14
|
attribute :domain_name_label
|
15
15
|
attribute :fqdn
|
16
16
|
attribute :reverse_fqdn
|
17
|
+
attribute :tags
|
17
18
|
|
18
19
|
def self.parse(public_ip)
|
19
20
|
hash = {}
|
@@ -25,6 +26,7 @@ module Fog
|
|
25
26
|
hash['ip_address'] = public_ip.ip_address
|
26
27
|
hash['idle_timeout_in_minutes'] = public_ip.idle_timeout_in_minutes
|
27
28
|
hash['ip_configuration_id'] = public_ip.ip_configuration.id unless public_ip.ip_configuration.nil?
|
29
|
+
hash['tags'] = public_ip.tags
|
28
30
|
|
29
31
|
unless public_ip.dns_settings.nil?
|
30
32
|
hash['domain_name_label'] = public_ip.dns_settings.domain_name_label
|
@@ -40,7 +42,7 @@ module Fog
|
|
40
42
|
requires :public_ip_allocation_method
|
41
43
|
requires :location
|
42
44
|
requires :resource_group
|
43
|
-
public_ip = service.create_or_update_public_ip(resource_group, name, location, public_ip_allocation_method, idle_timeout_in_minutes, domain_name_label)
|
45
|
+
public_ip = service.create_or_update_public_ip(resource_group, name, location, public_ip_allocation_method, idle_timeout_in_minutes, domain_name_label, tags)
|
44
46
|
merge_attributes(Fog::Network::AzureRM::PublicIp.parse(public_ip))
|
45
47
|
end
|
46
48
|
|
@@ -51,7 +53,7 @@ module Fog
|
|
51
53
|
def update(input_hash)
|
52
54
|
validate_input(input_hash)
|
53
55
|
merge_attributes(input_hash)
|
54
|
-
pip = service.create_or_update_public_ip(resource_group, name, location, public_ip_allocation_method, idle_timeout_in_minutes, domain_name_label)
|
56
|
+
pip = service.create_or_update_public_ip(resource_group, name, location, public_ip_allocation_method, idle_timeout_in_minutes, domain_name_label, tags)
|
55
57
|
merge_attributes(Fog::Network::AzureRM::PublicIp.parse(pip))
|
56
58
|
end
|
57
59
|
|
@@ -11,6 +11,7 @@ module Fog
|
|
11
11
|
attribute :dns_servers
|
12
12
|
attribute :subnets
|
13
13
|
attribute :address_prefixes
|
14
|
+
attribute :tags
|
14
15
|
|
15
16
|
def self.parse(vnet)
|
16
17
|
hash = {}
|
@@ -20,6 +21,7 @@ module Fog
|
|
20
21
|
hash['location'] = vnet.location
|
21
22
|
hash['dns_servers'] = vnet.dhcp_options.dns_servers unless vnet.dhcp_options.nil?
|
22
23
|
hash['address_prefixes'] = vnet.address_space.address_prefixes unless vnet.address_space.address_prefixes.nil?
|
24
|
+
hash['tags'] = vnet.tags
|
23
25
|
|
24
26
|
subnets = []
|
25
27
|
vnet.subnets.each do |subnet|
|
@@ -36,7 +38,7 @@ module Fog
|
|
36
38
|
requires :resource_group
|
37
39
|
validate_subnets!(subnets) unless subnets.nil?
|
38
40
|
|
39
|
-
virtual_network = service.create_or_update_virtual_network(resource_group, name, location, dns_servers, subnets, address_prefixes)
|
41
|
+
virtual_network = service.create_or_update_virtual_network(resource_group, name, location, dns_servers, subnets, address_prefixes, tags)
|
40
42
|
merge_attributes(Fog::Network::AzureRM::VirtualNetwork.parse(virtual_network))
|
41
43
|
end
|
42
44
|
|
@@ -75,7 +77,7 @@ module Fog
|
|
75
77
|
raise('Provided hash can not be empty.') if vnet_hash.empty? || vnet_hash.nil?
|
76
78
|
validate_update_attributes!(vnet_hash)
|
77
79
|
merge_attributes(vnet_hash)
|
78
|
-
virtual_network = service.create_or_update_virtual_network(resource_group, name, location, dns_servers, subnets, address_prefixes)
|
80
|
+
virtual_network = service.create_or_update_virtual_network(resource_group, name, location, dns_servers, subnets, address_prefixes, tags)
|
79
81
|
merge_attributes(Fog::Network::AzureRM::VirtualNetwork.parse(virtual_network))
|
80
82
|
end
|
81
83
|
|
@@ -7,19 +7,21 @@ module Fog
|
|
7
7
|
identity :name
|
8
8
|
attribute :id
|
9
9
|
attribute :location
|
10
|
+
attribute :tags
|
10
11
|
|
11
12
|
def self.parse(resource_group)
|
12
13
|
hash = {}
|
13
14
|
hash['id'] = resource_group.id
|
14
15
|
hash['name'] = resource_group.name
|
15
16
|
hash['location'] = resource_group.location
|
17
|
+
hash['tags'] = resource_group.tags
|
16
18
|
hash
|
17
19
|
end
|
18
20
|
|
19
21
|
def save
|
20
22
|
requires :name
|
21
23
|
requires :location
|
22
|
-
resource_group = service.create_resource_group(name, location)
|
24
|
+
resource_group = service.create_resource_group(name, location, tags)
|
23
25
|
merge_attributes(Fog::Resources::AzureRM::ResourceGroup.parse(resource_group))
|
24
26
|
end
|
25
27
|
|