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] resources/resource-manager #6533

Closed
wants to merge 9 commits into from
8 changes: 8 additions & 0 deletions sdk/resources/azure-mgmt-resource/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
Release History
===============

3.1.0 (2019-07-20)
++++++++++++++++++

**Features**

- Model TenantIdDescription has a new parameter domains
- Model TenantIdDescription has a new parameter display_name

3.0.0 (2019-06-13)
++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion sdk/resources/azure-mgmt-resource/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the Microsoft Azure Resource 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, 3.6 and 3.7.
This package has been tested with Python 2.7, 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
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from .v2015_01_01.models import *
from .v2016_09_01.models import *
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class PolicyClient(MultiApiClientMixin, SDKClient):
:type profile: azure.profiles.KnownProfiles
"""

DEFAULT_API_VERSION = '2018-05-01'
DEFAULT_API_VERSION = '2019-01-01'
_PROFILE_TAG = "azure.mgmt.resource.policy.PolicyClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand Down Expand Up @@ -78,6 +78,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2017-06-01-preview: :mod:`v2017_06_01_preview.models<azure.mgmt.resource.policy.v2017_06_01_preview.models>`
* 2018-03-01: :mod:`v2018_03_01.models<azure.mgmt.resource.policy.v2018_03_01.models>`
* 2018-05-01: :mod:`v2018_05_01.models<azure.mgmt.resource.policy.v2018_05_01.models>`
* 2019-01-01: :mod:`v2019_01_01.models<azure.mgmt.resource.policy.v2019_01_01.models>`
"""
if api_version == '2015-10-01-preview':
from .v2015_10_01_preview import models
Expand All @@ -97,6 +98,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2018-05-01':
from .v2018_05_01 import models
return models
elif api_version == '2019-01-01':
from .v2019_01_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
Expand All @@ -109,6 +113,7 @@ def policy_assignments(self):
* 2017-06-01-preview: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2017_06_01_preview.operations.PolicyAssignmentsOperations>`
* 2018-03-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicyAssignmentsOperations>`
* 2018-05-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2018_05_01.operations.PolicyAssignmentsOperations>`
* 2019-01-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2019_01_01.operations.PolicyAssignmentsOperations>`
"""
api_version = self._get_api_version('policy_assignments')
if api_version == '2015-10-01-preview':
Expand All @@ -123,6 +128,8 @@ def policy_assignments(self):
from .v2018_03_01.operations import PolicyAssignmentsOperations as OperationClass
elif api_version == '2018-05-01':
from .v2018_05_01.operations import PolicyAssignmentsOperations as OperationClass
elif api_version == '2019-01-01':
from .v2019_01_01.operations import PolicyAssignmentsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -137,6 +144,7 @@ def policy_definitions(self):
* 2017-06-01-preview: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2017_06_01_preview.operations.PolicyDefinitionsOperations>`
* 2018-03-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicyDefinitionsOperations>`
* 2018-05-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2018_05_01.operations.PolicyDefinitionsOperations>`
* 2019-01-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2019_01_01.operations.PolicyDefinitionsOperations>`
"""
api_version = self._get_api_version('policy_definitions')
if api_version == '2015-10-01-preview':
Expand All @@ -151,6 +159,8 @@ def policy_definitions(self):
from .v2018_03_01.operations import PolicyDefinitionsOperations as OperationClass
elif api_version == '2018-05-01':
from .v2018_05_01.operations import PolicyDefinitionsOperations as OperationClass
elif api_version == '2019-01-01':
from .v2019_01_01.operations import PolicyDefinitionsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -162,6 +172,7 @@ def policy_set_definitions(self):
* 2017-06-01-preview: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2017_06_01_preview.operations.PolicySetDefinitionsOperations>`
* 2018-03-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicySetDefinitionsOperations>`
* 2018-05-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2018_05_01.operations.PolicySetDefinitionsOperations>`
* 2019-01-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2019_01_01.operations.PolicySetDefinitionsOperations>`
"""
api_version = self._get_api_version('policy_set_definitions')
if api_version == '2017-06-01-preview':
Expand All @@ -170,6 +181,8 @@ def policy_set_definitions(self):
from .v2018_03_01.operations import PolicySetDefinitionsOperations as OperationClass
elif api_version == '2018-05-01':
from .v2018_05_01.operations import PolicySetDefinitionsOperations as OperationClass
elif api_version == '2019-01-01':
from .v2019_01_01.operations import PolicySetDefinitionsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,4 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from .v2015_10_01_preview.models import *
from .v2016_04_01.models import *
from .v2016_12_01.models import *
from .v2017_06_01_preview.models import *
from .v2018_03_01.models import *
from .v2018_05_01.models import *
from .v2019_01_01.models import *
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ def list_for_resource_group(
includes all policy assignments that apply to the resource group, which
is everything in the unfiltered list except those applied to resources
contained within the resource group. If $filter=policyDefinitionId eq
'{value}' is provided, the returned list includes only policy
assignments that apply to the resource group and assign the policy
definition whose id is {value}.
'{value}' is provided, the returned list includes all policy
assignments of the policy definition whose id is {value} that apply to
the resource group.

:param resource_group_name: The name of the resource group that
contains policy assignments.
Expand Down Expand Up @@ -367,16 +367,16 @@ def list_for_resource(
to the resource, which is everything in the unfiltered list except
those applied to resources contained within the resource. If
$filter=policyDefinitionId eq '{value}' is provided, the returned list
includes only policy assignments that apply to the resource and assign
the policy definition whose id is {value}. Three parameters plus the
resource name are used to identify a specific resource. If the resource
is not part of a parent resource (the more common case), the parent
resource path should not be provided (or provided as ''). For example a
web app could be specified as ({resourceProviderNamespace} ==
'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites',
{resourceName} == 'MyWebApp'). If the resource is part of a parent
resource, then all parameters should be provided. For example a virtual
machine DNS name could be specified as ({resourceProviderNamespace} ==
includes all policy assignments of the policy definition whose id is
{value} that apply to the resource. Three parameters plus the resource
name are used to identify a specific resource. If the resource is not
part of a parent resource (the more common case), the parent resource
path should not be provided (or provided as ''). For example a web app
could be specified as ({resourceProviderNamespace} == 'Microsoft.Web',
{parentResourcePath} == '', {resourceType} == 'sites', {resourceName}
== 'MyWebApp'). If the resource is part of a parent resource, then all
parameters should be provided. For example a virtual machine DNS name
could be specified as ({resourceProviderNamespace} ==
'Microsoft.Compute', {parentResourcePath} ==
'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames',
{resourceName} == 'MyComputerName'). A convenient alternative to
Expand Down Expand Up @@ -487,9 +487,8 @@ def list(
includes all policy assignments that apply to the subscription, which
is everything in the unfiltered list except those applied to objects
contained within the subscription. If $filter=policyDefinitionId eq
'{value}' is provided, the returned list includes only policy
assignments that apply to the subscription and assign the policy
definition whose id is {value}.
'{value}' is provided, the returned list includes all policy
assignments of the policy definition whose id is {value}.

:param filter: The filter to apply on the operation. Valid values for
$filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ def list_for_resource_group(
includes all policy assignments that apply to the resource group, which
is everything in the unfiltered list except those applied to resources
contained within the resource group. If $filter=policyDefinitionId eq
'{value}' is provided, the returned list includes only policy
assignments that apply to the resource group and assign the policy
definition whose id is {value}.
'{value}' is provided, the returned list includes all policy
assignments of the policy definition whose id is {value} that apply to
the resource group.

:param resource_group_name: The name of the resource group that
contains policy assignments.
Expand Down Expand Up @@ -367,16 +367,16 @@ def list_for_resource(
to the resource, which is everything in the unfiltered list except
those applied to resources contained within the resource. If
$filter=policyDefinitionId eq '{value}' is provided, the returned list
includes only policy assignments that apply to the resource and assign
the policy definition whose id is {value}. Three parameters plus the
resource name are used to identify a specific resource. If the resource
is not part of a parent resource (the more common case), the parent
resource path should not be provided (or provided as ''). For example a
web app could be specified as ({resourceProviderNamespace} ==
'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites',
{resourceName} == 'MyWebApp'). If the resource is part of a parent
resource, then all parameters should be provided. For example a virtual
machine DNS name could be specified as ({resourceProviderNamespace} ==
includes all policy assignments of the policy definition whose id is
{value} that apply to the resource. Three parameters plus the resource
name are used to identify a specific resource. If the resource is not
part of a parent resource (the more common case), the parent resource
path should not be provided (or provided as ''). For example a web app
could be specified as ({resourceProviderNamespace} == 'Microsoft.Web',
{parentResourcePath} == '', {resourceType} == 'sites', {resourceName}
== 'MyWebApp'). If the resource is part of a parent resource, then all
parameters should be provided. For example a virtual machine DNS name
could be specified as ({resourceProviderNamespace} ==
'Microsoft.Compute', {parentResourcePath} ==
'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames',
{resourceName} == 'MyComputerName'). A convenient alternative to
Expand Down Expand Up @@ -487,9 +487,8 @@ def list(
includes all policy assignments that apply to the subscription, which
is everything in the unfiltered list except those applied to objects
contained within the subscription. If $filter=policyDefinitionId eq
'{value}' is provided, the returned list includes only policy
assignments that apply to the subscription and assign the policy
definition whose id is {value}.
'{value}' is provided, the returned list includes all policy
assignments of the policy definition whose id is {value}.

:param filter: The filter to apply on the operation. Valid values for
$filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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 ._configuration import PolicyClientConfiguration
from ._policy_client import PolicyClient
__all__ = ['PolicyClient', 'PolicyClientConfiguration']

from .version import VERSION

__version__ = VERSION

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 msrestazure import AzureConfiguration

from .version import VERSION


class PolicyClientConfiguration(AzureConfiguration):
"""Configuration for PolicyClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(PolicyClientConfiguration, self).__init__(base_url)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

