azure_mgmt_service_fabric 0.15.2 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/2016-09-01/generated/azure_mgmt_service_fabric/cluster_versions.rb +51 -44
- data/lib/2016-09-01/generated/azure_mgmt_service_fabric/clusters.rb +62 -58
- data/lib/2016-09-01/generated/azure_mgmt_service_fabric/operations.rb +15 -13
- data/lib/2016-09-01/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb +4 -1
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric.rb +91 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/application.rb +691 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/application_type.rb +487 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/cluster_versions.rb +471 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/clusters.rb +778 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_health_policy.rb +104 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_metric_description.rb +113 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_parameter.rb +58 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource.rb +206 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource_list.rb +55 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource_update.rb +182 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_type_resource.rb +83 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_type_resource_list.rb +55 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_upgrade_policy.rb +81 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/available_operation_display.rb +79 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/azure_active_directory.rb +68 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/certificate_description.rb +70 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/client_certificate_common_name.rb +70 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/client_certificate_thumbprint.rb +59 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster.rb +398 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_code_versions_list_result.rb +66 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_code_versions_result.rb +102 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_health_policy.rb +70 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_list_result.rb +66 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_update_parameters.rb +246 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_upgrade_delta_health_policy.rb +97 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_upgrade_policy.rb +156 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_version_details.rb +69 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/diagnostics_storage_account_config.rb +91 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/endpoint_range_description.rb +57 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/error_model.rb +57 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/named_partition_scheme_description.rb +81 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/node_type_description.rb +189 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/operation_list_result.rb +101 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/operation_result.rb +81 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/partition_scheme_description.rb +48 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/provisioning_state.rb +18 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/proxy_resource.rb +82 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/resource.rb +101 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/rolling_upgrade_monitoring_policy.rb +90 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_correlation_description.rb +58 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_load_metric_description.rb +98 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_placement_policy_description.rb +46 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_properties.rb +151 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_properties_base.rb +123 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource.rb +207 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource_list.rb +55 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource_update.rb +169 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_delta_health_policy.rb +51 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_health_policy.rb +108 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_health_policy_map_item.rb +60 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_update_properties.rb +113 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/settings_parameter_description.rb +57 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/settings_section_description.rb +67 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/singleton_partition_scheme_description.rb +51 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateful_service_properties.rb +227 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateful_service_update_properties.rb +186 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateless_service_properties.rb +161 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateless_service_update_properties.rb +133 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/uniform_int64range_partition_scheme_description.rb +91 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/version_resource.rb +115 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/version_resource_list.rb +55 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/module_definition.rb +9 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/operations.rb +230 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/service.rb +735 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb +147 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/version.rb +559 -0
- data/lib/azure_mgmt_service_fabric.rb +1 -0
- data/lib/profiles/latest/modules/servicefabric_profile_module.rb +269 -114
- data/lib/profiles/latest/servicefabric_latest_profile_client.rb +28 -9
- data/lib/profiles/latest/servicefabric_module_definition.rb +0 -1
- data/lib/version.rb +1 -1
- metadata +70 -3
@@ -0,0 +1,735 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::ServiceFabric::Mgmt::V2017_07_01_preview
|
7
|
+
#
|
8
|
+
# Azure Service Fabric Resource Provider API Client
|
9
|
+
#
|
10
|
+
class Service
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Service class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [ServiceFabricManagementClient] reference to the ServiceFabricManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Returns a service resource with the specified name.
|
26
|
+
#
|
27
|
+
# @param subscription_id [String] The customer subscription identifier
|
28
|
+
# @param resource_group_name [String] The name of the resource group.
|
29
|
+
# @param cluster_name [String] The name of the cluster resource
|
30
|
+
# @param application_name [String] The name of the application resource.
|
31
|
+
# @param service_name [String] The name of the service resource in the format
|
32
|
+
# of {applicationName}~{serviceName}.
|
33
|
+
# @param api_version [String] The version of the API.
|
34
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
35
|
+
# will be added to the HTTP request.
|
36
|
+
#
|
37
|
+
# @return [ServiceResource] operation results.
|
38
|
+
#
|
39
|
+
def get(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, custom_headers:nil)
|
40
|
+
response = get_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, custom_headers:custom_headers).value!
|
41
|
+
response.body unless response.nil?
|
42
|
+
end
|
43
|
+
|
44
|
+
#
|
45
|
+
# Returns a service resource with the specified name.
|
46
|
+
#
|
47
|
+
# @param subscription_id [String] The customer subscription identifier
|
48
|
+
# @param resource_group_name [String] The name of the resource group.
|
49
|
+
# @param cluster_name [String] The name of the cluster resource
|
50
|
+
# @param application_name [String] The name of the application resource.
|
51
|
+
# @param service_name [String] The name of the service resource in the format
|
52
|
+
# of {applicationName}~{serviceName}.
|
53
|
+
# @param api_version [String] The version of the API.
|
54
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
55
|
+
# will be added to the HTTP request.
|
56
|
+
#
|
57
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
58
|
+
#
|
59
|
+
def get_with_http_info(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, custom_headers:nil)
|
60
|
+
get_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, custom_headers:custom_headers).value!
|
61
|
+
end
|
62
|
+
|
63
|
+
#
|
64
|
+
# Returns a service resource with the specified name.
|
65
|
+
#
|
66
|
+
# @param subscription_id [String] The customer subscription identifier
|
67
|
+
# @param resource_group_name [String] The name of the resource group.
|
68
|
+
# @param cluster_name [String] The name of the cluster resource
|
69
|
+
# @param application_name [String] The name of the application resource.
|
70
|
+
# @param service_name [String] The name of the service resource in the format
|
71
|
+
# of {applicationName}~{serviceName}.
|
72
|
+
# @param api_version [String] The version of the API.
|
73
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
74
|
+
# to the HTTP request.
|
75
|
+
#
|
76
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
77
|
+
#
|
78
|
+
def get_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, custom_headers:nil)
|
79
|
+
fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
|
80
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
81
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
82
|
+
fail ArgumentError, 'application_name is nil' if application_name.nil?
|
83
|
+
fail ArgumentError, 'service_name is nil' if service_name.nil?
|
84
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
85
|
+
|
86
|
+
|
87
|
+
request_headers = {}
|
88
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
89
|
+
|
90
|
+
# Set Headers
|
91
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
92
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
93
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}'
|
94
|
+
|
95
|
+
request_url = @base_url || @client.base_url
|
96
|
+
|
97
|
+
options = {
|
98
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
99
|
+
path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationName' => application_name,'serviceName' => service_name},
|
100
|
+
query_params: {'api-version' => api_version},
|
101
|
+
headers: request_headers.merge(custom_headers || {}),
|
102
|
+
base_url: request_url
|
103
|
+
}
|
104
|
+
promise = @client.make_request_async(:get, path_template, options)
|
105
|
+
|
106
|
+
promise = promise.then do |result|
|
107
|
+
http_response = result.response
|
108
|
+
status_code = http_response.status
|
109
|
+
response_content = http_response.body
|
110
|
+
unless status_code == 200
|
111
|
+
error_model = JSON.load(response_content)
|
112
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
113
|
+
end
|
114
|
+
|
115
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
116
|
+
# Deserialize Response
|
117
|
+
if status_code == 200
|
118
|
+
begin
|
119
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
120
|
+
result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ServiceResource.mapper()
|
121
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
122
|
+
rescue Exception => e
|
123
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
result
|
128
|
+
end
|
129
|
+
|
130
|
+
promise.execute
|
131
|
+
end
|
132
|
+
|
133
|
+
#
|
134
|
+
# Creates or updates a service resource with the specified name.
|
135
|
+
#
|
136
|
+
# @param subscription_id [String] The customer subscription identifier
|
137
|
+
# @param resource_group_name [String] The name of the resource group.
|
138
|
+
# @param cluster_name [String] The name of the cluster resource
|
139
|
+
# @param application_name [String] The name of the application resource.
|
140
|
+
# @param service_name [String] The name of the service resource in the format
|
141
|
+
# of {applicationName}~{serviceName}.
|
142
|
+
# @param api_version [String] The version of the API.
|
143
|
+
# @param parameters [ServiceResource] The service resource.
|
144
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
145
|
+
# will be added to the HTTP request.
|
146
|
+
#
|
147
|
+
# @return [ServiceResource] operation results.
|
148
|
+
#
|
149
|
+
def put(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:nil)
|
150
|
+
response = put_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:custom_headers).value!
|
151
|
+
response.body unless response.nil?
|
152
|
+
end
|
153
|
+
|
154
|
+
#
|
155
|
+
# @param subscription_id [String] The customer subscription identifier
|
156
|
+
# @param resource_group_name [String] The name of the resource group.
|
157
|
+
# @param cluster_name [String] The name of the cluster resource
|
158
|
+
# @param application_name [String] The name of the application resource.
|
159
|
+
# @param service_name [String] The name of the service resource in the format
|
160
|
+
# of {applicationName}~{serviceName}.
|
161
|
+
# @param api_version [String] The version of the API.
|
162
|
+
# @param parameters [ServiceResource] The service resource.
|
163
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
164
|
+
# will be added to the HTTP request.
|
165
|
+
#
|
166
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
167
|
+
# response.
|
168
|
+
#
|
169
|
+
def put_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:nil)
|
170
|
+
# Send request
|
171
|
+
promise = begin_put_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:custom_headers)
|
172
|
+
|
173
|
+
promise = promise.then do |response|
|
174
|
+
# Defining deserialization method.
|
175
|
+
deserialize_method = lambda do |parsed_response|
|
176
|
+
result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ServiceResource.mapper()
|
177
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
178
|
+
end
|
179
|
+
|
180
|
+
# Waiting for response.
|
181
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
182
|
+
end
|
183
|
+
|
184
|
+
promise
|
185
|
+
end
|
186
|
+
|
187
|
+
#
|
188
|
+
# Updates a service resource with the specified name.
|
189
|
+
#
|
190
|
+
# @param subscription_id [String] The customer subscription identifier
|
191
|
+
# @param resource_group_name [String] The name of the resource group.
|
192
|
+
# @param cluster_name [String] The name of the cluster resource
|
193
|
+
# @param application_name [String] The name of the application resource.
|
194
|
+
# @param service_name [String] The name of the service resource in the format
|
195
|
+
# of {applicationName}~{serviceName}.
|
196
|
+
# @param api_version [String] The version of the API.
|
197
|
+
# @param parameters [ServiceResourceUpdate] The service resource for patch
|
198
|
+
# operations.
|
199
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
200
|
+
# will be added to the HTTP request.
|
201
|
+
#
|
202
|
+
# @return [ServiceResourceUpdate] operation results.
|
203
|
+
#
|
204
|
+
def patch(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:nil)
|
205
|
+
response = patch_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:custom_headers).value!
|
206
|
+
response.body unless response.nil?
|
207
|
+
end
|
208
|
+
|
209
|
+
#
|
210
|
+
# @param subscription_id [String] The customer subscription identifier
|
211
|
+
# @param resource_group_name [String] The name of the resource group.
|
212
|
+
# @param cluster_name [String] The name of the cluster resource
|
213
|
+
# @param application_name [String] The name of the application resource.
|
214
|
+
# @param service_name [String] The name of the service resource in the format
|
215
|
+
# of {applicationName}~{serviceName}.
|
216
|
+
# @param api_version [String] The version of the API.
|
217
|
+
# @param parameters [ServiceResourceUpdate] The service resource for patch
|
218
|
+
# operations.
|
219
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
220
|
+
# will be added to the HTTP request.
|
221
|
+
#
|
222
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
223
|
+
# response.
|
224
|
+
#
|
225
|
+
def patch_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:nil)
|
226
|
+
# Send request
|
227
|
+
promise = begin_patch_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:custom_headers)
|
228
|
+
|
229
|
+
promise = promise.then do |response|
|
230
|
+
# Defining deserialization method.
|
231
|
+
deserialize_method = lambda do |parsed_response|
|
232
|
+
result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ServiceResourceUpdate.mapper()
|
233
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
234
|
+
end
|
235
|
+
|
236
|
+
# Waiting for response.
|
237
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
238
|
+
end
|
239
|
+
|
240
|
+
promise
|
241
|
+
end
|
242
|
+
|
243
|
+
#
|
244
|
+
# Deletes a service resource with the specified name.
|
245
|
+
#
|
246
|
+
# @param subscription_id [String] The customer subscription identifier
|
247
|
+
# @param resource_group_name [String] The name of the resource group.
|
248
|
+
# @param cluster_name [String] The name of the cluster resource
|
249
|
+
# @param application_name [String] The name of the application resource.
|
250
|
+
# @param service_name [String] The name of the service resource in the format
|
251
|
+
# of {applicationName}~{serviceName}.
|
252
|
+
# @param api_version [String] The version of the API.
|
253
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
254
|
+
# will be added to the HTTP request.
|
255
|
+
#
|
256
|
+
def delete(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, custom_headers:nil)
|
257
|
+
response = delete_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, custom_headers:custom_headers).value!
|
258
|
+
nil
|
259
|
+
end
|
260
|
+
|
261
|
+
#
|
262
|
+
# @param subscription_id [String] The customer subscription identifier
|
263
|
+
# @param resource_group_name [String] The name of the resource group.
|
264
|
+
# @param cluster_name [String] The name of the cluster resource
|
265
|
+
# @param application_name [String] The name of the application resource.
|
266
|
+
# @param service_name [String] The name of the service resource in the format
|
267
|
+
# of {applicationName}~{serviceName}.
|
268
|
+
# @param api_version [String] The version of the API.
|
269
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
270
|
+
# will be added to the HTTP request.
|
271
|
+
#
|
272
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
273
|
+
# response.
|
274
|
+
#
|
275
|
+
def delete_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, custom_headers:nil)
|
276
|
+
# Send request
|
277
|
+
promise = begin_delete_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, custom_headers:custom_headers)
|
278
|
+
|
279
|
+
promise = promise.then do |response|
|
280
|
+
# Defining deserialization method.
|
281
|
+
deserialize_method = lambda do |parsed_response|
|
282
|
+
end
|
283
|
+
|
284
|
+
# Waiting for response.
|
285
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
286
|
+
end
|
287
|
+
|
288
|
+
promise
|
289
|
+
end
|
290
|
+
|
291
|
+
#
|
292
|
+
# Returns all service resources in the specified application.
|
293
|
+
#
|
294
|
+
# @param subscription_id [String] The customer subscription identifier
|
295
|
+
# @param resource_group_name [String] The name of the resource group.
|
296
|
+
# @param cluster_name [String] The name of the cluster resource
|
297
|
+
# @param application_name [String] The name of the application resource.
|
298
|
+
# @param api_version [String] The version of the API.
|
299
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
300
|
+
# will be added to the HTTP request.
|
301
|
+
#
|
302
|
+
# @return [ServiceResourceList] operation results.
|
303
|
+
#
|
304
|
+
def list(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:nil)
|
305
|
+
response = list_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:custom_headers).value!
|
306
|
+
response.body unless response.nil?
|
307
|
+
end
|
308
|
+
|
309
|
+
#
|
310
|
+
# Returns all service resources in the specified application.
|
311
|
+
#
|
312
|
+
# @param subscription_id [String] The customer subscription identifier
|
313
|
+
# @param resource_group_name [String] The name of the resource group.
|
314
|
+
# @param cluster_name [String] The name of the cluster resource
|
315
|
+
# @param application_name [String] The name of the application resource.
|
316
|
+
# @param api_version [String] The version of the API.
|
317
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
318
|
+
# will be added to the HTTP request.
|
319
|
+
#
|
320
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
321
|
+
#
|
322
|
+
def list_with_http_info(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:nil)
|
323
|
+
list_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:custom_headers).value!
|
324
|
+
end
|
325
|
+
|
326
|
+
#
|
327
|
+
# Returns all service resources in the specified application.
|
328
|
+
#
|
329
|
+
# @param subscription_id [String] The customer subscription identifier
|
330
|
+
# @param resource_group_name [String] The name of the resource group.
|
331
|
+
# @param cluster_name [String] The name of the cluster resource
|
332
|
+
# @param application_name [String] The name of the application resource.
|
333
|
+
# @param api_version [String] The version of the API.
|
334
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
335
|
+
# to the HTTP request.
|
336
|
+
#
|
337
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
338
|
+
#
|
339
|
+
def list_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:nil)
|
340
|
+
fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
|
341
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
342
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
343
|
+
fail ArgumentError, 'application_name is nil' if application_name.nil?
|
344
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
345
|
+
|
346
|
+
|
347
|
+
request_headers = {}
|
348
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
349
|
+
|
350
|
+
# Set Headers
|
351
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
352
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
353
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services'
|
354
|
+
|
355
|
+
request_url = @base_url || @client.base_url
|
356
|
+
|
357
|
+
options = {
|
358
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
359
|
+
path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationName' => application_name},
|
360
|
+
query_params: {'api-version' => api_version},
|
361
|
+
headers: request_headers.merge(custom_headers || {}),
|
362
|
+
base_url: request_url
|
363
|
+
}
|
364
|
+
promise = @client.make_request_async(:get, path_template, options)
|
365
|
+
|
366
|
+
promise = promise.then do |result|
|
367
|
+
http_response = result.response
|
368
|
+
status_code = http_response.status
|
369
|
+
response_content = http_response.body
|
370
|
+
unless status_code == 200
|
371
|
+
error_model = JSON.load(response_content)
|
372
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
373
|
+
end
|
374
|
+
|
375
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
376
|
+
# Deserialize Response
|
377
|
+
if status_code == 200
|
378
|
+
begin
|
379
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
380
|
+
result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ServiceResourceList.mapper()
|
381
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
382
|
+
rescue Exception => e
|
383
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
384
|
+
end
|
385
|
+
end
|
386
|
+
|
387
|
+
result
|
388
|
+
end
|
389
|
+
|
390
|
+
promise.execute
|
391
|
+
end
|
392
|
+
|
393
|
+
#
|
394
|
+
# Creates or updates a service resource with the specified name.
|
395
|
+
#
|
396
|
+
# @param subscription_id [String] The customer subscription identifier
|
397
|
+
# @param resource_group_name [String] The name of the resource group.
|
398
|
+
# @param cluster_name [String] The name of the cluster resource
|
399
|
+
# @param application_name [String] The name of the application resource.
|
400
|
+
# @param service_name [String] The name of the service resource in the format
|
401
|
+
# of {applicationName}~{serviceName}.
|
402
|
+
# @param api_version [String] The version of the API.
|
403
|
+
# @param parameters [ServiceResource] The service resource.
|
404
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
405
|
+
# will be added to the HTTP request.
|
406
|
+
#
|
407
|
+
# @return [ServiceResource] operation results.
|
408
|
+
#
|
409
|
+
def begin_put(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:nil)
|
410
|
+
response = begin_put_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:custom_headers).value!
|
411
|
+
response.body unless response.nil?
|
412
|
+
end
|
413
|
+
|
414
|
+
#
|
415
|
+
# Creates or updates a service resource with the specified name.
|
416
|
+
#
|
417
|
+
# @param subscription_id [String] The customer subscription identifier
|
418
|
+
# @param resource_group_name [String] The name of the resource group.
|
419
|
+
# @param cluster_name [String] The name of the cluster resource
|
420
|
+
# @param application_name [String] The name of the application resource.
|
421
|
+
# @param service_name [String] The name of the service resource in the format
|
422
|
+
# of {applicationName}~{serviceName}.
|
423
|
+
# @param api_version [String] The version of the API.
|
424
|
+
# @param parameters [ServiceResource] The service resource.
|
425
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
426
|
+
# will be added to the HTTP request.
|
427
|
+
#
|
428
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
429
|
+
#
|
430
|
+
def begin_put_with_http_info(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:nil)
|
431
|
+
begin_put_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:custom_headers).value!
|
432
|
+
end
|
433
|
+
|
434
|
+
#
|
435
|
+
# Creates or updates a service resource with the specified name.
|
436
|
+
#
|
437
|
+
# @param subscription_id [String] The customer subscription identifier
|
438
|
+
# @param resource_group_name [String] The name of the resource group.
|
439
|
+
# @param cluster_name [String] The name of the cluster resource
|
440
|
+
# @param application_name [String] The name of the application resource.
|
441
|
+
# @param service_name [String] The name of the service resource in the format
|
442
|
+
# of {applicationName}~{serviceName}.
|
443
|
+
# @param api_version [String] The version of the API.
|
444
|
+
# @param parameters [ServiceResource] The service resource.
|
445
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
446
|
+
# to the HTTP request.
|
447
|
+
#
|
448
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
449
|
+
#
|
450
|
+
def begin_put_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:nil)
|
451
|
+
fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
|
452
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
453
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
454
|
+
fail ArgumentError, 'application_name is nil' if application_name.nil?
|
455
|
+
fail ArgumentError, 'service_name is nil' if service_name.nil?
|
456
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
457
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
458
|
+
|
459
|
+
|
460
|
+
request_headers = {}
|
461
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
462
|
+
|
463
|
+
# Set Headers
|
464
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
465
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
466
|
+
|
467
|
+
# Serialize Request
|
468
|
+
request_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ServiceResource.mapper()
|
469
|
+
request_content = @client.serialize(request_mapper, parameters)
|
470
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
471
|
+
|
472
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}'
|
473
|
+
|
474
|
+
request_url = @base_url || @client.base_url
|
475
|
+
|
476
|
+
options = {
|
477
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
478
|
+
path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationName' => application_name,'serviceName' => service_name},
|
479
|
+
query_params: {'api-version' => api_version},
|
480
|
+
body: request_content,
|
481
|
+
headers: request_headers.merge(custom_headers || {}),
|
482
|
+
base_url: request_url
|
483
|
+
}
|
484
|
+
promise = @client.make_request_async(:put, path_template, options)
|
485
|
+
|
486
|
+
promise = promise.then do |result|
|
487
|
+
http_response = result.response
|
488
|
+
status_code = http_response.status
|
489
|
+
response_content = http_response.body
|
490
|
+
unless status_code == 202
|
491
|
+
error_model = JSON.load(response_content)
|
492
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
493
|
+
end
|
494
|
+
|
495
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
496
|
+
# Deserialize Response
|
497
|
+
if status_code == 202
|
498
|
+
begin
|
499
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
500
|
+
result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ServiceResource.mapper()
|
501
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
502
|
+
rescue Exception => e
|
503
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
504
|
+
end
|
505
|
+
end
|
506
|
+
|
507
|
+
result
|
508
|
+
end
|
509
|
+
|
510
|
+
promise.execute
|
511
|
+
end
|
512
|
+
|
513
|
+
#
|
514
|
+
# Updates a service resource with the specified name.
|
515
|
+
#
|
516
|
+
# @param subscription_id [String] The customer subscription identifier
|
517
|
+
# @param resource_group_name [String] The name of the resource group.
|
518
|
+
# @param cluster_name [String] The name of the cluster resource
|
519
|
+
# @param application_name [String] The name of the application resource.
|
520
|
+
# @param service_name [String] The name of the service resource in the format
|
521
|
+
# of {applicationName}~{serviceName}.
|
522
|
+
# @param api_version [String] The version of the API.
|
523
|
+
# @param parameters [ServiceResourceUpdate] The service resource for patch
|
524
|
+
# operations.
|
525
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
526
|
+
# will be added to the HTTP request.
|
527
|
+
#
|
528
|
+
# @return [ServiceResourceUpdate] operation results.
|
529
|
+
#
|
530
|
+
def begin_patch(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:nil)
|
531
|
+
response = begin_patch_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:custom_headers).value!
|
532
|
+
response.body unless response.nil?
|
533
|
+
end
|
534
|
+
|
535
|
+
#
|
536
|
+
# Updates a service resource with the specified name.
|
537
|
+
#
|
538
|
+
# @param subscription_id [String] The customer subscription identifier
|
539
|
+
# @param resource_group_name [String] The name of the resource group.
|
540
|
+
# @param cluster_name [String] The name of the cluster resource
|
541
|
+
# @param application_name [String] The name of the application resource.
|
542
|
+
# @param service_name [String] The name of the service resource in the format
|
543
|
+
# of {applicationName}~{serviceName}.
|
544
|
+
# @param api_version [String] The version of the API.
|
545
|
+
# @param parameters [ServiceResourceUpdate] The service resource for patch
|
546
|
+
# operations.
|
547
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
548
|
+
# will be added to the HTTP request.
|
549
|
+
#
|
550
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
551
|
+
#
|
552
|
+
def begin_patch_with_http_info(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:nil)
|
553
|
+
begin_patch_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:custom_headers).value!
|
554
|
+
end
|
555
|
+
|
556
|
+
#
|
557
|
+
# Updates a service resource with the specified name.
|
558
|
+
#
|
559
|
+
# @param subscription_id [String] The customer subscription identifier
|
560
|
+
# @param resource_group_name [String] The name of the resource group.
|
561
|
+
# @param cluster_name [String] The name of the cluster resource
|
562
|
+
# @param application_name [String] The name of the application resource.
|
563
|
+
# @param service_name [String] The name of the service resource in the format
|
564
|
+
# of {applicationName}~{serviceName}.
|
565
|
+
# @param api_version [String] The version of the API.
|
566
|
+
# @param parameters [ServiceResourceUpdate] The service resource for patch
|
567
|
+
# operations.
|
568
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
569
|
+
# to the HTTP request.
|
570
|
+
#
|
571
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
572
|
+
#
|
573
|
+
def begin_patch_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, parameters, custom_headers:nil)
|
574
|
+
fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
|
575
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
576
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
577
|
+
fail ArgumentError, 'application_name is nil' if application_name.nil?
|
578
|
+
fail ArgumentError, 'service_name is nil' if service_name.nil?
|
579
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
580
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
581
|
+
|
582
|
+
|
583
|
+
request_headers = {}
|
584
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
585
|
+
|
586
|
+
# Set Headers
|
587
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
588
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
589
|
+
|
590
|
+
# Serialize Request
|
591
|
+
request_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ServiceResourceUpdate.mapper()
|
592
|
+
request_content = @client.serialize(request_mapper, parameters)
|
593
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
594
|
+
|
595
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}'
|
596
|
+
|
597
|
+
request_url = @base_url || @client.base_url
|
598
|
+
|
599
|
+
options = {
|
600
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
601
|
+
path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationName' => application_name,'serviceName' => service_name},
|
602
|
+
query_params: {'api-version' => api_version},
|
603
|
+
body: request_content,
|
604
|
+
headers: request_headers.merge(custom_headers || {}),
|
605
|
+
base_url: request_url
|
606
|
+
}
|
607
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
608
|
+
|
609
|
+
promise = promise.then do |result|
|
610
|
+
http_response = result.response
|
611
|
+
status_code = http_response.status
|
612
|
+
response_content = http_response.body
|
613
|
+
unless status_code == 202
|
614
|
+
error_model = JSON.load(response_content)
|
615
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
616
|
+
end
|
617
|
+
|
618
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
619
|
+
# Deserialize Response
|
620
|
+
if status_code == 202
|
621
|
+
begin
|
622
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
623
|
+
result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ServiceResourceUpdate.mapper()
|
624
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
625
|
+
rescue Exception => e
|
626
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
627
|
+
end
|
628
|
+
end
|
629
|
+
|
630
|
+
result
|
631
|
+
end
|
632
|
+
|
633
|
+
promise.execute
|
634
|
+
end
|
635
|
+
|
636
|
+
#
|
637
|
+
# Deletes a service resource with the specified name.
|
638
|
+
#
|
639
|
+
# @param subscription_id [String] The customer subscription identifier
|
640
|
+
# @param resource_group_name [String] The name of the resource group.
|
641
|
+
# @param cluster_name [String] The name of the cluster resource
|
642
|
+
# @param application_name [String] The name of the application resource.
|
643
|
+
# @param service_name [String] The name of the service resource in the format
|
644
|
+
# of {applicationName}~{serviceName}.
|
645
|
+
# @param api_version [String] The version of the API.
|
646
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
647
|
+
# will be added to the HTTP request.
|
648
|
+
#
|
649
|
+
#
|
650
|
+
def begin_delete(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, custom_headers:nil)
|
651
|
+
response = begin_delete_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, custom_headers:custom_headers).value!
|
652
|
+
nil
|
653
|
+
end
|
654
|
+
|
655
|
+
#
|
656
|
+
# Deletes a service resource with the specified name.
|
657
|
+
#
|
658
|
+
# @param subscription_id [String] The customer subscription identifier
|
659
|
+
# @param resource_group_name [String] The name of the resource group.
|
660
|
+
# @param cluster_name [String] The name of the cluster resource
|
661
|
+
# @param application_name [String] The name of the application resource.
|
662
|
+
# @param service_name [String] The name of the service resource in the format
|
663
|
+
# of {applicationName}~{serviceName}.
|
664
|
+
# @param api_version [String] The version of the API.
|
665
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
666
|
+
# will be added to the HTTP request.
|
667
|
+
#
|
668
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
669
|
+
#
|
670
|
+
def begin_delete_with_http_info(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, custom_headers:nil)
|
671
|
+
begin_delete_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, custom_headers:custom_headers).value!
|
672
|
+
end
|
673
|
+
|
674
|
+
#
|
675
|
+
# Deletes a service resource with the specified name.
|
676
|
+
#
|
677
|
+
# @param subscription_id [String] The customer subscription identifier
|
678
|
+
# @param resource_group_name [String] The name of the resource group.
|
679
|
+
# @param cluster_name [String] The name of the cluster resource
|
680
|
+
# @param application_name [String] The name of the application resource.
|
681
|
+
# @param service_name [String] The name of the service resource in the format
|
682
|
+
# of {applicationName}~{serviceName}.
|
683
|
+
# @param api_version [String] The version of the API.
|
684
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
685
|
+
# to the HTTP request.
|
686
|
+
#
|
687
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
688
|
+
#
|
689
|
+
def begin_delete_async(subscription_id, resource_group_name, cluster_name, application_name, service_name, api_version, custom_headers:nil)
|
690
|
+
fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
|
691
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
692
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
693
|
+
fail ArgumentError, 'application_name is nil' if application_name.nil?
|
694
|
+
fail ArgumentError, 'service_name is nil' if service_name.nil?
|
695
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
696
|
+
|
697
|
+
|
698
|
+
request_headers = {}
|
699
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
700
|
+
|
701
|
+
# Set Headers
|
702
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
703
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
704
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}'
|
705
|
+
|
706
|
+
request_url = @base_url || @client.base_url
|
707
|
+
|
708
|
+
options = {
|
709
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
710
|
+
path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationName' => application_name,'serviceName' => service_name},
|
711
|
+
query_params: {'api-version' => api_version},
|
712
|
+
headers: request_headers.merge(custom_headers || {}),
|
713
|
+
base_url: request_url
|
714
|
+
}
|
715
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
716
|
+
|
717
|
+
promise = promise.then do |result|
|
718
|
+
http_response = result.response
|
719
|
+
status_code = http_response.status
|
720
|
+
response_content = http_response.body
|
721
|
+
unless status_code == 202 || status_code == 204
|
722
|
+
error_model = JSON.load(response_content)
|
723
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
724
|
+
end
|
725
|
+
|
726
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
727
|
+
|
728
|
+
result
|
729
|
+
end
|
730
|
+
|
731
|
+
promise.execute
|
732
|
+
end
|
733
|
+
|
734
|
+
end
|
735
|
+
end
|