azure-armrest 0.6.1 → 0.7.0

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
  SHA1:
3
- metadata.gz: 739bcc0a0725b01ed19cb4613d4036de16314ba3
4
- data.tar.gz: 76506f0c47bd543cde5bfed94311c9114a778b83
3
+ metadata.gz: 334383bab1b7edd2c39daafb14efe81009ef4267
4
+ data.tar.gz: da29b50e0da626eaa025b8aece101e377e2ca51b
5
5
  SHA512:
6
- metadata.gz: 9e6e87f32216e23b917f992981baa881d8b73b9c375ce8ac16c9ecc215c05cf38607fd847b7514f14b23e6b9279d42f4309cb582c78cc30df27552ad83b917b8
7
- data.tar.gz: a3ec1341a93fd17748313af68a3fa8ddc2a41d73429898d0e350024ee6de15b0833a3c5045a1b4ddee060dba0efc72ec7f3ec1b7c03902b32527e3301a104ef1
6
+ metadata.gz: 9378fa04c55c7b8dee0ec201b186e47101f20213e75b99559e854a21fe7fc1db0d59ce581ad2566c15867959f2b41220e400690d1f72b6fe41a611e88ba5a41f
7
+ data.tar.gz: ace1a8e5eb3b55411bcf9b46b292b9a0522fae6426cc4bc84128c7a6f8dea00984e908d5973bfbd5a25febcb13ff321909e2070a168be879dc55719c86f8b3e2
data/.travis.yml CHANGED
@@ -1,7 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "2.2.5"
4
- - "2.3.1"
3
+ - "2.2.6"
4
+ - "2.3.3"
5
+ - "2.4.0"
5
6
  - ruby-head
6
7
  - jruby-head
7
8
  matrix:
data/CHANGES CHANGED
@@ -1,3 +1,14 @@
1
+ = 0.7.0 - 24-Mar-2017
2
+ * Altered the TemplateDeploymentService#get_template method to only return
3
+ a plain JSON string instead of a model object. The previous approach was
4
+ doomed to fail eventually given the less structured nature of templates.
5
+ * Minor buff to our dynamic model creation, as it will now handle spaces
6
+ in key names. We thought the .underscore method already did this (it doesn't).
7
+ * Added the Storage::DiskService, Storage::ImageService and
8
+ Storage::SnapshotService service classes. These all relate to managed disks.
9
+ * Some spec cleanup for the logger tests which were failing on Windows.
10
+ * Updates to our test matrix, including the addition of Ruby 2.4.0.
11
+
1
12
  = 0.6.1 - 28-Feb-2017
2
13
  * Replaced the cache_method gem with the memoist gem because cache_method was
3
14
  causing problems when this gem was used within a Rails app. Thanks go to
data/lib/azure/armrest.rb CHANGED
@@ -25,6 +25,9 @@ require 'azure/armrest/resource_group_based_service'
25
25
  require 'azure/armrest/resource_group_based_subservice'
26
26
  require 'azure/armrest/storage_account_service'
27
27
  require 'azure/armrest/availability_set_service'
28
+ require 'azure/armrest/storage/disk_service'
29
+ require 'azure/armrest/storage/snapshot_service'
30
+ require 'azure/armrest/storage/image_service'
28
31
  require 'azure/armrest/virtual_machine_service'
29
32
  require 'azure/armrest/virtual_machine_image_service'
30
33
  require 'azure/armrest/virtual_machine_extension_service'
@@ -147,7 +147,7 @@ module Azure
147
147
  @hashobj = obj
148
148
  excl_list = self.class.send(:excl_list)
149
149
  obj.each do |key, value|
150
- snake = key.to_s.underscore
150
+ snake = key.to_s.tr(' ', '_').underscore
151
151
 
152
152
  unless excl_list.include?(snake) # Must deal with nested models
153
153
  if value.kind_of?(Array)
@@ -180,7 +180,6 @@ module Azure
180
180
  # Initial class definitions. Reopen these classes as needed.
181
181
 
182
182
  class AvailabilitySet < BaseModel; end
183
- class DeploymentTemplate < BaseModel; end
184
183
  class Event < BaseModel; end
185
184
  class ImageVersion < BaseModel; end
186
185
  class Offer < BaseModel; end
@@ -249,6 +248,12 @@ module Azure
249
248
  class SqlServer < BaseModel; end
250
249
  class SqlDatabase < BaseModel; end
251
250
  end
251
+
252
+ module Storage
253
+ class Disk < BaseModel; end
254
+ class Image < BaseModel; end
255
+ class Snapshot < BaseModel; end
256
+ end
252
257
  end
253
258
  end
254
259
 
@@ -16,7 +16,10 @@ module Azure
16
16
  'securityrules' => Azure::Armrest::Network::NetworkSecurityRule,
17
17
  'routes' => Azure::Armrest::Network::Route,
18
18
  'databases' => Azure::Armrest::Sql::SqlDatabase,
19
- 'extensions' => Azure::Armrest::VirtualMachineExtension
19
+ 'extensions' => Azure::Armrest::VirtualMachineExtension,
20
+ 'disks' => Azure::Armrest::Storage::Disk,
21
+ 'snapshots' => Azure::Armrest::Storage::Snapshot,
22
+ 'images' => Azure::Armrest::Storage::Image
20
23
  }.freeze
