From 72a895d077157b77b183805fab9358ecd50aa96c Mon Sep 17 00:00:00 2001 From: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> Date: Tue, 19 May 2020 09:27:16 +0800 Subject: [PATCH] release-for-hanaonazure-mgmt (#11441) --- .../azure-mgmt-hanaonazure/CHANGELOG.md | 23 + .../azure-mgmt-hanaonazure/README.md | 2 +- .../hanaonazure/_hana_management_client.py | 12 +- .../azure/mgmt/hanaonazure/models/__init__.py | 43 +- .../models/_hana_management_client_enums.py | 63 -- .../azure/mgmt/hanaonazure/models/_models.py | 463 +++-------- .../mgmt/hanaonazure/models/_models_py3.py | 475 +++-------- .../mgmt/hanaonazure/models/_paged_models.py | 16 +- .../mgmt/hanaonazure/operations/__init__.py | 4 +- .../operations/_hana_instances_operations.py | 738 ------------------ .../hanaonazure/operations/_operations.py | 4 +- .../_provider_instances_operations.py | 376 +++++++++ .../operations/_sap_monitors_operations.py | 6 +- .../azure/mgmt/hanaonazure/version.py | 2 +- .../azure-mgmt-hanaonazure/setup.py | 4 +- .../tests/test_azure_mgmt_hanaonazure.py | 42 +- 16 files changed, 707 insertions(+), 1566 deletions(-) delete mode 100644 sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_hana_instances_operations.py create mode 100644 sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_provider_instances_operations.py diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/CHANGELOG.md b/sdk/hanaonazure/azure-mgmt-hanaonazure/CHANGELOG.md index d1d9f3211aa1..291003e4e762 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/CHANGELOG.md +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/CHANGELOG.md @@ -1,5 +1,28 @@ # Release History +## 0.14.0 (2020-05-14) + +**Features** + + - Model SapMonitor has a new parameter sap_monitor_collector_version + - Model SapMonitor has a new parameter monitor_subnet + - Added operation group ProviderInstancesOperations + +**Breaking changes** + + - Model Resource no longer has parameter tags + - Model Resource no longer has parameter location + - Model SapMonitor no longer has parameter key_vault_id + - Model SapMonitor no longer has parameter hana_db_password_key_vault_url + - Model SapMonitor no longer has parameter hana_db_name + - Model SapMonitor no longer has parameter hana_db_credentials_msi_id + - Model SapMonitor no longer has parameter hana_hostname + - Model SapMonitor no longer has parameter hana_db_username + - Model SapMonitor no longer has parameter hana_db_password + - Model SapMonitor no longer has parameter hana_subnet + - Model SapMonitor no longer has parameter hana_db_sql_port + - Removed operation group HanaInstancesOperations + ## 0.13.0 (2020-02-13) **Features** diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/README.md b/sdk/hanaonazure/azure-mgmt-hanaonazure/README.md index 0520341083ff..768547abc09f 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/README.md +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/README.md @@ -2,7 +2,7 @@ This is the Microsoft Azure SAP Hana on Azure Management Client Library. This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. -For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/sdk) +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) # Usage diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_hana_management_client.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_hana_management_client.py index 14a418e6c608..f33f93a665be 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_hana_management_client.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_hana_management_client.py @@ -14,8 +14,8 @@ from ._configuration import HanaManagementClientConfiguration from .operations import Operations -from .operations import HanaInstancesOperations from .operations import SapMonitorsOperations +from .operations import ProviderInstancesOperations from . import models @@ -27,10 +27,10 @@ class HanaManagementClient(SDKClient): :ivar operations: Operations operations :vartype operations: azure.mgmt.hanaonazure.operations.Operations - :ivar hana_instances: HanaInstances operations - :vartype hana_instances: azure.mgmt.hanaonazure.operations.HanaInstancesOperations :ivar sap_monitors: SapMonitors operations :vartype sap_monitors: azure.mgmt.hanaonazure.operations.SapMonitorsOperations + :ivar provider_instances: ProviderInstances operations + :vartype provider_instances: azure.mgmt.hanaonazure.operations.ProviderInstancesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -49,13 +49,13 @@ def __init__( super(HanaManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2017-11-03-preview' + self.api_version = '2020-02-07-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) - self.hana_instances = HanaInstancesOperations( - self._client, self.config, self._serialize, self._deserialize) self.sap_monitors = SapMonitorsOperations( self._client, self.config, self._serialize, self._deserialize) + self.provider_instances = ProviderInstancesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/__init__.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/__init__.py index 2d5850e75153..edf9a1ac8042 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/__init__.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/__init__.py @@ -10,65 +10,44 @@ # -------------------------------------------------------------------------- try: - from ._models_py3 import Disk from ._models_py3 import Display from ._models_py3 import ErrorResponse, ErrorResponseException - from ._models_py3 import HanaInstance - from ._models_py3 import HardwareProfile - from ._models_py3 import IpAddress - from ._models_py3 import MonitoringDetails - from ._models_py3 import NetworkProfile from ._models_py3 import Operation - from ._models_py3 import OSProfile + from ._models_py3 import ProviderInstance + from ._models_py3 import ProxyResource from ._models_py3 import Resource from ._models_py3 import SapMonitor - from ._models_py3 import StorageProfile from ._models_py3 import Tags + from ._models_py3 import TrackedResource except (SyntaxError, ImportError): - from ._models import Disk from ._models import Display from ._models import ErrorResponse, ErrorResponseException - from ._models import HanaInstance - from ._models import HardwareProfile - from ._models import IpAddress - from ._models import MonitoringDetails - from ._models import NetworkProfile from ._models import Operation - from ._models import OSProfile + from ._models import ProviderInstance + from ._models import ProxyResource from ._models import Resource from ._models import SapMonitor - from ._models import StorageProfile from ._models import Tags -from ._paged_models import HanaInstancePaged + from ._models import TrackedResource from ._paged_models import OperationPaged +from ._paged_models import ProviderInstancePaged from ._paged_models import SapMonitorPaged from ._hana_management_client_enums import ( - HanaHardwareTypeNamesEnum, - HanaInstanceSizeNamesEnum, - HanaInstancePowerStateEnum, HanaProvisioningStatesEnum, ) __all__ = [ - 'Disk', 'Display', 'ErrorResponse', 'ErrorResponseException', - 'HanaInstance', - 'HardwareProfile', - 'IpAddress', - 'MonitoringDetails', - 'NetworkProfile', 'Operation', - 'OSProfile', + 'ProviderInstance', + 'ProxyResource', 'Resource', 'SapMonitor', - 'StorageProfile', 'Tags', + 'TrackedResource', 'OperationPaged', - 'HanaInstancePaged', 'SapMonitorPaged', - 'HanaHardwareTypeNamesEnum', - 'HanaInstanceSizeNamesEnum', - 'HanaInstancePowerStateEnum', + 'ProviderInstancePaged', 'HanaProvisioningStatesEnum', ] diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_hana_management_client_enums.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_hana_management_client_enums.py index 3dd378fc347e..1b1fb05524c9 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_hana_management_client_enums.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_hana_management_client_enums.py @@ -12,69 +12,6 @@ from enum import Enum -class HanaHardwareTypeNamesEnum(str, Enum): - - cisco_ucs = "Cisco_UCS" - hpe = "HPE" - - -class HanaInstanceSizeNamesEnum(str, Enum): - - s72m = "S72m" - s144m = "S144m" - s72 = "S72" - s144 = "S144" - s192 = "S192" - s192m = "S192m" - s192xm = "S192xm" - s96 = "S96" - s112 = "S112" - s224 = "S224" - s224m = "S224m" - s224om = "S224om" - s224oo = "S224oo" - s224oom = "S224oom" - s224ooo = "S224ooo" - s384 = "S384" - s384m = "S384m" - s384xm = "S384xm" - s384xxm = "S384xxm" - s448 = "S448" - s448m = "S448m" - s448om = "S448om" - s448oo = "S448oo" - s448oom = "S448oom" - s448ooo = "S448ooo" - s576m = "S576m" - s576xm = "S576xm" - s672 = "S672" - s672m = "S672m" - s672om = "S672om" - s672oo = "S672oo" - s672oom = "S672oom" - s672ooo = "S672ooo" - s768 = "S768" - s768m = "S768m" - s768xm = "S768xm" - s896 = "S896" - s896m = "S896m" - s896om = "S896om" - s896oo = "S896oo" - s896oom = "S896oom" - s896ooo = "S896ooo" - s960m = "S960m" - - -class HanaInstancePowerStateEnum(str, Enum): - - starting = "starting" - started = "started" - stopping = "stopping" - stopped = "stopped" - restarting = "restarting" - unknown = "unknown" - - class HanaProvisioningStatesEnum(str, Enum): accepted = "Accepted" diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_models.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_models.py index c9ada9c8225f..f707289710cf 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_models.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_models.py @@ -21,40 +21,6 @@ class CloudError(Model): } -class Disk(Model): - """Specifies the disk information fo the HANA instance. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param name: The disk name. - :type name: str - :param disk_size_gb: Specifies the size of an empty data disk in - gigabytes. - :type disk_size_gb: int - :ivar lun: Specifies the logical unit number of the data disk. This value - is used to identify data disks within the VM and therefore must be unique - for each data disk attached to a VM. - :vartype lun: int - """ - - _validation = { - 'lun': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(Disk, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.disk_size_gb = kwargs.get('disk_size_gb', None) - self.lun = None - - class Display(Model): """Detailed HANA operation information. @@ -142,364 +108,215 @@ def __init__(self, deserialize, response, *args): super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) -class Resource(Model): - """The resource model definition. +class Operation(Model): + """HANA operation information. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID - :vartype id: str - :ivar name: Resource name + :ivar name: The name of the operation being performed on this particular + object. This name should match the action name that appears in RBAC / the + event service. :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :ivar tags: Resource tags - :vartype tags: dict[str, str] + :param display: Displayed HANA operation information + :type display: ~azure.mgmt.hanaonazure.models.Display """ _validation = { - 'id': {'readonly': True}, 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'display': {'key': 'display', 'type': 'Display'}, } def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None + super(Operation, self).__init__(**kwargs) self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = None + self.display = kwargs.get('display', None) -class HanaInstance(Resource): - """HANA instance info on Azure (ARM properties and HANA properties). +class Resource(Model): + """The core properties of ARM resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} :vartype id: str - :ivar name: Resource name + :ivar name: The name of the resource :vartype name: str - :ivar type: Resource type + :ivar type: The type of the resource. Ex- + Microsoft.Network/trafficManagerProfiles. :vartype type: str - :param location: Resource location - :type location: str - :ivar tags: Resource tags - :vartype tags: dict[str, str] - :param hardware_profile: Specifies the hardware settings for the HANA - instance. - :type hardware_profile: ~azure.mgmt.hanaonazure.models.HardwareProfile - :param storage_profile: Specifies the storage settings for the HANA - instance disks. - :type storage_profile: ~azure.mgmt.hanaonazure.models.StorageProfile - :param os_profile: Specifies the operating system settings for the HANA - instance. - :type os_profile: ~azure.mgmt.hanaonazure.models.OSProfile - :param network_profile: Specifies the network settings for the HANA - instance. - :type network_profile: ~azure.mgmt.hanaonazure.models.NetworkProfile - :ivar hana_instance_id: Specifies the HANA instance unique ID. - :vartype hana_instance_id: str - :ivar power_state: Resource power state. Possible values include: - 'starting', 'started', 'stopping', 'stopped', 'restarting', 'unknown' - :vartype power_state: str or - ~azure.mgmt.hanaonazure.models.HanaInstancePowerStateEnum - :ivar proximity_placement_group: Resource proximity placement group - :vartype proximity_placement_group: str - :ivar hw_revision: Hardware revision of a HANA instance - :vartype hw_revision: str - :param partner_node_id: ARM ID of another HanaInstance that will share a - network with this HanaInstance - :type partner_node_id: str - :ivar provisioning_state: State of provisioning of the HanaInstance. - Possible values include: 'Accepted', 'Creating', 'Updating', 'Failed', - 'Succeeded', 'Deleting', 'Migrating' - :vartype provisioning_state: str or - ~azure.mgmt.hanaonazure.models.HanaProvisioningStatesEnum """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'hana_instance_id': {'readonly': True}, - 'power_state': {'readonly': True}, - 'proximity_placement_group': {'readonly': True}, - 'hw_revision': {'readonly': True}, - 'provisioning_state': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, - 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, - 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, - 'hana_instance_id': {'key': 'properties.hanaInstanceId', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'str'}, - 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'str'}, - 'hw_revision': {'key': 'properties.hwRevision', 'type': 'str'}, - 'partner_node_id': {'key': 'properties.partnerNodeId', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } def __init__(self, **kwargs): - super(HanaInstance, self).__init__(**kwargs) - self.hardware_profile = kwargs.get('hardware_profile', None) - self.storage_profile = kwargs.get('storage_profile', None) - self.os_profile = kwargs.get('os_profile', None) - self.network_profile = kwargs.get('network_profile', None) - self.hana_instance_id = None - self.power_state = None - self.proximity_placement_group = None - self.hw_revision = None - self.partner_node_id = kwargs.get('partner_node_id', None) - self.provisioning_state = None + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class HardwareProfile(Model): - """Specifies the hardware settings for the HANA instance. +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. Variables are only populated by the server, and will be ignored when sending a request. - :ivar hardware_type: Name of the hardware type (vendor and/or their - product name). Possible values include: 'Cisco_UCS', 'HPE' - :vartype hardware_type: str or - ~azure.mgmt.hanaonazure.models.HanaHardwareTypeNamesEnum - :ivar hana_instance_size: Specifies the HANA instance SKU. Possible values - include: 'S72m', 'S144m', 'S72', 'S144', 'S192', 'S192m', 'S192xm', 'S96', - 'S112', 'S224', 'S224m', 'S224om', 'S224oo', 'S224oom', 'S224ooo', 'S384', - 'S384m', 'S384xm', 'S384xxm', 'S448', 'S448m', 'S448om', 'S448oo', - 'S448oom', 'S448ooo', 'S576m', 'S576xm', 'S672', 'S672m', 'S672om', - 'S672oo', 'S672oom', 'S672ooo', 'S768', 'S768m', 'S768xm', 'S896', - 'S896m', 'S896om', 'S896oo', 'S896oom', 'S896ooo', 'S960m' - :vartype hana_instance_size: str or - ~azure.mgmt.hanaonazure.models.HanaInstanceSizeNamesEnum + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Network/trafficManagerProfiles. + :vartype type: str """ _validation = { - 'hardware_type': {'readonly': True}, - 'hana_instance_size': {'readonly': True}, - } - - _attribute_map = { - 'hardware_type': {'key': 'hardwareType', 'type': 'str'}, - 'hana_instance_size': {'key': 'hanaInstanceSize', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(HardwareProfile, self).__init__(**kwargs) - self.hardware_type = None - self.hana_instance_size = None - - -class IpAddress(Model): - """Specifies the IP address of the network interface. - - :param ip_address: Specifies the IP address of the network interface. - :type ip_address: str - """ - - _attribute_map = { - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } - def __init__(self, **kwargs): - super(IpAddress, self).__init__(**kwargs) - self.ip_address = kwargs.get('ip_address', None) - - -class MonitoringDetails(Model): - """Details needed to monitor a Hana Instance. - - :param hana_subnet: ARM ID of an Azure Subnet with access to the HANA - instance. - :type hana_subnet: str - :param hana_hostname: Hostname of the HANA Instance blade. - :type hana_hostname: str - :param hana_db_name: Name of the database itself. - :type hana_db_name: str - :param hana_db_sql_port: The port number of the tenant DB. Used to connect - to the DB. - :type hana_db_sql_port: int - :param hana_db_username: Username for the HANA database to login to for - monitoring - :type hana_db_username: str - :param hana_db_password: Password for the HANA database to login for - monitoring - :type hana_db_password: str - """ - _attribute_map = { - 'hana_subnet': {'key': 'hanaSubnet', 'type': 'str'}, - 'hana_hostname': {'key': 'hanaHostname', 'type': 'str'}, - 'hana_db_name': {'key': 'hanaDbName', 'type': 'str'}, - 'hana_db_sql_port': {'key': 'hanaDbSqlPort', 'type': 'int'}, - 'hana_db_username': {'key': 'hanaDbUsername', 'type': 'str'}, - 'hana_db_password': {'key': 'hanaDbPassword', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__(self, **kwargs): - super(MonitoringDetails, self).__init__(**kwargs) - self.hana_subnet = kwargs.get('hana_subnet', None) - self.hana_hostname = kwargs.get('hana_hostname', None) - self.hana_db_name = kwargs.get('hana_db_name', None) - self.hana_db_sql_port = kwargs.get('hana_db_sql_port', None) - self.hana_db_username = kwargs.get('hana_db_username', None) - self.hana_db_password = kwargs.get('hana_db_password', None) + super(ProxyResource, self).__init__(**kwargs) -class NetworkProfile(Model): - """Specifies the network settings for the HANA instance disks. +class ProviderInstance(ProxyResource): + """A provider instance associated with a SAP monitor. Variables are only populated by the server, and will be ignored when sending a request. - :param network_interfaces: Specifies the network interfaces for the HANA + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Network/trafficManagerProfiles. + :vartype type: str + :param provider_instance_type: The type of provider instance. + :type provider_instance_type: str + :param properties: A JSON string containing the properties of the provider instance. - :type network_interfaces: list[~azure.mgmt.hanaonazure.models.IpAddress] - :ivar circuit_id: Specifies the circuit id for connecting to express - route. - :vartype circuit_id: str + :type properties: str + :param metadata: A JSON string containing metadata of the provider + instance. + :type metadata: str + :ivar provisioning_state: State of provisioning of the provider instance. + Possible values include: 'Accepted', 'Creating', 'Updating', 'Failed', + 'Succeeded', 'Deleting', 'Migrating' + :vartype provisioning_state: str or + ~azure.mgmt.hanaonazure.models.HanaProvisioningStatesEnum """ _validation = { - 'circuit_id': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { - 'network_interfaces': {'key': 'networkInterfaces', 'type': '[IpAddress]'}, - 'circuit_id': {'key': 'circuitId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provider_instance_type': {'key': 'properties.type', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } def __init__(self, **kwargs): - super(NetworkProfile, self).__init__(**kwargs) - self.network_interfaces = kwargs.get('network_interfaces', None) - self.circuit_id = None + super(ProviderInstance, self).__init__(**kwargs) + self.provider_instance_type = kwargs.get('provider_instance_type', None) + self.properties = kwargs.get('properties', None) + self.metadata = kwargs.get('metadata', None) + self.provisioning_state = None -class Operation(Model): - """HANA operation information. +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The name of the operation being performed on this particular - object. This name should match the action name that appears in RBAC / the - event service. + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} + :vartype id: str + :ivar name: The name of the resource :vartype name: str - :param display: Displayed HANA operation information - :type display: ~azure.mgmt.hanaonazure.models.Display + :ivar type: The type of the resource. Ex- + Microsoft.Network/trafficManagerProfiles. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str """ _validation = { + 'id': {'readonly': True}, 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'Display'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = kwargs.get('display', None) - - -class OSProfile(Model): - """Specifies the operating system settings for the HANA instance. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param computer_name: Specifies the host OS name of the HANA instance. - :type computer_name: str - :ivar os_type: This property allows you to specify the type of the OS. - :vartype os_type: str - :ivar version: Specifies version of operating system. - :vartype version: str - :param ssh_public_key: Specifies the SSH public key used to access the - operating system. - :type ssh_public_key: str - """ - - _validation = { - 'os_type': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'computer_name': {'key': 'computerName', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'ssh_public_key': {'key': 'sshPublicKey', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, } def __init__(self, **kwargs): - super(OSProfile, self).__init__(**kwargs) - self.computer_name = kwargs.get('computer_name', None) - self.os_type = None - self.version = None - self.ssh_public_key = kwargs.get('ssh_public_key', None) + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) -class SapMonitor(Resource): +class SapMonitor(TrackedResource): """SAP monitor info on Azure (ARM properties and SAP monitor properties). Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} :vartype id: str - :ivar name: Resource name + :ivar name: The name of the resource :vartype name: str - :ivar type: Resource type + :ivar type: The type of the resource. Ex- + Microsoft.Network/trafficManagerProfiles. :vartype type: str - :param location: Resource location + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives :type location: str - :ivar tags: Resource tags - :vartype tags: dict[str, str] - :param hana_subnet: Specifies the SAP monitor unique ID. - :type hana_subnet: str - :param hana_hostname: Hostname of the HANA instance. - :type hana_hostname: str - :param hana_db_name: Database name of the HANA instance. - :type hana_db_name: str - :param hana_db_sql_port: Database port of the HANA instance. - :type hana_db_sql_port: int - :param hana_db_username: Database username of the HANA instance. - :type hana_db_username: str - :param hana_db_password: Database password of the HANA instance. - :type hana_db_password: str - :param hana_db_password_key_vault_url: KeyVault URL link to the password - for the HANA database. - :type hana_db_password_key_vault_url: str - :param hana_db_credentials_msi_id: MSI ID passed by customer which has - access to customer's KeyVault and to be assigned to the Collector VM. - :type hana_db_credentials_msi_id: str - :param key_vault_id: Key Vault ID containing customer's HANA credentials. - :type key_vault_id: str :ivar provisioning_state: State of provisioning of the HanaInstance. Possible values include: 'Accepted', 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' @@ -520,91 +337,55 @@ class SapMonitor(Resource): :param log_analytics_workspace_shared_key: The shared key of the log analytics workspace that is used for monitoring :type log_analytics_workspace_shared_key: str + :ivar sap_monitor_collector_version: The version of the payload running in + the Collector VM + :vartype sap_monitor_collector_version: str + :param monitor_subnet: The subnet which the SAP monitor will be deployed + in + :type monitor_subnet: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'tags': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'managed_resource_group_name': {'readonly': True}, + 'sap_monitor_collector_version': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'hana_subnet': {'key': 'properties.hanaSubnet', 'type': 'str'}, - 'hana_hostname': {'key': 'properties.hanaHostname', 'type': 'str'}, - 'hana_db_name': {'key': 'properties.hanaDbName', 'type': 'str'}, - 'hana_db_sql_port': {'key': 'properties.hanaDbSqlPort', 'type': 'int'}, - 'hana_db_username': {'key': 'properties.hanaDbUsername', 'type': 'str'}, - 'hana_db_password': {'key': 'properties.hanaDbPassword', 'type': 'str'}, - 'hana_db_password_key_vault_url': {'key': 'properties.hanaDbPasswordKeyVaultUrl', 'type': 'str'}, - 'hana_db_credentials_msi_id': {'key': 'properties.hanaDbCredentialsMsiId', 'type': 'str'}, - 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'managed_resource_group_name': {'key': 'properties.managedResourceGroupName', 'type': 'str'}, 'log_analytics_workspace_arm_id': {'key': 'properties.logAnalyticsWorkspaceArmId', 'type': 'str'}, 'enable_customer_analytics': {'key': 'properties.enableCustomerAnalytics', 'type': 'bool'}, 'log_analytics_workspace_id': {'key': 'properties.logAnalyticsWorkspaceId', 'type': 'str'}, 'log_analytics_workspace_shared_key': {'key': 'properties.logAnalyticsWorkspaceSharedKey', 'type': 'str'}, + 'sap_monitor_collector_version': {'key': 'properties.sapMonitorCollectorVersion', 'type': 'str'}, + 'monitor_subnet': {'key': 'properties.monitorSubnet', 'type': 'str'}, } def __init__(self, **kwargs): super(SapMonitor, self).__init__(**kwargs) - self.hana_subnet = kwargs.get('hana_subnet', None) - self.hana_hostname = kwargs.get('hana_hostname', None) - self.hana_db_name = kwargs.get('hana_db_name', None) - self.hana_db_sql_port = kwargs.get('hana_db_sql_port', None) - self.hana_db_username = kwargs.get('hana_db_username', None) - self.hana_db_password = kwargs.get('hana_db_password', None) - self.hana_db_password_key_vault_url = kwargs.get('hana_db_password_key_vault_url', None) - self.hana_db_credentials_msi_id = kwargs.get('hana_db_credentials_msi_id', None) - self.key_vault_id = kwargs.get('key_vault_id', None) self.provisioning_state = None self.managed_resource_group_name = None self.log_analytics_workspace_arm_id = kwargs.get('log_analytics_workspace_arm_id', None) self.enable_customer_analytics = kwargs.get('enable_customer_analytics', None) self.log_analytics_workspace_id = kwargs.get('log_analytics_workspace_id', None) self.log_analytics_workspace_shared_key = kwargs.get('log_analytics_workspace_shared_key', None) - - -class StorageProfile(Model): - """Specifies the storage settings for the HANA instance disks. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar nfs_ip_address: IP Address to connect to storage. - :vartype nfs_ip_address: str - :param os_disks: Specifies information about the operating system disk - used by the hana instance. - :type os_disks: list[~azure.mgmt.hanaonazure.models.Disk] - """ - - _validation = { - 'nfs_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'nfs_ip_address': {'key': 'nfsIpAddress', 'type': 'str'}, - 'os_disks': {'key': 'osDisks', 'type': '[Disk]'}, - } - - def __init__(self, **kwargs): - super(StorageProfile, self).__init__(**kwargs) - self.nfs_ip_address = None - self.os_disks = kwargs.get('os_disks', None) + self.sap_monitor_collector_version = None + self.monitor_subnet = kwargs.get('monitor_subnet', None) class Tags(Model): - """Tags field of the HANA instance. + """Tags field of the resource. - :param tags: Tags field of the HANA instance. + :param tags: Tags field of the resource. :type tags: dict[str, str] """ diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_models_py3.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_models_py3.py index 71c6f2d05e96..a69a56494bd2 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_models_py3.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_models_py3.py @@ -21,40 +21,6 @@ class CloudError(Model): } -class Disk(Model): - """Specifies the disk information fo the HANA instance. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param name: The disk name. - :type name: str - :param disk_size_gb: Specifies the size of an empty data disk in - gigabytes. - :type disk_size_gb: int - :ivar lun: Specifies the logical unit number of the data disk. This value - is used to identify data disks within the VM and therefore must be unique - for each data disk attached to a VM. - :vartype lun: int - """ - - _validation = { - 'lun': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - } - - def __init__(self, *, name: str=None, disk_size_gb: int=None, **kwargs) -> None: - super(Disk, self).__init__(**kwargs) - self.name = name - self.disk_size_gb = disk_size_gb - self.lun = None - - class Display(Model): """Detailed HANA operation information. @@ -142,364 +108,215 @@ def __init__(self, deserialize, response, *args): super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) -class Resource(Model): - """The resource model definition. +class Operation(Model): + """HANA operation information. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID - :vartype id: str - :ivar name: Resource name + :ivar name: The name of the operation being performed on this particular + object. This name should match the action name that appears in RBAC / the + event service. :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :ivar tags: Resource tags - :vartype tags: dict[str, str] + :param display: Displayed HANA operation information + :type display: ~azure.mgmt.hanaonazure.models.Display """ _validation = { - 'id': {'readonly': True}, 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'display': {'key': 'display', 'type': 'Display'}, } - def __init__(self, *, location: str=None, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) self.name = None - self.type = None - self.location = location - self.tags = None + self.display = display -class HanaInstance(Resource): - """HANA instance info on Azure (ARM properties and HANA properties). +class Resource(Model): + """The core properties of ARM resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} :vartype id: str - :ivar name: Resource name + :ivar name: The name of the resource :vartype name: str - :ivar type: Resource type + :ivar type: The type of the resource. Ex- + Microsoft.Network/trafficManagerProfiles. :vartype type: str - :param location: Resource location - :type location: str - :ivar tags: Resource tags - :vartype tags: dict[str, str] - :param hardware_profile: Specifies the hardware settings for the HANA - instance. - :type hardware_profile: ~azure.mgmt.hanaonazure.models.HardwareProfile - :param storage_profile: Specifies the storage settings for the HANA - instance disks. - :type storage_profile: ~azure.mgmt.hanaonazure.models.StorageProfile - :param os_profile: Specifies the operating system settings for the HANA - instance. - :type os_profile: ~azure.mgmt.hanaonazure.models.OSProfile - :param network_profile: Specifies the network settings for the HANA - instance. - :type network_profile: ~azure.mgmt.hanaonazure.models.NetworkProfile - :ivar hana_instance_id: Specifies the HANA instance unique ID. - :vartype hana_instance_id: str - :ivar power_state: Resource power state. Possible values include: - 'starting', 'started', 'stopping', 'stopped', 'restarting', 'unknown' - :vartype power_state: str or - ~azure.mgmt.hanaonazure.models.HanaInstancePowerStateEnum - :ivar proximity_placement_group: Resource proximity placement group - :vartype proximity_placement_group: str - :ivar hw_revision: Hardware revision of a HANA instance - :vartype hw_revision: str - :param partner_node_id: ARM ID of another HanaInstance that will share a - network with this HanaInstance - :type partner_node_id: str - :ivar provisioning_state: State of provisioning of the HanaInstance. - Possible values include: 'Accepted', 'Creating', 'Updating', 'Failed', - 'Succeeded', 'Deleting', 'Migrating' - :vartype provisioning_state: str or - ~azure.mgmt.hanaonazure.models.HanaProvisioningStatesEnum """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'hana_instance_id': {'readonly': True}, - 'power_state': {'readonly': True}, - 'proximity_placement_group': {'readonly': True}, - 'hw_revision': {'readonly': True}, - 'provisioning_state': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, - 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, - 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, - 'hana_instance_id': {'key': 'properties.hanaInstanceId', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'str'}, - 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'str'}, - 'hw_revision': {'key': 'properties.hwRevision', 'type': 'str'}, - 'partner_node_id': {'key': 'properties.partnerNodeId', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, location: str=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, partner_node_id: str=None, **kwargs) -> None: - super(HanaInstance, self).__init__(location=location, **kwargs) - self.hardware_profile = hardware_profile - self.storage_profile = storage_profile - self.os_profile = os_profile - self.network_profile = network_profile - self.hana_instance_id = None - self.power_state = None - self.proximity_placement_group = None - self.hw_revision = None - self.partner_node_id = partner_node_id - self.provisioning_state = None + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class HardwareProfile(Model): - """Specifies the hardware settings for the HANA instance. +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. Variables are only populated by the server, and will be ignored when sending a request. - :ivar hardware_type: Name of the hardware type (vendor and/or their - product name). Possible values include: 'Cisco_UCS', 'HPE' - :vartype hardware_type: str or - ~azure.mgmt.hanaonazure.models.HanaHardwareTypeNamesEnum - :ivar hana_instance_size: Specifies the HANA instance SKU. Possible values - include: 'S72m', 'S144m', 'S72', 'S144', 'S192', 'S192m', 'S192xm', 'S96', - 'S112', 'S224', 'S224m', 'S224om', 'S224oo', 'S224oom', 'S224ooo', 'S384', - 'S384m', 'S384xm', 'S384xxm', 'S448', 'S448m', 'S448om', 'S448oo', - 'S448oom', 'S448ooo', 'S576m', 'S576xm', 'S672', 'S672m', 'S672om', - 'S672oo', 'S672oom', 'S672ooo', 'S768', 'S768m', 'S768xm', 'S896', - 'S896m', 'S896om', 'S896oo', 'S896oom', 'S896ooo', 'S960m' - :vartype hana_instance_size: str or - ~azure.mgmt.hanaonazure.models.HanaInstanceSizeNamesEnum + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Network/trafficManagerProfiles. + :vartype type: str """ _validation = { - 'hardware_type': {'readonly': True}, - 'hana_instance_size': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { - 'hardware_type': {'key': 'hardwareType', 'type': 'str'}, - 'hana_instance_size': {'key': 'hanaInstanceSize', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__(self, **kwargs) -> None: - super(HardwareProfile, self).__init__(**kwargs) - self.hardware_type = None - self.hana_instance_size = None - - -class IpAddress(Model): - """Specifies the IP address of the network interface. - - :param ip_address: Specifies the IP address of the network interface. - :type ip_address: str - """ - - _attribute_map = { - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - } - - def __init__(self, *, ip_address: str=None, **kwargs) -> None: - super(IpAddress, self).__init__(**kwargs) - self.ip_address = ip_address - - -class MonitoringDetails(Model): - """Details needed to monitor a Hana Instance. + super(ProxyResource, self).__init__(**kwargs) - :param hana_subnet: ARM ID of an Azure Subnet with access to the HANA - instance. - :type hana_subnet: str - :param hana_hostname: Hostname of the HANA Instance blade. - :type hana_hostname: str - :param hana_db_name: Name of the database itself. - :type hana_db_name: str - :param hana_db_sql_port: The port number of the tenant DB. Used to connect - to the DB. - :type hana_db_sql_port: int - :param hana_db_username: Username for the HANA database to login to for - monitoring - :type hana_db_username: str - :param hana_db_password: Password for the HANA database to login for - monitoring - :type hana_db_password: str - """ - - _attribute_map = { - 'hana_subnet': {'key': 'hanaSubnet', 'type': 'str'}, - 'hana_hostname': {'key': 'hanaHostname', 'type': 'str'}, - 'hana_db_name': {'key': 'hanaDbName', 'type': 'str'}, - 'hana_db_sql_port': {'key': 'hanaDbSqlPort', 'type': 'int'}, - 'hana_db_username': {'key': 'hanaDbUsername', 'type': 'str'}, - 'hana_db_password': {'key': 'hanaDbPassword', 'type': 'str'}, - } - def __init__(self, *, hana_subnet: str=None, hana_hostname: str=None, hana_db_name: str=None, hana_db_sql_port: int=None, hana_db_username: str=None, hana_db_password: str=None, **kwargs) -> None: - super(MonitoringDetails, self).__init__(**kwargs) - self.hana_subnet = hana_subnet - self.hana_hostname = hana_hostname - self.hana_db_name = hana_db_name - self.hana_db_sql_port = hana_db_sql_port - self.hana_db_username = hana_db_username - self.hana_db_password = hana_db_password - - -class NetworkProfile(Model): - """Specifies the network settings for the HANA instance disks. +class ProviderInstance(ProxyResource): + """A provider instance associated with a SAP monitor. Variables are only populated by the server, and will be ignored when sending a request. - :param network_interfaces: Specifies the network interfaces for the HANA + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Network/trafficManagerProfiles. + :vartype type: str + :param provider_instance_type: The type of provider instance. + :type provider_instance_type: str + :param properties: A JSON string containing the properties of the provider instance. - :type network_interfaces: list[~azure.mgmt.hanaonazure.models.IpAddress] - :ivar circuit_id: Specifies the circuit id for connecting to express - route. - :vartype circuit_id: str + :type properties: str + :param metadata: A JSON string containing metadata of the provider + instance. + :type metadata: str + :ivar provisioning_state: State of provisioning of the provider instance. + Possible values include: 'Accepted', 'Creating', 'Updating', 'Failed', + 'Succeeded', 'Deleting', 'Migrating' + :vartype provisioning_state: str or + ~azure.mgmt.hanaonazure.models.HanaProvisioningStatesEnum """ _validation = { - 'circuit_id': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { - 'network_interfaces': {'key': 'networkInterfaces', 'type': '[IpAddress]'}, - 'circuit_id': {'key': 'circuitId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provider_instance_type': {'key': 'properties.type', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, network_interfaces=None, **kwargs) -> None: - super(NetworkProfile, self).__init__(**kwargs) - self.network_interfaces = network_interfaces - self.circuit_id = None + def __init__(self, *, provider_instance_type: str=None, properties: str=None, metadata: str=None, **kwargs) -> None: + super(ProviderInstance, self).__init__(**kwargs) + self.provider_instance_type = provider_instance_type + self.properties = properties + self.metadata = metadata + self.provisioning_state = None -class Operation(Model): - """HANA operation information. +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The name of the operation being performed on this particular - object. This name should match the action name that appears in RBAC / the - event service. + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} + :vartype id: str + :ivar name: The name of the resource :vartype name: str - :param display: Displayed HANA operation information - :type display: ~azure.mgmt.hanaonazure.models.Display + :ivar type: The type of the resource. Ex- + Microsoft.Network/trafficManagerProfiles. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str """ _validation = { + 'id': {'readonly': True}, 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'Display'}, - } - - def __init__(self, *, display=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = display - - -class OSProfile(Model): - """Specifies the operating system settings for the HANA instance. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param computer_name: Specifies the host OS name of the HANA instance. - :type computer_name: str - :ivar os_type: This property allows you to specify the type of the OS. - :vartype os_type: str - :ivar version: Specifies version of operating system. - :vartype version: str - :param ssh_public_key: Specifies the SSH public key used to access the - operating system. - :type ssh_public_key: str - """ - - _validation = { - 'os_type': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'computer_name': {'key': 'computerName', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'ssh_public_key': {'key': 'sshPublicKey', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, } - def __init__(self, *, computer_name: str=None, ssh_public_key: str=None, **kwargs) -> None: - super(OSProfile, self).__init__(**kwargs) - self.computer_name = computer_name - self.os_type = None - self.version = None - self.ssh_public_key = ssh_public_key + def __init__(self, *, tags=None, location: str=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location -class SapMonitor(Resource): +class SapMonitor(TrackedResource): """SAP monitor info on Azure (ARM properties and SAP monitor properties). Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} :vartype id: str - :ivar name: Resource name + :ivar name: The name of the resource :vartype name: str - :ivar type: Resource type + :ivar type: The type of the resource. Ex- + Microsoft.Network/trafficManagerProfiles. :vartype type: str - :param location: Resource location + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives :type location: str - :ivar tags: Resource tags - :vartype tags: dict[str, str] - :param hana_subnet: Specifies the SAP monitor unique ID. - :type hana_subnet: str - :param hana_hostname: Hostname of the HANA instance. - :type hana_hostname: str - :param hana_db_name: Database name of the HANA instance. - :type hana_db_name: str - :param hana_db_sql_port: Database port of the HANA instance. - :type hana_db_sql_port: int - :param hana_db_username: Database username of the HANA instance. - :type hana_db_username: str - :param hana_db_password: Database password of the HANA instance. - :type hana_db_password: str - :param hana_db_password_key_vault_url: KeyVault URL link to the password - for the HANA database. - :type hana_db_password_key_vault_url: str - :param hana_db_credentials_msi_id: MSI ID passed by customer which has - access to customer's KeyVault and to be assigned to the Collector VM. - :type hana_db_credentials_msi_id: str - :param key_vault_id: Key Vault ID containing customer's HANA credentials. - :type key_vault_id: str :ivar provisioning_state: State of provisioning of the HanaInstance. Possible values include: 'Accepted', 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' @@ -520,91 +337,55 @@ class SapMonitor(Resource): :param log_analytics_workspace_shared_key: The shared key of the log analytics workspace that is used for monitoring :type log_analytics_workspace_shared_key: str + :ivar sap_monitor_collector_version: The version of the payload running in + the Collector VM + :vartype sap_monitor_collector_version: str + :param monitor_subnet: The subnet which the SAP monitor will be deployed + in + :type monitor_subnet: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'tags': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'managed_resource_group_name': {'readonly': True}, + 'sap_monitor_collector_version': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'hana_subnet': {'key': 'properties.hanaSubnet', 'type': 'str'}, - 'hana_hostname': {'key': 'properties.hanaHostname', 'type': 'str'}, - 'hana_db_name': {'key': 'properties.hanaDbName', 'type': 'str'}, - 'hana_db_sql_port': {'key': 'properties.hanaDbSqlPort', 'type': 'int'}, - 'hana_db_username': {'key': 'properties.hanaDbUsername', 'type': 'str'}, - 'hana_db_password': {'key': 'properties.hanaDbPassword', 'type': 'str'}, - 'hana_db_password_key_vault_url': {'key': 'properties.hanaDbPasswordKeyVaultUrl', 'type': 'str'}, - 'hana_db_credentials_msi_id': {'key': 'properties.hanaDbCredentialsMsiId', 'type': 'str'}, - 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'managed_resource_group_name': {'key': 'properties.managedResourceGroupName', 'type': 'str'}, 'log_analytics_workspace_arm_id': {'key': 'properties.logAnalyticsWorkspaceArmId', 'type': 'str'}, 'enable_customer_analytics': {'key': 'properties.enableCustomerAnalytics', 'type': 'bool'}, 'log_analytics_workspace_id': {'key': 'properties.logAnalyticsWorkspaceId', 'type': 'str'}, 'log_analytics_workspace_shared_key': {'key': 'properties.logAnalyticsWorkspaceSharedKey', 'type': 'str'}, + 'sap_monitor_collector_version': {'key': 'properties.sapMonitorCollectorVersion', 'type': 'str'}, + 'monitor_subnet': {'key': 'properties.monitorSubnet', 'type': 'str'}, } - def __init__(self, *, location: str=None, hana_subnet: str=None, hana_hostname: str=None, hana_db_name: str=None, hana_db_sql_port: int=None, hana_db_username: str=None, hana_db_password: str=None, hana_db_password_key_vault_url: str=None, hana_db_credentials_msi_id: str=None, key_vault_id: str=None, log_analytics_workspace_arm_id: str=None, enable_customer_analytics: bool=None, log_analytics_workspace_id: str=None, log_analytics_workspace_shared_key: str=None, **kwargs) -> None: - super(SapMonitor, self).__init__(location=location, **kwargs) - self.hana_subnet = hana_subnet - self.hana_hostname = hana_hostname - self.hana_db_name = hana_db_name - self.hana_db_sql_port = hana_db_sql_port - self.hana_db_username = hana_db_username - self.hana_db_password = hana_db_password - self.hana_db_password_key_vault_url = hana_db_password_key_vault_url - self.hana_db_credentials_msi_id = hana_db_credentials_msi_id - self.key_vault_id = key_vault_id + def __init__(self, *, tags=None, location: str=None, log_analytics_workspace_arm_id: str=None, enable_customer_analytics: bool=None, log_analytics_workspace_id: str=None, log_analytics_workspace_shared_key: str=None, monitor_subnet: str=None, **kwargs) -> None: + super(SapMonitor, self).__init__(tags=tags, location=location, **kwargs) self.provisioning_state = None self.managed_resource_group_name = None self.log_analytics_workspace_arm_id = log_analytics_workspace_arm_id self.enable_customer_analytics = enable_customer_analytics self.log_analytics_workspace_id = log_analytics_workspace_id self.log_analytics_workspace_shared_key = log_analytics_workspace_shared_key - - -class StorageProfile(Model): - """Specifies the storage settings for the HANA instance disks. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar nfs_ip_address: IP Address to connect to storage. - :vartype nfs_ip_address: str - :param os_disks: Specifies information about the operating system disk - used by the hana instance. - :type os_disks: list[~azure.mgmt.hanaonazure.models.Disk] - """ - - _validation = { - 'nfs_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'nfs_ip_address': {'key': 'nfsIpAddress', 'type': 'str'}, - 'os_disks': {'key': 'osDisks', 'type': '[Disk]'}, - } - - def __init__(self, *, os_disks=None, **kwargs) -> None: - super(StorageProfile, self).__init__(**kwargs) - self.nfs_ip_address = None - self.os_disks = os_disks + self.sap_monitor_collector_version = None + self.monitor_subnet = monitor_subnet class Tags(Model): - """Tags field of the HANA instance. + """Tags field of the resource. - :param tags: Tags field of the HANA instance. + :param tags: Tags field of the resource. :type tags: dict[str, str] """ diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_paged_models.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_paged_models.py index 874542d2dcaf..3d6078986be8 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_paged_models.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_paged_models.py @@ -25,29 +25,29 @@ class OperationPaged(Paged): def __init__(self, *args, **kwargs): super(OperationPaged, self).__init__(*args, **kwargs) -class HanaInstancePaged(Paged): +class SapMonitorPaged(Paged): """ - A paging container for iterating over a list of :class:`HanaInstance ` object + A paging container for iterating over a list of :class:`SapMonitor ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[HanaInstance]'} + 'current_page': {'key': 'value', 'type': '[SapMonitor]'} } def __init__(self, *args, **kwargs): - super(HanaInstancePaged, self).__init__(*args, **kwargs) -class SapMonitorPaged(Paged): + super(SapMonitorPaged, self).__init__(*args, **kwargs) +class ProviderInstancePaged(Paged): """ - A paging container for iterating over a list of :class:`SapMonitor ` object + A paging container for iterating over a list of :class:`ProviderInstance ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SapMonitor]'} + 'current_page': {'key': 'value', 'type': '[ProviderInstance]'} } def __init__(self, *args, **kwargs): - super(SapMonitorPaged, self).__init__(*args, **kwargs) + super(ProviderInstancePaged, self).__init__(*args, **kwargs) diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/__init__.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/__init__.py index 03aed444efe9..729ae15a1600 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/__init__.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/__init__.py @@ -10,11 +10,11 @@ # -------------------------------------------------------------------------- from ._operations import Operations -from ._hana_instances_operations import HanaInstancesOperations from ._sap_monitors_operations import SapMonitorsOperations +from ._provider_instances_operations import ProviderInstancesOperations __all__ = [ 'Operations', - 'HanaInstancesOperations', 'SapMonitorsOperations', + 'ProviderInstancesOperations', ] diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_hana_instances_operations.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_hana_instances_operations.py deleted file mode 100644 index 2165693784cd..000000000000 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_hana_instances_operations.py +++ /dev/null @@ -1,738 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class HanaInstancesOperations(object): - """HanaInstancesOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2017-11-03-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-11-03-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets a list of SAP HANA instances in the specified subscription. - - Gets a list of SAP HANA instances in the specified subscription. The - operations returns various properties of each SAP HANA on Azure - instance. - - :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`. - :return: An iterator like instance of HanaInstance - :rtype: - ~azure.mgmt.hanaonazure.models.HanaInstancePaged[~azure.mgmt.hanaonazure.models.HanaInstance] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - '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') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.HanaInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HanaOnAzure/hanaInstances'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of SAP HANA instances in the specified subscription and the - resource group. - - Gets a list of SAP HANA instances in the specified subscription and the - resource group. The operations returns various properties of each SAP - HANA on Azure instance. - - :param resource_group_name: Name of the resource group. - :type resource_group_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`. - :return: An iterator like instance of HanaInstance - :rtype: - ~azure.mgmt.hanaonazure.models.HanaInstancePaged[~azure.mgmt.hanaonazure.models.HanaInstance] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.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') - } - 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') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.HanaInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances'} - - def get( - self, resource_group_name, hana_instance_name, custom_headers=None, raw=False, **operation_config): - """Gets properties of a SAP HANA instance. - - Gets properties of a SAP HANA instance for the specified subscription, - resource group, and instance name. - - :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`. - :return: HanaInstance or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.hanaonazure.models.HanaInstance or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.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 = {} - header_parameters['Accept'] = 'application/json' - 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.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('HanaInstance', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}'} - - - def _create_initial( - self, resource_group_name, hana_instance_name, hana_instance_parameter, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create.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 = {} - header_parameters['Accept'] = 'application/json' - 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 body - body_content = self._serialize.body(hana_instance_parameter, 'HanaInstance') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('HanaInstance', response) - if response.status_code == 201: - deserialized = self._deserialize('HanaInstance', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, hana_instance_name, hana_instance_parameter, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates a SAP HANA instance. - - Creates a SAP HANA instance for the specified subscription, resource - group, and instance name. - - :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 hana_instance_parameter: Request body representing a - HanaInstance - :type hana_instance_parameter: - ~azure.mgmt.hanaonazure.models.HanaInstance - :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 - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns HanaInstance or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hanaonazure.models.HanaInstance] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.hanaonazure.models.HanaInstance]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - hana_instance_name=hana_instance_name, - hana_instance_parameter=hana_instance_parameter, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('HanaInstance', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}'} - - - def _delete_initial( - self, resource_group_name, hana_instance_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.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.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, hana_instance_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes a SAP HANA instance. - - Deletes a SAP HANA instance with the specified subscription, resource - group, and instance name. - - :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: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - hana_instance_name=hana_instance_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}'} - - def update( - self, resource_group_name, hana_instance_name, tags=None, custom_headers=None, raw=False, **operation_config): - """Patches the Tags field of a SAP HANA instance. - - Patches the Tags field of a SAP HANA instance for the specified - subscription, resource group, and instance name. - - :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 tags: Tags field of the HANA instance. - :type tags: dict[str, 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`. - :return: HanaInstance or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.hanaonazure.models.HanaInstance or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - tags_parameter = models.Tags(tags=tags) - - # Construct URL - url = self.update.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 = {} - header_parameters['Accept'] = 'application/json' - 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 body - body_content = self._serialize.body(tags_parameter, 'Tags') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('HanaInstance', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}'} - - - def _restart_initial( - self, resource_group_name, hana_instance_name, custom_headers=None, raw=False, **operation_config): - # 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 [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def restart( - self, resource_group_name, hana_instance_name, custom_headers=None, raw=False, polling=True, **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: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._restart_initial( - resource_group_name=resource_group_name, - hana_instance_name=hana_instance_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}/restart'} - - - def _start_initial( - self, resource_group_name, hana_instance_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.start.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 [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def start( - self, resource_group_name, hana_instance_name, custom_headers=None, raw=False, polling=True, **operation_config): - """The operation to start 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: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._start_initial( - resource_group_name=resource_group_name, - hana_instance_name=hana_instance_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}/start'} - - - def _shutdown_initial( - self, resource_group_name, hana_instance_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.shutdown.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 [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def shutdown( - self, resource_group_name, hana_instance_name, custom_headers=None, raw=False, polling=True, **operation_config): - """The operation to shutdown 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: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._shutdown_initial( - resource_group_name=resource_group_name, - hana_instance_name=hana_instance_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - shutdown.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}/shutdown'} diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_operations.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_operations.py index 75c81a3d2b75..3bce38bb487c 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_operations.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_operations.py @@ -24,7 +24,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2017-11-03-preview". + :ivar api_version: Client API version. Constant value: "2020-02-07-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-11-03-preview" + self.api_version = "2020-02-07-preview" self.config = config diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_provider_instances_operations.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_provider_instances_operations.py new file mode 100644 index 000000000000..e1cdebe48280 --- /dev/null +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_provider_instances_operations.py @@ -0,0 +1,376 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ProviderInstancesOperations(object): + """ProviderInstancesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2020-02-07-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-02-07-preview" + + self.config = config + + def list( + self, resource_group_name, sap_monitor_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of provider instances in the specified SAP monitor. + + Gets a list of provider instances in the specified SAP monitor. The + operations returns various properties of each provider instances. + + :param resource_group_name: Name of the resource group. + :type resource_group_name: str + :param sap_monitor_name: Name of the SAP monitor resource. + :type sap_monitor_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`. + :return: An iterator like instance of ProviderInstance + :rtype: + ~azure.mgmt.hanaonazure.models.ProviderInstancePaged[~azure.mgmt.hanaonazure.models.ProviderInstance] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'sapMonitorName': self._serialize.url("sap_monitor_name", sap_monitor_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ProviderInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}/providerInstances'} + + def get( + self, resource_group_name, sap_monitor_name, provider_instance_name, custom_headers=None, raw=False, **operation_config): + """Gets properties of a provider instance. + + Gets properties of a provider instance for the specified subscription, + resource group, SapMonitor name, and resource name. + + :param resource_group_name: Name of the resource group. + :type resource_group_name: str + :param sap_monitor_name: Name of the SAP monitor resource. + :type sap_monitor_name: str + :param provider_instance_name: Name of the provider instance. + :type provider_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`. + :return: ProviderInstance or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hanaonazure.models.ProviderInstance or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.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'), + 'sapMonitorName': self._serialize.url("sap_monitor_name", sap_monitor_name, 'str'), + 'providerInstanceName': self._serialize.url("provider_instance_name", provider_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 = {} + header_parameters['Accept'] = 'application/json' + 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.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProviderInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}/providerInstances/{providerInstanceName}'} + + + def _create_initial( + self, resource_group_name, sap_monitor_name, provider_instance_name, provider_instance_parameter, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.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'), + 'sapMonitorName': self._serialize.url("sap_monitor_name", sap_monitor_name, 'str'), + 'providerInstanceName': self._serialize.url("provider_instance_name", provider_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 = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(provider_instance_parameter, 'ProviderInstance') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ProviderInstance', response) + if response.status_code == 201: + deserialized = self._deserialize('ProviderInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, sap_monitor_name, provider_instance_name, provider_instance_parameter, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a provider instance. + + Creates a provider instance for the specified subscription, resource + group, SapMonitor name, and resource name. + + :param resource_group_name: Name of the resource group. + :type resource_group_name: str + :param sap_monitor_name: Name of the SAP monitor resource. + :type sap_monitor_name: str + :param provider_instance_name: Name of the provider instance. + :type provider_instance_name: str + :param provider_instance_parameter: Request body representing a + provider instance + :type provider_instance_parameter: + ~azure.mgmt.hanaonazure.models.ProviderInstance + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ProviderInstance or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hanaonazure.models.ProviderInstance] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.hanaonazure.models.ProviderInstance]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + sap_monitor_name=sap_monitor_name, + provider_instance_name=provider_instance_name, + provider_instance_parameter=provider_instance_parameter, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ProviderInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}/providerInstances/{providerInstanceName}'} + + + def _delete_initial( + self, resource_group_name, sap_monitor_name, provider_instance_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.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'), + 'sapMonitorName': self._serialize.url("sap_monitor_name", sap_monitor_name, 'str'), + 'providerInstanceName': self._serialize.url("provider_instance_name", provider_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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, sap_monitor_name, provider_instance_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a provider instance. + + Deletes a provider instance for the specified subscription, resource + group, SapMonitor name, and resource name. + + :param resource_group_name: Name of the resource group. + :type resource_group_name: str + :param sap_monitor_name: Name of the SAP monitor resource. + :type sap_monitor_name: str + :param provider_instance_name: Name of the provider instance. + :type provider_instance_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + sap_monitor_name=sap_monitor_name, + provider_instance_name=provider_instance_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}/providerInstances/{providerInstanceName}'} diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_sap_monitors_operations.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_sap_monitors_operations.py index 9f7b87beddb9..08e1be3cf936 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_sap_monitors_operations.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_sap_monitors_operations.py @@ -26,7 +26,7 @@ class SapMonitorsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2017-11-03-preview". + :ivar api_version: Client API version. Constant value: "2020-02-07-preview". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-11-03-preview" + self.api_version = "2020-02-07-preview" self.config = config @@ -367,7 +367,7 @@ def update( :type resource_group_name: str :param sap_monitor_name: Name of the SAP monitor resource. :type sap_monitor_name: str - :param tags: Tags field of the HANA instance. + :param tags: Tags field of the resource. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/version.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/version.py index aeae719acfc3..eba31a2798cf 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/version.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.13.0" +VERSION = "0.14.0" diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/setup.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/setup.py index 8923708522e7..b0bd60a460e0 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/setup.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/tests/test_azure_mgmt_hanaonazure.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/tests/test_azure_mgmt_hanaonazure.py index d751a6d81f70..982d1f3d5626 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/tests/test_azure_mgmt_hanaonazure.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/tests/test_azure_mgmt_hanaonazure.py @@ -24,27 +24,27 @@ def setUp(self): def process(self, result): pass - def test_hanainstance_list(self): - hanainstances = list(self.hanaonazure_client.hana_instances.list()) - self.assertEqual(len(hanainstances), 3) - - @ResourceGroupPreparer() - def test_hanainstance_list_by_resource_group(self, resource_group): - - resource_group_name = resource_group.name - - hanainstances = list(self.hanaonazure_client.hana_instances.list_by_resource_group(resource_group_name)) - self.assertEqual(len(hanainstances), 3) - - @ResourceGroupPreparer() - def test_hanainstance_get(self, resource_group): - - resource_group_name = resource_group.name - resource_name = "testhanainstanceresourcename" - - hanainstance = self.hanaonazure_client.hana_instances.get(resource_group_name, resource_name) - self.assertEqual(hanainstance.name, resource_name) + #def test_hanainstance_list(self): + # hanainstances = list(self.hanaonazure_client.hana_instances.list()) + # self.assertEqual(len(hanainstances), 3) + # + #@ResourceGroupPreparer() + #def test_hanainstance_list_by_resource_group(self, resource_group): + # + # resource_group_name = resource_group.name + # + # hanainstances = list(self.hanaonazure_client.hana_instances.list_by_resource_group(resource_group_name)) + # self.assertEqual(len(hanainstances), 3) + + #@ResourceGroupPreparer() + #def test_hanainstance_get(self, resource_group): + + # resource_group_name = resource_group.name + # resource_name = "testhanainstanceresourcename" + + # hanainstance = self.hanaonazure_client.hana_instances.get(resource_group_name, resource_name) + # self.assertEqual(hanainstance.name, resource_name) #------------------------------------------------------------------------------ if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main()