ms_rest_azure 0.6.2 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20542983875e3b9bb51018539eada5e851cc294d
4
- data.tar.gz: 42f00e5d2209f616f7746bbe66ea29b5efd4ef08
3
+ metadata.gz: 67720d4755221ce7b280201aef573104e48b3f63
4
+ data.tar.gz: 9559d6fed552c0d8ffcc99a75857ce45cbe7c20a
5
5
  SHA512:
6
- metadata.gz: d910ddbcb65f989e293607d357d015d5724fd3e1d1312f3112c3b17c1f1e277dd264c1d139befc66815edf8cf6541e18ec114cc129163527728080692f3e4064
7
- data.tar.gz: 91e1ec637131764e0a527c07b6d17d2d0b6e96ae84c80942c1fd440622242b09dd4da64e71ccf63dbe0dd618229134782d263fb9661798e6af8bb42eade65ea1
6
+ metadata.gz: 2cdd5052429ac7bb6e2fb0998a177c5622b8bda062e3675461a605243e82eb7dec7011ee1002d7b35b957b71d0c425ab250fefd626e96d188ee4e3cc4b98c57d
7
+ data.tar.gz: daa4c182871b3160f92a0ca2bb97460ac50d8bd9d205609afd3efe573ffb3fb72edb44896e225c941fa1e42af490404db9d0f96f5b0b40cbba1751e9bd97ab22
@@ -1,3 +1,9 @@
1
+ ##2017.02.06 ms_rest_azure version 0.7.0
2
+ * [Breaking Change] Correcting typo in `storage_endpoint_suffix` key for azure environments [Issue #603](https://github.com/Azure/azure-sdk-for-ruby/issues/603) [PR #604](https://github.com/Azure/azure-sdk-for-ruby/pull/604)
3
+ * [Breaking Change] Handling custom deserialization block in `MsRestAzure::AzureServiceClient.update_state_from_azure_async_operation_header` [PR #656](https://github.com/Azure/azure-sdk-for-ruby/pull/656)
4
+ * Adding `resource_group` property on MsRestAzure::Resource to be populated with Azure resource group name when available from `id` [Issue 340](https://github.com/Azure/azure-sdk-for-ruby/issues/340) [PR #620](https://github.com/Azure/azure-sdk-for-ruby/pull/620)
5
+ * Deriving `MsREstAzure::Resource` from `MsRestAzure::SubResource` to share `id` property [PR #663](https://github.com/Azure/azure-sdk-for-ruby/pull/663)
6
+
1
7
  ##2016.11.14 ms_rest_azure version 0.6.2
2
8
  * Update to ms_rest v0.6.2 due to fix for missing default ca-cert for providing ssl options [#580](https://github.com/Azure/azure-sdk-for-ruby/issues/580)
3
9
 
data/README.md CHANGED
@@ -37,7 +37,7 @@ To start working on the gem the only additional dev dependecy is required - rspe
37
37
  Reference it in the gemfile and also add this line to your client's gemspec file:
38
38
 
39
39
  ```ruby
40
- spec.add_runtime_dependency 'ms_rest_azure', '~> 0.6.2'
40
+ spec.add_runtime_dependency 'ms_rest_azure', '~> 0.7.0'
41
41
  ```
42
42
  Don't forget to correct the version.
43
43
 
@@ -12,9 +12,9 @@ require 'ms_rest_azure/azure_service_client.rb'
12
12
  require 'ms_rest_azure/cloud_error_data.rb'
13
13
  require 'ms_rest_azure/credentials/application_token_provider.rb'
14
14
  require 'ms_rest_azure/polling_state.rb'
15
+ require 'ms_rest_azure/sub_resource.rb'
15
16
  require 'ms_rest_azure/resource.rb'
16
17
  require 'ms_rest_azure/serialization.rb'
17
- require 'ms_rest_azure/sub_resource.rb'
18
18
  require 'ms_rest_azure/version'
19
19
 
20
20
  module MsRestAzure end
@@ -97,7 +97,7 @@ module MsRestAzure
97
97
  :active_directory_resource_id => 'https://management.core.windows.net/',
98
98
  :active_directory_graph_resource_id => 'https://graph.windows.net/',
99
99
  :active_directory_graph_api_version => '2013-04-05',
100
- :storage_endpoing_suffix => '.core.windows.net',
100
+ :storage_endpoint_suffix => '.core.windows.net',
101
101
  :key_vault_dns_suffix => '.vault.azure.net',
102
102
  :datalake_store_filesystem_endpoint_suffix => 'azuredatalakestore.net',
103
103
  :datalake_analytics_catalog_and_job_endpoint_suffix => 'azuredatalakeanalytics.net'
@@ -115,7 +115,7 @@ module MsRestAzure
115
115
  :active_directory_resource_id => 'https://management.core.chinacloudapi.cn/',
116
116
  :active_directory_graph_resource_id => 'https://graph.chinacloudapi.cn/',
117
117
  :active_directory_graph_api_version => '2013-04-05',
118
- :storage_endpoing_suffix => '.core.chinacloudapi.cn',
118
+ :storage_endpoint_suffix => '.core.chinacloudapi.cn',
119
119
  :key_vault_dns_suffix => '.vault.azure.cn',
120
120
  # TODO: add dns suffixes for the china cloud for datalake store and datalake analytics once they are defined.
121
121
  :datalake_store_filesystem_endpoint_suffix => 'N/A',
@@ -134,7 +134,7 @@ module MsRestAzure
134
134
  :active_directory_resource_id => 'https://management.core.usgovcloudapi.net/',
135
135
  :active_directory_graph_resource_id => 'https://graph.windows.net/',
136
136
  :active_directory_graph_api_version => '2013-04-05',
137
- :storage_endpoing_suffix => '.core.usgovcloudapi.net',
137
+ :storage_endpoint_suffix => '.core.usgovcloudapi.net',
138
138
  :key_vault_dns_suffix => '.vault.usgovcloudapi.net',
139
139
  # TODO: add dns suffixes for the US government for datalake store and datalake analytics once they are defined.
140
140
  :datalake_store_filesystem_endpoint_suffix => 'N/A',
@@ -153,7 +153,7 @@ module MsRestAzure
153
153
  :active_directory_resource_id => 'https://management.core.cloudapi.de/',
154
154
  :active_directory_graph_resource_id => 'https://graph.cloudapi.de/',
155
155
  :active_directory_graph_api_version => '2013-04-05',
156
- :storage_endpoing_suffix => '.core.cloudapi.de',
156
+ :storage_endpoint_suffix => '.core.cloudapi.de',
157
157
  :key_vault_dns_suffix => '.vault.microsoftazure.de',
158
158
  # TODO: add dns suffixes for the US government for datalake store and datalake analytics once they are defined.
159
159
  :datalake_store_filesystem_endpoint_suffix => 'N/A',
@@ -73,9 +73,20 @@ module MsRestAzure
73
73
  fail polling_error if polling_error.is_a?(Exception)
74
74
  end
75
75
 
76
- if (http_method === :put || http_method === :patch) && AsyncOperationStatus.is_successful_status(polling_state.status) && polling_state.resource.nil?
77
- get_request = MsRest::HttpOperationRequest.new(request.base_uri, request.build_path.to_s, :get, {query_params: request.query_params, headers: request.headers})
78
- update_state_from_get_resource_operation(get_request, polling_state, custom_deserialization_block)
76
+ if AsyncOperationStatus.is_successful_status(polling_state.status)
77
+ # Process long-running PUT/PATCH
78
+ if (http_method === :put || http_method === :patch) && polling_state.resource.nil?
79
+ get_request = MsRest::HttpOperationRequest.new(request.base_uri, request.build_path.to_s, :get, {query_params: request.query_params, headers: request.headers})
80
+ update_state_from_get_resource_operation(get_request, polling_state, custom_deserialization_block)
81
+ end
82
+
83
+ # Process long-running POST/DELETE operation with schema defined on success status codes
84
+ if (http_method === :post || http_method === :delete) && custom_deserialization_block && polling_state.response
85
+ unless polling_state.response.body.to_s.empty?
86
+ body = JSON.load(polling_state.response.body)
87
+ polling_state.resource = custom_deserialization_block.call(body)
88
+ end
89
+ end
79
90
  end
80
91
 
81
92
  if AsyncOperationStatus.is_failed_status(polling_state.status)
@@ -2,14 +2,12 @@
2
2
  # Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  # Licensed under the MIT License. See License.txt in the project root for license information.
4
4
 
5
+
5
6
  module MsRestAzure
6
7
  #
7
8
  # Class which represents any Azure resource.
8
9
  #
9
- class Resource
10
-
11
- # @return [String] the id of the resource.
12
- attr_accessor :id
10
+ class Resource < SubResource
13
11
 
14
12
  # @return [String] the name of the resource.
15
13
  attr_accessor :name
@@ -23,6 +21,14 @@ module MsRestAzure
23
21
  # @return [Hash{String => String}] the tags attached to resources (optional).
24
22
  attr_accessor :tags
25
23
 
24
+ # @return [String] the name of the resource group of the resource.
25
+ def resource_group
26
+ unless self.id.nil?
27
+ groups = self.id.match(/.+\/resourceGroups\/([^\/]+)\/.+/)
28
+ groups.captures[0].strip if groups
29
+ end
30
+ end
31
+
26
32
  def self.mapper
27
33
  {
28
34
  required: false,
@@ -3,5 +3,5 @@
3
3
  # Licensed under the MIT License. See License.txt in the project root for license information.
4
4
 
5
5
  module MsRestAzure
6
- VERSION = '0.6.2'
6
+ VERSION = '0.7.0'
7
7
  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.6.2
4
+ version: 0.7.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-14 00:00:00.000000000 Z
11
+ date: 2017-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.6.2
103
+ version: 0.6.3
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.6.2
110
+ version: 0.6.3
111
111
  description: Azure Client Library for Ruby.
112
112
  email: azsdkteam@microsoft.com
113
113
  executables: []