azure_mgmt_storage 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +3 -0
  5. data/Gemfile +15 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +111 -0
  8. data/Rakefile +5 -0
  9. data/azure_mgmt_storage.gemspec +39 -0
  10. data/lib/azure_mgmt_storage.rb +54 -0
  11. data/lib/azure_mgmt_storage/models/account_status.rb +16 -0
  12. data/lib/azure_mgmt_storage/models/account_type.rb +19 -0
  13. data/lib/azure_mgmt_storage/models/check_name_availability_result.rb +85 -0
  14. data/lib/azure_mgmt_storage/models/custom_domain.rb +70 -0
  15. data/lib/azure_mgmt_storage/models/endpoints.rb +77 -0
  16. data/lib/azure_mgmt_storage/models/key_name.rb +16 -0
  17. data/lib/azure_mgmt_storage/models/provisioning_state.rb +17 -0
  18. data/lib/azure_mgmt_storage/models/reason.rb +16 -0
  19. data/lib/azure_mgmt_storage/models/storage_account.rb +94 -0
  20. data/lib/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +68 -0
  21. data/lib/azure_mgmt_storage/models/storage_account_create_parameters.rb +94 -0
  22. data/lib/azure_mgmt_storage/models/storage_account_keys.rb +67 -0
  23. data/lib/azure_mgmt_storage/models/storage_account_list_result.rb +89 -0
  24. data/lib/azure_mgmt_storage/models/storage_account_properties.rb +212 -0
  25. data/lib/azure_mgmt_storage/models/storage_account_properties_create_parameters.rb +63 -0
  26. data/lib/azure_mgmt_storage/models/storage_account_properties_update_parameters.rb +85 -0
  27. data/lib/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +62 -0
  28. data/lib/azure_mgmt_storage/models/storage_account_update_parameters.rb +94 -0
  29. data/lib/azure_mgmt_storage/models/usage.rb +101 -0
  30. data/lib/azure_mgmt_storage/models/usage_list_result.rb +78 -0
  31. data/lib/azure_mgmt_storage/models/usage_name.rb +67 -0
  32. data/lib/azure_mgmt_storage/models/usage_unit.rb +20 -0
  33. data/lib/azure_mgmt_storage/module_definition.rb +6 -0
  34. data/lib/azure_mgmt_storage/storage_accounts.rb +1105 -0
  35. data/lib/azure_mgmt_storage/storage_management_client.rb +65 -0
  36. data/lib/azure_mgmt_storage/usage_operations.rb +111 -0
  37. data/lib/azure_mgmt_storage/version.rb +6 -0
  38. metadata +226 -0
