azure_mgmt_batch 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/2015-12-01/generated/azure_mgmt_batch.rb +50 -0
- data/lib/2015-12-01/generated/azure_mgmt_batch/application_operations.rb +635 -0
- data/lib/{generated → 2015-12-01/generated}/azure_mgmt_batch/application_package_operations.rb +4 -4
- data/lib/2015-12-01/generated/azure_mgmt_batch/batch_account_operations.rb +1229 -0
- data/lib/2015-12-01/generated/azure_mgmt_batch/batch_management_client.rb +142 -0
- data/lib/2015-12-01/generated/azure_mgmt_batch/location.rb +115 -0
- data/lib/{generated → 2015-12-01/generated}/azure_mgmt_batch/models/account_key_type.rb +1 -1
- data/lib/2015-12-01/generated/azure_mgmt_batch/models/activate_application_package_parameters.rb +45 -0
- data/lib/2015-12-01/generated/azure_mgmt_batch/models/add_application_parameters.rb +55 -0
- data/lib/{generated → 2015-12-01/generated}/azure_mgmt_batch/models/application.rb +1 -1
- data/lib/2015-12-01/generated/azure_mgmt_batch/models/application_package.rb +110 -0
- data/lib/2015-12-01/generated/azure_mgmt_batch/models/auto_storage_base_properties.rb +45 -0
- data/lib/2015-12-01/generated/azure_mgmt_batch/models/auto_storage_properties.rb +57 -0
- data/lib/2015-12-01/generated/azure_mgmt_batch/models/batch_account.rb +147 -0
- data/lib/2015-12-01/generated/azure_mgmt_batch/models/batch_account_create_parameters.rb +74 -0
- data/lib/2015-12-01/generated/azure_mgmt_batch/models/batch_account_keys.rb +54 -0
- data/lib/2015-12-01/generated/azure_mgmt_batch/models/batch_account_list_result.rb +95 -0
- data/lib/{generated → 2015-12-01/generated}/azure_mgmt_batch/models/batch_account_regenerate_key_parameters.rb +1 -1
- data/lib/2015-12-01/generated/azure_mgmt_batch/models/batch_account_update_parameters.rb +64 -0
- data/lib/2015-12-01/generated/azure_mgmt_batch/models/batch_location_quota.rb +45 -0
- data/lib/2015-12-01/generated/azure_mgmt_batch/models/list_applications_result.rb +94 -0
- data/lib/{generated → 2015-12-01/generated}/azure_mgmt_batch/models/package_state.rb +1 -1
- data/lib/{generated → 2015-12-01/generated}/azure_mgmt_batch/models/provisioning_state.rb +1 -1
- data/lib/2015-12-01/generated/azure_mgmt_batch/models/resource.rb +94 -0
- data/lib/2015-12-01/generated/azure_mgmt_batch/models/update_application_parameters.rb +66 -0
- data/lib/2015-12-01/generated/azure_mgmt_batch/module_definition.rb +9 -0
- data/lib/{generated → 2015-12-01/generated}/azure_mgmt_batch/version.rb +2 -2
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch.rb +35 -35
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/application_operations.rb +7 -7
- data/lib/2017-05-01/generated/azure_mgmt_batch/application_package_operations.rb +427 -0
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/batch_account_operations.rb +14 -14
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/batch_management_client.rb +3 -3
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/location.rb +4 -4
- data/lib/2017-05-01/generated/azure_mgmt_batch/models/account_key_type.rb +16 -0
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/activate_application_package_parameters.rb +1 -1
- data/lib/2017-05-01/generated/azure_mgmt_batch/models/application.rb +96 -0
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/application_create_parameters.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/application_package.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/application_update_parameters.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/auto_storage_base_properties.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/auto_storage_properties.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/batch_account.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/batch_account_create_parameters.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/batch_account_keys.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/batch_account_list_result.rb +1 -1
- data/lib/2017-05-01/generated/azure_mgmt_batch/models/batch_account_regenerate_key_parameters.rb +46 -0
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/batch_account_update_parameters.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/batch_location_quota.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/check_name_availability_parameters.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/check_name_availability_result.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/key_vault_reference.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/list_applications_result.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/name_availability_reason.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/operation.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/operation_display.rb +1 -1
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/operation_list_result.rb +1 -1
- data/lib/2017-05-01/generated/azure_mgmt_batch/models/package_state.rb +17 -0
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/pool_allocation_mode.rb +1 -1
- data/lib/2017-05-01/generated/azure_mgmt_batch/models/provisioning_state.rb +20 -0
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/models/resource.rb +1 -1
- data/lib/2017-05-01/generated/azure_mgmt_batch/module_definition.rb +9 -0
- data/lib/{generated → 2017-05-01/generated}/azure_mgmt_batch/operations.rb +3 -3
- data/lib/{generated/azure_mgmt_batch/module_definition.rb → 2017-05-01/generated/azure_mgmt_batch/version.rb} +3 -3
- data/lib/azure_mgmt_batch.rb +3 -1
- data/lib/module_definition.rb +7 -0
- data/lib/profiles/common/configurable.rb +73 -0
- data/lib/profiles/common/default.rb +68 -0
- data/lib/profiles/latest/batch_latest_profile_client.rb +33 -0
- data/lib/profiles/latest/batch_module_definition.rb +9 -0
- data/lib/profiles/latest/modules/batch_profile_module.rb +158 -0
- data/lib/version.rb +7 -0
- metadata +72 -38
@@ -3,7 +3,7 @@
|
|
3
3
|
# Changes may cause incorrect behavior and will be lost if the code is
|
4
4
|
# regenerated.
|
5
5
|
|
6
|
-
module Azure::
|
6
|
+
module Azure::Batch::Mgmt::V2017_05_01
|
7
7
|
#
|
8
8
|
# ApplicationOperations
|
9
9
|
#
|
@@ -89,7 +89,7 @@ module Azure::ARM::Batch
|
|
89
89
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
90
90
|
|
91
91
|
# Serialize Request
|
92
|
-
request_mapper = Azure::
|
92
|
+
request_mapper = Azure::Batch::Mgmt::V2017_05_01::Models::ApplicationCreateParameters.mapper()
|
93
93
|
request_content = @client.serialize(request_mapper, parameters)
|
94
94
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
95
95
|
|
@@ -121,7 +121,7 @@ module Azure::ARM::Batch
|
|
121
121
|
if status_code == 201
|
122
122
|
begin
|
123
123
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
124
|
-
result_mapper = Azure::
|
124
|
+
result_mapper = Azure::Batch::Mgmt::V2017_05_01::Models::Application.mapper()
|
125
125
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
126
126
|
rescue Exception => e
|
127
127
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -306,7 +306,7 @@ module Azure::ARM::Batch
|
|
306
306
|
if status_code == 200
|
307
307
|
begin
|
308
308
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
309
|
-
result_mapper = Azure::
|
309
|
+
result_mapper = Azure::Batch::Mgmt::V2017_05_01::Models::Application.mapper()
|
310
310
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
311
311
|
rescue Exception => e
|
312
312
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -387,7 +387,7 @@ module Azure::ARM::Batch
|
|
387
387
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
388
388
|
|
389
389
|
# Serialize Request
|
390
|
-
request_mapper = Azure::
|
390
|
+
request_mapper = Azure::Batch::Mgmt::V2017_05_01::Models::ApplicationUpdateParameters.mapper()
|
391
391
|
request_content = @client.serialize(request_mapper, parameters)
|
392
392
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
393
393
|
|
@@ -509,7 +509,7 @@ module Azure::ARM::Batch
|
|
509
509
|
if status_code == 200
|
510
510
|
begin
|
511
511
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
512
|
-
result_mapper = Azure::
|
512
|
+
result_mapper = Azure::Batch::Mgmt::V2017_05_01::Models::ListApplicationsResult.mapper()
|
513
513
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
514
514
|
rescue Exception => e
|
515
515
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -596,7 +596,7 @@ module Azure::ARM::Batch
|
|
596
596
|
if status_code == 200
|
597
597
|
begin
|
598
598
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
599
|
-
result_mapper = Azure::
|
599
|
+
result_mapper = Azure::Batch::Mgmt::V2017_05_01::Models::ListApplicationsResult.mapper()
|
600
600
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
601
601
|
rescue Exception => e
|
602
602
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -0,0 +1,427 @@
|
|
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::Batch::Mgmt::V2017_05_01
|
7
|
+
#
|
8
|
+
# ApplicationPackageOperations
|
9
|
+
#
|
10
|
+
class ApplicationPackageOperations
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the ApplicationPackageOperations class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [BatchManagementClient] reference to the BatchManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Activates the specified application package.
|
26
|
+
#
|
27
|
+
# @param resource_group_name [String] The name of the resource group that
|
28
|
+
# contains the Batch account.
|
29
|
+
# @param account_name [String] The name of the Batch account.
|
30
|
+
# @param application_id [String] The ID of the application.
|
31
|
+
# @param version [String] The version of the application to activate.
|
32
|
+
# @param parameters [ActivateApplicationPackageParameters] The parameters for
|
33
|
+
# the request.
|
34
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
35
|
+
# will be added to the HTTP request.
|
36
|
+
#
|
37
|
+
#
|
38
|
+
def activate(resource_group_name, account_name, application_id, version, parameters, custom_headers = nil)
|
39
|
+
response = activate_async(resource_group_name, account_name, application_id, version, parameters, custom_headers).value!
|
40
|
+
nil
|
41
|
+
end
|
42
|
+
|
43
|
+
#
|
44
|
+
# Activates the specified application package.
|
45
|
+
#
|
46
|
+
# @param resource_group_name [String] The name of the resource group that
|
47
|
+
# contains the Batch account.
|
48
|
+
# @param account_name [String] The name of the Batch account.
|
49
|
+
# @param application_id [String] The ID of the application.
|
50
|
+
# @param version [String] The version of the application to activate.
|
51
|
+
# @param parameters [ActivateApplicationPackageParameters] The parameters for
|
52
|
+
# the request.
|
53
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
54
|
+
# will be added to the HTTP request.
|
55
|
+
#
|
56
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
57
|
+
#
|
58
|
+
def activate_with_http_info(resource_group_name, account_name, application_id, version, parameters, custom_headers = nil)
|
59
|
+
activate_async(resource_group_name, account_name, application_id, version, parameters, custom_headers).value!
|
60
|
+
end
|
61
|
+
|
62
|
+
#
|
63
|
+
# Activates the specified application package.
|
64
|
+
#
|
65
|
+
# @param resource_group_name [String] The name of the resource group that
|
66
|
+
# contains the Batch account.
|
67
|
+
# @param account_name [String] The name of the Batch account.
|
68
|
+
# @param application_id [String] The ID of the application.
|
69
|
+
# @param version [String] The version of the application to activate.
|
70
|
+
# @param parameters [ActivateApplicationPackageParameters] The parameters for
|
71
|
+
# the request.
|
72
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
73
|
+
# to the HTTP request.
|
74
|
+
#
|
75
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
76
|
+
#
|
77
|
+
def activate_async(resource_group_name, account_name, application_id, version, parameters, custom_headers = nil)
|
78
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
79
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
80
|
+
fail ArgumentError, 'application_id is nil' if application_id.nil?
|
81
|
+
fail ArgumentError, 'version is nil' if version.nil?
|
82
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
83
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
84
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
85
|
+
|
86
|
+
|
87
|
+
request_headers = {}
|
88
|
+
|
89
|
+
# Set Headers
|
90
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
91
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
92
|
+
|
93
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
94
|
+
|
95
|
+
# Serialize Request
|
96
|
+
request_mapper = Azure::Batch::Mgmt::V2017_05_01::Models::ActivateApplicationPackageParameters.mapper()
|
97
|
+
request_content = @client.serialize(request_mapper, parameters)
|
98
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
99
|
+
|
100
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}/activate'
|
101
|
+
|
102
|
+
request_url = @base_url || @client.base_url
|
103
|
+
|
104
|
+
options = {
|
105
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
106
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'subscriptionId' => @client.subscription_id},
|
107
|
+
query_params: {'api-version' => @client.api_version},
|
108
|
+
body: request_content,
|
109
|
+
headers: request_headers.merge(custom_headers || {}),
|
110
|
+
base_url: request_url
|
111
|
+
}
|
112
|
+
promise = @client.make_request_async(:post, path_template, options)
|
113
|
+
|
114
|
+
promise = promise.then do |result|
|
115
|
+
http_response = result.response
|
116
|
+
status_code = http_response.status
|
117
|
+
response_content = http_response.body
|
118
|
+
unless status_code == 204
|
119
|
+
error_model = JSON.load(response_content)
|
120
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
121
|
+
end
|
122
|
+
|
123
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
124
|
+
|
125
|
+
result
|
126
|
+
end
|
127
|
+
|
128
|
+
promise.execute
|
129
|
+
end
|
130
|
+
|
131
|
+
#
|
132
|
+
# Creates an application package record.
|
133
|
+
#
|
134
|
+
# @param resource_group_name [String] The name of the resource group that
|
135
|
+
# contains the Batch account.
|
136
|
+
# @param account_name [String] The name of the Batch account.
|
137
|
+
# @param application_id [String] The ID of the application.
|
138
|
+
# @param version [String] The version of the application.
|
139
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
140
|
+
# will be added to the HTTP request.
|
141
|
+
#
|
142
|
+
# @return [ApplicationPackage] operation results.
|
143
|
+
#
|
144
|
+
def create(resource_group_name, account_name, application_id, version, custom_headers = nil)
|
145
|
+
response = create_async(resource_group_name, account_name, application_id, version, custom_headers).value!
|
146
|
+
response.body unless response.nil?
|
147
|
+
end
|
148
|
+
|
149
|
+
#
|
150
|
+
# Creates an application package record.
|
151
|
+
#
|
152
|
+
# @param resource_group_name [String] The name of the resource group that
|
153
|
+
# contains the Batch account.
|
154
|
+
# @param account_name [String] The name of the Batch account.
|
155
|
+
# @param application_id [String] The ID of the application.
|
156
|
+
# @param version [String] The version of the application.
|
157
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
158
|
+
# will be added to the HTTP request.
|
159
|
+
#
|
160
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
161
|
+
#
|
162
|
+
def create_with_http_info(resource_group_name, account_name, application_id, version, custom_headers = nil)
|
163
|
+
create_async(resource_group_name, account_name, application_id, version, custom_headers).value!
|
164
|
+
end
|
165
|
+
|
166
|
+
#
|
167
|
+
# Creates an application package record.
|
168
|
+
#
|
169
|
+
# @param resource_group_name [String] The name of the resource group that
|
170
|
+
# contains the Batch account.
|
171
|
+
# @param account_name [String] The name of the Batch account.
|
172
|
+
# @param application_id [String] The ID of the application.
|
173
|
+
# @param version [String] The version of the application.
|
174
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
175
|
+
# to the HTTP request.
|
176
|
+
#
|
177
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
178
|
+
#
|
179
|
+
def create_async(resource_group_name, account_name, application_id, version, custom_headers = nil)
|
180
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
181
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
182
|
+
fail ArgumentError, 'application_id is nil' if application_id.nil?
|
183
|
+
fail ArgumentError, 'version is nil' if version.nil?
|
184
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
185
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
186
|
+
|
187
|
+
|
188
|
+
request_headers = {}
|
189
|
+
|
190
|
+
# Set Headers
|
191
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
192
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
193
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}'
|
194
|
+
|
195
|
+
request_url = @base_url || @client.base_url
|
196
|
+
|
197
|
+
options = {
|
198
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
199
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'subscriptionId' => @client.subscription_id},
|
200
|
+
query_params: {'api-version' => @client.api_version},
|
201
|
+
headers: request_headers.merge(custom_headers || {}),
|
202
|
+
base_url: request_url
|
203
|
+
}
|
204
|
+
promise = @client.make_request_async(:put, path_template, options)
|
205
|
+
|
206
|
+
promise = promise.then do |result|
|
207
|
+
http_response = result.response
|
208
|
+
status_code = http_response.status
|
209
|
+
response_content = http_response.body
|
210
|
+
unless status_code == 201
|
211
|
+
error_model = JSON.load(response_content)
|
212
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
213
|
+
end
|
214
|
+
|
215
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
216
|
+
# Deserialize Response
|
217
|
+
if status_code == 201
|
218
|
+
begin
|
219
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
220
|
+
result_mapper = Azure::Batch::Mgmt::V2017_05_01::Models::ApplicationPackage.mapper()
|
221
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
222
|
+
rescue Exception => e
|
223
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
result
|
228
|
+
end
|
229
|
+
|
230
|
+
promise.execute
|
231
|
+
end
|
232
|
+
|
233
|
+
#
|
234
|
+
# Deletes an application package record and its associated binary file.
|
235
|
+
#
|
236
|
+
# @param resource_group_name [String] The name of the resource group that
|
237
|
+
# contains the Batch account.
|
238
|
+
# @param account_name [String] The name of the Batch account.
|
239
|
+
# @param application_id [String] The ID of the application.
|
240
|
+
# @param version [String] The version of the application to delete.
|
241
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
242
|
+
# will be added to the HTTP request.
|
243
|
+
#
|
244
|
+
#
|
245
|
+
def delete(resource_group_name, account_name, application_id, version, custom_headers = nil)
|
246
|
+
response = delete_async(resource_group_name, account_name, application_id, version, custom_headers).value!
|
247
|
+
nil
|
248
|
+
end
|
249
|
+
|
250
|
+
#
|
251
|
+
# Deletes an application package record and its associated binary file.
|
252
|
+
#
|
253
|
+
# @param resource_group_name [String] The name of the resource group that
|
254
|
+
# contains the Batch account.
|
255
|
+
# @param account_name [String] The name of the Batch account.
|
256
|
+
# @param application_id [String] The ID of the application.
|
257
|
+
# @param version [String] The version of the application to delete.
|
258
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
259
|
+
# will be added to the HTTP request.
|
260
|
+
#
|
261
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
262
|
+
#
|
263
|
+
def delete_with_http_info(resource_group_name, account_name, application_id, version, custom_headers = nil)
|
264
|
+
delete_async(resource_group_name, account_name, application_id, version, custom_headers).value!
|
265
|
+
end
|
266
|
+
|
267
|
+
#
|
268
|
+
# Deletes an application package record and its associated binary file.
|
269
|
+
#
|
270
|
+
# @param resource_group_name [String] The name of the resource group that
|
271
|
+
# contains the Batch account.
|
272
|
+
# @param account_name [String] The name of the Batch account.
|
273
|
+
# @param application_id [String] The ID of the application.
|
274
|
+
# @param version [String] The version of the application to delete.
|
275
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
276
|
+
# to the HTTP request.
|
277
|
+
#
|
278
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
279
|
+
#
|
280
|
+
def delete_async(resource_group_name, account_name, application_id, version, custom_headers = nil)
|
281
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
282
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
283
|
+
fail ArgumentError, 'application_id is nil' if application_id.nil?
|
284
|
+
fail ArgumentError, 'version is nil' if version.nil?
|
285
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
286
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
287
|
+
|
288
|
+
|
289
|
+
request_headers = {}
|
290
|
+
|
291
|
+
# Set Headers
|
292
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
293
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
294
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}'
|
295
|
+
|
296
|
+
request_url = @base_url || @client.base_url
|
297
|
+
|
298
|
+
options = {
|
299
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
300
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'subscriptionId' => @client.subscription_id},
|
301
|
+
query_params: {'api-version' => @client.api_version},
|
302
|
+
headers: request_headers.merge(custom_headers || {}),
|
303
|
+
base_url: request_url
|
304
|
+
}
|
305
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
306
|
+
|
307
|
+
promise = promise.then do |result|
|
308
|
+
http_response = result.response
|
309
|
+
status_code = http_response.status
|
310
|
+
response_content = http_response.body
|
311
|
+
unless status_code == 204
|
312
|
+
error_model = JSON.load(response_content)
|
313
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
314
|
+
end
|
315
|
+
|
316
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
317
|
+
|
318
|
+
result
|
319
|
+
end
|
320
|
+
|
321
|
+
promise.execute
|
322
|
+
end
|
323
|
+
|
324
|
+
#
|
325
|
+
# Gets information about the specified application package.
|
326
|
+
#
|
327
|
+
# @param resource_group_name [String] The name of the resource group that
|
328
|
+
# contains the Batch account.
|
329
|
+
# @param account_name [String] The name of the Batch account.
|
330
|
+
# @param application_id [String] The ID of the application.
|
331
|
+
# @param version [String] The version of the application.
|
332
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
333
|
+
# will be added to the HTTP request.
|
334
|
+
#
|
335
|
+
# @return [ApplicationPackage] operation results.
|
336
|
+
#
|
337
|
+
def get(resource_group_name, account_name, application_id, version, custom_headers = nil)
|
338
|
+
response = get_async(resource_group_name, account_name, application_id, version, custom_headers).value!
|
339
|
+
response.body unless response.nil?
|
340
|
+
end
|
341
|
+
|
342
|
+
#
|
343
|
+
# Gets information about the specified application package.
|
344
|
+
#
|
345
|
+
# @param resource_group_name [String] The name of the resource group that
|
346
|
+
# contains the Batch account.
|
347
|
+
# @param account_name [String] The name of the Batch account.
|
348
|
+
# @param application_id [String] The ID of the application.
|
349
|
+
# @param version [String] The version of the application.
|
350
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
351
|
+
# will be added to the HTTP request.
|
352
|
+
#
|
353
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
354
|
+
#
|
355
|
+
def get_with_http_info(resource_group_name, account_name, application_id, version, custom_headers = nil)
|
356
|
+
get_async(resource_group_name, account_name, application_id, version, custom_headers).value!
|
357
|
+
end
|
358
|
+
|
359
|
+
#
|
360
|
+
# Gets information about the specified application package.
|
361
|
+
#
|
362
|
+
# @param resource_group_name [String] The name of the resource group that
|
363
|
+
# contains the Batch account.
|
364
|
+
# @param account_name [String] The name of the Batch account.
|
365
|
+
# @param application_id [String] The ID of the application.
|
366
|
+
# @param version [String] The version of the application.
|
367
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
368
|
+
# to the HTTP request.
|
369
|
+
#
|
370
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
371
|
+
#
|
372
|
+
def get_async(resource_group_name, account_name, application_id, version, custom_headers = nil)
|
373
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
374
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
375
|
+
fail ArgumentError, 'application_id is nil' if application_id.nil?
|
376
|
+
fail ArgumentError, 'version is nil' if version.nil?
|
377
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
378
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
379
|
+
|
380
|
+
|
381
|
+
request_headers = {}
|
382
|
+
|
383
|
+
# Set Headers
|
384
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
385
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
386
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}'
|
387
|
+
|
388
|
+
request_url = @base_url || @client.base_url
|
389
|
+
|
390
|
+
options = {
|
391
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
392
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'subscriptionId' => @client.subscription_id},
|
393
|
+
query_params: {'api-version' => @client.api_version},
|
394
|
+
headers: request_headers.merge(custom_headers || {}),
|
395
|
+
base_url: request_url
|
396
|
+
}
|
397
|
+
promise = @client.make_request_async(:get, path_template, options)
|
398
|
+
|
399
|
+
promise = promise.then do |result|
|
400
|
+
http_response = result.response
|
401
|
+
status_code = http_response.status
|
402
|
+
response_content = http_response.body
|
403
|
+
unless status_code == 200
|
404
|
+
error_model = JSON.load(response_content)
|
405
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
406
|
+
end
|
407
|
+
|
408
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
409
|
+
# Deserialize Response
|
410
|
+
if status_code == 200
|
411
|
+
begin
|
412
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
413
|
+
result_mapper = Azure::Batch::Mgmt::V2017_05_01::Models::ApplicationPackage.mapper()
|
414
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
415
|
+
rescue Exception => e
|
416
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
417
|
+
end
|
418
|
+
end
|
419
|
+
|
420
|
+
result
|
421
|
+
end
|
422
|
+
|
423
|
+
promise.execute
|
424
|
+
end
|
425
|
+
|
426
|
+
end
|
427
|
+
end
|