Skip to content

Commit

Permalink
[AutoPR] hanaonazure/resource-manager (#3251)
Browse files Browse the repository at this point in the history
* Generated from d1446d423e320cce211206a2c7e4230223361674 (#3226)

Added HANA instance restart API

* Package 0.2.1
  • Loading branch information
AutorestCI authored and lmazuel committed Aug 31, 2018
1 parent e6d2abb commit 4a76ec8
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
7 changes: 7 additions & 0 deletions azure-mgmt-hanaonazure/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
Release History
===============

0.2.1 (2018-08-31)
++++++++++++++++++

**Features**

- Add restart operation

0.2.0 (2018-08-06)
++++++++++++++++++

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError

from .. import models

Expand Down Expand Up @@ -237,3 +238,56 @@ def get(

return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}'}

def restart(
self, resource_group_name, hana_instance_name, custom_headers=None, raw=False, **operation_config):
"""The operation to restart a SAP HANA instance.
:param resource_group_name: Name of the resource group.
:type resource_group_name: str
:param hana_instance_name: Name of the SAP HANA on Azure instance.
:type hana_instance_name: str
: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: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.restart.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'hanaInstanceName': self._serialize.url("hana_instance_name", hana_instance_name, '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')

# Construct headers
header_parameters = {}
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, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

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

if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}/restart'}
2 changes: 1 addition & 1 deletion azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "0.2.0"
VERSION = "0.2.1"

0 comments on commit 4a76ec8

Please sign in to comment.