azure_mgmt_labservices 0.17.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 +7 -0
- data/LICENSE.txt +21 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices.rb +109 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/environment_settings.rb +1254 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb +1286 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/gallery_images.rb +672 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb +1131 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/lab_accounts.rb +1093 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/labs.rb +890 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/managed_labs_client.rb +163 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/add_remove.rb +16 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/add_users_payload.rb +55 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/configuration_state.rb +16 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/create_lab_properties.rb +101 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment.rb +235 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_details.rb +149 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_fragment.rb +121 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_operations_payload.rb +47 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting.rb +210 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_creation_parameters.rb +48 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_fragment.rb +157 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_size.rb +110 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_size_fragment.rb +69 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image.rb +231 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_fragment.rb +143 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference.rb +90 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference_fragment.rb +90 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_environment_response.rb +48 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_personal_preferences_response.rb +65 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_regional_availability_response.rb +56 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab.rb +219 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_account.rb +147 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_account_fragment.rb +119 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_creation_parameters.rb +46 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_details.rb +82 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_fragment.rb +144 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_user_access_mode.rb +16 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/latest_operation_result.rb +107 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_environments_payload.rb +46 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_environments_response.rb +55 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_labs_response.rb +55 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/managed_lab_vm_size.rb +17 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/network_interface.rb +83 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_payload.rb +54 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response.rb +57 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response_item.rb +61 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_error.rb +57 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata.rb +59 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata_display.rb +80 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_result.rb +59 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_status_payload.rb +46 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_status_response.rb +48 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/personal_preferences_operations_payload.rb +71 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/provider_operation_result.rb +101 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/publish_payload.rb +47 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/publishing_state.rb +19 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm.rb +84 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_creation_parameters.rb +57 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_fragment.rb +58 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/regional_availability.rb +67 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/register_payload.rb +46 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/reset_password_payload.rb +68 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource.rb +110 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_set.rb +57 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_set_fragment.rb +57 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_setting_creation_parameters.rb +94 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_settings.rb +108 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_settings_fragment.rb +71 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment.rb +98 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment_setting.rb +100 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_gallery_image.rb +98 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab.rb +98 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab_account.rb +98 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_user.rb +98 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_availability.rb +59 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties.rb +56 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties_fragment.rb +56 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_info.rb +82 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_info_fragment.rb +82 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/user.rb +186 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/user_fragment.rb +108 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/virtual_machine_details.rb +107 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/models/vm_state_details.rb +86 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/module_definition.rb +9 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/operations.rb +117 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/provider_operations.rb +215 -0
- data/lib/2018-10-15/generated/azure_mgmt_labservices/users.rb +729 -0
- data/lib/azure_mgmt_labservices.rb +6 -0
- data/lib/module_definition.rb +7 -0
- data/lib/profiles/latest/labservices_latest_profile_client.rb +40 -0
- data/lib/profiles/latest/labservices_module_definition.rb +8 -0
- data/lib/profiles/latest/modules/labservices_profile_module.rb +369 -0
- data/lib/version.rb +7 -0
- metadata +210 -0
|
@@ -0,0 +1,1286 @@
|
|
|
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::Labservices::Mgmt::V2018_10_15
|
|
7
|
+
#
|
|
8
|
+
# The Managed Labs Client.
|
|
9
|
+
#
|
|
10
|
+
class Environments
|
|
11
|
+
include MsRestAzure
|
|
12
|
+
|
|
13
|
+
#
|
|
14
|
+
# Creates and initializes a new instance of the Environments class.
|
|
15
|
+
# @param client service class for accessing basic functionality.
|
|
16
|
+
#
|
|
17
|
+
def initialize(client)
|
|
18
|
+
@client = client
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @return [ManagedLabsClient] reference to the ManagedLabsClient
|
|
22
|
+
attr_reader :client
|
|
23
|
+
|
|
24
|
+
#
|
|
25
|
+
# List environments in a given environment setting.
|
|
26
|
+
#
|
|
27
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
28
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
29
|
+
# @param lab_name [String] The name of the lab.
|
|
30
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
31
|
+
# @param expand [String] Specify the $expand query. Example:
|
|
32
|
+
# 'properties($expand=networkInterface)'
|
|
33
|
+
# @param filter [String] The filter to apply to the operation.
|
|
34
|
+
# @param top [Integer] The maximum number of resources to return from the
|
|
35
|
+
# operation.
|
|
36
|
+
# @param orderby [String] The ordering expression for the results, using OData
|
|
37
|
+
# notation.
|
|
38
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
39
|
+
# will be added to the HTTP request.
|
|
40
|
+
#
|
|
41
|
+
# @return [Array<Environment>] operation results.
|
|
42
|
+
#
|
|
43
|
+
def list(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
|
|
44
|
+
first_page = list_as_lazy(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers)
|
|
45
|
+
first_page.get_all_items
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
#
|
|
49
|
+
# List environments in a given environment setting.
|
|
50
|
+
#
|
|
51
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
52
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
53
|
+
# @param lab_name [String] The name of the lab.
|
|
54
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
55
|
+
# @param expand [String] Specify the $expand query. Example:
|
|
56
|
+
# 'properties($expand=networkInterface)'
|
|
57
|
+
# @param filter [String] The filter to apply to the operation.
|
|
58
|
+
# @param top [Integer] The maximum number of resources to return from the
|
|
59
|
+
# operation.
|
|
60
|
+
# @param orderby [String] The ordering expression for the results, using OData
|
|
61
|
+
# notation.
|
|
62
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
63
|
+
# will be added to the HTTP request.
|
|
64
|
+
#
|
|
65
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
66
|
+
#
|
|
67
|
+
def list_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
|
|
68
|
+
list_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
#
|
|
72
|
+
# List environments in a given environment setting.
|
|
73
|
+
#
|
|
74
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
75
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
76
|
+
# @param lab_name [String] The name of the lab.
|
|
77
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
78
|
+
# @param expand [String] Specify the $expand query. Example:
|
|
79
|
+
# 'properties($expand=networkInterface)'
|
|
80
|
+
# @param filter [String] The filter to apply to the operation.
|
|
81
|
+
# @param top [Integer] The maximum number of resources to return from the
|
|
82
|
+
# operation.
|
|
83
|
+
# @param orderby [String] The ordering expression for the results, using OData
|
|
84
|
+
# notation.
|
|
85
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
86
|
+
# to the HTTP request.
|
|
87
|
+
#
|
|
88
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
89
|
+
#
|
|
90
|
+
def list_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
|
|
91
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
92
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
93
|
+
fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
|
|
94
|
+
fail ArgumentError, 'lab_name is nil' if lab_name.nil?
|
|
95
|
+
fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
|
|
96
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
request_headers = {}
|
|
100
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
101
|
+
|
|
102
|
+
# Set Headers
|
|
103
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
104
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
105
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments'
|
|
106
|
+
|
|
107
|
+
request_url = @base_url || @client.base_url
|
|
108
|
+
|
|
109
|
+
options = {
|
|
110
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
111
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name},
|
|
112
|
+
query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'api-version' => @client.api_version},
|
|
113
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
114
|
+
base_url: request_url
|
|
115
|
+
}
|
|
116
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
117
|
+
|
|
118
|
+
promise = promise.then do |result|
|
|
119
|
+
http_response = result.response
|
|
120
|
+
status_code = http_response.status
|
|
121
|
+
response_content = http_response.body
|
|
122
|
+
unless status_code == 200
|
|
123
|
+
error_model = JSON.load(response_content)
|
|
124
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
128
|
+
# Deserialize Response
|
|
129
|
+
if status_code == 200
|
|
130
|
+
begin
|
|
131
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
132
|
+
result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironment.mapper()
|
|
133
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
134
|
+
rescue Exception => e
|
|
135
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
result
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
promise.execute
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
#
|
|
146
|
+
# Get environment
|
|
147
|
+
#
|
|
148
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
149
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
150
|
+
# @param lab_name [String] The name of the lab.
|
|
151
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
152
|
+
# @param environment_name [String] The name of the environment.
|
|
153
|
+
# @param expand [String] Specify the $expand query. Example:
|
|
154
|
+
# 'properties($expand=networkInterface)'
|
|
155
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
156
|
+
# will be added to the HTTP request.
|
|
157
|
+
#
|
|
158
|
+
# @return [Environment] operation results.
|
|
159
|
+
#
|
|
160
|
+
def get(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, expand:nil, custom_headers:nil)
|
|
161
|
+
response = get_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, expand:expand, custom_headers:custom_headers).value!
|
|
162
|
+
response.body unless response.nil?
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
#
|
|
166
|
+
# Get environment
|
|
167
|
+
#
|
|
168
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
169
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
170
|
+
# @param lab_name [String] The name of the lab.
|
|
171
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
172
|
+
# @param environment_name [String] The name of the environment.
|
|
173
|
+
# @param expand [String] Specify the $expand query. Example:
|
|
174
|
+
# 'properties($expand=networkInterface)'
|
|
175
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
176
|
+
# will be added to the HTTP request.
|
|
177
|
+
#
|
|
178
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
179
|
+
#
|
|
180
|
+
def get_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, expand:nil, custom_headers:nil)
|
|
181
|
+
get_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, expand:expand, custom_headers:custom_headers).value!
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
#
|
|
185
|
+
# Get environment
|
|
186
|
+
#
|
|
187
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
188
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
189
|
+
# @param lab_name [String] The name of the lab.
|
|
190
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
191
|
+
# @param environment_name [String] The name of the environment.
|
|
192
|
+
# @param expand [String] Specify the $expand query. Example:
|
|
193
|
+
# 'properties($expand=networkInterface)'
|
|
194
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
195
|
+
# to the HTTP request.
|
|
196
|
+
#
|
|
197
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
198
|
+
#
|
|
199
|
+
def get_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, expand:nil, custom_headers:nil)
|
|
200
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
201
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
202
|
+
fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
|
|
203
|
+
fail ArgumentError, 'lab_name is nil' if lab_name.nil?
|
|
204
|
+
fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
|
|
205
|
+
fail ArgumentError, 'environment_name is nil' if environment_name.nil?
|
|
206
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
request_headers = {}
|
|
210
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
211
|
+
|
|
212
|
+
# Set Headers
|
|
213
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
214
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
215
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}'
|
|
216
|
+
|
|
217
|
+
request_url = @base_url || @client.base_url
|
|
218
|
+
|
|
219
|
+
options = {
|
|
220
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
221
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_name},
|
|
222
|
+
query_params: {'$expand' => expand,'api-version' => @client.api_version},
|
|
223
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
224
|
+
base_url: request_url
|
|
225
|
+
}
|
|
226
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
227
|
+
|
|
228
|
+
promise = promise.then do |result|
|
|
229
|
+
http_response = result.response
|
|
230
|
+
status_code = http_response.status
|
|
231
|
+
response_content = http_response.body
|
|
232
|
+
unless status_code == 200
|
|
233
|
+
error_model = JSON.load(response_content)
|
|
234
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
238
|
+
# Deserialize Response
|
|
239
|
+
if status_code == 200
|
|
240
|
+
begin
|
|
241
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
242
|
+
result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::Environment.mapper()
|
|
243
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
244
|
+
rescue Exception => e
|
|
245
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
result
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
promise.execute
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
#
|
|
256
|
+
# Create or replace an existing Environment.
|
|
257
|
+
#
|
|
258
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
259
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
260
|
+
# @param lab_name [String] The name of the lab.
|
|
261
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
262
|
+
# @param environment_name [String] The name of the environment.
|
|
263
|
+
# @param environment [Environment] Represents an environment instance
|
|
264
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
265
|
+
# will be added to the HTTP request.
|
|
266
|
+
#
|
|
267
|
+
# @return [Environment] operation results.
|
|
268
|
+
#
|
|
269
|
+
def create_or_update(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:nil)
|
|
270
|
+
response = create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:custom_headers).value!
|
|
271
|
+
response.body unless response.nil?
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
#
|
|
275
|
+
# Create or replace an existing Environment.
|
|
276
|
+
#
|
|
277
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
278
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
279
|
+
# @param lab_name [String] The name of the lab.
|
|
280
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
281
|
+
# @param environment_name [String] The name of the environment.
|
|
282
|
+
# @param environment [Environment] Represents an environment instance
|
|
283
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
284
|
+
# will be added to the HTTP request.
|
|
285
|
+
#
|
|
286
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
287
|
+
#
|
|
288
|
+
def create_or_update_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:nil)
|
|
289
|
+
create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:custom_headers).value!
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
#
|
|
293
|
+
# Create or replace an existing Environment.
|
|
294
|
+
#
|
|
295
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
296
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
297
|
+
# @param lab_name [String] The name of the lab.
|
|
298
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
299
|
+
# @param environment_name [String] The name of the environment.
|
|
300
|
+
# @param environment [Environment] Represents an environment instance
|
|
301
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
302
|
+
# to the HTTP request.
|
|
303
|
+
#
|
|
304
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
305
|
+
#
|
|
306
|
+
def create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:nil)
|
|
307
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
308
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
309
|
+
fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
|
|
310
|
+
fail ArgumentError, 'lab_name is nil' if lab_name.nil?
|
|
311
|
+
fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
|
|
312
|
+
fail ArgumentError, 'environment_name is nil' if environment_name.nil?
|
|
313
|
+
fail ArgumentError, 'environment is nil' if environment.nil?
|
|
314
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
request_headers = {}
|
|
318
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
319
|
+
|
|
320
|
+
# Set Headers
|
|
321
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
322
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
323
|
+
|
|
324
|
+
# Serialize Request
|
|
325
|
+
request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::Environment.mapper()
|
|
326
|
+
request_content = @client.serialize(request_mapper, environment)
|
|
327
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
328
|
+
|
|
329
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}'
|
|
330
|
+
|
|
331
|
+
request_url = @base_url || @client.base_url
|
|
332
|
+
|
|
333
|
+
options = {
|
|
334
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
335
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_name},
|
|
336
|
+
query_params: {'api-version' => @client.api_version},
|
|
337
|
+
body: request_content,
|
|
338
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
339
|
+
base_url: request_url
|
|
340
|
+
}
|
|
341
|
+
promise = @client.make_request_async(:put, path_template, options)
|
|
342
|
+
|
|
343
|
+
promise = promise.then do |result|
|
|
344
|
+
http_response = result.response
|
|
345
|
+
status_code = http_response.status
|
|
346
|
+
response_content = http_response.body
|
|
347
|
+
unless status_code == 200 || status_code == 201
|
|
348
|
+
error_model = JSON.load(response_content)
|
|
349
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
353
|
+
# Deserialize Response
|
|
354
|
+
if status_code == 200
|
|
355
|
+
begin
|
|
356
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
357
|
+
result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::Environment.mapper()
|
|
358
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
359
|
+
rescue Exception => e
|
|
360
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
361
|
+
end
|
|
362
|
+
end
|
|
363
|
+
# Deserialize Response
|
|
364
|
+
if status_code == 201
|
|
365
|
+
begin
|
|
366
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
367
|
+
result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::Environment.mapper()
|
|
368
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
369
|
+
rescue Exception => e
|
|
370
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
371
|
+
end
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
result
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
promise.execute
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
#
|
|
381
|
+
# Delete environment. This operation can take a while to complete
|
|
382
|
+
#
|
|
383
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
384
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
385
|
+
# @param lab_name [String] The name of the lab.
|
|
386
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
387
|
+
# @param environment_name [String] The name of the environment.
|
|
388
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
389
|
+
# will be added to the HTTP request.
|
|
390
|
+
#
|
|
391
|
+
def delete(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
392
|
+
response = delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
|
|
393
|
+
nil
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
#
|
|
397
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
398
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
399
|
+
# @param lab_name [String] The name of the lab.
|
|
400
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
401
|
+
# @param environment_name [String] The name of the environment.
|
|
402
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
403
|
+
# will be added to the HTTP request.
|
|
404
|
+
#
|
|
405
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
406
|
+
# response.
|
|
407
|
+
#
|
|
408
|
+
def delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
409
|
+
# Send request
|
|
410
|
+
promise = begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers)
|
|
411
|
+
|
|
412
|
+
promise = promise.then do |response|
|
|
413
|
+
# Defining deserialization method.
|
|
414
|
+
deserialize_method = lambda do |parsed_response|
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
# Waiting for response.
|
|
418
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
promise
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
#
|
|
425
|
+
# Modify properties of environments.
|
|
426
|
+
#
|
|
427
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
428
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
429
|
+
# @param lab_name [String] The name of the lab.
|
|
430
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
431
|
+
# @param environment_name [String] The name of the environment.
|
|
432
|
+
# @param environment [EnvironmentFragment] Represents an environment instance
|
|
433
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
434
|
+
# will be added to the HTTP request.
|
|
435
|
+
#
|
|
436
|
+
# @return [Environment] operation results.
|
|
437
|
+
#
|
|
438
|
+
def update(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:nil)
|
|
439
|
+
response = update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:custom_headers).value!
|
|
440
|
+
response.body unless response.nil?
|
|
441
|
+
end
|
|
442
|
+
|
|
443
|
+
#
|
|
444
|
+
# Modify properties of environments.
|
|
445
|
+
#
|
|
446
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
447
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
448
|
+
# @param lab_name [String] The name of the lab.
|
|
449
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
450
|
+
# @param environment_name [String] The name of the environment.
|
|
451
|
+
# @param environment [EnvironmentFragment] Represents an environment instance
|
|
452
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
453
|
+
# will be added to the HTTP request.
|
|
454
|
+
#
|
|
455
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
456
|
+
#
|
|
457
|
+
def update_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:nil)
|
|
458
|
+
update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:custom_headers).value!
|
|
459
|
+
end
|
|
460
|
+
|
|
461
|
+
#
|
|
462
|
+
# Modify properties of environments.
|
|
463
|
+
#
|
|
464
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
465
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
466
|
+
# @param lab_name [String] The name of the lab.
|
|
467
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
468
|
+
# @param environment_name [String] The name of the environment.
|
|
469
|
+
# @param environment [EnvironmentFragment] Represents an environment instance
|
|
470
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
471
|
+
# to the HTTP request.
|
|
472
|
+
#
|
|
473
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
474
|
+
#
|
|
475
|
+
def update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:nil)
|
|
476
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
477
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
478
|
+
fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
|
|
479
|
+
fail ArgumentError, 'lab_name is nil' if lab_name.nil?
|
|
480
|
+
fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
|
|
481
|
+
fail ArgumentError, 'environment_name is nil' if environment_name.nil?
|
|
482
|
+
fail ArgumentError, 'environment is nil' if environment.nil?
|
|
483
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
request_headers = {}
|
|
487
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
488
|
+
|
|
489
|
+
# Set Headers
|
|
490
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
491
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
492
|
+
|
|
493
|
+
# Serialize Request
|
|
494
|
+
request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentFragment.mapper()
|
|
495
|
+
request_content = @client.serialize(request_mapper, environment)
|
|
496
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
497
|
+
|
|
498
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}'
|
|
499
|
+
|
|
500
|
+
request_url = @base_url || @client.base_url
|
|
501
|
+
|
|
502
|
+
options = {
|
|
503
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
504
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_name},
|
|
505
|
+
query_params: {'api-version' => @client.api_version},
|
|
506
|
+
body: request_content,
|
|
507
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
508
|
+
base_url: request_url
|
|
509
|
+
}
|
|
510
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
|
511
|
+
|
|
512
|
+
promise = promise.then do |result|
|
|
513
|
+
http_response = result.response
|
|
514
|
+
status_code = http_response.status
|
|
515
|
+
response_content = http_response.body
|
|
516
|
+
unless status_code == 200
|
|
517
|
+
error_model = JSON.load(response_content)
|
|
518
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
519
|
+
end
|
|
520
|
+
|
|
521
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
522
|
+
# Deserialize Response
|
|
523
|
+
if status_code == 200
|
|
524
|
+
begin
|
|
525
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
526
|
+
result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::Environment.mapper()
|
|
527
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
528
|
+
rescue Exception => e
|
|
529
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
530
|
+
end
|
|
531
|
+
end
|
|
532
|
+
|
|
533
|
+
result
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
promise.execute
|
|
537
|
+
end
|
|
538
|
+
|
|
539
|
+
#
|
|
540
|
+
# Claims the environment and assigns it to the user
|
|
541
|
+
#
|
|
542
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
543
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
544
|
+
# @param lab_name [String] The name of the lab.
|
|
545
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
546
|
+
# @param environment_name [String] The name of the environment.
|
|
547
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
548
|
+
# will be added to the HTTP request.
|
|
549
|
+
#
|
|
550
|
+
#
|
|
551
|
+
def claim(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
552
|
+
response = claim_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
|
|
553
|
+
nil
|
|
554
|
+
end
|
|
555
|
+
|
|
556
|
+
#
|
|
557
|
+
# Claims the environment and assigns it to the user
|
|
558
|
+
#
|
|
559
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
560
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
561
|
+
# @param lab_name [String] The name of the lab.
|
|
562
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
563
|
+
# @param environment_name [String] The name of the environment.
|
|
564
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
565
|
+
# will be added to the HTTP request.
|
|
566
|
+
#
|
|
567
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
568
|
+
#
|
|
569
|
+
def claim_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
570
|
+
claim_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
|
|
571
|
+
end
|
|
572
|
+
|
|
573
|
+
#
|
|
574
|
+
# Claims the environment and assigns it to the user
|
|
575
|
+
#
|
|
576
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
577
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
578
|
+
# @param lab_name [String] The name of the lab.
|
|
579
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
580
|
+
# @param environment_name [String] The name of the environment.
|
|
581
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
582
|
+
# to the HTTP request.
|
|
583
|
+
#
|
|
584
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
585
|
+
#
|
|
586
|
+
def claim_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
587
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
588
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
589
|
+
fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
|
|
590
|
+
fail ArgumentError, 'lab_name is nil' if lab_name.nil?
|
|
591
|
+
fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
|
|
592
|
+
fail ArgumentError, 'environment_name is nil' if environment_name.nil?
|
|
593
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
request_headers = {}
|
|
597
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
598
|
+
|
|
599
|
+
# Set Headers
|
|
600
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
601
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
602
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/claim'
|
|
603
|
+
|
|
604
|
+
request_url = @base_url || @client.base_url
|
|
605
|
+
|
|
606
|
+
options = {
|
|
607
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
608
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_name},
|
|
609
|
+
query_params: {'api-version' => @client.api_version},
|
|
610
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
611
|
+
base_url: request_url
|
|
612
|
+
}
|
|
613
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
614
|
+
|
|
615
|
+
promise = promise.then do |result|
|
|
616
|
+
http_response = result.response
|
|
617
|
+
status_code = http_response.status
|
|
618
|
+
response_content = http_response.body
|
|
619
|
+
unless status_code == 200
|
|
620
|
+
error_model = JSON.load(response_content)
|
|
621
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
622
|
+
end
|
|
623
|
+
|
|
624
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
625
|
+
|
|
626
|
+
result
|
|
627
|
+
end
|
|
628
|
+
|
|
629
|
+
promise.execute
|
|
630
|
+
end
|
|
631
|
+
|
|
632
|
+
#
|
|
633
|
+
# Resets the user password on an environment This operation can take a while to
|
|
634
|
+
# complete
|
|
635
|
+
#
|
|
636
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
637
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
638
|
+
# @param lab_name [String] The name of the lab.
|
|
639
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
640
|
+
# @param environment_name [String] The name of the environment.
|
|
641
|
+
# @param reset_password_payload [ResetPasswordPayload] Represents the payload
|
|
642
|
+
# for resetting passwords.
|
|
643
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
644
|
+
# will be added to the HTTP request.
|
|
645
|
+
#
|
|
646
|
+
def reset_password(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil)
|
|
647
|
+
response = reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:custom_headers).value!
|
|
648
|
+
nil
|
|
649
|
+
end
|
|
650
|
+
|
|
651
|
+
#
|
|
652
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
653
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
654
|
+
# @param lab_name [String] The name of the lab.
|
|
655
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
656
|
+
# @param environment_name [String] The name of the environment.
|
|
657
|
+
# @param reset_password_payload [ResetPasswordPayload] Represents the payload
|
|
658
|
+
# for resetting passwords.
|
|
659
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
660
|
+
# will be added to the HTTP request.
|
|
661
|
+
#
|
|
662
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
663
|
+
# response.
|
|
664
|
+
#
|
|
665
|
+
def reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil)
|
|
666
|
+
# Send request
|
|
667
|
+
promise = begin_reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:custom_headers)
|
|
668
|
+
|
|
669
|
+
promise = promise.then do |response|
|
|
670
|
+
# Defining deserialization method.
|
|
671
|
+
deserialize_method = lambda do |parsed_response|
|
|
672
|
+
end
|
|
673
|
+
|
|
674
|
+
# Waiting for response.
|
|
675
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
|
676
|
+
end
|
|
677
|
+
|
|
678
|
+
promise
|
|
679
|
+
end
|
|
680
|
+
|
|
681
|
+
#
|
|
682
|
+
# Starts an environment by starting all resources inside the environment. This
|
|
683
|
+
# operation can take a while to complete
|
|
684
|
+
#
|
|
685
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
686
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
687
|
+
# @param lab_name [String] The name of the lab.
|
|
688
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
689
|
+
# @param environment_name [String] The name of the environment.
|
|
690
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
691
|
+
# will be added to the HTTP request.
|
|
692
|
+
#
|
|
693
|
+
def start(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
694
|
+
response = start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
|
|
695
|
+
nil
|
|
696
|
+
end
|
|
697
|
+
|
|
698
|
+
#
|
|
699
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
700
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
701
|
+
# @param lab_name [String] The name of the lab.
|
|
702
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
703
|
+
# @param environment_name [String] The name of the environment.
|
|
704
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
705
|
+
# will be added to the HTTP request.
|
|
706
|
+
#
|
|
707
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
708
|
+
# response.
|
|
709
|
+
#
|
|
710
|
+
def start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
711
|
+
# Send request
|
|
712
|
+
promise = begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers)
|
|
713
|
+
|
|
714
|
+
promise = promise.then do |response|
|
|
715
|
+
# Defining deserialization method.
|
|
716
|
+
deserialize_method = lambda do |parsed_response|
|
|
717
|
+
end
|
|
718
|
+
|
|
719
|
+
# Waiting for response.
|
|
720
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
|
721
|
+
end
|
|
722
|
+
|
|
723
|
+
promise
|
|
724
|
+
end
|
|
725
|
+
|
|
726
|
+
#
|
|
727
|
+
# Stops an environment by stopping all resources inside the environment This
|
|
728
|
+
# operation can take a while to complete
|
|
729
|
+
#
|
|
730
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
731
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
732
|
+
# @param lab_name [String] The name of the lab.
|
|
733
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
734
|
+
# @param environment_name [String] The name of the environment.
|
|
735
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
736
|
+
# will be added to the HTTP request.
|
|
737
|
+
#
|
|
738
|
+
def stop(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
739
|
+
response = stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
|
|
740
|
+
nil
|
|
741
|
+
end
|
|
742
|
+
|
|
743
|
+
#
|
|
744
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
745
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
746
|
+
# @param lab_name [String] The name of the lab.
|
|
747
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
748
|
+
# @param environment_name [String] The name of the environment.
|
|
749
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
750
|
+
# will be added to the HTTP request.
|
|
751
|
+
#
|
|
752
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
753
|
+
# response.
|
|
754
|
+
#
|
|
755
|
+
def stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
756
|
+
# Send request
|
|
757
|
+
promise = begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers)
|
|
758
|
+
|
|
759
|
+
promise = promise.then do |response|
|
|
760
|
+
# Defining deserialization method.
|
|
761
|
+
deserialize_method = lambda do |parsed_response|
|
|
762
|
+
end
|
|
763
|
+
|
|
764
|
+
# Waiting for response.
|
|
765
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
|
766
|
+
end
|
|
767
|
+
|
|
768
|
+
promise
|
|
769
|
+
end
|
|
770
|
+
|
|
771
|
+
#
|
|
772
|
+
# Delete environment. This operation can take a while to complete
|
|
773
|
+
#
|
|
774
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
775
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
776
|
+
# @param lab_name [String] The name of the lab.
|
|
777
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
778
|
+
# @param environment_name [String] The name of the environment.
|
|
779
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
780
|
+
# will be added to the HTTP request.
|
|
781
|
+
#
|
|
782
|
+
#
|
|
783
|
+
def begin_delete(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
784
|
+
response = begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
|
|
785
|
+
nil
|
|
786
|
+
end
|
|
787
|
+
|
|
788
|
+
#
|
|
789
|
+
# Delete environment. This operation can take a while to complete
|
|
790
|
+
#
|
|
791
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
792
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
793
|
+
# @param lab_name [String] The name of the lab.
|
|
794
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
795
|
+
# @param environment_name [String] The name of the environment.
|
|
796
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
797
|
+
# will be added to the HTTP request.
|
|
798
|
+
#
|
|
799
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
800
|
+
#
|
|
801
|
+
def begin_delete_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
802
|
+
begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
|
|
803
|
+
end
|
|
804
|
+
|
|
805
|
+
#
|
|
806
|
+
# Delete environment. This operation can take a while to complete
|
|
807
|
+
#
|
|
808
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
809
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
810
|
+
# @param lab_name [String] The name of the lab.
|
|
811
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
812
|
+
# @param environment_name [String] The name of the environment.
|
|
813
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
814
|
+
# to the HTTP request.
|
|
815
|
+
#
|
|
816
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
817
|
+
#
|
|
818
|
+
def begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
819
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
820
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
821
|
+
fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
|
|
822
|
+
fail ArgumentError, 'lab_name is nil' if lab_name.nil?
|
|
823
|
+
fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
|
|
824
|
+
fail ArgumentError, 'environment_name is nil' if environment_name.nil?
|
|
825
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
request_headers = {}
|
|
829
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
830
|
+
|
|
831
|
+
# Set Headers
|
|
832
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
833
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
834
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}'
|
|
835
|
+
|
|
836
|
+
request_url = @base_url || @client.base_url
|
|
837
|
+
|
|
838
|
+
options = {
|
|
839
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
840
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_name},
|
|
841
|
+
query_params: {'api-version' => @client.api_version},
|
|
842
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
843
|
+
base_url: request_url
|
|
844
|
+
}
|
|
845
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
|
846
|
+
|
|
847
|
+
promise = promise.then do |result|
|
|
848
|
+
http_response = result.response
|
|
849
|
+
status_code = http_response.status
|
|
850
|
+
response_content = http_response.body
|
|
851
|
+
unless status_code == 202 || status_code == 204
|
|
852
|
+
error_model = JSON.load(response_content)
|
|
853
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
854
|
+
end
|
|
855
|
+
|
|
856
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
857
|
+
|
|
858
|
+
result
|
|
859
|
+
end
|
|
860
|
+
|
|
861
|
+
promise.execute
|
|
862
|
+
end
|
|
863
|
+
|
|
864
|
+
#
|
|
865
|
+
# Resets the user password on an environment This operation can take a while to
|
|
866
|
+
# complete
|
|
867
|
+
#
|
|
868
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
869
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
870
|
+
# @param lab_name [String] The name of the lab.
|
|
871
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
872
|
+
# @param environment_name [String] The name of the environment.
|
|
873
|
+
# @param reset_password_payload [ResetPasswordPayload] Represents the payload
|
|
874
|
+
# for resetting passwords.
|
|
875
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
876
|
+
# will be added to the HTTP request.
|
|
877
|
+
#
|
|
878
|
+
#
|
|
879
|
+
def begin_reset_password(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil)
|
|
880
|
+
response = begin_reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:custom_headers).value!
|
|
881
|
+
nil
|
|
882
|
+
end
|
|
883
|
+
|
|
884
|
+
#
|
|
885
|
+
# Resets the user password on an environment This operation can take a while to
|
|
886
|
+
# complete
|
|
887
|
+
#
|
|
888
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
889
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
890
|
+
# @param lab_name [String] The name of the lab.
|
|
891
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
892
|
+
# @param environment_name [String] The name of the environment.
|
|
893
|
+
# @param reset_password_payload [ResetPasswordPayload] Represents the payload
|
|
894
|
+
# for resetting passwords.
|
|
895
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
896
|
+
# will be added to the HTTP request.
|
|
897
|
+
#
|
|
898
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
899
|
+
#
|
|
900
|
+
def begin_reset_password_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil)
|
|
901
|
+
begin_reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:custom_headers).value!
|
|
902
|
+
end
|
|
903
|
+
|
|
904
|
+
#
|
|
905
|
+
# Resets the user password on an environment This operation can take a while to
|
|
906
|
+
# complete
|
|
907
|
+
#
|
|
908
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
909
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
910
|
+
# @param lab_name [String] The name of the lab.
|
|
911
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
912
|
+
# @param environment_name [String] The name of the environment.
|
|
913
|
+
# @param reset_password_payload [ResetPasswordPayload] Represents the payload
|
|
914
|
+
# for resetting passwords.
|
|
915
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
916
|
+
# to the HTTP request.
|
|
917
|
+
#
|
|
918
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
919
|
+
#
|
|
920
|
+
def begin_reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil)
|
|
921
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
922
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
923
|
+
fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
|
|
924
|
+
fail ArgumentError, 'lab_name is nil' if lab_name.nil?
|
|
925
|
+
fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
|
|
926
|
+
fail ArgumentError, 'environment_name is nil' if environment_name.nil?
|
|
927
|
+
fail ArgumentError, 'reset_password_payload is nil' if reset_password_payload.nil?
|
|
928
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
request_headers = {}
|
|
932
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
933
|
+
|
|
934
|
+
# Set Headers
|
|
935
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
936
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
937
|
+
|
|
938
|
+
# Serialize Request
|
|
939
|
+
request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::ResetPasswordPayload.mapper()
|
|
940
|
+
request_content = @client.serialize(request_mapper, reset_password_payload)
|
|
941
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
942
|
+
|
|
943
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/resetPassword'
|
|
944
|
+
|
|
945
|
+
request_url = @base_url || @client.base_url
|
|
946
|
+
|
|
947
|
+
options = {
|
|
948
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
949
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_name},
|
|
950
|
+
query_params: {'api-version' => @client.api_version},
|
|
951
|
+
body: request_content,
|
|
952
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
953
|
+
base_url: request_url
|
|
954
|
+
}
|
|
955
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
956
|
+
|
|
957
|
+
promise = promise.then do |result|
|
|
958
|
+
http_response = result.response
|
|
959
|
+
status_code = http_response.status
|
|
960
|
+
response_content = http_response.body
|
|
961
|
+
unless status_code == 200 || status_code == 202
|
|
962
|
+
error_model = JSON.load(response_content)
|
|
963
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
964
|
+
end
|
|
965
|
+
|
|
966
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
967
|
+
|
|
968
|
+
result
|
|
969
|
+
end
|
|
970
|
+
|
|
971
|
+
promise.execute
|
|
972
|
+
end
|
|
973
|
+
|
|
974
|
+
#
|
|
975
|
+
# Starts an environment by starting all resources inside the environment. This
|
|
976
|
+
# operation can take a while to complete
|
|
977
|
+
#
|
|
978
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
979
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
980
|
+
# @param lab_name [String] The name of the lab.
|
|
981
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
982
|
+
# @param environment_name [String] The name of the environment.
|
|
983
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
984
|
+
# will be added to the HTTP request.
|
|
985
|
+
#
|
|
986
|
+
#
|
|
987
|
+
def begin_start(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
988
|
+
response = begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
|
|
989
|
+
nil
|
|
990
|
+
end
|
|
991
|
+
|
|
992
|
+
#
|
|
993
|
+
# Starts an environment by starting all resources inside the environment. This
|
|
994
|
+
# operation can take a while to complete
|
|
995
|
+
#
|
|
996
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
997
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
998
|
+
# @param lab_name [String] The name of the lab.
|
|
999
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
1000
|
+
# @param environment_name [String] The name of the environment.
|
|
1001
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1002
|
+
# will be added to the HTTP request.
|
|
1003
|
+
#
|
|
1004
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
1005
|
+
#
|
|
1006
|
+
def begin_start_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
1007
|
+
begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
|
|
1008
|
+
end
|
|
1009
|
+
|
|
1010
|
+
#
|
|
1011
|
+
# Starts an environment by starting all resources inside the environment. This
|
|
1012
|
+
# operation can take a while to complete
|
|
1013
|
+
#
|
|
1014
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
1015
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
1016
|
+
# @param lab_name [String] The name of the lab.
|
|
1017
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
1018
|
+
# @param environment_name [String] The name of the environment.
|
|
1019
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
1020
|
+
# to the HTTP request.
|
|
1021
|
+
#
|
|
1022
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
1023
|
+
#
|
|
1024
|
+
def begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
1025
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1026
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1027
|
+
fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
|
|
1028
|
+
fail ArgumentError, 'lab_name is nil' if lab_name.nil?
|
|
1029
|
+
fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
|
|
1030
|
+
fail ArgumentError, 'environment_name is nil' if environment_name.nil?
|
|
1031
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
request_headers = {}
|
|
1035
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
1036
|
+
|
|
1037
|
+
# Set Headers
|
|
1038
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1039
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1040
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/start'
|
|
1041
|
+
|
|
1042
|
+
request_url = @base_url || @client.base_url
|
|
1043
|
+
|
|
1044
|
+
options = {
|
|
1045
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1046
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_name},
|
|
1047
|
+
query_params: {'api-version' => @client.api_version},
|
|
1048
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
1049
|
+
base_url: request_url
|
|
1050
|
+
}
|
|
1051
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
1052
|
+
|
|
1053
|
+
promise = promise.then do |result|
|
|
1054
|
+
http_response = result.response
|
|
1055
|
+
status_code = http_response.status
|
|
1056
|
+
response_content = http_response.body
|
|
1057
|
+
unless status_code == 200 || status_code == 202
|
|
1058
|
+
error_model = JSON.load(response_content)
|
|
1059
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
1060
|
+
end
|
|
1061
|
+
|
|
1062
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1063
|
+
|
|
1064
|
+
result
|
|
1065
|
+
end
|
|
1066
|
+
|
|
1067
|
+
promise.execute
|
|
1068
|
+
end
|
|
1069
|
+
|
|
1070
|
+
#
|
|
1071
|
+
# Stops an environment by stopping all resources inside the environment This
|
|
1072
|
+
# operation can take a while to complete
|
|
1073
|
+
#
|
|
1074
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
1075
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
1076
|
+
# @param lab_name [String] The name of the lab.
|
|
1077
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
1078
|
+
# @param environment_name [String] The name of the environment.
|
|
1079
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1080
|
+
# will be added to the HTTP request.
|
|
1081
|
+
#
|
|
1082
|
+
#
|
|
1083
|
+
def begin_stop(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
1084
|
+
response = begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
|
|
1085
|
+
nil
|
|
1086
|
+
end
|
|
1087
|
+
|
|
1088
|
+
#
|
|
1089
|
+
# Stops an environment by stopping all resources inside the environment This
|
|
1090
|
+
# operation can take a while to complete
|
|
1091
|
+
#
|
|
1092
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
1093
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
1094
|
+
# @param lab_name [String] The name of the lab.
|
|
1095
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
1096
|
+
# @param environment_name [String] The name of the environment.
|
|
1097
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1098
|
+
# will be added to the HTTP request.
|
|
1099
|
+
#
|
|
1100
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
1101
|
+
#
|
|
1102
|
+
def begin_stop_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
1103
|
+
begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
|
|
1104
|
+
end
|
|
1105
|
+
|
|
1106
|
+
#
|
|
1107
|
+
# Stops an environment by stopping all resources inside the environment This
|
|
1108
|
+
# operation can take a while to complete
|
|
1109
|
+
#
|
|
1110
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
1111
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
1112
|
+
# @param lab_name [String] The name of the lab.
|
|
1113
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
1114
|
+
# @param environment_name [String] The name of the environment.
|
|
1115
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
1116
|
+
# to the HTTP request.
|
|
1117
|
+
#
|
|
1118
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
1119
|
+
#
|
|
1120
|
+
def begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
|
|
1121
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1122
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1123
|
+
fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
|
|
1124
|
+
fail ArgumentError, 'lab_name is nil' if lab_name.nil?
|
|
1125
|
+
fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
|
|
1126
|
+
fail ArgumentError, 'environment_name is nil' if environment_name.nil?
|
|
1127
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
request_headers = {}
|
|
1131
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
1132
|
+
|
|
1133
|
+
# Set Headers
|
|
1134
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1135
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1136
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/stop'
|
|
1137
|
+
|
|
1138
|
+
request_url = @base_url || @client.base_url
|
|
1139
|
+
|
|
1140
|
+
options = {
|
|
1141
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1142
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_name},
|
|
1143
|
+
query_params: {'api-version' => @client.api_version},
|
|
1144
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
1145
|
+
base_url: request_url
|
|
1146
|
+
}
|
|
1147
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
1148
|
+
|
|
1149
|
+
promise = promise.then do |result|
|
|
1150
|
+
http_response = result.response
|
|
1151
|
+
status_code = http_response.status
|
|
1152
|
+
response_content = http_response.body
|
|
1153
|
+
unless status_code == 200 || status_code == 202
|
|
1154
|
+
error_model = JSON.load(response_content)
|
|
1155
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
1156
|
+
end
|
|
1157
|
+
|
|
1158
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1159
|
+
|
|
1160
|
+
result
|
|
1161
|
+
end
|
|
1162
|
+
|
|
1163
|
+
promise.execute
|
|
1164
|
+
end
|
|
1165
|
+
|
|
1166
|
+
#
|
|
1167
|
+
# List environments in a given environment setting.
|
|
1168
|
+
#
|
|
1169
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
1170
|
+
# to List operation.
|
|
1171
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1172
|
+
# will be added to the HTTP request.
|
|
1173
|
+
#
|
|
1174
|
+
# @return [ResponseWithContinuationEnvironment] operation results.
|
|
1175
|
+
#
|
|
1176
|
+
def list_next(next_page_link, custom_headers:nil)
|
|
1177
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
|
1178
|
+
response.body unless response.nil?
|
|
1179
|
+
end
|
|
1180
|
+
|
|
1181
|
+
#
|
|
1182
|
+
# List environments in a given environment setting.
|
|
1183
|
+
#
|
|
1184
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
1185
|
+
# to List operation.
|
|
1186
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1187
|
+
# will be added to the HTTP request.
|
|
1188
|
+
#
|
|
1189
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
1190
|
+
#
|
|
1191
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
|
1192
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
|
1193
|
+
end
|
|
1194
|
+
|
|
1195
|
+
#
|
|
1196
|
+
# List environments in a given environment setting.
|
|
1197
|
+
#
|
|
1198
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
1199
|
+
# to List operation.
|
|
1200
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
1201
|
+
# to the HTTP request.
|
|
1202
|
+
#
|
|
1203
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
1204
|
+
#
|
|
1205
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
|
1206
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
request_headers = {}
|
|
1210
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
1211
|
+
|
|
1212
|
+
# Set Headers
|
|
1213
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1214
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1215
|
+
path_template = '{nextLink}'
|
|
1216
|
+
|
|
1217
|
+
request_url = @base_url || @client.base_url
|
|
1218
|
+
|
|
1219
|
+
options = {
|
|
1220
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1221
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
|
1222
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
1223
|
+
base_url: request_url
|
|
1224
|
+
}
|
|
1225
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
1226
|
+
|
|
1227
|
+
promise = promise.then do |result|
|
|
1228
|
+
http_response = result.response
|
|
1229
|
+
status_code = http_response.status
|
|
1230
|
+
response_content = http_response.body
|
|
1231
|
+
unless status_code == 200
|
|
1232
|
+
error_model = JSON.load(response_content)
|
|
1233
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
1234
|
+
end
|
|
1235
|
+
|
|
1236
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1237
|
+
# Deserialize Response
|
|
1238
|
+
if status_code == 200
|
|
1239
|
+
begin
|
|
1240
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1241
|
+
result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironment.mapper()
|
|
1242
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
1243
|
+
rescue Exception => e
|
|
1244
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1245
|
+
end
|
|
1246
|
+
end
|
|
1247
|
+
|
|
1248
|
+
result
|
|
1249
|
+
end
|
|
1250
|
+
|
|
1251
|
+
promise.execute
|
|
1252
|
+
end
|
|
1253
|
+
|
|
1254
|
+
#
|
|
1255
|
+
# List environments in a given environment setting.
|
|
1256
|
+
#
|
|
1257
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
1258
|
+
# @param lab_account_name [String] The name of the lab Account.
|
|
1259
|
+
# @param lab_name [String] The name of the lab.
|
|
1260
|
+
# @param environment_setting_name [String] The name of the environment Setting.
|
|
1261
|
+
# @param expand [String] Specify the $expand query. Example:
|
|
1262
|
+
# 'properties($expand=networkInterface)'
|
|
1263
|
+
# @param filter [String] The filter to apply to the operation.
|
|
1264
|
+
# @param top [Integer] The maximum number of resources to return from the
|
|
1265
|
+
# operation.
|
|
1266
|
+
# @param orderby [String] The ordering expression for the results, using OData
|
|
1267
|
+
# notation.
|
|
1268
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1269
|
+
# will be added to the HTTP request.
|
|
1270
|
+
#
|
|
1271
|
+
# @return [ResponseWithContinuationEnvironment] which provide lazy access to
|
|
1272
|
+
# pages of the response.
|
|
1273
|
+
#
|
|
1274
|
+
def list_as_lazy(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
|
|
1275
|
+
response = list_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
|
|
1276
|
+
unless response.nil?
|
|
1277
|
+
page = response.body
|
|
1278
|
+
page.next_method = Proc.new do |next_page_link|
|
|
1279
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
|
1280
|
+
end
|
|
1281
|
+
page
|
|
1282
|
+
end
|
|
1283
|
+
end
|
|
1284
|
+
|
|
1285
|
+
end
|
|
1286
|
+
end
|