Skip to content
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
14 changes: 11 additions & 3 deletions azure-mgmt-resource/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
Release History
===============

2.0.0 (2018-07-20)
++++++++++++++++++

**Features**

- Identity class has now a user_assigned_identities attribute
- Client class can be used as a context manager to keep the underlying HTTP session open for performance

2.0.0rc2 (2018-06-13)
+++++++++++++++++++++

Expand Down Expand Up @@ -56,7 +64,7 @@ This version uses a next-generation code generator that *might* introduce breaki

- 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`,
- 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.
Expand Down Expand Up @@ -123,8 +131,8 @@ This version uses a next-generation code generator that *might* introduce breaki

**Disclaimer**

- We removed the "filter" parameter of policy_definitions.list method.
However, we don't upgrade the major version of the package, since this parameter has no meaning
- We removed the "filter" parameter of policy_definitions.list method.
However, we don't upgrade the major version of the package, since this parameter has no meaning
for the RestAPI and there is no way any Python users would have been able to use it anyway.

1.1.0 (2017-05-15)
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

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


class FeatureClient(MultiApiClientMixin):
class FeatureClient(MultiApiClientMixin, SDKClient):
"""Azure Feature Exposure Control (AFEC) provides a mechanism for the resource providers to control feature exposure to users. Resource providers typically use this mechanism to provide public/private preview for new features prior to making them generally available. Users need to explicitly register for AFEC features to get access to such functionality.

:ivar config: Configuration for client.
Expand Down Expand Up @@ -83,17 +83,14 @@ class FeatureClient(MultiApiClientMixin):
)

def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default):
self.config = FeatureClientConfiguration(credentials, subscription_id, api_version, base_url)
super(FeatureClient, self).__init__(
credentials=credentials,
subscription_id=subscription_id,
credentials,
self.config,
api_version=api_version,
base_url=base_url,
profile=profile
)

self.config = FeatureClientConfiguration(credentials, subscription_id, api_version, base_url)
self._client = ServiceClient(self.config.credentials, self.config)

############ Generated from here ############

@classmethod
Expand All @@ -110,7 +107,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
from .v2015_12_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
def features(self):
"""Instance depends on the API version:
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

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


class ManagementLinkClient(MultiApiClientMixin):
class ManagementLinkClient(MultiApiClientMixin, SDKClient):
"""Azure resources can be linked together to form logical relationships. You can establish links between resources belonging to different resource groups. However, all the linked resources must belong to the same subscription. Each resource can be linked to 50 other resources. If any of the linked resources are deleted or moved, the link owner must clean up the remaining link.

:ivar config: Configuration for client.
Expand Down Expand Up @@ -78,17 +78,14 @@ class ManagementLinkClient(MultiApiClientMixin):
)

def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default):
self.config = ManagementLinkClientConfiguration(credentials, subscription_id, base_url)
super(ManagementLinkClient, self).__init__(
credentials=credentials,
subscription_id=subscription_id,
credentials,
self.config,
api_version=api_version,
base_url=base_url,
profile=profile
)

self.config = ManagementLinkClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)

############ Generated from here ############

@classmethod
Expand All @@ -105,7 +102,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
from .v2016_09_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
def resource_links(self):
"""Instance depends on the API version:
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

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


class ManagementLockClient(MultiApiClientMixin):
class ManagementLockClient(MultiApiClientMixin, SDKClient):
"""Azure resources can be locked to prevent other users in your organization from deleting or modifying resources.

:ivar config: Configuration for client.
Expand Down Expand Up @@ -78,17 +78,14 @@ class ManagementLockClient(MultiApiClientMixin):
)

def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default):
self.config = ManagementLockClientConfiguration(credentials, subscription_id, base_url)
super(ManagementLockClient, self).__init__(
credentials=credentials,
subscription_id=subscription_id,
credentials,
self.config,
api_version=api_version,
base_url=base_url,
profile=profile
)

self.config = ManagementLockClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)

############ Generated from here ############

@classmethod
Expand All @@ -109,7 +106,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
from .v2016_09_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
def management_locks(self):
"""Instance depends on the API version:
Expand Down
13 changes: 5 additions & 8 deletions azure-mgmt-resource/azure/mgmt/resource/policy/policy_client.py
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

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


class PolicyClient(MultiApiClientMixin):
class PolicyClient(MultiApiClientMixin, SDKClient):
"""To manage and control access to your resources, you can define customized policies and assign them at a scope.

:ivar config: Configuration for client.
Expand Down Expand Up @@ -78,17 +78,14 @@ class PolicyClient(MultiApiClientMixin):
)

def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default):
self.config = PolicyClientConfiguration(credentials, subscription_id, base_url)
super(PolicyClient, self).__init__(
credentials=credentials,
subscription_id=subscription_id,
credentials,
self.config,
api_version=api_version,
base_url=base_url,
profile=profile
)

self.config = PolicyClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)

############ Generated from here ############

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# --------------------------------------------------------------------------

import uuid
import warnings
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError

Expand Down Expand Up @@ -314,9 +313,6 @@ def list_for_resource(
self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter=None, custom_headers=None, raw=False, **operation_config):
"""Gets policy assignments for a resource.

.. warning::
This method is deprecated

:param resource_group_name: The name of the resource group containing
the resource. The name is case insensitive.
:type resource_group_name: str
Expand All @@ -342,7 +338,6 @@ def list_for_resource(
~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignmentPaged[~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignment]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
warnings.warn("Method list_for_resource is deprecated", DeprecationWarning)
def internal_paging(next_link=None, raw=False):

if not next_link:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# regenerated.
# --------------------------------------------------------------------------

import warnings
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# --------------------------------------------------------------------------

import uuid
import warnings
from msrest.pipeline import ClientRawResponse

from .. import models
Expand Down Expand Up @@ -309,9 +308,6 @@ def list_for_resource(
self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter=None, custom_headers=None, raw=False, **operation_config):
"""Gets policy assignments for a resource.

.. warning::
This method is deprecated

:param resource_group_name: The name of the resource group containing
the resource. The name is case insensitive.
:type resource_group_name: str
Expand All @@ -338,7 +334,6 @@ def list_for_resource(
:raises:
:class:`ErrorResponseException<azure.mgmt.resource.policy.v2017_06_01_preview.models.ErrorResponseException>`
"""
warnings.warn("Method list_for_resource is deprecated", DeprecationWarning)
def internal_paging(next_link=None, raw=False):

if not next_link:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# regenerated.
# --------------------------------------------------------------------------

import warnings
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
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

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


class ResourceManagementClient(MultiApiClientMixin):
class ResourceManagementClient(MultiApiClientMixin, SDKClient):
"""Provides operations for working with resources and resource groups.

:ivar config: Configuration for client.
Expand Down Expand Up @@ -78,17 +78,14 @@ class ResourceManagementClient(MultiApiClientMixin):
)

def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default):
self.config = ResourceManagementClientConfiguration(credentials, subscription_id, base_url)
super(ResourceManagementClient, self).__init__(
credentials=credentials,
subscription_id=subscription_id,
credentials,
self.config,
api_version=api_version,
base_url=base_url,
profile=profile
)

self.config = ResourceManagementClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)

############ Generated from here ############

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from .deployment_extended_py3 import DeploymentExtended
from .plan_py3 import Plan
from .sku_py3 import Sku
from .identity_user_assigned_identities_value_py3 import IdentityUserAssignedIdentitiesValue
from .identity_py3 import Identity
from .generic_resource_py3 import GenericResource
from .resource_group_properties_py3 import ResourceGroupProperties
Expand Down Expand Up @@ -75,6 +76,7 @@
from .deployment_extended import DeploymentExtended
from .plan import Plan
from .sku import Sku
from .identity_user_assigned_identities_value import IdentityUserAssignedIdentitiesValue
from .identity import Identity
from .generic_resource import GenericResource
from .resource_group_properties import ResourceGroupProperties
Expand Down Expand Up @@ -129,6 +131,7 @@
'DeploymentExtended',
'Plan',
'Sku',
'IdentityUserAssignedIdentitiesValue',
'Identity',
'GenericResource',
'ResourceGroupProperties',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ class Identity(Model):
'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
:type type: str or
~azure.mgmt.resource.resources.v2018_05_01.models.ResourceIdentityType
:param user_assigned_identities: The list of user identities associated
with the resource. The user identity dictionary key references will be ARM
resource ids in the form:
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
:type user_assigned_identities: dict[str,
~azure.mgmt.resource.resources.v2018_05_01.models.IdentityUserAssignedIdentitiesValue]
"""

_validation = {
Expand All @@ -37,10 +43,12 @@ class Identity(Model):
'principal_id': {'key': 'principalId', 'type': 'str'},
'tenant_id': {'key': 'tenantId', 'type': 'str'},
'type': {'key': 'type', 'type': 'ResourceIdentityType'},
'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{IdentityUserAssignedIdentitiesValue}'},
}

def __init__(self, **kwargs):
super(Identity, self).__init__(**kwargs)
self.principal_id = None
self.tenant_id = None
self.type = kwargs.get('type', None)
self.user_assigned_identities = kwargs.get('user_assigned_identities', None)
Loading