azure_mgmt_storage 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/azure_mgmt_storage.gemspec +3 -8
  3. data/lib/azure_mgmt_storage.rb +3 -8
  4. data/lib/azure_mgmt_storage/models/account_status.rb +1 -1
  5. data/lib/azure_mgmt_storage/models/account_type.rb +1 -1
  6. data/lib/azure_mgmt_storage/models/check_name_availability_result.rb +3 -6
  7. data/lib/azure_mgmt_storage/models/custom_domain.rb +2 -4
  8. data/lib/azure_mgmt_storage/models/endpoints.rb +9 -2
  9. data/lib/azure_mgmt_storage/models/provisioning_state.rb +1 -1
  10. data/lib/azure_mgmt_storage/models/reason.rb +1 -1
  11. data/lib/azure_mgmt_storage/models/storage_account.rb +7 -9
  12. data/lib/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +2 -4
  13. data/lib/azure_mgmt_storage/models/storage_account_create_parameters.rb +10 -22
  14. data/lib/azure_mgmt_storage/models/storage_account_keys.rb +1 -3
  15. data/lib/azure_mgmt_storage/models/storage_account_list_result.rb +4 -16
  16. data/lib/azure_mgmt_storage/models/storage_account_properties.rb +11 -14
  17. data/lib/azure_mgmt_storage/models/storage_account_properties_create_parameters.rb +5 -6
  18. data/lib/azure_mgmt_storage/models/storage_account_properties_update_parameters.rb +4 -7
  19. data/lib/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +3 -9
  20. data/lib/azure_mgmt_storage/models/storage_account_update_parameters.rb +6 -28
  21. data/lib/azure_mgmt_storage/models/usage.rb +9 -7
  22. data/lib/azure_mgmt_storage/models/usage_list_result.rb +4 -6
  23. data/lib/azure_mgmt_storage/models/usage_name.rb +1 -3
  24. data/lib/azure_mgmt_storage/models/usage_unit.rb +1 -1
  25. data/lib/azure_mgmt_storage/module_definition.rb +5 -3
  26. data/lib/azure_mgmt_storage/storage_accounts.rb +187 -591
  27. data/lib/azure_mgmt_storage/storage_management_client.rb +14 -7
  28. data/lib/azure_mgmt_storage/usage_operations.rb +20 -45
  29. data/lib/azure_mgmt_storage/version.rb +5 -3
  30. metadata +7 -87
  31. data/.gitignore +0 -10
  32. data/.travis.yml +0 -3
  33. data/Gemfile +0 -15
  34. data/lib/azure_mgmt_storage/models/key_name.rb +0 -16
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -14,7 +14,7 @@ module Azure::ARM::Storage
14
14
  # @return [String] the base URI of the service.
15
15
  attr_accessor :base_url
16
16
 
17
- # @return [ServiceClientCredentials] The management credentials for Azure.
17
+ # @return Gets Azure subscription credentials.
18
18
  attr_reader :credentials
19
19
 
20
20
  # @return [String] Gets subscription credentials which uniquely identify
@@ -28,11 +28,16 @@ module Azure::ARM::Storage
28
28
  # @return [String] Gets or sets the preferred language for the response.
29
29
  attr_accessor :accept_language
30
30
 
31
- # @return [Integer] The retry timeout for Long Running Operations.
31
+ # @return [Integer] Gets or sets the retry timeout in seconds for Long
32
+ # Running Operations. Default value is 30.
32
33
  attr_accessor :long_running_operation_retry_timeout
33
34
 
34
- # @return [ServiceClient] Subscription credentials which uniquely identify
35
- # client subscription.
35
+ # @return [Boolean] When set to true a unique x-ms-client-request-id value
36
+ # is generated and included in each request. Default is true.
37
+ attr_accessor :generate_client_request_id
38
+
39
+ # @return Subscription credentials which uniquely identify client
40
+ # subscription.
36
41
  attr_accessor :credentials
37
42
 
38
43
  # @return storage_accounts
@@ -57,8 +62,10 @@ module Azure::ARM::Storage
57
62
 
58
63
  @storage_accounts = StorageAccounts.new(self)
59
64
  @usage_operations = UsageOperations.new(self)
