azure_mgmt_batch 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d5c82c60663262d8089eb7de031263e4ba6aa1d
|
4
|
+
data.tar.gz: fd051e445eb988ea35a4a04a4e7fe4bc6c57d019
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d36b03a0a07b67e020f66a3d5f1dd12f0c9e0257e38e004ed74006a6b3f4b4785e0bb47482ed1e64591adf12495fb7836afb2de25887e312a6e96ceb8078660
|
7
|
+
data.tar.gz: 0648aea1321f228d97f5fe518d5a0be48eb376665c5c47ddd561e199e93a715c6d831c05385e81f8533167bd77abbc4ec66cf79a534c0650f986cb6049b0d801
|
@@ -0,0 +1,50 @@
|
|
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
|
+
require 'uri'
|
7
|
+
require 'cgi'
|
8
|
+
require 'date'
|
9
|
+
require 'json'
|
10
|
+
require 'base64'
|
11
|
+
require 'erb'
|
12
|
+
require 'securerandom'
|
13
|
+
require 'time'
|
14
|
+
require 'timeliness'
|
15
|
+
require 'faraday'
|
16
|
+
require 'faraday-cookie_jar'
|
17
|
+
require 'concurrent'
|
18
|
+
require 'ms_rest'
|
19
|
+
require '2015-12-01/generated/azure_mgmt_batch/module_definition'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
module Azure::Batch::Mgmt::V2015_12_01
|
23
|
+
autoload :BatchAccountOperations, '2015-12-01/generated/azure_mgmt_batch/batch_account_operations.rb'
|
24
|
+
autoload :ApplicationPackageOperations, '2015-12-01/generated/azure_mgmt_batch/application_package_operations.rb'
|
25
|
+
autoload :ApplicationOperations, '2015-12-01/generated/azure_mgmt_batch/application_operations.rb'
|
26
|
+
autoload :Location, '2015-12-01/generated/azure_mgmt_batch/location.rb'
|
27
|
+
autoload :BatchManagementClient, '2015-12-01/generated/azure_mgmt_batch/batch_management_client.rb'
|
28
|
+
|
29
|
+
module Models
|
30
|
+
autoload :ActivateApplicationPackageParameters, '2015-12-01/generated/azure_mgmt_batch/models/activate_application_package_parameters.rb'
|
31
|
+
autoload :AutoStorageBaseProperties, '2015-12-01/generated/azure_mgmt_batch/models/auto_storage_base_properties.rb'
|
32
|
+
autoload :AddApplicationParameters, '2015-12-01/generated/azure_mgmt_batch/models/add_application_parameters.rb'
|
33
|
+
autoload :AutoStorageProperties, '2015-12-01/generated/azure_mgmt_batch/models/auto_storage_properties.rb'
|
34
|
+
autoload :ApplicationPackage, '2015-12-01/generated/azure_mgmt_batch/models/application_package.rb'
|
35
|
+
autoload :BatchAccountUpdateParameters, '2015-12-01/generated/azure_mgmt_batch/models/batch_account_update_parameters.rb'
|
36
|
+
autoload :Application, '2015-12-01/generated/azure_mgmt_batch/models/application.rb'
|
37
|
+
autoload :BatchAccountRegenerateKeyParameters, '2015-12-01/generated/azure_mgmt_batch/models/batch_account_regenerate_key_parameters.rb'
|
38
|
+
autoload :ListApplicationsResult, '2015-12-01/generated/azure_mgmt_batch/models/list_applications_result.rb'
|
39
|
+
autoload :BatchAccountCreateParameters, '2015-12-01/generated/azure_mgmt_batch/models/batch_account_create_parameters.rb'
|
40
|
+
autoload :UpdateApplicationParameters, '2015-12-01/generated/azure_mgmt_batch/models/update_application_parameters.rb'
|
41
|
+
autoload :BatchAccountListResult, '2015-12-01/generated/azure_mgmt_batch/models/batch_account_list_result.rb'
|
42
|
+
autoload :BatchLocationQuota, '2015-12-01/generated/azure_mgmt_batch/models/batch_location_quota.rb'
|
43
|
+
autoload :BatchAccountKeys, '2015-12-01/generated/azure_mgmt_batch/models/batch_account_keys.rb'
|
44
|
+
autoload :Resource, '2015-12-01/generated/azure_mgmt_batch/models/resource.rb'
|
45
|
+
autoload :BatchAccount, '2015-12-01/generated/azure_mgmt_batch/models/batch_account.rb'
|
46
|
+
autoload :ProvisioningState, '2015-12-01/generated/azure_mgmt_batch/models/provisioning_state.rb'
|
47
|
+
autoload :AccountKeyType, '2015-12-01/generated/azure_mgmt_batch/models/account_key_type.rb'
|
48
|
+
autoload :PackageState, '2015-12-01/generated/azure_mgmt_batch/models/package_state.rb'
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,635 @@
|
|
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::V2015_12_01
|
7
|
+
#
|
8
|
+
# ApplicationOperations
|
9
|
+
#
|
10
|
+
class ApplicationOperations
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the ApplicationOperations 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
|
+
# Adds an application to the specified Batch account.
|
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 parameters [AddApplicationParameters] The parameters for the request.
|
32
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
33
|
+
# will be added to the HTTP request.
|
34
|
+
#
|
35
|
+
# @return [Application] operation results.
|
36
|
+
#
|
37
|
+
def create(resource_group_name, account_name, application_id, parameters = nil, custom_headers = nil)
|
38
|
+
response = create_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
|
39
|
+
response.body unless response.nil?
|
40
|
+
end
|
41
|
+
|
42
|
+
#
|
43
|
+
# Adds an application to the specified Batch account.
|
44
|
+
#
|
45
|
+
# @param resource_group_name [String] The name of the resource group that
|
46
|
+
# contains the Batch account.
|
47
|
+
# @param account_name [String] The name of the Batch account.
|
48
|
+
# @param application_id [String] The ID of the application.
|
49
|
+
# @param parameters [AddApplicationParameters] The parameters for the request.
|
50
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
51
|
+
# will be added to the HTTP request.
|
52
|
+
#
|
53
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
54
|
+
#
|
55
|
+
def create_with_http_info(resource_group_name, account_name, application_id, parameters = nil, custom_headers = nil)
|
56
|
+
create_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
|
57
|
+
end
|
58
|
+
|
59
|
+
#
|
60
|
+
# Adds an application to the specified Batch account.
|
61
|
+
#
|
62
|
+
# @param resource_group_name [String] The name of the resource group that
|
63
|
+
# contains the Batch account.
|
64
|
+
# @param account_name [String] The name of the Batch account.
|
65
|
+
# @param application_id [String] The ID of the application.
|
66
|
+
# @param parameters [AddApplicationParameters] The parameters for the request.
|
67
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
68
|
+
# to the HTTP request.
|
69
|
+
#
|
70
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
71
|
+
#
|
72
|
+
def create_async(resource_group_name, account_name, application_id, parameters = nil, custom_headers = nil)
|
73
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
74
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
75
|
+
fail ArgumentError, 'application_id is nil' if application_id.nil?
|
76
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
77
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
78
|
+
|
79
|
+
|
80
|
+
request_headers = {}
|
81
|
+
|
82
|
+
# Set Headers
|
83
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
84
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
85
|
+
|
86
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
87
|
+
|
88
|
+
# Serialize Request
|
89
|
+
request_mapper = Azure::Batch::Mgmt::V2015_12_01::Models::AddApplicationParameters.mapper()
|
90
|
+
request_content = @client.serialize(request_mapper, parameters)
|
91
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
92
|
+
|
93
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}'
|
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: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'subscriptionId' => @client.subscription_id},
|
100
|
+
query_params: {'api-version' => @client.api_version},
|
101
|
+
body: request_content,
|
102
|
+
headers: request_headers.merge(custom_headers || {}),
|
103
|
+
base_url: request_url
|
104
|
+
}
|
105
|
+
promise = @client.make_request_async(:put, path_template, options)
|
106
|
+
|
107
|
+
promise = promise.then do |result|
|
108
|
+
http_response = result.response
|
109
|
+
status_code = http_response.status
|
110
|
+
response_content = http_response.body
|
111
|
+
unless status_code == 201
|
112
|
+
error_model = JSON.load(response_content)
|
113
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
114
|
+
end
|
115
|
+
|
116
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
117
|
+
# Deserialize Response
|
118
|
+
if status_code == 201
|
119
|
+
begin
|
120
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
121
|
+
result_mapper = Azure::Batch::Mgmt::V2015_12_01::Models::Application.mapper()
|
122
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
123
|
+
rescue Exception => e
|
124
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
result
|
129
|
+
end
|
130
|
+
|
131
|
+
promise.execute
|
132
|
+
end
|
133
|
+
|
134
|
+
#
|
135
|
+
# Deletes an application.
|
136
|
+
#
|
137
|
+
# @param resource_group_name [String] The name of the resource group that
|
138
|
+
# contains the Batch account.
|
139
|
+
# @param account_name [String] The name of the Batch account.
|
140
|
+
# @param application_id [String] The ID of the application.
|
141
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
142
|
+
# will be added to the HTTP request.
|
143
|
+
#
|
144
|
+
#
|
145
|
+
def delete(resource_group_name, account_name, application_id, custom_headers = nil)
|
146
|
+
response = delete_async(resource_group_name, account_name, application_id, custom_headers).value!
|
147
|
+
nil
|
148
|
+
end
|
149
|
+
|
150
|
+
#
|
151
|
+
# Deletes an application.
|
152
|
+
#
|
153
|
+
# @param resource_group_name [String] The name of the resource group that
|
154
|
+
# contains the Batch account.
|
155
|
+
# @param account_name [String] The name of the Batch account.
|
156
|
+
# @param application_id [String] The ID 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 delete_with_http_info(resource_group_name, account_name, application_id, custom_headers = nil)
|
163
|
+
delete_async(resource_group_name, account_name, application_id, custom_headers).value!
|
164
|
+
end
|
165
|
+
|
166
|
+
#
|
167
|
+
# Deletes an application.
|
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 [Hash{String => String}] A hash of custom headers that will be added
|
174
|
+
# to the HTTP request.
|
175
|
+
#
|
176
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
177
|
+
#
|
178
|
+
def delete_async(resource_group_name, account_name, application_id, custom_headers = nil)
|
179
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
180
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
181
|
+
fail ArgumentError, 'application_id is nil' if application_id.nil?
|
182
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
183
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
184
|
+
|
185
|
+
|
186
|
+
request_headers = {}
|
187
|
+
|
188
|
+
# Set Headers
|
189
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
190
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
191
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}'
|
192
|
+
|
193
|
+
request_url = @base_url || @client.base_url
|
194
|
+
|
195
|
+
options = {
|
196
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
197
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'subscriptionId' => @client.subscription_id},
|
198
|
+
query_params: {'api-version' => @client.api_version},
|
199
|
+
headers: request_headers.merge(custom_headers || {}),
|
200
|
+
base_url: request_url
|
201
|
+
}
|
202
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
203
|
+
|
204
|
+
promise = promise.then do |result|
|
205
|
+
http_response = result.response
|
206
|
+
status_code = http_response.status
|
207
|
+
response_content = http_response.body
|
208
|
+
unless status_code == 204
|
209
|
+
error_model = JSON.load(response_content)
|
210
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
211
|
+
end
|
212
|
+
|
213
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
214
|
+
|
215
|
+
result
|
216
|
+
end
|
217
|
+
|
218
|
+
promise.execute
|
219
|
+
end
|
220
|
+
|
221
|
+
#
|
222
|
+
# Gets information about the specified application.
|
223
|
+
#
|
224
|
+
# @param resource_group_name [String] The name of the resource group that
|
225
|
+
# contains the Batch account.
|
226
|
+
# @param account_name [String] The name of the Batch account.
|
227
|
+
# @param application_id [String] The ID of the application.
|
228
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
229
|
+
# will be added to the HTTP request.
|
230
|
+
#
|
231
|
+
# @return [Application] operation results.
|
232
|
+
#
|
233
|
+
def get(resource_group_name, account_name, application_id, custom_headers = nil)
|
234
|
+
response = get_async(resource_group_name, account_name, application_id, custom_headers).value!
|
235
|
+
response.body unless response.nil?
|
236
|
+
end
|
237
|
+
|
238
|
+
#
|
239
|
+
# Gets information about the specified application.
|
240
|
+
#
|
241
|
+
# @param resource_group_name [String] The name of the resource group that
|
242
|
+
# contains the Batch account.
|
243
|
+
# @param account_name [String] The name of the Batch account.
|
244
|
+
# @param application_id [String] The ID of the application.
|
245
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
246
|
+
# will be added to the HTTP request.
|
247
|
+
#
|
248
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
249
|
+
#
|
250
|
+
def get_with_http_info(resource_group_name, account_name, application_id, custom_headers = nil)
|
251
|
+
get_async(resource_group_name, account_name, application_id, custom_headers).value!
|
252
|
+
end
|
253
|
+
|
254
|
+
#
|
255
|
+
# Gets information about the specified application.
|
256
|
+
#
|
257
|
+
# @param resource_group_name [String] The name of the resource group that
|
258
|
+
# contains the Batch account.
|
259
|
+
# @param account_name [String] The name of the Batch account.
|
260
|
+
# @param application_id [String] The ID of the application.
|
261
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
262
|
+
# to the HTTP request.
|
263
|
+
#
|
264
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
265
|
+
#
|
266
|
+
def get_async(resource_group_name, account_name, application_id, custom_headers = nil)
|
267
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
268
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
269
|
+
fail ArgumentError, 'application_id is nil' if application_id.nil?
|
270
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
271
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
272
|
+
|
273
|
+
|
274
|
+
request_headers = {}
|
275
|
+
|
276
|
+
# Set Headers
|
277
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
278
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
279
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}'
|
280
|
+
|
281
|
+
request_url = @base_url || @client.base_url
|
282
|
+
|
283
|
+
options = {
|
284
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
285
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'subscriptionId' => @client.subscription_id},
|
286
|
+
query_params: {'api-version' => @client.api_version},
|
287
|
+
headers: request_headers.merge(custom_headers || {}),
|
288
|
+
base_url: request_url
|
289
|
+
}
|
290
|
+
promise = @client.make_request_async(:get, path_template, options)
|
291
|
+
|
292
|
+
promise = promise.then do |result|
|
293
|
+
http_response = result.response
|
294
|
+
status_code = http_response.status
|
295
|
+
response_content = http_response.body
|
296
|
+
unless status_code == 200
|
297
|
+
error_model = JSON.load(response_content)
|
298
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
299
|
+
end
|
300
|
+
|
301
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
302
|
+
# Deserialize Response
|
303
|
+
if status_code == 200
|
304
|
+
begin
|
305
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
306
|
+
result_mapper = Azure::Batch::Mgmt::V2015_12_01::Models::Application.mapper()
|
307
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
308
|
+
rescue Exception => e
|
309
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
310
|
+
end
|
311
|
+
end
|
312
|
+
|
313
|
+
result
|
314
|
+
end
|
315
|
+
|
316
|
+
promise.execute
|
317
|
+
end
|
318
|
+
|
319
|
+
#
|
320
|
+
# Updates settings for the specified application.
|
321
|
+
#
|
322
|
+
# @param resource_group_name [String] The name of the resource group that
|
323
|
+
# contains the Batch account.
|
324
|
+
# @param account_name [String] The name of the Batch account.
|
325
|
+
# @param application_id [String] The ID of the application.
|
326
|
+
# @param parameters [UpdateApplicationParameters] The parameters for the
|
327
|
+
# request.
|
328
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
329
|
+
# will be added to the HTTP request.
|
330
|
+
#
|
331
|
+
#
|
332
|
+
def update(resource_group_name, account_name, application_id, parameters, custom_headers = nil)
|
333
|
+
response = update_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
|
334
|
+
nil
|
335
|
+
end
|
336
|
+
|
337
|
+
#
|
338
|
+
# Updates settings for the specified application.
|
339
|
+
#
|
340
|
+
# @param resource_group_name [String] The name of the resource group that
|
341
|
+
# contains the Batch account.
|
342
|
+
# @param account_name [String] The name of the Batch account.
|
343
|
+
# @param application_id [String] The ID of the application.
|
344
|
+
# @param parameters [UpdateApplicationParameters] The parameters for the
|
345
|
+
# request.
|
346
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
347
|
+
# will be added to the HTTP request.
|
348
|
+
#
|
349
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
350
|
+
#
|
351
|
+
def update_with_http_info(resource_group_name, account_name, application_id, parameters, custom_headers = nil)
|
352
|
+
update_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
|
353
|
+
end
|
354
|
+
|
355
|
+
#
|
356
|
+
# Updates settings for the specified application.
|
357
|
+
#
|
358
|
+
# @param resource_group_name [String] The name of the resource group that
|
359
|
+
# contains the Batch account.
|
360
|
+
# @param account_name [String] The name of the Batch account.
|
361
|
+
# @param application_id [String] The ID of the application.
|
362
|
+
# @param parameters [UpdateApplicationParameters] The parameters for the
|
363
|
+
# request.
|
364
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
365
|
+
# to the HTTP request.
|
366
|
+
#
|
367
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
368
|
+
#
|
369
|
+
def update_async(resource_group_name, account_name, application_id, parameters, custom_headers = nil)
|
370
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
371
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
372
|
+
fail ArgumentError, 'application_id is nil' if application_id.nil?
|
373
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
374
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
375
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
376
|
+
|
377
|
+
|
378
|
+
request_headers = {}
|
379
|
+
|
380
|
+
# Set Headers
|
381
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
382
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
383
|
+
|
384
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
385
|
+
|
386
|
+
# Serialize Request
|
387
|
+
request_mapper = Azure::Batch::Mgmt::V2015_12_01::Models::UpdateApplicationParameters.mapper()
|
388
|
+
request_content = @client.serialize(request_mapper, parameters)
|
389
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
390
|
+
|
391
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}'
|
392
|
+
|
393
|
+
request_url = @base_url || @client.base_url
|
394
|
+
|
395
|
+
options = {
|
396
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
397
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'subscriptionId' => @client.subscription_id},
|
398
|
+
query_params: {'api-version' => @client.api_version},
|
399
|
+
body: request_content,
|
400
|
+
headers: request_headers.merge(custom_headers || {}),
|
401
|
+
base_url: request_url
|
402
|
+
}
|
403
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
404
|
+
|
405
|
+
promise = promise.then do |result|
|
406
|
+
http_response = result.response
|
407
|
+
status_code = http_response.status
|
408
|
+
response_content = http_response.body
|
409
|
+
unless status_code == 204
|
410
|
+
error_model = JSON.load(response_content)
|
411
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
412
|
+
end
|
413
|
+
|
414
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
415
|
+
|
416
|
+
result
|
417
|
+
end
|
418
|
+
|
419
|
+
promise.execute
|
420
|
+
end
|
421
|
+
|
422
|
+
#
|
423
|
+
# Lists all of the applications in the specified account.
|
424
|
+
#
|
425
|
+
# @param resource_group_name [String] The name of the resource group that
|
426
|
+
# contains the Batch account.
|
427
|
+
# @param account_name [String] The name of the Batch account.
|
428
|
+
# @param maxresults [Integer] The maximum number of items to return in the
|
429
|
+
# response.
|
430
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
431
|
+
# will be added to the HTTP request.
|
432
|
+
#
|
433
|
+
# @return [Array<Application>] operation results.
|
434
|
+
#
|
435
|
+
def list(resource_group_name, account_name, maxresults = nil, custom_headers = nil)
|
436
|
+
first_page = list_as_lazy(resource_group_name, account_name, maxresults, custom_headers)
|
437
|
+
first_page.get_all_items
|
438
|
+
end
|
439
|
+
|
440
|
+
#
|
441
|
+
# Lists all of the applications in the specified account.
|
442
|
+
#
|
443
|
+
# @param resource_group_name [String] The name of the resource group that
|
444
|
+
# contains the Batch account.
|
445
|
+
# @param account_name [String] The name of the Batch account.
|
446
|
+
# @param maxresults [Integer] The maximum number of items to return in the
|
447
|
+
# response.
|
448
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
449
|
+
# will be added to the HTTP request.
|
450
|
+
#
|
451
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
452
|
+
#
|
453
|
+
def list_with_http_info(resource_group_name, account_name, maxresults = nil, custom_headers = nil)
|
454
|
+
list_async(resource_group_name, account_name, maxresults, custom_headers).value!
|
455
|
+
end
|
456
|
+
|
457
|
+
#
|
458
|
+
# Lists all of the applications in the specified account.
|
459
|
+
#
|
460
|
+
# @param resource_group_name [String] The name of the resource group that
|
461
|
+
# contains the Batch account.
|
462
|
+
# @param account_name [String] The name of the Batch account.
|
463
|
+
# @param maxresults [Integer] The maximum number of items to return in the
|
464
|
+
# response.
|
465
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
466
|
+
# to the HTTP request.
|
467
|
+
#
|
468
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
469
|
+
#
|
470
|
+
def list_async(resource_group_name, account_name, maxresults = nil, custom_headers = nil)
|
471
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
472
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
473
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
474
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
475
|
+
|
476
|
+
|
477
|
+
request_headers = {}
|
478
|
+
|
479
|
+
# Set Headers
|
480
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
481
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
482
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications'
|
483
|
+
|
484
|
+
request_url = @base_url || @client.base_url
|
485
|
+
|
486
|
+
options = {
|
487
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
488
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
489
|
+
query_params: {'maxresults' => maxresults,'api-version' => @client.api_version},
|
490
|
+
headers: request_headers.merge(custom_headers || {}),
|
491
|
+
base_url: request_url
|
492
|
+
}
|
493
|
+
promise = @client.make_request_async(:get, path_template, options)
|
494
|
+
|
495
|
+
promise = promise.then do |result|
|
496
|
+
http_response = result.response
|
497
|
+
status_code = http_response.status
|
498
|
+
response_content = http_response.body
|
499
|
+
unless status_code == 200
|
500
|
+
error_model = JSON.load(response_content)
|
501
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
502
|
+
end
|
503
|
+
|
504
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
505
|
+
# Deserialize Response
|
506
|
+
if status_code == 200
|
507
|
+
begin
|
508
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
509
|
+
result_mapper = Azure::Batch::Mgmt::V2015_12_01::Models::ListApplicationsResult.mapper()
|
510
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
511
|
+
rescue Exception => e
|
512
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
513
|
+
end
|
514
|
+
end
|
515
|
+
|
516
|
+
result
|
517
|
+
end
|
518
|
+
|
519
|
+
promise.execute
|
520
|
+
end
|
521
|
+
|
522
|
+
#
|
523
|
+
# Lists all of the applications in the specified account.
|
524
|
+
#
|
525
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
526
|
+
# to List operation.
|
527
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
528
|
+
# will be added to the HTTP request.
|
529
|
+
#
|
530
|
+
# @return [ListApplicationsResult] operation results.
|
531
|
+
#
|
532
|
+
def list_next(next_page_link, custom_headers = nil)
|
533
|
+
response = list_next_async(next_page_link, custom_headers).value!
|
534
|
+
response.body unless response.nil?
|
535
|
+
end
|
536
|
+
|
537
|
+
#
|
538
|
+
# Lists all of the applications in the specified account.
|
539
|
+
#
|
540
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
541
|
+
# to List operation.
|
542
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
543
|
+
# will be added to the HTTP request.
|
544
|
+
#
|
545
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
546
|
+
#
|
547
|
+
def list_next_with_http_info(next_page_link, custom_headers = nil)
|
548
|
+
list_next_async(next_page_link, custom_headers).value!
|
549
|
+
end
|
550
|
+
|
551
|
+
#
|
552
|
+
# Lists all of the applications in the specified account.
|
553
|
+
#
|
554
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
555
|
+
# to List operation.
|
556
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
557
|
+
# to the HTTP request.
|
558
|
+
#
|
559
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
560
|
+
#
|
561
|
+
def list_next_async(next_page_link, custom_headers = nil)
|
562
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
563
|
+
|
564
|
+
|
565
|
+
request_headers = {}
|
566
|
+
|
567
|
+
# Set Headers
|
568
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
569
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
570
|
+
path_template = '{nextLink}'
|
571
|
+
|
572
|
+
request_url = @base_url || @client.base_url
|
573
|
+
|
574
|
+
options = {
|
575
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
576
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
577
|
+
headers: request_headers.merge(custom_headers || {}),
|
578
|
+
base_url: request_url
|
579
|
+
}
|
580
|
+
promise = @client.make_request_async(:get, path_template, options)
|
581
|
+
|
582
|
+
promise = promise.then do |result|
|
583
|
+
http_response = result.response
|
584
|
+
status_code = http_response.status
|
585
|
+
response_content = http_response.body
|
586
|
+
unless status_code == 200
|
587
|
+
error_model = JSON.load(response_content)
|
588
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
589
|
+
end
|
590
|
+
|
591
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
592
|
+
# Deserialize Response
|
593
|
+
if status_code == 200
|
594
|
+
begin
|
595
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
596
|
+
result_mapper = Azure::Batch::Mgmt::V2015_12_01::Models::ListApplicationsResult.mapper()
|
597
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
598
|
+
rescue Exception => e
|
599
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
600
|
+
end
|
601
|
+
end
|
602
|
+
|
603
|
+
result
|
604
|
+
end
|
605
|
+
|
606
|
+
promise.execute
|
607
|
+
end
|
608
|
+
|
609
|
+
#
|
610
|
+
# Lists all of the applications in the specified account.
|
611
|
+
#
|
612
|
+
# @param resource_group_name [String] The name of the resource group that
|
613
|
+
# contains the Batch account.
|
614
|
+
# @param account_name [String] The name of the Batch account.
|
615
|
+
# @param maxresults [Integer] The maximum number of items to return in the
|
616
|
+
# response.
|
617
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
618
|
+
# will be added to the HTTP request.
|
619
|
+
#
|
620
|
+
# @return [ListApplicationsResult] which provide lazy access to pages of the
|
621
|
+
# response.
|
622
|
+
#
|
623
|
+
def list_as_lazy(resource_group_name, account_name, maxresults = nil, custom_headers = nil)
|
624
|
+
response = list_async(resource_group_name, account_name, maxresults, custom_headers).value!
|
625
|
+
unless response.nil?
|
626
|
+
page = response.body
|
627
|
+
page.next_method = Proc.new do |next_page_link|
|
628
|
+
list_next_async(next_page_link, custom_headers)
|
629
|
+
end
|
630
|
+
page
|
631
|
+
end
|
632
|
+
end
|
633
|
+
|
634
|
+
end
|
635
|
+
end
|