azure-armrest 0.9.14 → 0.9.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b0957efe3f85a19324899af360fbd31e7e63240743645e52d2f97853a0e8c47
4
- data.tar.gz: a32638465e060e560c607b1c0ea8143414f6b9b3a535ac1c1f65bc00743fc122
3
+ metadata.gz: 80afc2002d933a6dcb326ccac2d00089cabb7e4a7b6682035aaf230fd39331e7
4
+ data.tar.gz: faf1d1200944bff09a16d42245cb3e09cb3c0c7d77c6f1fa205da31f8b30eeb2
5
5
  SHA512:
6
- metadata.gz: 82cd043c9ae57d178edaf3078a9a4cb7d12ca79a08396b66c1cd0d24217dcb42d387750aa02282a4ee03b577d26114e05aa584234ce0cf4cd33eff9a78db93b6
7
- data.tar.gz: 1909e23b186abc7992afc58b0b4755adefae92a6143de32c08abd5ddcef6b0ae54a80c37c7ce9505f97c4eeb15fa075a6ba7e5b36a2dd532a5c78707ef8ba336
6
+ metadata.gz: 41f18c5fd46a8de71bdbe70e5dbcbdf7488a6b17ea50a9d8340380220b4a6372cc6d3466acd880700808114c84fa929c7dae404fd789c4eb403d85af3643c3be
7
+ data.tar.gz: 608c0b7d4661ea5f3b6071715c37ea3fe039fa818de14d16e02b4e960c80a10da85abc9b76a4fcc634ff3400175d4a9c12f3101eee3c4a4b6de99cc031af6133
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ = 0.9.15 - 23-Jan-2020
2
+ * The VirtualMachineService#delete_associated_resources now supports deleting
3
+ attached data disks.
4
+
1
5
  = 0.9.14 - 23-Oct-2019
2
6
  * Added the VirtualMachineService#list_by_location method.
3
7
  * The VirtualMachineService#vm_operations method now returns a response object
@@ -1,6 +1,6 @@
1
1
  module Azure
2
2
  module Armrest
3
3
  # The version of the azure-armrest library.
4
- VERSION = '0.9.14'.freeze
4
+ VERSION = '0.9.15'.freeze
5
5
  end
6
6
  end
@@ -152,6 +152,7 @@ module Azure
152
152
  :network_interfaces => true,
153
153
  :ip_addresses => true,
154
154
  :os_disk => true,
155
+ :data_disks => false,
155
156
  :network_security_groups => false,
156
157
  :storage_account => false,
157
158
  :verbose => false
@@ -172,6 +173,10 @@ module Azure
172
173
  if options[:os_disk] || options[:storage_account]
173
174
  delete_associated_disk(vm, options)
174
175
  end
176
+
177
+ if options[:data_disks]
178
+ delete_associated_data_disks(vm, options)
179
+ end
175
180
  end
176
181
 
177
182
  def model_class
@@ -235,6 +240,20 @@ module Azure
235
240
  end
236
241
  end
237
242
 
243
+ # This deletes any attached data disks that are associated with the
244
+ # virtual machine. Note that this should only happen after the VM
245
+ # has been deleted.
246
+ #
247
+ def delete_associated_data_disks(vm, options)
248
+ sds = Azure::Armrest::Storage::DiskService.new(configuration)
249
+ data_disks = vm.properties.storage_profile.try(:data_disks)
250
+
251
+ data_disks&.each do |data_disk|
252
+ disk = sds.get_by_id(data_disk.managed_disk.id)
253
+ delete_and_wait(sds, disk.name, disk.resource_group, options)
254
+ end
255
+ end
256
+
238
257
  def delete_managed_storage(vm, options)
239
258
  sds = Azure::Armrest::Storage::DiskService.new(configuration)
240
259
  disk = sds.get_by_id(vm.properties.storage_profile.os_disk.managed_disk.id)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure-armrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.14
4
+ version: 0.9.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-10-23 00:00:00.000000000 Z
14
+ date: 2020-01-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: json