Skip to content
Closed
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
5 changes: 4 additions & 1 deletion azure-mgmt-relay/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
recursive-include tests *.py *.yaml
include *.rst
include azure_bdist_wheel.py
include azure/__init__.py
include azure/mgmt/__init__.py

30 changes: 7 additions & 23 deletions azure-mgmt-relay/README.rst
Original file line number Diff line number Diff line change
@@ -1,43 +1,24 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure Relay Client Library.
This is the Microsoft Azure MyService 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.

For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


Compatibility
=============

**IMPORTANT**: If you have an earlier version of the azure package
(version < 1.0), you should uninstall it before installing this package.

You can check the version using pip:

.. code:: shell

pip freeze

If you see azure==0.11.0 (or any version below 1.0), uninstall it first:

.. code:: shell

pip uninstall azure


Usage
=====

For code examples, see `Relay
<https://docs.microsoft.com/python/azure/>`__
For code examples, see `MyService Management
<https://docs.microsoft.com/python/api/overview/azure/>`__
on docs.microsoft.com.


Expand All @@ -47,3 +28,6 @@ Provide Feedback
If you encounter any bugs or have suggestions, please file an issue in the
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__
section of the project.


.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-relay%2FREADME.png
2 changes: 1 addition & 1 deletion azure-mgmt-relay/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
2 changes: 1 addition & 1 deletion azure-mgmt-relay/azure/mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
50 changes: 34 additions & 16 deletions azure-mgmt-relay/azure/mgmt/relay/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,40 @@
# regenerated.
# --------------------------------------------------------------------------

from .tracked_resource import TrackedResource
from .resource_namespace_patch import ResourceNamespacePatch
from .resource import Resource
from .hybrid_connection import HybridConnection
from .wcf_relay import WcfRelay
from .sku import Sku
from .relay_namespace import RelayNamespace
from .relay_update_parameters import RelayUpdateParameters
from .authorization_rule import AuthorizationRule
from .access_keys import AccessKeys
from .regenerate_access_key_parameters import RegenerateAccessKeyParameters
from .check_name_availability import CheckNameAvailability
from .check_name_availability_result import CheckNameAvailabilityResult
from .operation_display import OperationDisplay
from .operation import Operation
from .error_response import ErrorResponse, ErrorResponseException
try:
from .tracked_resource_py3 import TrackedResource
from .resource_namespace_patch_py3 import ResourceNamespacePatch
from .resource_py3 import Resource
from .hybrid_connection_py3 import HybridConnection
from .wcf_relay_py3 import WcfRelay
from .sku_py3 import Sku
from .relay_namespace_py3 import RelayNamespace
from .relay_update_parameters_py3 import RelayUpdateParameters
from .authorization_rule_py3 import AuthorizationRule
from .access_keys_py3 import AccessKeys
from .regenerate_access_key_parameters_py3 import RegenerateAccessKeyParameters
from .check_name_availability_py3 import CheckNameAvailability
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
except (SyntaxError, ImportError):
from .tracked_resource import TrackedResource
from .resource_namespace_patch import ResourceNamespacePatch
from .resource import Resource
from .hybrid_connection import HybridConnection
from .wcf_relay import WcfRelay
from .sku import Sku
from .relay_namespace import RelayNamespace
from .relay_update_parameters import RelayUpdateParameters
from .authorization_rule import AuthorizationRule
from .access_keys import AccessKeys
from .regenerate_access_key_parameters import RegenerateAccessKeyParameters
from .check_name_availability import CheckNameAvailability
from .check_name_availability_result import CheckNameAvailabilityResult
from .operation_display import OperationDisplay
from .operation import Operation
from .error_response import ErrorResponse, ErrorResponseException
from .operation_paged import OperationPaged
from .relay_namespace_paged import RelayNamespacePaged
from .authorization_rule_paged import AuthorizationRulePaged
Expand Down
14 changes: 7 additions & 7 deletions azure-mgmt-relay/azure/mgmt/relay/models/access_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class AccessKeys(Model):
'key_name': {'key': 'keyName', 'type': 'str'},
}

def __init__(self, primary_connection_string=None, secondary_connection_string=None, primary_key=None, secondary_key=None, key_name=None):
super(AccessKeys, self).__init__()
self.primary_connection_string = primary_connection_string
self.secondary_connection_string = secondary_connection_string
self.primary_key = primary_key
self.secondary_key = secondary_key
self.key_name = key_name
def __init__(self, **kwargs):
super(AccessKeys, self).__init__(**kwargs)
self.primary_connection_string = kwargs.get('primary_connection_string', None)
self.secondary_connection_string = kwargs.get('secondary_connection_string', None)
self.primary_key = kwargs.get('primary_key', None)
self.secondary_key = kwargs.get('secondary_key', None)
self.key_name = kwargs.get('key_name', None)
48 changes: 48 additions & 0 deletions azure-mgmt-relay/azure/mgmt/relay/models/access_keys_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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/Relay Connection String.

