Class: Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Rollouts

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb

Overview

REST APIs for orchestrating deployments using the Azure Deployment Manager (ADM). See docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-manager-overview for more information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Rollouts

Creates and initializes a new instance of the Rollouts class.

Parameters:

  • client

    service class for accessing basic functionality.



20
21
22
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 20

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientAzureDeploymentManager (readonly)

Returns reference to the AzureDeploymentManager.

Returns:



25
26
27
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 25

def client
  @client
end

Instance Method Details

#begin_create_or_update(resource_group_name, rollout_name, rollout_request: nil, custom_headers: nil) ⇒ RolloutRequest

Creates or updates a rollout.

This is an asynchronous operation and can be polled to completion using the location header returned by this operation.

is case insensitive. defines the rollout. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

  • rollout_request (RolloutRequest) (defaults to: nil)

    Source rollout request object that

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

    A hash of custom headers that

Returns:

  • (RolloutRequest)

    operation results.



519
520
521
522
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 519

def begin_create_or_update(resource_group_name, rollout_name, rollout_request:nil, custom_headers:nil)
  response = begin_create_or_update_async(resource_group_name, rollout_name, rollout_request:rollout_request, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_async(resource_group_name, rollout_name, rollout_request: nil, custom_headers: nil) ⇒ Concurrent::Promise

Creates or updates a rollout.

This is an asynchronous operation and can be polled to completion using the location header returned by this operation.

is case insensitive. defines the rollout. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

  • rollout_request (RolloutRequest) (defaults to: nil)

    Source rollout request object that

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 560

def begin_create_or_update_async(resource_group_name, rollout_name, rollout_request:nil, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'rollout_name is nil' if rollout_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  # Serialize Request
  request_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::RolloutRequest.mapper()
  request_content = @client.serialize(request_mapper,  rollout_request)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'rolloutName' => rollout_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::RolloutRequest.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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_or_update_with_http_info(resource_group_name, rollout_name, rollout_request: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates a rollout.

This is an asynchronous operation and can be polled to completion using the location header returned by this operation.

is case insensitive. defines the rollout. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

  • rollout_request (RolloutRequest) (defaults to: nil)

    Source rollout request object that

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



540
541
542
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 540

def begin_create_or_update_with_http_info(resource_group_name, rollout_name, rollout_request:nil, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, rollout_name, rollout_request:rollout_request, custom_headers:custom_headers).value!
end

#cancel(resource_group_name, rollout_name, custom_headers: nil) ⇒ Rollout

Stops a running rollout.

Only running rollouts can be canceled.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

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

    A hash of custom headers that

Returns:

  • (Rollout)

    operation results.



292
293
294
295
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 292

def cancel(resource_group_name, rollout_name, custom_headers:nil)
  response = cancel_async(resource_group_name, rollout_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#cancel_async(resource_group_name, rollout_name, custom_headers: nil) ⇒ Concurrent::Promise

Stops a running rollout.

Only running rollouts can be canceled.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



327
328
329
330
331
332
333
334
335
336
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
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 327

def cancel_async(resource_group_name, rollout_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'rollout_name is nil' if rollout_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # 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.DeploymentManager/rollouts/{rolloutName}/cancel'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'rolloutName' => rollout_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::Rollout.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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

#cancel_with_http_info(resource_group_name, rollout_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Stops a running rollout.

Only running rollouts can be canceled.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



310
311
312
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 310

def cancel_with_http_info(resource_group_name, rollout_name, custom_headers:nil)
  cancel_async(resource_group_name, rollout_name, custom_headers:custom_headers).value!
end

#create_or_update(resource_group_name, rollout_name, rollout_request: nil, custom_headers: nil) ⇒ RolloutRequest

Creates or updates a rollout.

This is an asynchronous operation and can be polled to completion using the location header returned by this operation.

is case insensitive. defines the rollout. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

  • rollout_request (RolloutRequest) (defaults to: nil)

    Source rollout request object that

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

    A hash of custom headers that

Returns:

  • (RolloutRequest)

    operation results.



43
44
45
46
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 43

def create_or_update(resource_group_name, rollout_name, rollout_request:nil, custom_headers:nil)
  response = create_or_update_async(resource_group_name, rollout_name, rollout_request:rollout_request, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, rollout_name, rollout_request: nil, custom_headers: nil) ⇒ Concurrent::Promise

is case insensitive. defines the rollout. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

  • rollout_request (RolloutRequest) (defaults to: nil)

    Source rollout request object that

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 60

def create_or_update_async(resource_group_name, rollout_name, rollout_request:nil, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, rollout_name, rollout_request:rollout_request, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::RolloutRequest.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

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

  promise
end

#delete(resource_group_name, rollout_name, custom_headers: nil) ⇒ Object

Deletes a rollout resource.

Only rollouts in terminal state can be deleted.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

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

    A hash of custom headers that



196
197
198
199
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 196

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

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

Deletes a rollout resource.

Only rollouts in terminal state can be deleted.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 231

def delete_async(resource_group_name, rollout_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'rollout_name is nil' if rollout_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # 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.DeploymentManager/rollouts/{rolloutName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'rolloutName' => rollout_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

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

Deletes a rollout resource.

Only rollouts in terminal state can be deleted.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



214
215
216
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 214

def delete_with_http_info(resource_group_name, rollout_name, custom_headers:nil)
  delete_async(resource_group_name, rollout_name, custom_headers:custom_headers).value!
end

#get(resource_group_name, rollout_name, retry_attempt: nil, custom_headers: nil) ⇒ Rollout

Gets detailed information of a rollout.

is case insensitive. result of. If not specified, result of the latest attempt will be returned. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

  • retry_attempt (Integer) (defaults to: nil)

    Rollout retry attempt ordinal to get the

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

    A hash of custom headers that

Returns:

  • (Rollout)

    operation results.



91
92
93
94
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 91

def get(resource_group_name, rollout_name, retry_attempt:nil, custom_headers:nil)
  response = get_async(resource_group_name, rollout_name, retry_attempt:retry_attempt, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, rollout_name, retry_attempt: nil, custom_headers: nil) ⇒ Concurrent::Promise

Gets detailed information of a rollout.

is case insensitive. result of. If not specified, result of the latest attempt will be returned. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

  • retry_attempt (Integer) (defaults to: nil)

    Rollout retry attempt ordinal to get the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
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
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 126

def get_async(resource_group_name, rollout_name, retry_attempt:nil, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'rollout_name is nil' if rollout_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # 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.DeploymentManager/rollouts/{rolloutName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'rolloutName' => rollout_name},
      query_params: {'api-version' => @client.api_version,'retryAttempt' => retry_attempt},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::Rollout.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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_with_http_info(resource_group_name, rollout_name, retry_attempt: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets detailed information of a rollout.

is case insensitive. result of. If not specified, result of the latest attempt will be returned. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

  • retry_attempt (Integer) (defaults to: nil)

    Rollout retry attempt ordinal to get the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



109
110
111
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 109

def get_with_http_info(resource_group_name, rollout_name, retry_attempt:nil, custom_headers:nil)
  get_async(resource_group_name, rollout_name, retry_attempt:retry_attempt, custom_headers:custom_headers).value!
end

#restart(resource_group_name, rollout_name, skip_succeeded: nil, custom_headers: nil) ⇒ Rollout

Restarts a failed rollout and optionally skips all succeeded steps.

Only failed rollouts can be restarted.

is case insensitive. in the rollout. If false, will execute the entire rollout again regardless of the current state of individual resources. Defaults to false if not specified. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

  • skip_succeeded (Boolean) (defaults to: nil)

    If true, will skip all succeeded steps so far

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

    A hash of custom headers that

Returns:

  • (Rollout)

    operation results.



402
403
404
405
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 402

def restart(resource_group_name, rollout_name, skip_succeeded:nil, custom_headers:nil)
  response = restart_async(resource_group_name, rollout_name, skip_succeeded:skip_succeeded, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#restart_async(resource_group_name, rollout_name, skip_succeeded: nil, custom_headers: nil) ⇒ Concurrent::Promise

Restarts a failed rollout and optionally skips all succeeded steps.

Only failed rollouts can be restarted.

is case insensitive. in the rollout. If false, will execute the entire rollout again regardless of the current state of individual resources. Defaults to false if not specified. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

  • skip_succeeded (Boolean) (defaults to: nil)

    If true, will skip all succeeded steps so far

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



445
446
447
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
492
493
494
495
496
497
498
499
500
501
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 445

def restart_async(resource_group_name, rollout_name, skip_succeeded:nil, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'rollout_name is nil' if rollout_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # 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.DeploymentManager/rollouts/{rolloutName}/restart'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'rolloutName' => rollout_name},
      query_params: {'skipSucceeded' => skip_succeeded,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DeploymentManager::Mgmt::V2018_09_01_preview::Models::Rollout.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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

#restart_with_http_info(resource_group_name, rollout_name, skip_succeeded: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Restarts a failed rollout and optionally skips all succeeded steps.

Only failed rollouts can be restarted.

is case insensitive. in the rollout. If false, will execute the entire rollout again regardless of the current state of individual resources. Defaults to false if not specified. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • rollout_name (String)

    The rollout name.

  • skip_succeeded (Boolean) (defaults to: nil)

    If true, will skip all succeeded steps so far

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



424
425
426
# File 'lib/2018-09-01-preview/generated/azure_mgmt_deployment_manager/rollouts.rb', line 424

def restart_with_http_info(resource_group_name, rollout_name, skip_succeeded:nil, custom_headers:nil)
  restart_async(resource_group_name, rollout_name, skip_succeeded:skip_succeeded, custom_headers:custom_headers).value!
end