60
- @api_version = "2015-05-01-preview"
61
- @accept_language = "en-US"
65
+ @api_version = '2015-06-15'
66
+ @accept_language = 'en-US'
67
+ @long_running_operation_retry_timeout = 30
68
+ @generate_client_request_id = true
62
69
  end
63
70
 
64
71
  end
@@ -1,11 +1,11 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::Storage
7
7
  #
8
- # UsageOperations
8
+ # The Storage Management Client.
9
9
  #
10
10
  class UsageOperations
11
11
  include Azure::ARM::Storage::Models
@@ -25,6 +25,7 @@ module Azure::ARM::Storage
25
25
  #
26
26
  # Gets the current usage count and the limit for the resources under the
27
27
  # subscription.
28
+ #
28
29
  # @param [Hash{String => String}] The hash of custom headers need to be
29
30
  # applied to HTTP request.
30
31
  #
@@ -34,70 +35,44 @@ module Azure::ARM::Storage
34
35
  def list(custom_headers = nil)
35
36
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
36
37
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
37
- # Construct URL
38
- path = "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"
39
- path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
40
- url = URI.join(@client.base_url, path)
41
- properties = {}
42
- properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
43
- unless url.query.nil?
44
- url.query.split('&').each do |url_item|
45
- url_items_parts = url_item.split('=')
46
- properties[url_items_parts[0]] = url_items_parts[1]
47
- end
48
- end
49
- properties.reject!{ |key, value| value.nil? }
50
- url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
51
- fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
52
- corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
53
- url = URI.parse(corrected_url)
54
-
55
- connection = Faraday.new(:url => url) do |faraday|
56
- faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
57
- faraday.use :cookie_jar
58
- faraday.adapter Faraday.default_adapter
59
- end
60
- request_headers = Hash.new
38
+ request_headers = {}
61
39
 
62
40
  # Set Headers
63
41
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
64
- request_headers["accept-language"] = @client.accept_language unless @client.accept_language.nil?
65
-
66
- unless custom_headers.nil?
67
- custom_headers.each do |key, value|
68
- request_headers[key] = value
69
- end
70
- end
71
-
72
- # Send Request
73
- promise = Concurrent::Promise.new do
74
- connection.get do |request|
75
- request.headers = request_headers
76
- @client.credentials.sign_request(request) unless @client.credentials.nil?
77
- end
42
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
43
+ path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'
44
+ options = {
45
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
46
+ path_params: {'subscriptionId' => @client.subscription_id},
47
+ query_params: {'api-version' => @client.api_version},
48
+ headers: request_headers.merge(custom_headers || {})
49
+ }
50
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
51
+ promise = request.run_promise do |req|
52
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
78
53
  end
79
54
 
80
55
  promise = promise.then do |http_response|
81
56
  status_code = http_response.status
82
57
  response_content = http_response.body
83
- unless (status_code == 200)
58
+ unless status_code == 200
84
59
  error_model = JSON.load(response_content)
85
- fail MsRestAzure::AzureOperationError.new(connection, http_response, error_model)
60
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
86
61
  end
87
62
 
88
63
  # Create Result
89
- result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
64
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
90
65
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
91
66
  # Deserialize Response
92
67
  if status_code == 200
93
68
  begin
94
- parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
69
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
95
70
  unless parsed_response.nil?
96
71
  parsed_response = UsageListResult.deserialize_object(parsed_response)
97
72
  end
98
73
  result.body = parsed_response
99
74
  rescue Exception => e
100
- fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
75
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
101
76
  end
102
77
  end
103
78
 
@@ -1,6 +1,8 @@
1
- # Copyright (c) Microsoft Corporation. All rights reserved.
2
- # Licensed under the MIT License. See License.txt in the project root for license information.
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
3
5
 
4
6
  module Azure::ARM::Storage