self.add_user_agent('azure-mgmt-resource/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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.service_client import SDKClient
from msrest import Serializer, Deserializer

from ._configuration import PolicyClientConfiguration
from .operations import PolicyAssignmentsOperations
from .operations import PolicyDefinitionsOperations
from .operations import PolicySetDefinitionsOperations
from . import models


class PolicyClient(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.
:vartype config: PolicyClientConfiguration

:ivar policy_assignments: PolicyAssignments operations
:vartype policy_assignments: azure.mgmt.resource.policy.v2019_01_01.operations.PolicyAssignmentsOperations
:ivar policy_definitions: PolicyDefinitions operations
:vartype policy_definitions: azure.mgmt.resource.policy.v2019_01_01.operations.PolicyDefinitionsOperations
:ivar policy_set_definitions: PolicySetDefinitions operations
:vartype policy_set_definitions: azure.mgmt.resource.policy.v2019_01_01.operations.PolicySetDefinitionsOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = PolicyClientConfiguration(credentials, subscription_id, base_url)
super(PolicyClient, 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 = '2019-01-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.policy_assignments = PolicyAssignmentsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.policy_definitions = PolicyDefinitionsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.policy_set_definitions = PolicySetDefinitionsOperations(
self._client, self.config, self._serialize, self._deserialize)
Loading