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 14fb694a3d94..33792a244feb 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 @@ -43,6 +43,7 @@ HanaHardwareTypeNamesEnum, HanaInstanceSizeNamesEnum, HanaInstancePowerStateEnum, + HanaProvisioningStatesEnum, ) __all__ = [ @@ -64,4 +65,5 @@ 'HanaHardwareTypeNamesEnum', 'HanaInstanceSizeNamesEnum', 'HanaInstancePowerStateEnum', + 'HanaProvisioningStatesEnum', ] diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance.py index 9ea4b0bb5e78..e3c5da1865ed 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance.py @@ -50,6 +50,14 @@ class HanaInstance(Resource): :vartype proximity_placement_group: str :ivar hw_revision: Hardware revision of a HANA instance :vartype hw_revision: str + :ivar partner_node_id: ARM ID of another HanaInstance that will share a + network with this HanaInstance + :vartype 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 = { @@ -62,6 +70,8 @@ class HanaInstance(Resource): 'power_state': {'readonly': True}, 'proximity_placement_group': {'readonly': True}, 'hw_revision': {'readonly': True}, + 'partner_node_id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { @@ -78,6 +88,8 @@ class HanaInstance(Resource): '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): @@ -90,3 +102,5 @@ def __init__(self, **kwargs): self.power_state = None self.proximity_placement_group = None self.hw_revision = None + self.partner_node_id = None + self.provisioning_state = None diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance_py3.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance_py3.py index 6628a200b84f..9b83736a677e 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance_py3.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance_py3.py @@ -50,6 +50,14 @@ class HanaInstance(Resource): :vartype proximity_placement_group: str :ivar hw_revision: Hardware revision of a HANA instance :vartype hw_revision: str + :ivar partner_node_id: ARM ID of another HanaInstance that will share a + network with this HanaInstance + :vartype 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 = { @@ -62,6 +70,8 @@ class HanaInstance(Resource): 'power_state': {'readonly': True}, 'proximity_placement_group': {'readonly': True}, 'hw_revision': {'readonly': True}, + 'partner_node_id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { @@ -78,6 +88,8 @@ class HanaInstance(Resource): '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, *, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, **kwargs) -> None: @@ -90,3 +102,5 @@ def __init__(self, *, hardware_profile=None, storage_profile=None, os_profile=No self.power_state = None self.proximity_placement_group = None self.hw_revision = None + self.partner_node_id = None + self.provisioning_state = None 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 72ad74754619..4d4be41c28bd 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 @@ -53,3 +53,14 @@ class HanaInstancePowerStateEnum(str, Enum): stopped = "stopped" restarting = "restarting" unknown = "unknown" + + +class HanaProvisioningStatesEnum(str, Enum): + + accepted = "Accepted" + creating = "Creating" + updating = "Updating" + failed = "Failed" + succeeded = "Succeeded" + deleting = "Deleting" + migrating = "Migrating" diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile.py index 775aa4320575..6eb7cbb133cb 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile.py @@ -24,18 +24,23 @@ class OSProfile(Model): :vartype os_type: str :ivar version: Specifies version of operating system. :vartype version: str + :ivar ssh_public_key: Specifies the SSH public key used to access the + operating system. + :vartype ssh_public_key: str """ _validation = { 'computer_name': {'readonly': True}, 'os_type': {'readonly': True}, 'version': {'readonly': True}, + 'ssh_public_key': {'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'}, } def __init__(self, **kwargs): @@ -43,3 +48,4 @@ def __init__(self, **kwargs): self.computer_name = None self.os_type = None self.version = None + self.ssh_public_key = None diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile_py3.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile_py3.py index 17fbeff93e45..2da441229ff7 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile_py3.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile_py3.py @@ -24,18 +24,23 @@ class OSProfile(Model): :vartype os_type: str :ivar version: Specifies version of operating system. :vartype version: str + :ivar ssh_public_key: Specifies the SSH public key used to access the + operating system. + :vartype ssh_public_key: str """ _validation = { 'computer_name': {'readonly': True}, 'os_type': {'readonly': True}, 'version': {'readonly': True}, + 'ssh_public_key': {'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'}, } def __init__(self, **kwargs) -> None: @@ -43,3 +48,4 @@ def __init__(self, **kwargs) -> None: self.computer_name = None self.os_type = None self.version = None + self.ssh_public_key = None 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 index af7da1551f59..83ac00b821d7 100644 --- 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 @@ -241,6 +241,193 @@ def get( 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.