5
- VERSION = '0.1.2'
7
+ VERSION = '0.2.0'
6
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_mgmt_storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-07 00:00:00.000000000 Z
11
+ date: 2016-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,114 +72,35 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.1'
75
+ version: '0.2'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.1'
83
- - !ruby/object:Gem::Dependency
84
- name: json
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '1.8'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '1.8'
97
- - !ruby/object:Gem::Dependency
98
- name: concurrent-ruby
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: 1.0.0.pre1
104
- - - "<"
105
- - !ruby/object:Gem::Version
106
- version: '2'
107
- type: :runtime
108
- prerelease: false
109
- version_requirements: !ruby/object:Gem::Requirement
110
- requirements:
111
- - - ">="
112
- - !ruby/object:Gem::Version
113
- version: 1.0.0.pre1
114
- - - "<"
115
- - !ruby/object:Gem::Version
116
- version: '2'
117
- - !ruby/object:Gem::Dependency
118
- name: faraday
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - "~>"
122
- - !ruby/object:Gem::Version
123
- version: '0.9'
124
- type: :runtime
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - "~>"
129
- - !ruby/object:Gem::Version
130
- version: '0.9'
131
- - !ruby/object:Gem::Dependency
132
- name: faraday-cookie_jar
133
- requirement: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - "~>"
136
- - !ruby/object:Gem::Version
137
- version: 0.0.6
138
- type: :runtime
139
- prerelease: false
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - "~>"
143
- - !ruby/object:Gem::Version
144
- version: 0.0.6
82
+ version: '0.2'
145
83
  - !ruby/object:Gem::Dependency
146
84
  name: ms_rest_azure
147
85
  requirement: !ruby/object:Gem::Requirement
148
86
  requirements:
149
87
  - - "~>"
150
88
  - !ruby/object:Gem::Version
151
- version: 0.1.0
152
- type: :runtime
153
- prerelease: false
154
- version_requirements: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - "~>"
157
- - !ruby/object:Gem::Version
158
- version: 0.1.0
159
- - !ruby/object:Gem::Dependency
160
- name: ms_rest
161
- requirement: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - "~>"
164
- - !ruby/object:Gem::Version
165
- version: 0.1.0
89
+ version: 0.2.0
166
90
  type: :runtime
167
91
  prerelease: false
168
92
  version_requirements: !ruby/object:Gem::Requirement
169
93
  requirements:
170
94
  - - "~>"
171
95
  - !ruby/object:Gem::Version
172
- version: 0.1.0
96
+ version: 0.2.0
173
97
  description: Microsoft Azure Storage Management Client Library for Ruby
174
- email: azsdkteam@microsoft.com
98
+ email: azrubyteam@microsoft.com
175
99
  executables: []
176
100
  extensions: []
177
101
  extra_rdoc_files: []
178
102
  files:
179
- - ".gitignore"
180
103
  - ".rspec"
181
- - ".travis.yml"
182
- - Gemfile
183
104
  - LICENSE.txt
184
105
  - README.md
185
106
  - Rakefile
@@ -190,7 +111,6 @@ files:
190
111
  - lib/azure_mgmt_storage/models/check_name_availability_result.rb
191
112
  - lib/azure_mgmt_storage/models/custom_domain.rb
192
113
  - lib/azure_mgmt_storage/models/endpoints.rb
193
- - lib/azure_mgmt_storage/models/key_name.rb
194
114
  - lib/azure_mgmt_storage/models/provisioning_state.rb
195
115
  - lib/azure_mgmt_storage/models/reason.rb
196
116
  - lib/azure_mgmt_storage/models/storage_account.rb
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /resource_management/azure_mgmt_storage/spec/reports/
9
- /tmp/
10
- /.idea/
data/.travis.yml DELETED
@@ -1,3 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.1.5
data/Gemfile DELETED
@@ -1,15 +0,0 @@
1
- # encoding: utf-8
2
- # Copyright (c) Microsoft Corporation. All rights reserved.
3
- # Licensed under the MIT License. See License.txt in the project root for license information.
4
-
5
- source 'https://rubygems.org'
6
-
7
- gemspec
8
-
9
- group :development do
10
- gem 'azure_mgmt_resources', path: '../azure_mgmt_resources'
11
- end
12
-
13
- group :test do
14
- gem 'rspec'
15
- end
@@ -1,16 +0,0 @@
1
- # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0
3
- # Changes may cause incorrect behavior and will be lost if the code is
4
- # regenerated.
5
-
6
- module Azure::ARM::Storage
7
- module Models
8
- #
9
- # Defines values for KeyName
10
- #
11
- module KeyName
12
- Key1 = "key1"
13
- Key2 = "key2"
14
- end
15
- end
16
- end