Skip to content

Commit

Permalink
[Compute] Adding new API for VMSS: ForceRecoveryServiceFabricPlatform…
Browse files Browse the repository at this point in the history
…UpdateDomainWalk (#1870)

* Generated from 02702702645f7e64ae63f4b6016bcc966f8513d9

Adding 6.1 tag to readme

* Generated from ef99ca24deaaecb3fdb6d1587617a98805cdd61b

Dropping 4th digit from version number for clarity

* Generated from c0dcfcd2e00ac0ac516d28ff343d1f1d40b3d45b

Update readme.md

* updating history to reflect new version

* azure-servicefabric 6.1.2.9

* Restapi auto areddish custom vision swagger (#1771)

* Generated from 0d4e675c639f9fe784946e2267223c132b266fcf

Add automatic Python conf for Custom Vision Prediction

* Generated from 049c2dd356adb296c9c28386207b66cd48781467

Add automatic Python conf to Custom Vision Training

* Generated from 599b21132b4678729ebe24ad4a60439fbf57047c

Fix Prediction Examples

* Generated from disks (#1835) - doc only

added image examples to 2017-12-01

* Restapi auto v sodsou content moderator v2 (#1861)

* Generated from b594737f845e43b28bd77878820b39f8543650d1

Revert version changes

* Generated from d18cc9d65430a8e1a1c3af522db42cbdbdcfe819

Missing Python version

* Generated from 9787c7c2b73d0b3ed91ba60d44acd9eb641c4277

Adding new API for VMSS: ForceRecoveryServiceFabricPlatformUpdateDomainWalk
  • Loading branch information
AutorestCI committed Feb 28, 2018
1 parent a6a90a4 commit 4faf50d
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
from .resource import Resource
from .update_resource import UpdateResource
from .sub_resource_read_only import SubResourceReadOnly
from .recovery_walk_response import RecoveryWalkResponse
from .operation_status_response import OperationStatusResponse
from .request_rate_by_interval_input import RequestRateByIntervalInput
from .throttled_requests_input import ThrottledRequestsInput
Expand Down Expand Up @@ -262,6 +263,7 @@
'Resource',
'UpdateResource',
'SubResourceReadOnly',
'RecoveryWalkResponse',
'OperationStatusResponse',
'RequestRateByIntervalInput',
'ThrottledRequestsInput',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class RecoveryWalkResponse(Model):
"""Response after calling a manual recovery walk.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar walk_performed: Whether the recovery walk was performed
:vartype walk_performed: bool
:ivar next_platform_update_domain: The next update domain that needs to be
walked. Null means walk spanning all update domains has been completed
:vartype next_platform_update_domain: int
"""

_validation = {
'walk_performed': {'readonly': True},
'next_platform_update_domain': {'readonly': True},
}

_attribute_map = {
'walk_performed': {'key': 'walkPerformed', 'type': 'bool'},
'next_platform_update_domain': {'key': 'nextPlatformUpdateDomain', 'type': 'int'},
}

def __init__(self):
super(RecoveryWalkResponse, self).__init__()
self.walk_performed = None
self.next_platform_update_domain = None
Original file line number Diff line number Diff line change
Expand Up @@ -1726,3 +1726,69 @@ def get_long_running_output(response):
return AzureOperationPoller(
long_running_send, get_long_running_output,
get_long_running_status, long_running_operation_timeout)

def force_recovery_service_fabric_platform_update_domain_walk(
self, resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers=None, raw=False, **operation_config):
"""Manual platform update domain walk to update virtual machines in a
service fabric virtual machine scale set.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param vm_scale_set_name: The name of the VM scale set.
:type vm_scale_set_name: str
:param platform_update_domain: The platform update domain for which a
manual recovery walk is requested
:type platform_update_domain: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: RecoveryWalkResponse or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.compute.v2017_12_01.models.RecoveryWalkResponse or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk'
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
query_parameters['platformUpdateDomain'] = self._serialize.query("platform_update_domain", platform_update_domain, 'int')

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('RecoveryWalkResponse', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized

0 comments on commit 4faf50d

Please sign in to comment.