Skip to content

Commit 4a62ff7

Browse files
AutorestCIlmazuel
authored andcommitted
[AutoPR] hanaonazure/resource-manager (#3070)
* [AutoPR hanaonazure/resource-manager] Added power state to Hana Instance (#3069) * Generated from 49201e1122012eafd505ebcf228a908f85c9146f Added power state to Hana Instance * Generated from b9bb485143557a4cd2d295adde6dcfdd74b741da moved power state under properties * Generated from cd61ee2c6bc8da6444de839e4c5715c815031587 added power state enum * Packaging
1 parent ab01fc1 commit 4a62ff7

32 files changed

+686
-69
lines changed

azure-mgmt-hanaonazure/HISTORY.rst

+37
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,43 @@
33
Release History
44
===============
55

6+
0.2.0 (2018-08-06)
7+
++++++++++++++++++
8+
9+
**Features**
10+
11+
- Add power state to Hana instance
12+
- Client class can be used as a context manager to keep the underlying HTTP session open for performance
13+
14+
**General Breaking changes**
15+
16+
This version uses a next-generation code generator that *might* introduce breaking changes.
17+
18+
- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments.
19+
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.
20+
- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered.
21+
While this is not a breaking change, the distinctions are important, and are documented here:
22+
https://docs.python.org/3/library/enum.html#others
23+
At a glance:
24+
25+
- "is" should not be used at all.
26+
- "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered.
27+
28+
- New Long Running Operation:
29+
30+
- Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same.
31+
- Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used.
32+
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
33+
without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`.
34+
- New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`,
35+
the response of the initial call will be returned without polling.
36+
- `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`.
37+
- `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away.
38+
39+
**Bugfixes**
40+
41+
- Compatibility of the sdist with wheel 0.31.0
42+
643
0.1.1 (2018-05-17)
744
++++++++++++++++++
845

azure-mgmt-hanaonazure/README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is the Microsoft Azure SAP Hana on Azure Management Client Library.
66
Azure Resource Manager (ARM) is the next generation of management APIs that
77
replace the old Azure Service Management (ASM).
88

9-
This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.
9+
This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.
1010

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

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

4343

azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/hana_management_client.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from msrest.service_client import ServiceClient
12+
from msrest.service_client import SDKClient
1313
from msrest import Serializer, Deserializer
1414
from msrestazure import AzureConfiguration
1515
from .version import VERSION
@@ -52,7 +52,7 @@ def __init__(
5252
self.subscription_id = subscription_id
5353

5454

55-
class HanaManagementClient(object):
55+
class HanaManagementClient(SDKClient):
5656
"""HANA on Azure Client
5757
5858
:ivar config: Configuration for client.
@@ -77,7 +77,7 @@ def __init__(
7777
self, credentials, subscription_id, base_url=None):
7878

7979
self.config = HanaManagementClientConfiguration(credentials, subscription_id, base_url)
80-
self._client = ServiceClient(self.config.credentials, self.config)
80+
super(HanaManagementClient, self).__init__(self.config.credentials, self.config)
8181

8282
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
8383
self.api_version = '2017-11-03-preview'

azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/__init__.py

+26-11
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,36 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from .resource import Resource
13-
from .hardware_profile import HardwareProfile
14-
from .disk import Disk
15-
from .storage_profile import StorageProfile
16-
from .os_profile import OSProfile
17-
from .ip_address import IpAddress
18-
from .network_profile import NetworkProfile
19-
from .hana_instance import HanaInstance
20-
from .display import Display
21-
from .operation import Operation
22-
from .error_response import ErrorResponse, ErrorResponseException
12+
try:
13+
from .resource_py3 import Resource
14+
from .hardware_profile_py3 import HardwareProfile
15+
from .disk_py3 import Disk
16+
from .storage_profile_py3 import StorageProfile
17+
from .os_profile_py3 import OSProfile
18+
from .ip_address_py3 import IpAddress
19+
from .network_profile_py3 import NetworkProfile
20+
from .hana_instance_py3 import HanaInstance
21+
from .display_py3 import Display
22+
from .operation_py3 import Operation
23+
from .error_response_py3 import ErrorResponse, ErrorResponseException
24+
except (SyntaxError, ImportError):
25+
from .resource import Resource
26+
from .hardware_profile import HardwareProfile
27+
from .disk import Disk
28+
from .storage_profile import StorageProfile
29+
from .os_profile import OSProfile
30+
from .ip_address import IpAddress
31+
from .network_profile import NetworkProfile
32+
from .hana_instance import HanaInstance
33+
from .display import Display
34+
from .operation import Operation
35+
from .error_response import ErrorResponse, ErrorResponseException
2336
from .operation_paged import OperationPaged
2437
from .hana_instance_paged import HanaInstancePaged
2538
from .hana_management_client_enums import (
2639
HanaHardwareTypeNamesEnum,
2740
HanaInstanceSizeNamesEnum,
41+
HanaInstancePowerStateEnum,
2842
)
2943

3044
__all__ = [
@@ -43,4 +57,5 @@
4357
'HanaInstancePaged',
4458
'HanaHardwareTypeNamesEnum',
4559
'HanaInstanceSizeNamesEnum',
60+
'HanaInstancePowerStateEnum',
4661
]

azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/disk.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class Disk(Model):
3939
'lun': {'key': 'lun', 'type': 'int'},
4040
}
4141

42-
def __init__(self, name=None, disk_size_gb=None):
43-
super(Disk, self).__init__()
44-
self.name = name
45-
self.disk_size_gb = disk_size_gb
42+
def __init__(self, **kwargs):
43+
super(Disk, self).__init__(**kwargs)
44+
self.name = kwargs.get('name', None)
45+
self.disk_size_gb = kwargs.get('disk_size_gb', None)
4646
self.lun = None
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class Disk(Model):
16+
"""Specifies the disk information fo the HANA instance.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
:param name: The disk name.
22+
:type name: str
23+
:param disk_size_gb: Specifies the size of an empty data disk in
24+
gigabytes.
25+
:type disk_size_gb: int
26+
:ivar lun: Specifies the logical unit number of the data disk. This value
27+
is used to identify data disks within the VM and therefore must be unique
28+
for each data disk attached to a VM.
29+
:vartype lun: int
30+
"""
31+
32+
_validation = {
33+
'lun': {'readonly': True},
34+
}
35+
36+
_attribute_map = {
37+
'name': {'key': 'name', 'type': 'str'},
38+
'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'},
39+
'lun': {'key': 'lun', 'type': 'int'},
40+
}
41+
42+
def __init__(self, *, name: str=None, disk_size_gb: int=None, **kwargs) -> None:
43+
super(Disk, self).__init__(**kwargs)
44+
self.name = name
45+
self.disk_size_gb = disk_size_gb
46+
self.lun = None

azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/display.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Display(Model):
2020
2121
:ivar provider: The localized friendly form of the resource provider name.
2222
This form is also expected to include the publisher/company responsible.
23-
Use Title Casing. Begin with Microsoft for 1st party services.
23+
Use Title Casing. Begin with "Microsoft" for 1st party services.
2424
:vartype provider: str
2525
:ivar resource: The localized friendly form of the resource type related
2626
to this action/operation. This form should match the public documentation
@@ -58,8 +58,8 @@ class Display(Model):
5858
'origin': {'key': 'origin', 'type': 'str'},
5959
}
6060

61-
def __init__(self):
62-
super(Display, self).__init__()
61+
def __init__(self, **kwargs):
62+
super(Display, self).__init__(**kwargs)
6363
self.provider = None
6464
self.resource = None
6565
self.operation = None
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class Display(Model):
16+
"""Detailed HANA operation information.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
:ivar provider: The localized friendly form of the resource provider name.
22+
This form is also expected to include the publisher/company responsible.
23+
Use Title Casing. Begin with "Microsoft" for 1st party services.
24+
:vartype provider: str
25+
:ivar resource: The localized friendly form of the resource type related
26+
to this action/operation. This form should match the public documentation
27+
for the resource provider. Use Title Casing. For examples, refer to the
28+
“name” section.
29+
:vartype resource: str
30+
:ivar operation: The localized friendly name for the operation as shown to
31+
the user. This name should be concise (to fit in drop downs), but clear
32+
(self-documenting). Use Title Casing and include the entity/resource to
33+
which it applies.
34+
:vartype operation: str
35+
:ivar description: The localized friendly description for the operation as
36+
shown to the user. This description should be thorough, yet concise. It
37+
will be used in tool-tips and detailed views.
38+
:vartype description: str
39+
:ivar origin: The intended executor of the operation; governs the display
40+
of the operation in the RBAC UX and the audit logs UX. Default value is
41+
'user,system'
42+
:vartype origin: str
43+
"""
44+
45+
_validation = {
46+
'provider': {'readonly': True},
47+
'resource': {'readonly': True},
48+
'operation': {'readonly': True},
49+
'description': {'readonly': True},
50+
'origin': {'readonly': True},
51+
}
52+
53+
_attribute_map = {
54+
'provider': {'key': 'provider', 'type': 'str'},
55+
'resource': {'key': 'resource', 'type': 'str'},
56+
'operation': {'key': 'operation', 'type': 'str'},
57+
'description': {'key': 'description', 'type': 'str'},
58+
'origin': {'key': 'origin', 'type': 'str'},
59+
}
60+
61+
def __init__(self, **kwargs) -> None:
62+
super(Display, self).__init__(**kwargs)
63+
self.provider = None
64+
self.resource = None
65+
self.operation = None
66+
self.description = None
67+
self.origin = None

azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/error_response.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ class ErrorResponse(Model):
2727
'message': {'key': 'message', 'type': 'str'},
2828
}
2929

30-
def __init__(self, code=None, message=None):
31-
super(ErrorResponse, self).__init__()
32-
self.code = code
33-
self.message = message
30+
def __init__(self, **kwargs):
31+
super(ErrorResponse, self).__init__(**kwargs)
32+
self.code = kwargs.get('code', None)
33+
self.message = kwargs.get('message', None)
3434

3535

3636
class ErrorResponseException(HttpOperationError):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
from msrest.exceptions import HttpOperationError
14+
15+
16+
class ErrorResponse(Model):
17+
"""Describes the format of Error response.
18+
19+
:param code: Error code
20+
:type code: str
21+
:param message: Error message indicating why the operation failed.
22+
:type message: str
23+
"""
24+
25+
_attribute_map = {
26+
'code': {'key': 'code', 'type': 'str'},
27+
'message': {'key': 'message', 'type': 'str'},
28+
}
29+
30+
def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None:
31+
super(ErrorResponse, self).__init__(**kwargs)
32+
self.code = code
33+
self.message = message
34+
35+
36+
class ErrorResponseException(HttpOperationError):
37+
"""Server responsed with exception of type: 'ErrorResponse'.
38+
39+
:param deserialize: A deserializer
40+
:param response: Server response to be deserialized.
41+
"""
42+
43+
def __init__(self, deserialize, response, *args):
44+
45+
super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)

azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ class HanaInstance(Resource):
4242
:type network_profile: ~azure.mgmt.hanaonazure.models.NetworkProfile
4343
:ivar hana_instance_id: Specifies the HANA instance unique ID.
4444
:vartype hana_instance_id: str
45+
:ivar power_state: Resource power state. Possible values include:
46+
'starting', 'started', 'stopping', 'stopped', 'restarting', 'unknown'
47+
:vartype power_state: str or
48+
~azure.mgmt.hanaonazure.models.HanaInstancePowerStateEnum
4549
"""
4650

4751
_validation = {
@@ -51,6 +55,7 @@ class HanaInstance(Resource):
5155
'location': {'readonly': True},
5256
'tags': {'readonly': True},
5357
'hana_instance_id': {'readonly': True},
58+
'power_state': {'readonly': True},
5459
}
5560

5661
_attribute_map = {
@@ -64,12 +69,14 @@ class HanaInstance(Resource):
6469
'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'},
6570
'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'},
6671
'hana_instance_id': {'key': 'properties.hanaInstanceId', 'type': 'str'},
72+
'power_state': {'key': 'properties.powerState', 'type': 'str'},
6773
}
6874

69-
def __init__(self, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None):
70-
super(HanaInstance, self).__init__()
71-
self.hardware_profile = hardware_profile
72-
self.storage_profile = storage_profile
73-
self.os_profile = os_profile
74-
self.network_profile = network_profile
75+
def __init__(self, **kwargs):
76+
super(HanaInstance, self).__init__(**kwargs)
77+
self.hardware_profile = kwargs.get('hardware_profile', None)
78+
self.storage_profile = kwargs.get('storage_profile', None)
79+
self.os_profile = kwargs.get('os_profile', None)
80+
self.network_profile = kwargs.get('network_profile', None)
7581
self.hana_instance_id = None
82+
self.power_state = None

0 commit comments

Comments
 (0)