21
24
 
22
25
  # Create a resource +name+ within the resource group +rgroup+, or the
@@ -0,0 +1,17 @@
1
+ # Azure namespace
2
+ module Azure
3
+ # Armrest namespace
4
+ module Armrest
5
+ # Storage namespace
6
+ module Storage
7
+ # Base class for managing disks.
8
+ class DiskService < ResourceGroupBasedService
9
+ # Create and return a new DiskService instance.
10
+ #
11
+ def initialize(configuration, options = {})
12
+ super(configuration, 'disks', 'Microsoft.Compute', options)
13
+ end
14
+ end # DiskService
15
+ end # Storage
16
+ end # Armrest
17
+ end # Azure
@@ -0,0 +1,17 @@
1
+ # Azure namespace
2
+ module Azure
3
+ # Armrest namespace
4
+ module Armrest
5
+ # Storage namespace
6
+ module Storage
7
+ # Base class for managing images.
8
+ class ImageService < ResourceGroupBasedService
9
+ # Create and return a new DiskService instance.
10
+ #
11
+ def initialize(configuration, options = {})
12
+ super(configuration, 'images', 'Microsoft.Compute', options)
13
+ end
14
+ end # ImageService
15
+ end # Storage
16
+ end # Armrest
17
+ end # Azure
@@ -0,0 +1,17 @@
1
+ # Azure namespace
2
+ module Azure
3
+ # Armrest namespace
4
+ module Armrest
5
+ # Storage namespace
6
+ module Storage
7
+ # Base class for managing snapshots.
8
+ class SnapshotService < ResourceGroupBasedService
9
+ # Create and return a new SnapshotService instance.
10
+ #
11
+ def initialize(configuration, options = {})
12
+ super(configuration, 'snapshots', 'Microsoft.Compute', options)
13
+ end
14
+ end # SnapshotService
15
+ end # Storage
16
+ end # Armrest
17
+ end # Azure
@@ -38,16 +38,13 @@ module Azure
38
38
  TemplateDeploymentOperation.new(response)
39
39
  end
40
40
 
41
- # Returns the json template as an object for the given deployment.
42
- #
43
- # If you want the plain JSON text then call .to_json on the returned object.
41
+ # Returns the raw json template for the given deployment as a string.
44
42
  #
45
43
  def get_template(deploy_name, resource_group = configuration.resource_group)
46
44
  validate_resource_group(resource_group)
47
45
  validate_resource(deploy_name)
48
46
  url = build_url(resource_group, deploy_name, 'exportTemplate')
49
- response = JSON.parse(rest_post(url))['template']
50
- DeploymentTemplate.new(response)
47
+ JSON.parse(rest_post(url))['template'].to_json
51
48
  end
52
49
 
53
50
  # Delete a deployment and all associated resources that were generated by the
@@ -1,6 +1,6 @@
1
1
  module Azure
2
2
  module Armrest
3
3
  # The version of the azure-armrest library.
4
- VERSION = '0.6.1'.freeze
4
+ VERSION = '0.7.0'.freeze
5
5
  end
6
6
  end
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.6.1
4
+ version: 0.7.0
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-02-28 00:00:00.000000000 Z
14
+ date: 2017-03-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: json
@@ -268,6 +268,9 @@ files:
268
268
  - lib/azure/armrest/role/definition_service.rb
269
269
  - lib/azure/armrest/sql/sql_database_service.rb
270
270
  - lib/azure/armrest/sql/sql_server_service.rb
271
+ - lib/azure/armrest/storage/disk_service.rb
272
+ - lib/azure/armrest/storage/image_service.rb
273
+ - lib/azure/armrest/storage/snapshot_service.rb
271
274
  - lib/azure/armrest/storage_account_service.rb
272
275
  - lib/azure/armrest/subscription_service.rb
273
276
  - lib/azure/armrest/template_deployment_service.rb
@@ -295,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
295
298
  version: '0'
296
299
  requirements: []
297
300
  rubyforge_project:
298
- rubygems_version: 2.6.8
301
+ rubygems_version: 2.6.6
299
302
  signing_key:
300
303
  specification_version: 4
301
304
  summary: An interface for ARM/JSON Azure REST API