Class: Azure::ARM::ServerManagement::Gateway

Inherits:
Object
  • Object
show all
Includes:
Models, MsRestAzure
Defined in:
lib/generated/azure_mgmt_server_management/gateway.rb

Overview

REST API for Azure Server Management Service

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Gateway

Creates and initializes a new instance of the Gateway class.

Parameters:

  • client

    service class for accessing basic functionality.



18
19
20
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 18

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientServerManagement (readonly)

Returns reference to the ServerManagement.

Returns:



23
24
25
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 23

def client
  @client
end

Instance Method Details

#begin_create(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil) ⇒ GatewayResource

Creates or updates a ManagementService gateway.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume autoUpgrade = Off. Possible values include: ‘On’, ‘Off’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    location of the resource

  • tags (defaults to: nil)

    resource tags

  • auto_upgrade (AutoUpgrade) (defaults to: nil)

    The autoUpgrade property gives the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



98
99
100
101
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 98

def begin_create(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
  response = begin_create_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers).value!
  response.body unless response.nil?
end

#begin_create_async(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil) ⇒ Concurrent::Promise

Creates or updates a ManagementService gateway.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume autoUpgrade = Off. Possible values include: ‘On’, ‘Off’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    location of the resource

  • tags (defaults to: nil)

    resource tags

  • auto_upgrade (AutoUpgrade) (defaults to: nil)

    The autoUpgrade property gives the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 141

