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] eventhub/resource-manager #2051

Merged
merged 8 commits into from
May 5, 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
39 changes: 39 additions & 0 deletions azure-mgmt-eventhub/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,45 @@
Release History
===============

2.0.0 (2018-05-04)
++++++++++++++++++

**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.

**Features**

- Client class can be used as a context manager to keep the underlying HTTP session open for performance
- Add region operations group
- Add skip/top to relevant operations
- Add get_messaging_plan operation

**Bugfixes**

- Compatibility of the sdist with wheel 0.31.0

1.2.0 (2017-12-12)
++++++++++++++++++

Expand Down
4 changes: 2 additions & 2 deletions azure-mgmt-eventhub/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ Usage
=====

For code examples, see `EventHub Management
<https://azure-sdk-for-python.readthedocs.org/en/latest/sample_azure-mgmt-eventhub.html>`__
on readthedocs.org.
<https://docs.microsoft.com/python/api/overview/azure/event-hub>`__
on docs.microsoft.com.


Provide Feedback
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 All @@ -18,6 +18,7 @@
from .operations.disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations
from .operations.event_hubs_operations import EventHubsOperations
from .operations.consumer_groups_operations import ConsumerGroupsOperations
from .operations.regions_operations import RegionsOperations
from . import models


Expand Down Expand Up @@ -55,7 +56,7 @@ def __init__(
self.subscription_id = subscription_id


class EventHubManagementClient(object):
class EventHubManagementClient(SDKClient):
"""Azure Event Hubs client

:ivar config: Configuration for client.
Expand All @@ -71,6 +72,8 @@ class EventHubManagementClient(object):
:vartype event_hubs: azure.mgmt.eventhub.operations.EventHubsOperations
:ivar consumer_groups: ConsumerGroups operations
:vartype consumer_groups: azure.mgmt.eventhub.operations.ConsumerGroupsOperations
:ivar regions: Regions operations
:vartype regions: azure.mgmt.eventhub.operations.RegionsOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
Expand All @@ -86,7 +89,7 @@ def __init__(
self, credentials, subscription_id, base_url=None):

self.config = EventHubManagementClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)
super(EventHubManagementClient, 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-04-01'
Expand All @@ -103,3 +106,5 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.consumer_groups = ConsumerGroupsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.regions = RegionsOperations(
self._client, self.config, self._serialize, self._deserialize)
64 changes: 47 additions & 17 deletions azure-mgmt-eventhub/azure/mgmt/eventhub/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,55 @@
# regenerated.
# --------------------------------------------------------------------------

from .tracked_resource import TrackedResource
from .resource import Resource
from .sku import Sku
from .eh_namespace import EHNamespace
from .authorization_rule import AuthorizationRule
from .access_keys import AccessKeys
from .regenerate_access_key_parameters import RegenerateAccessKeyParameters
from .destination import Destination
from .capture_description import CaptureDescription
from .eventhub import Eventhub
from .consumer_group import ConsumerGroup
from .check_name_availability_parameter import CheckNameAvailabilityParameter
from .check_name_availability_result import CheckNameAvailabilityResult
from .operation_display import OperationDisplay
from .operation import Operation
from .error_response import ErrorResponse, ErrorResponseException
from .arm_disaster_recovery import ArmDisasterRecovery
try:
from .tracked_resource_py3 import TrackedResource
from .resource_py3 import Resource
from .sku_py3 import Sku
from .eh_namespace_py3 import EHNamespace
from .authorization_rule_py3 import AuthorizationRule
from .access_keys_py3 import AccessKeys
from .regenerate_access_key_parameters_py3 import RegenerateAccessKeyParameters
from .destination_py3 import Destination
from .capture_description_py3 import CaptureDescription
from .eventhub_py3 import Eventhub
from .consumer_group_py3 import ConsumerGroup
from .check_name_availability_parameter_py3 import CheckNameAvailabilityParameter
from .check_name_availability_result_py3 import CheckNameAvailabilityResult
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .error_response_py3 import ErrorResponse, ErrorResponseException
from .arm_disaster_recovery_py3 import ArmDisasterRecovery
from .messaging_regions_properties_py3 import MessagingRegionsProperties
from .messaging_regions_py3 import MessagingRegions
from .messaging_plan_py3 import MessagingPlan
except (SyntaxError, ImportError):
from .tracked_resource import TrackedResource
from .resource import Resource
from .sku import Sku
from .eh_namespace import EHNamespace
from .authorization_rule import AuthorizationRule
from .access_keys import AccessKeys
from .regenerate_access_key_parameters import RegenerateAccessKeyParameters
from .destination import Destination
from .capture_description import CaptureDescription
from .eventhub import Eventhub
from .consumer_group import ConsumerGroup
from .check_name_availability_parameter import CheckNameAvailabilityParameter
from .check_name_availability_result import CheckNameAvailabilityResult
from .operation_display import OperationDisplay
from .operation import Operation
from .error_response import ErrorResponse, ErrorResponseException
from .arm_disaster_recovery import ArmDisasterRecovery
from .messaging_regions_properties import MessagingRegionsProperties
from .messaging_regions import MessagingRegions
from .messaging_plan import MessagingPlan
from .operation_paged import OperationPaged
from .eh_namespace_paged import EHNamespacePaged
from .authorization_rule_paged import AuthorizationRulePaged
from .arm_disaster_recovery_paged import ArmDisasterRecoveryPaged
from .eventhub_paged import EventhubPaged
from .consumer_group_paged import ConsumerGroupPaged
from .messaging_regions_paged import MessagingRegionsPaged
from .event_hub_management_client_enums import (
SkuName,
SkuTier,
Expand Down Expand Up @@ -62,12 +88,16 @@
'Operation',
'ErrorResponse', 'ErrorResponseException',
'ArmDisasterRecovery',
'MessagingRegionsProperties',
'MessagingRegions',
'MessagingPlan',
'OperationPaged',
'EHNamespacePaged',
'AuthorizationRulePaged',
'ArmDisasterRecoveryPaged',
'EventhubPaged',
'ConsumerGroupPaged',
'MessagingRegionsPaged',
'SkuName',
'SkuTier',
'AccessRights',
Expand Down
4 changes: 2 additions & 2 deletions azure-mgmt-eventhub/azure/mgmt/eventhub/models/access_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class AccessKeys(Model):
'key_name': {'key': 'keyName', 'type': 'str'},
}

def __init__(self):
super(AccessKeys, self).__init__()
def __init__(self, **kwargs):
super(AccessKeys, self).__init__(**kwargs)
self.primary_connection_string = None
self.secondary_connection_string = None
self.alias_primary_connection_string = None
Expand Down
71 changes: 71 additions & 0 deletions azure-mgmt-eventhub/azure/mgmt/eventhub/models/access_keys_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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 AccessKeys(Model):
"""Namespace/EventHub Connection String.

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

:ivar primary_connection_string: Primary connection string of the created
namespace AuthorizationRule.
:vartype primary_connection_string: str
:ivar secondary_connection_string: Secondary connection string of the
created namespace AuthorizationRule.
:vartype secondary_connection_string: str
:ivar alias_primary_connection_string: Primary connection string of the
alias if GEO DR is enabled
:vartype alias_primary_connection_string: str
:ivar alias_secondary_connection_string: Secondary connection string of
the alias if GEO DR is enabled
:vartype alias_secondary_connection_string: str
:ivar primary_key: A base64-encoded 256-bit primary key for signing and
validating the SAS token.
:vartype primary_key: str
:ivar secondary_key: A base64-encoded 256-bit primary key for signing and
validating the SAS token.
:vartype secondary_key: str
:ivar key_name: A string that describes the AuthorizationRule.
:vartype key_name: str
"""

_validation = {
'primary_connection_string': {'readonly': True},
'secondary_connection_string': {'readonly': True},
'alias_primary_connection_string': {'readonly': True},
'alias_secondary_connection_string': {'readonly': True},
'primary_key': {'readonly': True},
'secondary_key': {'readonly': True},
'key_name': {'readonly': True},
}

_attribute_map = {
'primary_connection_string': {'key': 'primaryConnectionString', 'type': 'str'},
'secondary_connection_string': {'key': 'secondaryConnectionString', 'type': 'str'},
'alias_primary_connection_string': {'key': 'aliasPrimaryConnectionString', 'type': 'str'},
'alias_secondary_connection_string': {'key': 'aliasSecondaryConnectionString', 'type': 'str'},
'primary_key': {'key': 'primaryKey', 'type': 'str'},
'secondary_key': {'key': 'secondaryKey', 'type': 'str'},
'key_name': {'key': 'keyName', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
super(AccessKeys, self).__init__(**kwargs)
self.primary_connection_string = None
self.secondary_connection_string = None
self.alias_primary_connection_string = None
self.alias_secondary_connection_string = None
self.primary_key = None
self.secondary_key = None
self.key_name = None
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ class ArmDisasterRecovery(Resource):
'role': {'key': 'properties.role', 'type': 'RoleDisasterRecovery'},
}

def __init__(self, partner_namespace=None, alternate_name=None):
super(ArmDisasterRecovery, self).__init__()
def __init__(self, **kwargs):
super(ArmDisasterRecovery, self).__init__(**kwargs)
self.provisioning_state = None
self.partner_namespace = partner_namespace
self.alternate_name = alternate_name
self.partner_namespace = kwargs.get('partner_namespace', None)
self.alternate_name = kwargs.get('alternate_name', None)
self.role = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# 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 .resource import Resource


class ArmDisasterRecovery(Resource):
"""Single item in List or Get Alias(Disaster Recovery configuration)
operation.

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
:vartype name: str
:ivar type: Resource type
:vartype type: str
:ivar provisioning_state: Provisioning state of the Alias(Disaster
Recovery configuration) - possible values 'Accepted' or 'Succeeded' or
'Failed'. Possible values include: 'Accepted', 'Succeeded', 'Failed'
:vartype provisioning_state: str or
~azure.mgmt.eventhub.models.ProvisioningStateDR
:param partner_namespace: ARM Id of the Primary/Secondary eventhub
namespace name, which is part of GEO DR pairning
:type partner_namespace: str
:param alternate_name: Alternate name specified when alias and namespace
names are same.
:type alternate_name: str
:ivar role: role of namespace in GEO DR - possible values 'Primary' or
'PrimaryNotReplicating' or 'Secondary'. Possible values include:
'Primary', 'PrimaryNotReplicating', 'Secondary'
:vartype role: str or ~azure.mgmt.eventhub.models.RoleDisasterRecovery
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'provisioning_state': {'readonly': True},
'role': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningStateDR'},
'partner_namespace': {'key': 'properties.partnerNamespace', 'type': 'str'},
'alternate_name': {'key': 'properties.alternateName', 'type': 'str'},
'role': {'key': 'properties.role', 'type': 'RoleDisasterRecovery'},
}

def __init__(self, *, partner_namespace: str=None, alternate_name: str=None, **kwargs) -> None:
super(ArmDisasterRecovery, self).__init__(**kwargs)
self.provisioning_state = None
self.partner_namespace = partner_namespace
self.alternate_name = alternate_name
self.role = None
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ class AuthorizationRule(Resource):
Variables are only populated by the server, and will be ignored when
sending a request.

All required parameters must be populated in order to send to Azure.

:ivar id: Resource Id
:vartype id: str
:ivar name: Resource name
:vartype name: str
:ivar type: Resource type
:vartype type: str
:param rights: The rights associated with the rule.
:param rights: Required. The rights associated with the rule.
:type rights: list[str or ~azure.mgmt.eventhub.models.AccessRights]
"""

Expand All @@ -42,6 +44,6 @@ class AuthorizationRule(Resource):
'rights': {'key': 'properties.rights', 'type': '[str]'},
}

def __init__(self, rights):
super(AuthorizationRule, self).__init__()
self.rights = rights
def __init__(self, **kwargs):
super(AuthorizationRule, self).__init__(**kwargs)
self.rights = kwargs.get('rights', None)
Loading