@@ -0,0 +1,65 @@
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
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class StorageManagementClient < MsRestAzure::AzureServiceClient
11
+ include Azure::ARM::Storage::Models
12
+ include MsRestAzure
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return [ServiceClientCredentials] The management credentials for Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Gets subscription credentials which uniquely identify
21
+ # Microsoft Azure subscription. The subscription ID forms part of the URI
22
+ # for every service call.
23
+ attr_accessor :subscription_id
24
+
25
+ # @return [String] Client Api Version.
26
+ attr_reader :api_version
27
+
28
+ # @return [String] Gets or sets the preferred language for the response.
29
+ attr_accessor :accept_language
30
+
31
+ # @return [Integer] The retry timeout for Long Running Operations.
32
+ attr_accessor :long_running_operation_retry_timeout
33
+
34
+ # @return [ServiceClient] Subscription credentials which uniquely identify
35
+ # client subscription.
36
+ attr_accessor :credentials
37
+
38
+ # @return storage_accounts
39
+ attr_reader :storage_accounts
40
+
41
+ # @return usage_operations
42
+ attr_reader :usage_operations
43
+
44
+ #
45
+ # Creates initializes a new instance of the StorageManagementClient class.
46
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
47
+ # @param base_url [String] the base URI of the service.
48
+ # @param options [Array] filters to be applied to the HTTP requests.
49
+ #
50
+ def initialize(credentials, base_url = nil, options = nil)
51
+ super(credentials, options)
52
+ @base_url = base_url || 'https://management.azure.com'
53
+
54
+ fail ArgumentError, 'credentials is nil' if credentials.nil?
55
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials)
56
+ @credentials = credentials
57
+
58
+ @storage_accounts = StorageAccounts.new(self)
59
+ @usage_operations = UsageOperations.new(self)
60
+ @api_version = "2015-05-01-preview"
61
+ @accept_language = "en-US"
62
+ end
63
+
64
+ end
65
+ end
@@ -0,0 +1,111 @@
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
+ #
8
+ # UsageOperations
9
+ #
10
+ class UsageOperations
11
+ include Azure::ARM::Storage::Models
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the UsageOperations class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return reference to the StorageManagementClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Gets the current usage count and the limit for the resources under the
27
+ # subscription.
28
+ # @param [Hash{String => String}] The hash of custom headers need to be
29
+ # applied to HTTP request.
30
+ #
31
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
32
+ # response.
33
+ #
34
+ def list(custom_headers = nil)
35
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
36
+ 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
61
+
62
+ # Set Headers
63
+ 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
78
+ end
79
+
80
+ promise = promise.then do |http_response|
81
+ status_code = http_response.status
82
+ response_content = http_response.body
83
+ unless (status_code == 200)
84
+ error_model = JSON.load(response_content)
85
+ fail MsRestAzure::AzureOperationError.new(connection, http_response, error_model)
86
+ end
87
+
88
+ # Create Result
89
+ result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
90
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
91
+ # Deserialize Response
92
+ if status_code == 200
93
+ begin
94
+ parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
95
+ unless parsed_response.nil?
96
+ parsed_response = UsageListResult.deserialize_object(parsed_response)
97
+ end
98
+ result.body = parsed_response
99
+ rescue Exception => e
100
+ fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
101
+ end
102
+ end
103
+
104
+ result
105
+ end
106
+
107
+ promise.execute
108
+ end
109
+
110
+ end
111
+ end
@@ -0,0 +1,6 @@
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License. See License.txt in the project root for license information.
3
+
4
+ module Azure::ARM::Storage
5
+ VERSION = '0.1.0'
6
+ end
metadata ADDED
@@ -0,0 +1,226 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: azure_mgmt_storage
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Microsoft Corporation
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-08-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.9'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: dotenv
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: azure_mgmt_resources
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.1'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
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
145
+ - !ruby/object:Gem::Dependency
146
+ name: ms_rest_azure
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '0.1'
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'
159
+ description: Microsoft Azure Storage Management Client Library for Ruby
160
+ email: azsdkteam@microsoft.com
161
+ executables: []
162
+ extensions: []
163
+ extra_rdoc_files: []
164
+ files:
165
+ - ".gitignore"
166
+ - ".rspec"
167
+ - ".travis.yml"
168
+ - Gemfile
169
+ - LICENSE.txt
170
+ - README.md
171
+ - Rakefile
172
+ - azure_mgmt_storage.gemspec
173
+ - lib/azure_mgmt_storage.rb
174
+ - lib/azure_mgmt_storage/models/account_status.rb
175
+ - lib/azure_mgmt_storage/models/account_type.rb
176
+ - lib/azure_mgmt_storage/models/check_name_availability_result.rb
177
+ - lib/azure_mgmt_storage/models/custom_domain.rb
178
+ - lib/azure_mgmt_storage/models/endpoints.rb
179
+ - lib/azure_mgmt_storage/models/key_name.rb
180
+ - lib/azure_mgmt_storage/models/provisioning_state.rb
181
+ - lib/azure_mgmt_storage/models/reason.rb
182
+ - lib/azure_mgmt_storage/models/storage_account.rb
183
+ - lib/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb
184
+ - lib/azure_mgmt_storage/models/storage_account_create_parameters.rb
185
+ - lib/azure_mgmt_storage/models/storage_account_keys.rb
186
+ - lib/azure_mgmt_storage/models/storage_account_list_result.rb
187
+ - lib/azure_mgmt_storage/models/storage_account_properties.rb
188
+ - lib/azure_mgmt_storage/models/storage_account_properties_create_parameters.rb
189
+ - lib/azure_mgmt_storage/models/storage_account_properties_update_parameters.rb
190
+ - lib/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb
191
+ - lib/azure_mgmt_storage/models/storage_account_update_parameters.rb
192
+ - lib/azure_mgmt_storage/models/usage.rb
193
+ - lib/azure_mgmt_storage/models/usage_list_result.rb
194
+ - lib/azure_mgmt_storage/models/usage_name.rb
195
+ - lib/azure_mgmt_storage/models/usage_unit.rb
196
+ - lib/azure_mgmt_storage/module_definition.rb
197
+ - lib/azure_mgmt_storage/storage_accounts.rb
198
+ - lib/azure_mgmt_storage/storage_management_client.rb
199
+ - lib/azure_mgmt_storage/usage_operations.rb
200
+ - lib/azure_mgmt_storage/version.rb
201
+ homepage: http://github.com/azure/azure-sdk-for-ruby
202
+ licenses:
203
+ - MIT
204
+ metadata: {}
205
+ post_install_message:
206
+ rdoc_options: []
207
+ require_paths:
208
+ - lib
209
+ required_ruby_version: !ruby/object:Gem::Requirement
210
+ requirements:
211
+ - - ">="
212
+ - !ruby/object:Gem::Version
213
+ version: 1.9.3
214
+ required_rubygems_version: !ruby/object:Gem::Requirement
215
+ requirements:
216
+ - - ">="
217
+ - !ruby/object:Gem::Version
218
+ version: '0'
219
+ requirements: []
220
+ rubyforge_project:
221
+ rubygems_version: 2.4.6
222
+ signing_key:
223
+ specification_version: 4
224
+ summary: Official ruby client library to consume Microsoft Azure Storage Management
225
+ services.
226
+ test_files: []