Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR hanaonazure/resource-manager] Fixing the parameters because they should not be readonly #4862

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,30 @@
class MonitoringDetails(Model):
"""Details needed to monitor a Hana Instance.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar hana_vnet: ARM ID of an Azure Vnet with access to the HANA instance.
:vartype hana_vnet: str
:ivar hana_hostname: Hostname of the HANA Instance blade.
:vartype hana_hostname: str
:ivar hana_instance_num: A number between 00 and 99, stored as a string to
maintain leading zero.
:vartype hana_instance_num: str
:ivar db_container: Either single or multiple depending on the use of
:param hana_vnet: ARM ID of an Azure Vnet with access to the HANA
instance.
:type hana_vnet: str
:param hana_hostname: Hostname of the HANA Instance blade.
:type hana_hostname: str
:param hana_instance_num: A number between 00 and 99, stored as a string
to maintain leading zero.
:type hana_instance_num: str
:param db_container: Either single or multiple depending on the use of
MDC(Multiple Database Containers). Possible values include: 'single',
'multiple'. Default value: "single" .
:vartype db_container: str or
:type db_container: str or
~azure.mgmt.hanaonazure.models.HanaDatabaseContainersEnum
:ivar hana_database: Name of the database itself. It only needs to be
:param hana_database: Name of the database itself. It only needs to be
specified if using MDC
:vartype hana_database: str
:ivar hana_db_username: Username for the HANA database to login to for
:type hana_database: str
:param hana_db_username: Username for the HANA database to login to for
monitoring
:vartype hana_db_username: str
:ivar hana_db_password: Password for the HANA database to login for
:type hana_db_username: str
:param hana_db_password: Password for the HANA database to login for
monitoring
:vartype hana_db_password: str
:type hana_db_password: str
"""

_validation = {
'hana_vnet': {'readonly': True},
'hana_hostname': {'readonly': True},
'hana_instance_num': {'readonly': True},
'db_container': {'readonly': True},
'hana_database': {'readonly': True},
'hana_db_username': {'readonly': True},
'hana_db_password': {'readonly': True},
}

_attribute_map = {
'hana_vnet': {'key': 'hanaVnet', 'type': 'str'},
'hana_hostname': {'key': 'hanaHostname', 'type': 'str'},
Expand All @@ -63,10 +51,10 @@ class MonitoringDetails(Model):

def __init__(self, **kwargs):
super(MonitoringDetails, self).__init__(**kwargs)
self.hana_vnet = None
self.hana_hostname = None
self.hana_instance_num = None
self.db_container = None
self.hana_database = None
self.hana_db_username = None
self.hana_db_password = None
self.hana_vnet = kwargs.get('hana_vnet', None)
self.hana_hostname = kwargs.get('hana_hostname', None)
self.hana_instance_num = kwargs.get('hana_instance_num', None)
self.db_container = kwargs.get('db_container', "single")
self.hana_database = kwargs.get('hana_database', None)
self.hana_db_username = kwargs.get('hana_db_username', None)
self.hana_db_password = kwargs.get('hana_db_password', None)
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,30 @@
class MonitoringDetails(Model):
"""Details needed to monitor a Hana Instance.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar hana_vnet: ARM ID of an Azure Vnet with access to the HANA instance.
:vartype hana_vnet: str
:ivar hana_hostname: Hostname of the HANA Instance blade.
:vartype hana_hostname: str
:ivar hana_instance_num: A number between 00 and 99, stored as a string to
maintain leading zero.
:vartype hana_instance_num: str
:ivar db_container: Either single or multiple depending on the use of
:param hana_vnet: ARM ID of an Azure Vnet with access to the HANA
instance.
:type hana_vnet: str
:param hana_hostname: Hostname of the HANA Instance blade.
:type hana_hostname: str
:param hana_instance_num: A number between 00 and 99, stored as a string
to maintain leading zero.
:type hana_instance_num: str
:param db_container: Either single or multiple depending on the use of
MDC(Multiple Database Containers). Possible values include: 'single',
'multiple'. Default value: "single" .
:vartype db_container: str or
:type db_container: str or
~azure.mgmt.hanaonazure.models.HanaDatabaseContainersEnum
:ivar hana_database: Name of the database itself. It only needs to be
:param hana_database: Name of the database itself. It only needs to be
specified if using MDC
:vartype hana_database: str
:ivar hana_db_username: Username for the HANA database to login to for
:type hana_database: str
:param hana_db_username: Username for the HANA database to login to for
monitoring
:vartype hana_db_username: str
:ivar hana_db_password: Password for the HANA database to login for
:type hana_db_username: str
:param hana_db_password: Password for the HANA database to login for
monitoring
:vartype hana_db_password: str
:type hana_db_password: str
"""

_validation = {
'hana_vnet': {'readonly': True},
'hana_hostname': {'readonly': True},
'hana_instance_num': {'readonly': True},
'db_container': {'readonly': True},
'hana_database': {'readonly': True},
'hana_db_username': {'readonly': True},
'hana_db_password': {'readonly': True},
}

_attribute_map = {
'hana_vnet': {'key': 'hanaVnet', 'type': 'str'},
'hana_hostname': {'key': 'hanaHostname', 'type': 'str'},
Expand All @@ -61,12 +49,12 @@ class MonitoringDetails(Model):
'hana_db_password': {'key': 'hanaDbPassword', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
def __init__(self, *, hana_vnet: str=None, hana_hostname: str=None, hana_instance_num: str=None, db_container="single", hana_database: str=None, hana_db_username: str=None, hana_db_password: str=None, **kwargs) -> None:
super(MonitoringDetails, self).__init__(**kwargs)
self.hana_vnet = None
self.hana_hostname = None
self.hana_instance_num = None
self.db_container = None
self.hana_database = None
self.hana_db_username = None
self.hana_db_password = None
self.hana_vnet = hana_vnet
self.hana_hostname = hana_hostname
self.hana_instance_num = hana_instance_num
self.db_container = db_container
self.hana_database = hana_database
self.hana_db_username = hana_db_username
self.hana_db_password = hana_db_password
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ def __init__(self, client, config, serializer, deserializer):


def _hana_instances_method_initial(
self, resource_group_name, hana_instance_name, custom_headers=None, raw=False, **operation_config):
monitoring_parameter = None

self, resource_group_name, hana_instance_name, monitoring_parameter, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = self.hana_instances_method.metadata['url']
path_format_arguments = {
Expand Down Expand Up @@ -84,13 +82,17 @@ def _hana_instances_method_initial(
return client_raw_response

def hana_instances_method(
self, resource_group_name, hana_instance_name, custom_headers=None, raw=False, polling=True, **operation_config):
self, resource_group_name, hana_instance_name, monitoring_parameter, custom_headers=None, raw=False, polling=True, **operation_config):
"""The operation to monitor 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 monitoring_parameter: Request body that only contains
monitoring attributes
:type monitoring_parameter:
~azure.mgmt.hanaonazure.models.MonitoringDetails
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
Expand All @@ -105,6 +107,7 @@ def hana_instances_method(
raw_result = self._hana_instances_method_initial(
resource_group_name=resource_group_name,
hana_instance_name=hana_instance_name,
monitoring_parameter=monitoring_parameter,
custom_headers=custom_headers,
raw=True,
**operation_config
Expand Down
3 changes: 2 additions & 1 deletion azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "0.5.0"
VERSION = "0.1.0"