azure-armrest 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES +6 -0
- data/README.md +6 -1
- data/lib/azure/armrest.rb +2 -0
- data/lib/azure/armrest/hdinsight/application_service.rb +11 -0
- data/lib/azure/armrest/hdinsight/cluster_service.rb +11 -0
- data/lib/azure/armrest/model/base_model.rb +5 -0
- data/lib/azure/armrest/version.rb +1 -1
- data/lib/azure/armrest/virtual_machine_service.rb +26 -8
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0c2605f1a0d6193e9bcd8f41512d64d29c70f12acbf56df23972c6c7659ee41c
|
4
|
+
data.tar.gz: 747601d0bd5494f50b07473b86fddfdc20bc150b15906e7700f8438c638f30ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 998117ceb8031506e8569ec83988f880f9c3d841bd3b5a3ef8bd251f070554194eef8b10baa299b38cbd9b969b44f1dee3338aac0a8078975821cb184f86bb49
|
7
|
+
data.tar.gz: 284cb6d3b7b30bce806784c424fe4fe7c89ed3d9fa1f9f63bbd69cc9b960835088b1a36451aabe0c0f25637b7d3d9b2482ed320a3b61756503355963340423f6
|
data/CHANGES
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
= 0.9.4 - 29-Nov-2017
|
2
|
+
* Fixed the VirtualMachineService#delete_associated_resources to handle VM's
|
3
|
+
backed by managed storage, as well as VM's with a private IP.
|
4
|
+
* Added HDInsight service classes. Thanks go to Tyler Gregory for the PR.
|
5
|
+
* Updated README and VirtualMachineService documentation.
|
6
|
+
|
1
7
|
= 0.9.3 - 2-Nov-2017
|
2
8
|
* Fixed an issue in the get_by_id and delete_by_id methods where an invalid
|
3
9
|
request string could be generated. This primarily affected the
|
data/README.md
CHANGED
@@ -29,7 +29,12 @@ conf = Azure::Armrest::Configuration.new(
|
|
29
29
|
)
|
30
30
|
|
31
31
|
# This will then use the configuration info set above.
|
32
|
-
|
32
|
+
vms = Azure::Armrest::VirtualMachineService.new(conf)
|
33
|
+
|
34
|
+
# You can add other options specific to the service to be created,
|
35
|
+
# such as the provider.
|
36
|
+
|
37
|
+
options = {:provider => 'Microsoft.ClassicCompute'}
|
33
38
|
vms = Azure::Armrest::VirtualMachineService.new(conf, options)
|
34
39
|
|
35
40
|
# List all virtual machines for a given resource group:
|
data/lib/azure/armrest.rb
CHANGED
@@ -60,6 +60,8 @@ require 'azure/armrest/sql/sql_server_service'
|
|
60
60
|
require 'azure/armrest/sql/sql_database_service'
|
61
61
|
require 'azure/armrest/billing/usage_service'
|
62
62
|
require 'azure/armrest/key_vault_service'
|
63
|
+
require 'azure/armrest/hdinsight/cluster_service'
|
64
|
+
require 'azure/armrest/hdinsight/application_service'
|
63
65
|
|
64
66
|
# JSON wrapper classes. The service classes should require their own
|
65
67
|
# wrappers from this point on.
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Azure
|
2
|
+
module Armrest
|
3
|
+
module HDInsight
|
4
|
+
class ApplicationService < ResourceGroupBasedSubservice
|
5
|
+
def initialize(armrest_configuration, options = {})
|
6
|
+
super(armrest_configuration, 'clusters', 'applications', 'Microsoft.HDInsight', options)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Azure
|
2
|
+
module Armrest
|
3
|
+
module HDInsight
|
4
|
+
class ClusterService < ResourceGroupBasedService
|
5
|
+
def initialize(armrest_configuration, options = {})
|
6
|
+
super(armrest_configuration, 'clusters', 'Microsoft.HDInsight', options)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -306,6 +306,11 @@ module Azure
|
|
306
306
|
class VirtualMachineImage < BaseModel; end
|
307
307
|
class VirtualMachineSize < BaseModel; end
|
308
308
|
|
309
|
+
module HDInsight
|
310
|
+
class HDInsightCluster < BaseModel; end
|
311
|
+
class HDInsightApplication < BaseModel; end
|
312
|
+
end
|
313
|
+
|
309
314
|
module Insights
|
310
315
|
class Alert < BaseModel; end
|
311
316
|
class Diagnostic < BaseModel; end
|
@@ -4,13 +4,13 @@ module Azure
|
|
4
4
|
module Armrest
|
5
5
|
# Base class for managing virtual machines
|
6
6
|
class VirtualMachineService < ResourceGroupBasedService
|
7
|
-
# Create and return a new VirtualMachineService
|
8
|
-
# methods for a
|
9
|
-
# instances.
|
7
|
+
# Create and return a new VirtualMachineService instance. Most
|
8
|
+
# methods for a VirtualMachineService instance will return one or more
|
9
|
+
# VirtualMachine instances.
|
10
10
|
#
|
11
11
|
# This subclass accepts the additional :provider option as well. The
|
12
|
-
# default is 'Microsoft.
|
13
|
-
# 'Microsoft.
|
12
|
+
# default is 'Microsoft.Compute'. You may need to set this to
|
13
|
+
# 'Microsoft.ClassicCompute' for your purposes.
|
14
14
|
#
|
15
15
|
def initialize(configuration, options = {})
|
16
16
|
super(configuration, 'virtualMachines', 'Microsoft.Compute', options)
|
@@ -192,9 +192,13 @@ module Azure
|
|
192
192
|
delete_and_wait(nis, nic.name, nic.resource_group, options)
|
193
193
|
|
194
194
|
if options[:ip_addresses]
|
195
|
-
nic.properties.ip_configurations.each do |
|
196
|
-
|
197
|
-
|
195
|
+
nic.properties.ip_configurations.each do |ipconfig|
|
196
|
+
address = ipconfig.properties.try(:public_ip_address)
|
197
|
+
|
198
|
+
if address
|
199
|
+
ip = get_by_id(address.id)
|
200
|
+
delete_and_wait(ips, ip.name, ip.resource_group, options)
|
201
|
+
end
|
198
202
|
end
|
199
203
|
end
|
200
204
|
|
@@ -216,6 +220,20 @@ module Azure
|
|
216
220
|
# account first.
|
217
221
|
#
|
218
222
|
def delete_associated_disk(vm, options)
|
223
|
+
if vm.managed_disk?
|
224
|
+
delete_managed_storage(vm, options)
|
225
|
+
else
|
226
|
+
delete_unmanaged_storage(vm, options)
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
def delete_managed_storage(vm, options)
|
231
|
+
sds = Azure::Armrest::Storage::DiskService.new(configuration)
|
232
|
+
disk = sds.get_by_id(vm.properties.storage_profile.os_disk.managed_disk.id)
|
233
|
+
delete_and_wait(sds, disk.name, disk.resource_group, options)
|
234
|
+
end
|
235
|
+
|
236
|
+
def delete_unmanaged_storage(vm, options)
|
219
237
|
sas = Azure::Armrest::StorageAccountService.new(configuration)
|
220
238
|
|
221
239
|
storage_account = sas.get_from_vm(vm)
|
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.
|
4
|
+
version: 0.9.4
|
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: 2017-11-
|
14
|
+
date: 2017-11-29 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: json
|
@@ -229,6 +229,8 @@ files:
|
|
229
229
|
- lib/azure/armrest/container_service.rb
|
230
230
|
- lib/azure/armrest/environment.rb
|
231
231
|
- lib/azure/armrest/exception.rb
|
232
|
+
- lib/azure/armrest/hdinsight/application_service.rb
|
233
|
+
- lib/azure/armrest/hdinsight/cluster_service.rb
|
232
234
|
- lib/azure/armrest/insights/alert_service.rb
|
233
235
|
- lib/azure/armrest/insights/diagnostic_service.rb
|
234
236
|
- lib/azure/armrest/insights/event_service.rb
|
@@ -288,7 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
290
|
version: '0'
|
289
291
|
requirements: []
|
290
292
|
rubyforge_project:
|
291
|
-
rubygems_version: 2.
|
293
|
+
rubygems_version: 2.7.2
|
292
294
|
signing_key:
|
293
295
|
specification_version: 4
|
294
296
|
summary: An interface for ARM/JSON Azure REST API
|