:param primary_connection_string: Primary connection string of the created
namespace authorization rule.
:type primary_connection_string: str
:param secondary_connection_string: Secondary connection string of the
created namespace authorization rule.
:type secondary_connection_string: str
:param primary_key: A base64-encoded 256-bit primary key for signing and
validating the SAS token.
:type primary_key: str
:param secondary_key: A base64-encoded 256-bit secondary key for signing
and validating the SAS token.
:type secondary_key: str
:param key_name: A string that describes the authorization rule.
:type key_name: str
"""

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

def __init__(self, *, primary_connection_string: str=None, secondary_connection_string: str=None, primary_key: str=None, secondary_key: str=None, key_name: str=None, **kwargs) -> None:
super(AccessKeys, self).__init__(**kwargs)
self.primary_connection_string = primary_connection_string
self.secondary_connection_string = secondary_connection_string
self.primary_key = primary_key
self.secondary_key = secondary_key
self.key_name = key_name
10 changes: 6 additions & 4 deletions azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule.py
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.relay.models.AccessRights]
"""

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

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)
49 changes: 49 additions & 0 deletions azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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_py3 import Resource


class AuthorizationRule(Resource):
"""Description of a namespace authorization rule.

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: Required. The rights associated with the rule.
:type rights: list[str or ~azure.mgmt.relay.models.AccessRights]
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'rights': {'required': True, 'unique': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'rights': {'key': 'properties.rights', 'type': '[AccessRights]'},
}

def __init__(self, *, rights, **kwargs) -> None:
super(AuthorizationRule, self).__init__(**kwargs)
self.rights = rights
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
class CheckNameAvailability(Model):
"""Description of the check name availability request properties.

:param name: The namespace name to check for availability. The namespace
name can contain only letters, numbers, and hyphens. The namespace must
start with a letter, and it must end with a letter or number.
All required parameters must be populated in order to send to Azure.

:param name: Required. The namespace name to check for availability. The
namespace name can contain only letters, numbers, and hyphens. The
namespace must start with a letter, and it must end with a letter or
number.
:type name: str
"""

Expand All @@ -29,6 +32,6 @@ class CheckNameAvailability(Model):
'name': {'key': 'name', 'type': 'str'},
}

def __init__(self, name):
super(CheckNameAvailability, self).__init__()
self.name = name
def __init__(self, **kwargs):
super(CheckNameAvailability, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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 CheckNameAvailability(Model):
"""Description of the check name availability request properties.

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

:param name: Required. The namespace name to check for availability. The
namespace name can contain only letters, numbers, and hyphens. The
namespace must start with a letter, and it must end with a letter or
number.
:type name: str
"""

_validation = {
'name': {'required': True},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
}

def __init__(self, *, name: str, **kwargs) -> None:
super(CheckNameAvailability, self).__init__(**kwargs)
self.name = name
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class CheckNameAvailabilityResult(Model):
'reason': {'key': 'reason', 'type': 'UnavailableReason'},
}

def __init__(self, name_available=None, reason=None):
super(CheckNameAvailabilityResult, self).__init__()
def __init__(self, **kwargs):
super(CheckNameAvailabilityResult, self).__init__(**kwargs)
self.message = None
self.name_available = name_available
self.reason = reason
self.name_available = kwargs.get('name_available', None)
self.reason = kwargs.get('reason', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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 CheckNameAvailabilityResult(Model):
"""Description of the check name availability request properties.

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

:ivar message: The detailed info regarding the reason associated with the
namespace.
:vartype message: str
:param name_available: Value indicating namespace is available. Returns
true if the namespace is available; otherwise, false.
:type name_available: bool
:param reason: The reason for unavailability of a namespace. Possible
values include: 'None', 'InvalidName', 'SubscriptionIsDisabled',
'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription'
:type reason: str or ~azure.mgmt.relay.models.UnavailableReason
"""

_validation = {
'message': {'readonly': True},
}

_attribute_map = {
'message': {'key': 'message', 'type': 'str'},
'name_available': {'key': 'nameAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'UnavailableReason'},
}

def __init__(self, *, name_available: bool=None, reason=None, **kwargs) -> None:
super(CheckNameAvailabilityResult, self).__init__(**kwargs)
self.message = None
self.name_available = name_available
self.reason = reason
Loading