Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[AutoPR] hanaonazure/resource-manager #3070

Merged
merged 2 commits into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions azure-mgmt-hanaonazure/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,43 @@
Release History
===============

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

**Features**

- Add power state to Hana instance
- Client class can be used as a context manager to keep the underlying HTTP session open for performance

**General Breaking changes**

This version uses a next-generation code generator that *might* introduce breaking changes.

- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments.
To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments.
- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered.
While this is not a breaking change, the distinctions are important, and are documented here:
https://docs.python.org/3/library/enum.html#others
At a glance:

- "is" should not be used at all.
- "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered.

- New Long Running Operation:

- Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same.
- Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used.
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`.
- New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`,
the response of the initial call will be returned without polling.
- `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`.
- `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away.

**Bugfixes**

- Compatibility of the sdist with wheel 0.31.0

0.1.1 (2018-05-17)
++++++++++++++++++

Expand Down
4 changes: 2 additions & 2 deletions azure-mgmt-hanaonazure/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the Microsoft Azure SAP Hana on Azure Management Client Library.
Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.
This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
Expand Down Expand Up @@ -37,7 +37,7 @@ Usage
=====

For code examples, see `SAP Hana on Azure Management
<https://docs.microsoft.com//python/azure/>`__
<https://docs.microsoft.com/python/api/overview/azure/hanaonazure>`__
on docs.microsoft.com.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import ServiceClient
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
Expand Down Expand Up @@ -52,7 +52,7 @@ def __init__(
self.subscription_id = subscription_id


class HanaManagementClient(object):
class HanaManagementClient(SDKClient):
"""HANA on Azure Client

:ivar config: Configuration for client.
Expand All @@ -77,7 +77,7 @@ def __init__(
self, credentials, subscription_id, base_url=None):

self.config = HanaManagementClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)
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'
Expand Down
37 changes: 26 additions & 11 deletions azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,36 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource import Resource
from .hardware_profile import HardwareProfile
from .disk import Disk
from .storage_profile import StorageProfile
from .os_profile import OSProfile
from .ip_address import IpAddress
from .network_profile import NetworkProfile
from .hana_instance import HanaInstance
from .display import Display
from .operation import Operation
from .error_response import ErrorResponse, ErrorResponseException
try:
from .resource_py3 import Resource
from .hardware_profile_py3 import HardwareProfile
from .disk_py3 import Disk
from .storage_profile_py3 import StorageProfile
from .os_profile_py3 import OSProfile
from .ip_address_py3 import IpAddress
from .network_profile_py3 import NetworkProfile
from .hana_instance_py3 import HanaInstance
from .display_py3 import Display
from .operation_py3 import Operation
from .error_response_py3 import ErrorResponse, ErrorResponseException
except (SyntaxError, ImportError):
from .resource import Resource
from .hardware_profile import HardwareProfile
from .disk import Disk
from .storage_profile import StorageProfile
from .os_profile import OSProfile
from .ip_address import IpAddress
from .network_profile import NetworkProfile
from .hana_instance import HanaInstance
from .display import Display
from .operation import Operation
from .error_response import ErrorResponse, ErrorResponseException
from .operation_paged import OperationPaged
from .hana_instance_paged import HanaInstancePaged
from .hana_management_client_enums import (
HanaHardwareTypeNamesEnum,
HanaInstanceSizeNamesEnum,
HanaInstancePowerStateEnum,
)

__all__ = [
Expand All @@ -43,4 +57,5 @@
'HanaInstancePaged',
'HanaHardwareTypeNamesEnum',
'HanaInstanceSizeNamesEnum',
'HanaInstancePowerStateEnum',
]
8 changes: 4 additions & 4 deletions azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class Disk(Model):
'lun': {'key': 'lun', 'type': 'int'},
}

def __init__(self, name=None, disk_size_gb=None):
super(Disk, self).__init__()
self.name = name
self.disk_size_gb = disk_size_gb
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
46 changes: 46 additions & 0 deletions azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/disk_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class 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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Display(Model):

:ivar provider: The localized friendly form of the resource provider name.
This form is also expected to include the publisher/company responsible.
Use Title Casing. Begin with Microsoft for 1st party services.
Use Title Casing. Begin with "Microsoft" for 1st party services.
:vartype provider: str
:ivar resource: The localized friendly form of the resource type related
to this action/operation. This form should match the public documentation
Expand Down Expand Up @@ -58,8 +58,8 @@ class Display(Model):
'origin': {'key': 'origin', 'type': 'str'},
}

def __init__(self):
super(Display, self).__init__()
def __init__(self, **kwargs):
super(Display, self).__init__(**kwargs)
self.provider = None
self.resource = None
self.operation = None
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class Display(Model):
"""Detailed HANA operation information.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar provider: The localized friendly form of the resource provider name.
This form is also expected to include the publisher/company responsible.
Use Title Casing. Begin with "Microsoft" for 1st party services.
:vartype provider: str
:ivar resource: The localized friendly form of the resource type related
to this action/operation. This form should match the public documentation
for the resource provider. Use Title Casing. For examples, refer to the
“name” section.
:vartype resource: str
:ivar operation: The localized friendly name for the operation as shown to
the user. This name should be concise (to fit in drop downs), but clear
(self-documenting). Use Title Casing and include the entity/resource to
which it applies.
:vartype operation: str
:ivar description: The localized friendly description for the operation as
shown to the user. This description should be thorough, yet concise. It
will be used in tool-tips and detailed views.
:vartype description: str
:ivar origin: The intended executor of the operation; governs the display
of the operation in the RBAC UX and the audit logs UX. Default value is
'user,system'
:vartype origin: str
"""

_validation = {
'provider': {'readonly': True},
'resource': {'readonly': True},
'operation': {'readonly': True},
'description': {'readonly': True},
'origin': {'readonly': True},
}

_attribute_map = {
'provider': {'key': 'provider', 'type': 'str'},
'resource': {'key': 'resource', 'type': 'str'},
'operation': {'key': 'operation', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
'origin': {'key': 'origin', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
super(Display, self).__init__(**kwargs)
self.provider = None
self.resource = None
self.operation = None
self.description = None
self.origin = None
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ class ErrorResponse(Model):
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, code=None, message=None):
super(ErrorResponse, self).__init__()
self.code = code
self.message = message
def __init__(self, **kwargs):
super(ErrorResponse, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.message = kwargs.get('message', None)


class ErrorResponseException(HttpOperationError):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model
from msrest.exceptions import HttpOperationError


class ErrorResponse(Model):
"""Describes the format of Error response.

:param code: Error code
:type code: str
:param message: Error message indicating why the operation failed.
:type message: str
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None:
super(ErrorResponse, self).__init__(**kwargs)
self.code = code
self.message = message


class ErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorResponse'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class HanaInstance(Resource):
: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
"""

_validation = {
Expand All @@ -51,6 +55,7 @@ class HanaInstance(Resource):
'location': {'readonly': True},
'tags': {'readonly': True},
'hana_instance_id': {'readonly': True},
'power_state': {'readonly': True},
}

_attribute_map = {
Expand All @@ -64,12 +69,14 @@ class HanaInstance(Resource):
'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'},
}

def __init__(self, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None):
super(HanaInstance, self).__init__()
self.hardware_profile = hardware_profile
self.storage_profile = storage_profile
self.os_profile = os_profile
self.network_profile = network_profile
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
Loading