ms_rest_azure 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -2
- data/lib/ms_rest_azure/azure_operation_error.rb +29 -0
- data/lib/ms_rest_azure/azure_service_client.rb +20 -0
- data/lib/ms_rest_azure/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6245c14af0d65fe5cccfd8179024358a9cb761a
|
4
|
+
data.tar.gz: b48d9d6a00ce589692c9531c5b3e9ce8adf78645
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cb8d7448eb7ffc1ffd99777544b1c5ae690d5a0ab0575d246010f7775f4ab5b1757ec10a2294cefee9572d2e773e4730c3eecb900699f537c9835cbfce9e2fb
|
7
|
+
data.tar.gz: 221dc02de7944922bf8819d61e49ac3737162098deaa658b8ba5ba2cd111dc206d0facfec2d8fe083f67d09b6920b48d40ed3211f88db9e81e3b68033f007b8e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
##2016.10.05 ms_rest_azure version 0.6.0
|
2
|
+
* Minimum supported Ruby version is 2.0.0 [#1463](https://github.com/Azure/autorest/pull/1463)
|
3
|
+
* Implemented generic request method for AzureServiceClient [#1447](https://github.com/Azure/autorest/pull/1447)
|
4
|
+
* Improved AzureOperationError class to expose error_message and error_code properties [#1450](https://github.com/Azure/autorest/pull/1450)
|
5
|
+
|
1
6
|
##2016.09.15 ms_rest_azure version 0.5.0
|
2
7
|
* Updating ms_rest dependecy to version 0.5.0
|
3
8
|
* Adding known Azure Environments in ruby runtime for easy discovery
|
data/README.md
CHANGED
@@ -4,7 +4,6 @@ MsRestAzure is a library which supports the Azure clients (SDKs) generated with
|
|
4
4
|
|
5
5
|
# Supported Ruby Versions
|
6
6
|
|
7
|
-
* Ruby 1.9.3
|
8
7
|
* Ruby 2.0
|
9
8
|
* Ruby 2.1
|
10
9
|
* Ruby 2.2
|
@@ -38,7 +37,7 @@ To start working on the gem the only additional dev dependecy is required - rspe
|
|
38
37
|
Reference it in the gemfile and also add this line to your client's gemspec file:
|
39
38
|
|
40
39
|
```ruby
|
41
|
-
spec.add_runtime_dependency 'ms_rest_azure', '~> 0.
|
40
|
+
spec.add_runtime_dependency 'ms_rest_azure', '~> 0.6.0'
|
42
41
|
```
|
43
42
|
|
44
43
|
Don't forget to correct the version.
|
@@ -7,5 +7,34 @@ module MsRestAzure
|
|
7
7
|
# Class which represents an Azure error.
|
8
8
|
#
|
9
9
|
class AzureOperationError < MsRest::HttpOperationError
|
10
|
+
|
11
|
+
# @return [String] the error message.
|
12
|
+
attr_accessor :error_message
|
13
|
+
|
14
|
+
# @return [String] the error code.
|
15
|
+
attr_accessor :error_code
|
16
|
+
|
17
|
+
#
|
18
|
+
# Creates and initialize new instance of the AzureOperationError class.
|
19
|
+
# @param [Hash] the HTTP request data (uri, body, headers).
|
20
|
+
# @param [Faraday::Response] the HTTP response object.
|
21
|
+
# @param [String] body the HTTP response body.
|
22
|
+
# @param [String] error message.
|
23
|
+
#
|
24
|
+
def initialize(*args)
|
25
|
+
super(*args)
|
26
|
+
|
27
|
+
# Try to parse @body to find useful error message and code
|
28
|
+
# Body should meet the error condition response requirements for Microsoft REST API Guidelines
|
29
|
+
# https://github.com/Microsoft/api-guidelines/blob/master/Guidelines.md#7102-error-condition-responses
|
30
|
+
begin
|
31
|
+
unless @body.nil?
|
32
|
+
@error_message = @body['error']['message']
|
33
|
+
@error_code = @body['error']['code']
|
34
|
+
@msg = "#{@msg}: #{@error_code}: #{@error_message}"
|
35
|
+
end
|
36
|
+
rescue
|
37
|
+
end
|
38
|
+
end
|
10
39
|
end
|
11
40
|
end
|
@@ -14,6 +14,13 @@ module MsRestAzure
|
|
14
14
|
# @return [String] api version of the Azure in string format.
|
15
15
|
attr_accessor :api_version
|
16
16
|
|
17
|
+
def initialize(credentials, options = nil)
|
18
|
+
super(credentials, options)
|
19
|
+
@request_headers = {
|
20
|
+
'Content-Type' => 'application/json;charset=utf-8' # This is the current default for Azure services, and content-type supported by Autorest
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
17
24
|
#
|
18
25
|
# Retrieves the result of 'POST','DELETE','PUT' or 'PATCH' operation. Performs polling of required.
|
19
26
|
# @param azure_response [MsRestAzure::AzureOperationResponse] response from Azure service.
|
@@ -245,6 +252,19 @@ module MsRestAzure
|
|
245
252
|
|
246
253
|
result
|
247
254
|
end
|
255
|
+
|
256
|
+
|
257
|
+
private
|
258
|
+
#
|
259
|
+
# Retrieves a new instance of the AzureOperationResponse class.
|
260
|
+
# @param [MsRest::HttpOperationRequest] request the HTTP request object.
|
261
|
+
# @param [Faraday::Response] response the HTTP response object.
|
262
|
+
# @param [String] body the HTTP response body.
|
263
|
+
# @return [MsRestAzure::AzureOperationResponse] the operation response.
|
264
|
+
#
|
265
|
+
def create_response(request, http_response, body = nil)
|
266
|
+
AzureOperationResponse.new(request, http_response, body)
|
267
|
+
end
|
248
268
|
end
|
249
269
|
|
250
270
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ms_rest_azure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.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-
|
11
|
+
date: 2016-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
117
|
+
version: 0.6.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.
|
124
|
+
version: 0.6.0
|
125
125
|
description: Azure Client Library for Ruby.
|
126
126
|
email: azsdkteam@microsoft.com
|
127
127
|
executables: []
|
@@ -157,7 +157,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
157
157
|
requirements:
|
158
158
|
- - ">="
|
159
159
|
- !ruby/object:Gem::Version
|
160
|
-
version:
|
160
|
+
version: 2.0.0
|
161
161
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
163
|
- - ">="
|