def begin_create_async(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?

  gateway_parameters = GatewayParameters.new
  unless location.nil? && tags.nil? && auto_upgrade.nil?
    gateway_parameters.location = location
    gateway_parameters.tags = tags
    gateway_parameters.auto_upgrade = auto_upgrade
  end

  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = GatewayParameters.mapper()
  request_content = @client.serialize(request_mapper,  gateway_parameters, 'gateway_parameters')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = GatewayResource.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = GatewayResource.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_create_with_http_info(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates a ManagementService gateway.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume autoUpgrade = Off. Possible values include: ‘On’, ‘Off’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    location of the resource

  • tags (defaults to: nil)

    resource tags

  • auto_upgrade (AutoUpgrade) (defaults to: nil)

    The autoUpgrade property gives the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



120
121
122
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 120

def begin_create_with_http_info(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
  begin_create_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers).value!
end

#begin_get_profile(resource_group_name, gateway_name, custom_headers = nil) ⇒ GatewayProfile

Gets a gateway profile

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



1127
1128
1129
1130
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 1127

def begin_get_profile(resource_group_name, gateway_name, custom_headers = nil)
  response = begin_get_profile_async(resource_group_name, gateway_name, custom_headers).value!
  response.body unless response.nil?
end

#begin_get_profile_async(resource_group_name, gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets a gateway profile

identifies the resource group within the user subscriptionId. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 1158

def begin_get_profile_async(resource_group_name, gateway_name, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}/profile'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = GatewayProfile.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_get_profile_with_http_info(resource_group_name, gateway_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a gateway profile

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1143
1144
1145
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 1143

def begin_get_profile_with_http_info(resource_group_name, gateway_name, custom_headers = nil)
  begin_get_profile_async(resource_group_name, gateway_name, custom_headers).value!
end

#begin_regenerate_profile(resource_group_name, gateway_name, custom_headers = nil) ⇒ Object

Regenerate a gateway’s profile

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



996
997
998
999
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 996

def begin_regenerate_profile(resource_group_name, gateway_name, custom_headers = nil)
  response = begin_regenerate_profile_async(resource_group_name, gateway_name, custom_headers).value!
  nil
end

#begin_regenerate_profile_async(resource_group_name, gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

Regenerate a gateway’s profile

identifies the resource group within the user subscriptionId. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 1027

def begin_regenerate_profile_async(resource_group_name, gateway_name, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}/regenerateprofile'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#begin_regenerate_profile_with_http_info(resource_group_name, gateway_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Regenerate a gateway’s profile

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1012
1013
1014
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 1012

def begin_regenerate_profile_with_http_info(resource_group_name, gateway_name, custom_headers = nil)
  begin_regenerate_profile_async(resource_group_name, gateway_name, custom_headers).value!
end

#begin_update(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil) ⇒ GatewayResource

Updates a gateway belonging to a resource group.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume autoUpgrade = Off. Possible values include: ‘On’, ‘Off’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    location of the resource

  • tags (defaults to: nil)

    resource tags

  • auto_upgrade (AutoUpgrade) (defaults to: nil)

    The autoUpgrade property gives the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



294
295
296
297
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 294

def begin_update(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
  response = begin_update_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers).value!
  response.body unless response.nil?
end

#begin_update_async(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil) ⇒ Concurrent::Promise

Updates a gateway belonging to a resource group.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume autoUpgrade = Off. Possible values include: ‘On’, ‘Off’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    location of the resource

  • tags (defaults to: nil)

    resource tags

  • auto_upgrade (AutoUpgrade) (defaults to: nil)

    The autoUpgrade property gives the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 337

def begin_update_async(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?

  gateway_parameters = GatewayParameters.new
  unless location.nil? && tags.nil? && auto_upgrade.nil?
    gateway_parameters.location = location
    gateway_parameters.tags = tags
    gateway_parameters.auto_upgrade = auto_upgrade
  end

  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = GatewayParameters.mapper()
  request_content = @client.serialize(request_mapper,  gateway_parameters, 'gateway_parameters')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = GatewayResource.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_update_with_http_info(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Updates a gateway belonging to a resource group.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume autoUpgrade = Off. Possible values include: ‘On’, ‘Off’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    location of the resource

  • tags (defaults to: nil)

    resource tags

  • auto_upgrade (AutoUpgrade) (defaults to: nil)

    The autoUpgrade property gives the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



316
317
318
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 316

def begin_update_with_http_info(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
  begin_update_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers).value!
end

#begin_upgrade(resource_group_name, gateway_name, custom_headers = nil) ⇒ Object

Upgrade a gateway

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



870
871
872
873
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 870

def begin_upgrade(resource_group_name, gateway_name, custom_headers = nil)
  response = begin_upgrade_async(resource_group_name, gateway_name, custom_headers).value!
  nil
end

#begin_upgrade_async(resource_group_name, gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

Upgrade a gateway

identifies the resource group within the user subscriptionId. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 901

def begin_upgrade_async(resource_group_name, gateway_name, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}/upgradetolatest'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#begin_upgrade_with_http_info(resource_group_name, gateway_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Upgrade a gateway

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



886
887
888
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 886

def begin_upgrade_with_http_info(resource_group_name, gateway_name, custom_headers = nil)
  begin_upgrade_async(resource_group_name, gateway_name, custom_headers).value!
end

#create(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil) ⇒ GatewayResource

Creates or updates a ManagementService gateway.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume autoUpgrade = Off. Possible values include: ‘On’, ‘Off’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    location of the resource

  • tags (defaults to: nil)

    resource tags

  • auto_upgrade (AutoUpgrade) (defaults to: nil)

    The autoUpgrade property gives the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



42
43
44
45
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 42

def create(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
  response = create_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers).value!
  response.body unless response.nil?
end

#create_async(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil) ⇒ Concurrent::Promise

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume autoUpgrade = Off. Possible values include: ‘On’, ‘Off’ will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    location of the resource

  • tags (defaults to: nil)

    resource tags

  • auto_upgrade (AutoUpgrade) (defaults to: nil)

    The autoUpgrade property gives the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 63

def create_async(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
  # Send request
  promise = begin_create_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = GatewayResource.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#delete(resource_group_name, gateway_name, custom_headers = nil) ⇒ Object

Deletes a gateway from a resource group.

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



417
418
419
420
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 417

def delete(resource_group_name, gateway_name, custom_headers = nil)
  response = delete_async(resource_group_name, gateway_name, custom_headers).value!
  nil
end

#delete_async(resource_group_name, gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

Deletes a gateway from a resource group.

identifies the resource group within the user subscriptionId. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 448

def delete_async(resource_group_name, gateway_name, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#delete_with_http_info(resource_group_name, gateway_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a gateway from a resource group.

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



433
434
435
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 433

def delete_with_http_info(resource_group_name, gateway_name, custom_headers = nil)
  delete_async(resource_group_name, gateway_name, custom_headers).value!
end

#get(resource_group_name, gateway_name, expand = nil, custom_headers = nil) ⇒ GatewayResource

Returns a gateway

identifies the resource group within the user subscriptionId. uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Possible values include: ‘status’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum)

  • expand (GatewayExpandOption) (defaults to: nil)

    Gets subscription credentials which

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



507
508
509
510
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 507

def get(resource_group_name, gateway_name, expand = nil, custom_headers = nil)
  response = get_async(resource_group_name, gateway_name, expand, custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, gateway_name, expand = nil, custom_headers = nil) ⇒ Concurrent::Promise

Returns a gateway

identifies the resource group within the user subscriptionId. uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Possible values include: ‘status’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum)

  • expand (GatewayExpandOption) (defaults to: nil)

    Gets subscription credentials which

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 544

def get_async(resource_group_name, gateway_name, expand = nil, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
      query_params: {'api-version' => @client.api_version,'$expand' => expand},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = GatewayResource.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_profile(resource_group_name, gateway_name, custom_headers = nil) ⇒ GatewayProfile

Gets a gateway profile

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



1083
1084
1085
1086
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 1083

def get_profile(resource_group_name, gateway_name, custom_headers = nil)
  response = get_profile_async(resource_group_name, gateway_name, custom_headers).value!
  response.body unless response.nil?
end

#get_profile_async(resource_group_name, gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 1098

def get_profile_async(resource_group_name, gateway_name, custom_headers = nil)
  # Send request
  promise = begin_get_profile_async(resource_group_name, gateway_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = GatewayProfile.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#get_with_http_info(resource_group_name, gateway_name, expand = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Returns a gateway

identifies the resource group within the user subscriptionId. uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Possible values include: ‘status’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum)

  • expand (GatewayExpandOption) (defaults to: nil)

    Gets subscription credentials which

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



526
527
528
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 526

def get_with_http_info(resource_group_name, gateway_name, expand = nil, custom_headers = nil)
  get_async(resource_group_name, gateway_name, expand, custom_headers).value!
end

#list(custom_headers = nil) ⇒ Array<GatewayResource>

Returns gateways in a subscription

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



627
628
629
630
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 627

def list(custom_headers = nil)
  first_page = list_as_lazy(custom_headers)
  first_page.get_all_items
end

#list_as_lazy(custom_headers = nil) ⇒ GatewayResources

Returns gateways in a subscription

will be added to the HTTP request.

response.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



608
609
610
611
612
613
614
615
616
617
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 608

def list_as_lazy(custom_headers = nil)
  response = list_async(custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      list_next_async(next_link, custom_headers)
    end
    page
  end
end

#list_async(custom_headers = nil) ⇒ Concurrent::Promise

Returns gateways in a subscription

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 652

def list_async(custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.ServerManagement/gateways'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = GatewayResources.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_for_resource_group(resource_group_name, custom_headers = nil) ⇒ Array<GatewayResource>

Returns gateways in a resource group

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



737
738
739
740
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 737

def list_for_resource_group(resource_group_name, custom_headers = nil)
  first_page = list_for_resource_group_as_lazy(resource_group_name, custom_headers)
  first_page.get_all_items
end

#list_for_resource_group_as_lazy(resource_group_name, custom_headers = nil) ⇒ GatewayResources

Returns gateways in a resource group

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



716
717
718
719
720
721
722
723
724
725
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 716

def list_for_resource_group_as_lazy(resource_group_name, custom_headers = nil)
  response = list_for_resource_group_async(resource_group_name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      list_for_resource_group_next_async(next_link, custom_headers)
    end
    page
  end
end

#list_for_resource_group_async(resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Returns gateways in a resource group

identifies the resource group within the user subscriptionId. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 766

def list_for_resource_group_async(resource_group_name, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = GatewayResources.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_for_resource_group_next(next_page_link, custom_headers = nil) ⇒ GatewayResources

Returns gateways in a resource group

call to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



1313
1314
1315
1316
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 1313

def list_for_resource_group_next(next_page_link, custom_headers = nil)
  response = list_for_resource_group_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#list_for_resource_group_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Returns gateways in a resource group

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 1342

def list_for_resource_group_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = GatewayResources.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_for_resource_group_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Returns gateways in a resource group

call to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1328
1329
1330
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 1328

def list_for_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
  list_for_resource_group_next_async(next_page_link, custom_headers).value!
end

#list_for_resource_group_with_http_info(resource_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Returns gateways in a resource group

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



752
753
754
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 752

def list_for_resource_group_with_http_info(resource_group_name, custom_headers = nil)
  list_for_resource_group_async(resource_group_name, custom_headers).value!
end

#list_next(next_page_link, custom_headers = nil) ⇒ GatewayResources

Returns gateways in a subscription

call to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



1223
1224
1225
1226
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 1223

def list_next(next_page_link, custom_headers = nil)
  response = list_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#list_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Returns gateways in a subscription

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 1252

def list_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = GatewayResources.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Returns gateways in a subscription

call to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1238
1239
1240
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 1238

def list_next_with_http_info(next_page_link, custom_headers = nil)
  list_next_async(next_page_link, custom_headers).value!
end

#list_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Returns gateways in a subscription

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



640
641
642
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 640

def list_with_http_info(custom_headers = nil)
  list_async(custom_headers).value!
end

#regenerate_profile(resource_group_name, gateway_name, custom_headers = nil) ⇒ Object

Regenerate a gateway’s profile

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



955
956
957
958
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 955

def regenerate_profile(resource_group_name, gateway_name, custom_headers = nil)
  response = regenerate_profile_async(resource_group_name, gateway_name, custom_headers).value!
  nil
end

#regenerate_profile_async(resource_group_name, gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 970

def regenerate_profile_async(resource_group_name, gateway_name, custom_headers = nil)
  # Send request
  promise = begin_regenerate_profile_async(resource_group_name, gateway_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#update(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil) ⇒ GatewayResource

Updates a gateway belonging to a resource group.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume autoUpgrade = Off. Possible values include: ‘On’, ‘Off’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    location of the resource

  • tags (defaults to: nil)

    resource tags

  • auto_upgrade (AutoUpgrade) (defaults to: nil)

    The autoUpgrade property gives the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



238
239
240
241
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 238

def update(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
  response = update_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil) ⇒ Concurrent::Promise

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume autoUpgrade = Off. Possible values include: ‘On’, ‘Off’ will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    location of the resource

  • tags (defaults to: nil)

    resource tags

  • auto_upgrade (AutoUpgrade) (defaults to: nil)

    The autoUpgrade property gives the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 259

def update_async(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
  # Send request
  promise = begin_update_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = GatewayResource.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#upgrade(resource_group_name, gateway_name, custom_headers = nil) ⇒ Object

Upgrade a gateway

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



829
830
831
832
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 829

def upgrade(resource_group_name, gateway_name, custom_headers = nil)
  response = upgrade_async(resource_group_name, gateway_name, custom_headers).value!
  nil
end

#upgrade_async(resource_group_name, gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
# File 'lib/generated/azure_mgmt_server_management/gateway.rb', line 844

def upgrade_async(resource_group_name, gateway_name, custom_headers = nil)
  # Send request
  promise = begin_upgrade_async(resource_group_name, gateway_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end