azure_mgmt_resources 0.1.0 → 0.3.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 +13 -5
- data/README.md +1 -27
- data/azure_mgmt_resources.gemspec +2 -6
- data/lib/azure_mgmt_resources/deployment_operations.rb +161 -141
- data/lib/azure_mgmt_resources/deployments.rb +684 -310
- data/lib/azure_mgmt_resources/{Models → models}/basic_dependency.rb +1 -3
- data/lib/azure_mgmt_resources/models/debug_setting.rb +56 -0
- data/lib/azure_mgmt_resources/{Models → models}/dependency.rb +4 -6
- data/lib/azure_mgmt_resources/{Models → models}/deployment.rb +1 -3
- data/lib/azure_mgmt_resources/models/deployment_export_result.rb +56 -0
- data/lib/azure_mgmt_resources/{Models → models}/deployment_extended.rb +8 -9
- data/lib/azure_mgmt_resources/{Models → models}/deployment_extended_filter.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/deployment_list_result.rb +4 -6
- data/lib/azure_mgmt_resources/{Models → models}/deployment_mode.rb +2 -1
- data/lib/azure_mgmt_resources/{Models → models}/deployment_operation.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/deployment_operation_properties.rb +41 -2
- data/lib/azure_mgmt_resources/{Models → models}/deployment_operations_list_result.rb +4 -6
- data/lib/azure_mgmt_resources/{Models → models}/deployment_properties.rb +19 -4
- data/lib/azure_mgmt_resources/{Models → models}/deployment_properties_extended.rb +25 -10
- data/lib/azure_mgmt_resources/{Models → models}/deployment_validate_result.rb +1 -3
- data/lib/azure_mgmt_resources/models/export_template_request.rb +69 -0
- data/lib/azure_mgmt_resources/{Models → models}/generic_resource.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/generic_resource_filter.rb +1 -3
- data/lib/azure_mgmt_resources/models/http_message.rb +56 -0
- data/lib/azure_mgmt_resources/{Models → models}/parameters_link.rb +2 -4
- data/lib/azure_mgmt_resources/{Models → models}/plan.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/provider.rb +4 -6
- data/lib/azure_mgmt_resources/{Models → models}/provider_list_result.rb +4 -6
- data/lib/azure_mgmt_resources/{Models → models}/provider_resource_type.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/resource_group.rb +8 -9
- data/lib/azure_mgmt_resources/models/resource_group_export_result.rb +71 -0
- data/lib/azure_mgmt_resources/{Models → models}/resource_group_filter.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/resource_group_list_result.rb +11 -12
- data/lib/azure_mgmt_resources/{Models → models}/resource_group_properties.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/resource_list_result.rb +11 -12
- data/lib/azure_mgmt_resources/{Models → models}/resource_management_error_with_details.rb +29 -28
- data/lib/azure_mgmt_resources/{Models → models}/resource_provider_operation_definition.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/resource_provider_operation_detail_list_result.rb +4 -6
- data/lib/azure_mgmt_resources/{Models → models}/resource_provider_operation_display_properties.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/resources_move_info.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/tag_count.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/tag_details.rb +4 -6
- data/lib/azure_mgmt_resources/{Models → models}/tag_value.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/tags_list_result.rb +11 -12
- data/lib/azure_mgmt_resources/{Models → models}/target_resource.rb +1 -3
- data/lib/azure_mgmt_resources/{Models → models}/template_link.rb +2 -4
- data/lib/azure_mgmt_resources/module_definition.rb +5 -3
- data/lib/azure_mgmt_resources/providers.rb +265 -239
- data/lib/azure_mgmt_resources/resource_groups.rb +604 -465
- data/lib/azure_mgmt_resources/resource_management_client.rb +18 -11
- data/lib/azure_mgmt_resources/resource_provider_operation_details.rb +154 -47
- data/lib/azure_mgmt_resources/resources.rb +425 -380
- data/lib/azure_mgmt_resources/tags.rb +310 -288
- data/lib/azure_mgmt_resources/version.rb +5 -3
- data/lib/azure_mgmt_resources.rb +20 -19
- metadata +68 -126
- data/.travis.yml +0 -3
- data/Gemfile +0 -14
- data/lib/azure_mgmt_resources/Models/resource_group_extended.rb +0 -113
- data/lib/azure_mgmt_resources/Models/resource_group_extended_filter.rb +0 -63
- data/lib/azure_mgmt_resources/Models/resource_group_format_resource_properties.rb +0 -54
- data/lib/azure_mgmt_resources/Models/resource_management_error.rb +0 -77
checksums.yaml
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
|
|
2
|
+
!binary "U0hBMQ==":
|
|
3
|
+
metadata.gz: !binary |-
|
|
4
|
+
YTllYmEzYmI3ODVhM2IyYzVlZDUyYTdiZDEwYjI2NDg3ZTJlNTkwNg==
|
|
5
|
+
data.tar.gz: !binary |-
|
|
6
|
+
MmY5ZTg4MTVmZGU4NzM5OTQwNDg4MGNmMDA1ZGQ3YjlkZGQ2OGMzZQ==
|
|
5
7
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
|
|
8
|
+
metadata.gz: !binary |-
|
|
9
|
+
ODBkNTU4ZGRmZWIzMDc3MmVjOWQ2YzliZGE3ZWY3YjU4ZWViMWFlYjY2Y2E2
|
|
10
|
+
OWRkZmIwZjJjNTBjOWRlNWQ1ZjU4M2VjYThkYzFhOGMzZTllZTIzYzE1NDQw
|
|
11
|
+
NTY3NzhlYjM5MDAwMjZhNjRjYTk2N2FkMWUwOTNjMDllNGE4ZjE=
|
|
12
|
+
data.tar.gz: !binary |-
|
|
13
|
+
YzI4ZThhMGQ5MDJkY2FmNzNiZTBmOTFhOGU0MTVlYWRmOGMzODM2ODNlY2Vk
|
|
14
|
+
MzhhZjg5N2JjMjI5NjRmYTM1YTk4NzQzZWJmNjg4YWEzMDlmZDdiNmZmNjVi
|
|
15
|
+
NDFmODEyOTcyMDEyYzViODdkYTdhMDdiOGExYjUxMDUyOWZkYzY=
|
data/README.md
CHANGED
|
@@ -51,7 +51,7 @@ client.subscription_id = subscription_id
|
|
|
51
51
|
resource_group = Azure::ARM::Resources::Models::ResourceGroup.new()
|
|
52
52
|
resource_group.location = 'westus'
|
|
53
53
|
|
|
54
|
-
promise = client.resource_groups.
|
|
54
|
+
promise = client.resource_groups.create_or_update_async('new_test_resource_group', resource_group)
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
The SDK method returns a promise which you can utilize depending on your needs. E.g. if you need to get result immediately via sync blocking call - do the following:
|
|
@@ -78,29 +78,3 @@ p resource_group.id # the id of resource group
|
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
Congrats, you've create an ARM resource group. We encourage you to try more stuff and let us know your feedback!
|
|
81
|
-
|
|
82
|
-
# Running tests
|
|
83
|
-
|
|
84
|
-
## Adding env variables
|
|
85
|
-
|
|
86
|
-
To run the tests you would need to set the following environment variables with your real Azure data:
|
|
87
|
-
|
|
88
|
-
* azure_tenant_id
|
|
89
|
-
* azure_client_id
|
|
90
|
-
* azure_client_secret
|
|
91
|
-
* subscription_id
|
|
92
|
-
|
|
93
|
-
* run_long_tasks - set this to '1' only if you would like to run time consuming tests like VM creation.
|
|
94
|
-
|
|
95
|
-
## Starting tests
|
|
96
|
-
|
|
97
|
-
Just run 'rspec' command from the current gem folder.
|
|
98
|
-
|
|
99
|
-
# Contribution
|
|
100
|
-
|
|
101
|
-
All the SDK code was generated by tool 'AutoRest' - https://github.com/Azure/autorest
|
|
102
|
-
So if you have found a bug or have an idea for a new feature - suggest, discuss and contribute it into the AutoRest repository. After that SDK maintainers will update the sources and the gem.
|
|
103
|
-
|
|
104
|
-
# Provide feedback
|
|
105
|
-
|
|
106
|
-
Send email to the azsdkteam@microsoft.com or file new issue in this repository.
|
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
|
12
12
|
spec.name = 'azure_mgmt_resources'
|
|
13
13
|
spec.version = Azure::ARM::Resources::VERSION
|
|
14
14
|
spec.authors = 'Microsoft Corporation'
|
|
15
|
-
spec.email = '
|
|
15
|
+
spec.email = 'azrubyteam@microsoft.com'
|
|
16
16
|
spec.description = 'Microsoft Azure Resource Management Client Library for Ruby'
|
|
17
17
|
spec.summary = 'Official ruby client library to consume Microsoft Azure Resource Management services.'
|
|
18
18
|
spec.homepage = 'http://github.com/azure/azure-sdk-for-ruby'
|
|
@@ -30,9 +30,5 @@ Gem::Specification.new do |spec|
|
|
|
30
30
|
spec.add_development_dependency 'rspec', '~> 3'
|
|
31
31
|
spec.add_development_dependency 'dotenv', '~> 2'
|
|
32
32
|
|
|
33
|
-
spec.add_runtime_dependency '
|
|
34
|
-
spec.add_runtime_dependency 'concurrent-ruby', ['>= 1.0.0.pre1', '<2']
|
|
35
|
-
spec.add_runtime_dependency 'faraday', '~> 0.9'
|
|
36
|
-
spec.add_runtime_dependency 'faraday-cookie_jar', '~> 0.0.6'
|
|
37
|
-
spec.add_runtime_dependency 'ms_rest_azure', '~> 0.1'
|
|
33
|
+
spec.add_runtime_dependency 'ms_rest_azure', '~> 0.2.3'
|
|
38
34
|
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator 0.
|
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
|
|
3
3
|
# Changes may cause incorrect behavior and will be lost if the code is
|
|
4
4
|
# regenerated.
|
|
5
5
|
|
|
@@ -24,89 +24,96 @@ module Azure::ARM::Resources
|
|
|
24
24
|
|
|
25
25
|
#
|
|
26
26
|
# Get a list of deployments operations.
|
|
27
|
+
#
|
|
27
28
|
# @param resource_group_name [String] The name of the resource group. The name
|
|
28
29
|
# is case insensitive.
|
|
29
30
|
# @param deployment_name [String] The name of the deployment.
|
|
30
31
|
# @param operation_id [String] Operation Id.
|
|
31
|
-
# @param [Hash{String => String}]
|
|
32
|
-
#
|
|
32
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
33
|
+
# will be added to the HTTP request.
|
|
33
34
|
#
|
|
34
|
-
# @return [
|
|
35
|
-
# response.
|
|
35
|
+
# @return [DeploymentOperation] operation results.
|
|
36
36
|
#
|
|
37
37
|
def get(resource_group_name, deployment_name, operation_id, custom_headers = nil)
|
|
38
|
+
response = get_async(resource_group_name, deployment_name, operation_id, custom_headers).value!
|
|
39
|
+
response.body unless response.nil?
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
#
|
|
43
|
+
# Get a list of deployments operations.
|
|
44
|
+
#
|
|
45
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
|
46
|
+
# is case insensitive.
|
|
47
|
+
# @param deployment_name [String] The name of the deployment.
|
|
48
|
+
# @param operation_id [String] Operation Id.
|
|
49
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
50
|
+
# will be added to the HTTP request.
|
|
51
|
+
#
|
|
52
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
53
|
+
#
|
|
54
|
+
def get_with_http_info(resource_group_name, deployment_name, operation_id, custom_headers = nil)
|
|
55
|
+
get_async(resource_group_name, deployment_name, operation_id, custom_headers).value!
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
#
|
|
59
|
+
# Get a list of deployments operations.
|
|
60
|
+
#
|
|
61
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
|
62
|
+
# is case insensitive.
|
|
63
|
+
# @param deployment_name [String] The name of the deployment.
|
|
64
|
+
# @param operation_id [String] Operation Id.
|
|
65
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
66
|
+
# to the HTTP request.
|
|
67
|
+
#
|
|
68
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
69
|
+
#
|
|
70
|
+
def get_async(resource_group_name, deployment_name, operation_id, custom_headers = nil)
|
|
38
71
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
39
72
|
fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
|
|
40
73
|
fail ArgumentError, 'operation_id is nil' if operation_id.nil?
|
|
41
74
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
42
75
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
43
|
-
|
|
44
|
-
path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}"
|
|
45
|
-
path['{resourceGroupName}'] = ERB::Util.url_encode(resource_group_name) if path.include?('{resourceGroupName}')
|
|
46
|
-
path['{deploymentName}'] = ERB::Util.url_encode(deployment_name) if path.include?('{deploymentName}')
|
|
47
|
-
path['{operationId}'] = ERB::Util.url_encode(operation_id) if path.include?('{operationId}')
|
|
48
|
-
path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
|
|
49
|
-
url = URI.join(@client.base_url, path)
|
|
50
|
-
properties = {}
|
|
51
|
-
properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
|
|
52
|
-
unless url.query.nil?
|
|
53
|
-
url.query.split('&').each do |url_item|
|
|
54
|
-
url_items_parts = url_item.split('=')
|
|
55
|
-
properties[url_items_parts[0]] = url_items_parts[1]
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
properties.reject!{ |key, value| value.nil? }
|
|
59
|
-
url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
|
|
60
|
-
fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
|
|
61
|
-
corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
|
|
62
|
-
url = URI.parse(corrected_url)
|
|
63
|
-
|
|
64
|
-
connection = Faraday.new(:url => url) do |faraday|
|
|
65
|
-
faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
|
|
66
|
-
faraday.use :cookie_jar
|
|
67
|
-
faraday.adapter Faraday.default_adapter
|
|
68
|
-
end
|
|
69
|
-
request_headers = Hash.new
|
|
76
|
+
request_headers = {}
|
|
70
77
|
|
|
71
78
|
# Set Headers
|
|
72
79
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
73
|
-
request_headers[
|
|
80
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
81
|
+
path_template = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}'
|
|
82
|
+
options = {
|
|
83
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
84
|
+
path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'operationId' => operation_id,'subscriptionId' => @client.subscription_id},
|
|
85
|
+
query_params: {'api-version' => @client.api_version},
|
|
86
|
+
headers: request_headers.merge(custom_headers || {})
|
|
87
|
+
}
|
|
74
88
|
|
|
75
|
-
|
|
76
|
-
custom_headers.each do |key, value|
|
|
77
|
-
request_headers[key] = value
|
|
78
|
-
end
|
|
79
|
-
end
|
|
89
|
+
request_url = @base_url || @client.base_url
|
|
80
90
|
|
|
81
|
-
|
|
82
|
-
promise =
|
|
83
|
-
|
|
84
|
-
request.headers = request_headers
|
|
85
|
-
@client.credentials.sign_request(request) unless @client.credentials.nil?
|
|
86
|
-
end
|
|
91
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
|
92
|
+
promise = request.run_promise do |req|
|
|
93
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
87
94
|
end
|
|
88
95
|
|
|
89
96
|
promise = promise.then do |http_response|
|
|
90
97
|
status_code = http_response.status
|
|
91
98
|
response_content = http_response.body
|
|
92
|
-
unless
|
|
99
|
+
unless status_code == 200
|
|
93
100
|
error_model = JSON.load(response_content)
|
|
94
|
-
fail MsRestAzure::AzureOperationError.new(
|
|
101
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
95
102
|
end
|
|
96
103
|
|
|
97
104
|
# Create Result
|
|
98
|
-
result = MsRestAzure::AzureOperationResponse.new(
|
|
105
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
99
106
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
100
107
|
# Deserialize Response
|
|
101
108
|
if status_code == 200
|
|
102
109
|
begin
|
|
103
|
-
parsed_response = JSON.load(response_content)
|
|
110
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
104
111
|
unless parsed_response.nil?
|
|
105
112
|
parsed_response = DeploymentOperation.deserialize_object(parsed_response)
|
|
106
113
|
end
|
|
107
114
|
result.body = parsed_response
|
|
108
115
|
rescue Exception => e
|
|
109
|
-
fail MsRest::DeserializationError.new(
|
|
116
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
110
117
|
end
|
|
111
118
|
end
|
|
112
119
|
|
|
@@ -118,88 +125,95 @@ module Azure::ARM::Resources
|
|
|
118
125
|
|
|
119
126
|
#
|
|
120
127
|
# Gets a list of deployments operations.
|
|
128
|
+
#
|
|
121
129
|
# @param resource_group_name [String] The name of the resource group. The name
|
|
122
130
|
# is case insensitive.
|
|
123
131
|
# @param deployment_name [String] The name of the deployment.
|
|
124
132
|
# @param top [Integer] Query parameters.
|
|
125
|
-
# @param [Hash{String => String}]
|
|
126
|
-
#
|
|
133
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
134
|
+
# will be added to the HTTP request.
|
|
127
135
|
#
|
|
128
|
-
# @return [
|
|
129
|
-
# response.
|
|
136
|
+
# @return [DeploymentOperationsListResult] operation results.
|
|
130
137
|
#
|
|
131
138
|
def list(resource_group_name, deployment_name, top = nil, custom_headers = nil)
|
|
139
|
+
response = list_async(resource_group_name, deployment_name, top, custom_headers).value!
|
|
140
|
+
response.body unless response.nil?
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
#
|
|
144
|
+
# Gets a list of deployments operations.
|
|
145
|
+
#
|
|
146
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
|
147
|
+
# is case insensitive.
|
|
148
|
+
# @param deployment_name [String] The name of the deployment.
|
|
149
|
+
# @param top [Integer] Query parameters.
|
|
150
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
151
|
+
# will be added to the HTTP request.
|
|
152
|
+
#
|
|
153
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
154
|
+
#
|
|
155
|
+
def list_with_http_info(resource_group_name, deployment_name, top = nil, custom_headers = nil)
|
|
156
|
+
list_async(resource_group_name, deployment_name, top, custom_headers).value!
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
#
|
|
160
|
+
# Gets a list of deployments operations.
|
|
161
|
+
#
|
|
162
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
|
163
|
+
# is case insensitive.
|
|
164
|
+
# @param deployment_name [String] The name of the deployment.
|
|
165
|
+
# @param top [Integer] Query parameters.
|
|
166
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
167
|
+
# to the HTTP request.
|
|
168
|
+
#
|
|
169
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
170
|
+
#
|
|
171
|
+
def list_async(resource_group_name, deployment_name, top = nil, custom_headers = nil)
|
|
132
172
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
133
173
|
fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
|
|
134
174
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
135
175
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
136
|
-
|
|
137
|
-
path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations"
|
|
138
|
-
path['{resourceGroupName}'] = ERB::Util.url_encode(resource_group_name) if path.include?('{resourceGroupName}')
|
|
139
|
-
path['{deploymentName}'] = ERB::Util.url_encode(deployment_name) if path.include?('{deploymentName}')
|
|
140
|
-
path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
|
|
141
|
-
url = URI.join(@client.base_url, path)
|
|
142
|
-
properties = {}
|
|
143
|
-
properties['$top'] = ERB::Util.url_encode(top.to_s) unless top.nil?
|
|
144
|
-
properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
|
|
145
|
-
unless url.query.nil?
|
|
146
|
-
url.query.split('&').each do |url_item|
|
|
147
|
-
url_items_parts = url_item.split('=')
|
|
148
|
-
properties[url_items_parts[0]] = url_items_parts[1]
|
|
149
|
-
end
|
|
150
|
-
end
|
|
151
|
-
properties.reject!{ |key, value| value.nil? }
|
|
152
|
-
url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
|
|
153
|
-
fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
|
|
154
|
-
corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
|
|
155
|
-
url = URI.parse(corrected_url)
|
|
156
|
-
|
|
157
|
-
connection = Faraday.new(:url => url) do |faraday|
|
|
158
|
-
faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
|
|
159
|
-
faraday.use :cookie_jar
|
|
160
|
-
faraday.adapter Faraday.default_adapter
|
|
161
|
-
end
|
|
162
|
-
request_headers = Hash.new
|
|
176
|
+
request_headers = {}
|
|
163
177
|
|
|
164
178
|
# Set Headers
|
|
165
179
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
166
|
-
request_headers[
|
|
180
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
181
|
+
path_template = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations'
|
|
182
|
+
options = {
|
|
183
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
184
|
+
path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
|
|
185
|
+
query_params: {'$top' => top,'api-version' => @client.api_version},
|
|
186
|
+
headers: request_headers.merge(custom_headers || {})
|
|
187
|
+
}
|
|
167
188
|
|
|
168
|
-
|
|
169
|
-
custom_headers.each do |key, value|
|
|
170
|
-
request_headers[key] = value
|
|
171
|
-
end
|
|
172
|
-
end
|
|
189
|
+
request_url = @base_url || @client.base_url
|
|
173
190
|
|
|
174
|
-
|
|
175
|
-
promise =
|
|
176
|
-
|
|
177
|
-
request.headers = request_headers
|
|
178
|
-
@client.credentials.sign_request(request) unless @client.credentials.nil?
|
|
179
|
-
end
|
|
191
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
|
192
|
+
promise = request.run_promise do |req|
|
|
193
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
180
194
|
end
|
|
181
195
|
|
|
182
196
|
promise = promise.then do |http_response|
|
|
183
197
|
status_code = http_response.status
|
|
184
198
|
response_content = http_response.body
|
|
185
|
-
unless
|
|
199
|
+
unless status_code == 200
|
|
186
200
|
error_model = JSON.load(response_content)
|
|
187
|
-
fail MsRestAzure::AzureOperationError.new(
|
|
201
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
188
202
|
end
|
|
189
203
|
|
|
190
204
|
# Create Result
|
|
191
|
-
result = MsRestAzure::AzureOperationResponse.new(
|
|
205
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
192
206
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
193
207
|
# Deserialize Response
|
|
194
208
|
if status_code == 200
|
|
195
209
|
begin
|
|
196
|
-
parsed_response = JSON.load(response_content)
|
|
210
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
197
211
|
unless parsed_response.nil?
|
|
198
212
|
parsed_response = DeploymentOperationsListResult.deserialize_object(parsed_response)
|
|
199
213
|
end
|
|
200
214
|
result.body = parsed_response
|
|
201
215
|
rescue Exception => e
|
|
202
|
-
fail MsRest::DeserializationError.new(
|
|
216
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
203
217
|
end
|
|
204
218
|
end
|
|
205
219
|
|
|
@@ -211,79 +225,85 @@ module Azure::ARM::Resources
|
|
|
211
225
|
|
|
212
226
|
#
|
|
213
227
|
# Gets a list of deployments operations.
|
|
228
|
+
#
|
|
214
229
|
# @param next_page_link [String] The NextLink from the previous successful
|
|
215
230
|
# call to List operation.
|
|
216
|
-
# @param [Hash{String => String}]
|
|
217
|
-
#
|
|
231
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
232
|
+
# will be added to the HTTP request.
|
|
218
233
|
#
|
|
219
|
-
# @return [
|
|
220
|
-
# response.
|
|
234
|
+
# @return [DeploymentOperationsListResult] operation results.
|
|
221
235
|
#
|
|
222
236
|
def list_next(next_page_link, custom_headers = nil)
|
|
237
|
+
response = list_next_async(next_page_link, custom_headers).value!
|
|
238
|
+
response.body unless response.nil?
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
#
|
|
242
|
+
# Gets a list of deployments operations.
|
|
243
|
+
#
|
|
244
|
+
# @param next_page_link [String] The NextLink from the previous successful
|
|
245
|
+
# call to List operation.
|
|
246
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
247
|
+
# will be added to the HTTP request.
|
|
248
|
+
#
|
|
249
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
250
|
+
#
|
|
251
|
+
def list_next_with_http_info(next_page_link, custom_headers = nil)
|
|
252
|
+
list_next_async(next_page_link, custom_headers).value!
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
#
|
|
256
|
+
# Gets a list of deployments operations.
|
|
257
|
+
#
|
|
258
|
+
# @param next_page_link [String] The NextLink from the previous successful
|
|
259
|
+
# call to List operation.
|
|
260
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
261
|
+
# to the HTTP request.
|
|
262
|
+
#
|
|
263
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
264
|
+
#
|
|
265
|
+
def list_next_async(next_page_link, custom_headers = nil)
|
|
223
266
|
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
|
224
|
-
|
|
225
|
-
path = "{nextLink}"
|
|
226
|
-
path['{nextLink}'] = next_page_link if path.include?('{nextLink}')
|
|
227
|
-
url = URI.parse(path)
|
|
228
|
-
properties = {}
|
|
229
|
-
unless url.query.nil?
|
|
230
|
-
url.query.split('&').each do |url_item|
|
|
231
|
-
url_items_parts = url_item.split('=')
|
|
232
|
-
properties[url_items_parts[0]] = url_items_parts[1]
|
|
233
|
-
end
|
|
234
|
-
end
|
|
235
|
-
properties.reject!{ |key, value| value.nil? }
|
|
236
|
-
url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
|
|
237
|
-
fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
|
|
238
|
-
corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
|
|
239
|
-
url = URI.parse(corrected_url)
|
|
240
|
-
|
|
241
|
-
connection = Faraday.new(:url => url) do |faraday|
|
|
242
|
-
faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
|
|
243
|
-
faraday.use :cookie_jar
|
|
244
|
-
faraday.adapter Faraday.default_adapter
|
|
245
|
-
end
|
|
246
|
-
request_headers = Hash.new
|
|
267
|
+
request_headers = {}
|
|
247
268
|
|
|
248
269
|
# Set Headers
|
|
249
270
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
250
|
-
request_headers[
|
|
271
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
272
|
+
path_template = '{nextLink}'
|
|
273
|
+
options = {
|
|
274
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
275
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
|
276
|
+
headers: request_headers.merge(custom_headers || {})
|
|
277
|
+
}
|
|
251
278
|
|
|
252
|
-
|
|
253
|
-
custom_headers.each do |key, value|
|
|
254
|
-
request_headers[key] = value
|
|
255
|
-
end
|
|
256
|
-
end
|
|
279
|
+
request_url = @base_url || @client.base_url
|
|
257
280
|
|
|
258
|
-
|
|
259
|
-
promise =
|
|
260
|
-
|
|
261
|
-
request.headers = request_headers
|
|
262
|
-
@client.credentials.sign_request(request) unless @client.credentials.nil?
|
|
263
|
-
end
|
|
281
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
|
282
|
+
promise = request.run_promise do |req|
|
|
283
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
264
284
|
end
|
|
265
285
|
|
|
266
286
|
promise = promise.then do |http_response|
|
|
267
287
|
status_code = http_response.status
|
|
268
288
|
response_content = http_response.body
|
|
269
|
-
unless
|
|
289
|
+
unless status_code == 200
|
|
270
290
|
error_model = JSON.load(response_content)
|
|
271
|
-
fail MsRestAzure::AzureOperationError.new(
|
|
291
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
272
292
|
end
|
|
273
293
|
|
|
274
294
|
# Create Result
|
|
275
|
-
result = MsRestAzure::AzureOperationResponse.new(
|
|
295
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
276
296
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
277
297
|
# Deserialize Response
|
|
278
298
|
if status_code == 200
|
|
279
299
|
begin
|
|
280
|
-
parsed_response = JSON.load(response_content)
|
|
300
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
281
301
|
unless parsed_response.nil?
|
|
282
302
|
parsed_response = DeploymentOperationsListResult.deserialize_object(parsed_response)
|
|
283
303
|
end
|
|
284
304
|
result.body = parsed_response
|
|
285
305
|
rescue Exception => e
|
|
286
|
-
fail MsRest::DeserializationError.new(
|
|
306
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
287
307
|
end
|
|
288
308
|
end
|
|
289
309
|
|