Skip to content

Commit a509fef

Browse files
AutorestCIZim Kalinowski
authored and
Zim Kalinowski
committed
[AutoPR] resources/resource-manager (#6155)
* Generated from 6e7cafe31e550ebb35e76be3945898776f1afaa5 (#6129) Update API version missed in Azure/azure-rest-api-specs#6276 * Packaging update of azure-mgmt-resource * Generated from 7dd7493e50c01e2f7ceecd01127ab710280b0e32 (#6241) chore: jsonfmt resources * [AutoPR resources/resource-manager] Add missing displayName and domains properties to response of Tenants_List call (#6116) * Generated from 38bec715e92c9f8bcd1b0e381042194d3261fe58 Add missing displayName and domains properties to response of Tenants_List call * Generated from 38bec715e92c9f8bcd1b0e381042194d3261fe58 Add missing displayName and domains properties to response of Tenants_List call * updated release notes and version * updated test recordings
1 parent dce924b commit a509fef

File tree

62 files changed

+20246
-6331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+20246
-6331
lines changed

sdk/resources/azure-mgmt-resource/HISTORY.rst

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

6+
3.1.0 (2019-07-20)
7+
++++++++++++++++++
8+
9+
**Features**
10+
11+
- Model TenantIdDescription has a new parameter domains
12+
- Model TenantIdDescription has a new parameter display_name
13+
614
3.0.0 (2019-06-13)
715
++++++++++++++++++
816

sdk/resources/azure-mgmt-resource/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is the Microsoft Azure Resource 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, 3.6 and 3.7.
9+
This package has been tested with Python 2.7, 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.

sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/models.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
# Licensed under the MIT License. See License.txt in the project root for
55
# license information.
66
# --------------------------------------------------------------------------
7-
from .v2015_01_01.models import *
87
from .v2016_09_01.models import *

sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_policy_client.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class PolicyClient(MultiApiClientMixin, SDKClient):
4646
:type profile: azure.profiles.KnownProfiles
4747
"""
4848

49-
DEFAULT_API_VERSION = '2018-05-01'
49+
DEFAULT_API_VERSION = '2019-01-01'
5050
_PROFILE_TAG = "azure.mgmt.resource.policy.PolicyClient"
5151
LATEST_PROFILE = ProfileDefinition({
5252
_PROFILE_TAG: {
@@ -78,6 +78,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
7878
* 2017-06-01-preview: :mod:`v2017_06_01_preview.models<azure.mgmt.resource.policy.v2017_06_01_preview.models>`
7979
* 2018-03-01: :mod:`v2018_03_01.models<azure.mgmt.resource.policy.v2018_03_01.models>`
8080
* 2018-05-01: :mod:`v2018_05_01.models<azure.mgmt.resource.policy.v2018_05_01.models>`
81+
* 2019-01-01: :mod:`v2019_01_01.models<azure.mgmt.resource.policy.v2019_01_01.models>`
8182
"""
8283
if api_version == '2015-10-01-preview':
8384
from .v2015_10_01_preview import models
@@ -97,6 +98,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
9798
elif api_version == '2018-05-01':
9899
from .v2018_05_01 import models
99100
return models
101+
elif api_version == '2019-01-01':
102+
from .v2019_01_01 import models
103+
return models
100104
raise NotImplementedError("APIVersion {} is not available".format(api_version))
101105

102106
@property
@@ -109,6 +113,7 @@ def policy_assignments(self):
109113
* 2017-06-01-preview: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2017_06_01_preview.operations.PolicyAssignmentsOperations>`
110114
* 2018-03-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicyAssignmentsOperations>`
111115
* 2018-05-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2018_05_01.operations.PolicyAssignmentsOperations>`
116+
* 2019-01-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2019_01_01.operations.PolicyAssignmentsOperations>`
112117
"""
113118
api_version = self._get_api_version('policy_assignments')
114119
if api_version == '2015-10-01-preview':
@@ -123,6 +128,8 @@ def policy_assignments(self):
123128
from .v2018_03_01.operations import PolicyAssignmentsOperations as OperationClass
124129
elif api_version == '2018-05-01':
125130
from .v2018_05_01.operations import PolicyAssignmentsOperations as OperationClass
131+
elif api_version == '2019-01-01':
132+
from .v2019_01_01.operations import PolicyAssignmentsOperations as OperationClass
126133
else:
127134
raise NotImplementedError("APIVersion {} is not available".format(api_version))
128135
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@@ -137,6 +144,7 @@ def policy_definitions(self):
137144
* 2017-06-01-preview: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2017_06_01_preview.operations.PolicyDefinitionsOperations>`
138145
* 2018-03-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicyDefinitionsOperations>`
139146
* 2018-05-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2018_05_01.operations.PolicyDefinitionsOperations>`
147+
* 2019-01-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2019_01_01.operations.PolicyDefinitionsOperations>`
140148
"""
141149
api_version = self._get_api_version('policy_definitions')
142150
if api_version == '2015-10-01-preview':
@@ -151,6 +159,8 @@ def policy_definitions(self):
151159
from .v2018_03_01.operations import PolicyDefinitionsOperations as OperationClass
152160
elif api_version == '2018-05-01':
153161
from .v2018_05_01.operations import PolicyDefinitionsOperations as OperationClass
162+
elif api_version == '2019-01-01':
163+
from .v2019_01_01.operations import PolicyDefinitionsOperations as OperationClass
154164
else:
155165
raise NotImplementedError("APIVersion {} is not available".format(api_version))
156166
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@@ -162,6 +172,7 @@ def policy_set_definitions(self):
162172
* 2017-06-01-preview: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2017_06_01_preview.operations.PolicySetDefinitionsOperations>`
163173
* 2018-03-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicySetDefinitionsOperations>`
164174
* 2018-05-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2018_05_01.operations.PolicySetDefinitionsOperations>`
175+
* 2019-01-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2019_01_01.operations.PolicySetDefinitionsOperations>`
165176
"""
166177
api_version = self._get_api_version('policy_set_definitions')
167178
if api_version == '2017-06-01-preview':
@@ -170,6 +181,8 @@ def policy_set_definitions(self):
170181
from .v2018_03_01.operations import PolicySetDefinitionsOperations as OperationClass
171182
elif api_version == '2018-05-01':
172183
from .v2018_05_01.operations import PolicySetDefinitionsOperations as OperationClass
184+
elif api_version == '2019-01-01':
185+
from .v2019_01_01.operations import PolicySetDefinitionsOperations as OperationClass
173186
else:
174187
raise NotImplementedError("APIVersion {} is not available".format(api_version))
175188
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/models.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,4 @@
44
# Licensed under the MIT License. See License.txt in the project root for
55
# license information.
66
# --------------------------------------------------------------------------
7-
from .v2015_10_01_preview.models import *
8-
from .v2016_04_01.models import *
9-
from .v2016_12_01.models import *
10-
from .v2017_06_01_preview.models import *
11-
from .v2018_03_01.models import *
12-
from .v2018_05_01.models import *
7+
from .v2019_01_01.models import *

sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/_policy_assignments_operations.py

+15-16
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,9 @@ def list_for_resource_group(
276276
includes all policy assignments that apply to the resource group, which
277277
is everything in the unfiltered list except those applied to resources
278278
contained within the resource group. If $filter=policyDefinitionId eq
279-
'{value}' is provided, the returned list includes only policy
280-
assignments that apply to the resource group and assign the policy
281-
definition whose id is {value}.
279+
'{value}' is provided, the returned list includes all policy
280+
assignments of the policy definition whose id is {value} that apply to
281+
the resource group.
282282
283283
:param resource_group_name: The name of the resource group that
284284
contains policy assignments.
@@ -367,16 +367,16 @@ def list_for_resource(
367367
to the resource, which is everything in the unfiltered list except
368368
those applied to resources contained within the resource. If
369369
$filter=policyDefinitionId eq '{value}' is provided, the returned list
370-
includes only policy assignments that apply to the resource and assign
371-
the policy definition whose id is {value}. Three parameters plus the
372-
resource name are used to identify a specific resource. If the resource
373-
is not part of a parent resource (the more common case), the parent
374-
resource path should not be provided (or provided as ''). For example a
375-
web app could be specified as ({resourceProviderNamespace} ==
376-
'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites',
377-
{resourceName} == 'MyWebApp'). If the resource is part of a parent
378-
resource, then all parameters should be provided. For example a virtual
379-
machine DNS name could be specified as ({resourceProviderNamespace} ==
370+
includes all policy assignments of the policy definition whose id is
371+
{value} that apply to the resource. Three parameters plus the resource
372+
name are used to identify a specific resource. If the resource is not
373+
part of a parent resource (the more common case), the parent resource
374+
path should not be provided (or provided as ''). For example a web app
375+
could be specified as ({resourceProviderNamespace} == 'Microsoft.Web',
376+
{parentResourcePath} == '', {resourceType} == 'sites', {resourceName}
377+
== 'MyWebApp'). If the resource is part of a parent resource, then all
378+
parameters should be provided. For example a virtual machine DNS name
379+
could be specified as ({resourceProviderNamespace} ==
380380
'Microsoft.Compute', {parentResourcePath} ==
381381
'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames',
382382
{resourceName} == 'MyComputerName'). A convenient alternative to
@@ -487,9 +487,8 @@ def list(
487487
includes all policy assignments that apply to the subscription, which
488488
is everything in the unfiltered list except those applied to objects
489489
contained within the subscription. If $filter=policyDefinitionId eq
490-
'{value}' is provided, the returned list includes only policy
491-
assignments that apply to the subscription and assign the policy
492-
definition whose id is {value}.
490+
'{value}' is provided, the returned list includes all policy
491+
assignments of the policy definition whose id is {value}.
493492
494493
:param filter: The filter to apply on the operation. Valid values for
495494
$filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If

sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/_policy_assignments_operations.py

+15-16
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,9 @@ def list_for_resource_group(
276276
includes all policy assignments that apply to the resource group, which
277277
is everything in the unfiltered list except those applied to resources
278278
contained within the resource group. If $filter=policyDefinitionId eq
279-
'{value}' is provided, the returned list includes only policy
280-
assignments that apply to the resource group and assign the policy
281-
definition whose id is {value}.
279+
'{value}' is provided, the returned list includes all policy
280+
assignments of the policy definition whose id is {value} that apply to
281+
the resource group.
282282
283283
:param resource_group_name: The name of the resource group that
284284
contains policy assignments.
@@ -367,16 +367,16 @@ def list_for_resource(
367367
to the resource, which is everything in the unfiltered list except
368368
those applied to resources contained within the resource. If
369369
$filter=policyDefinitionId eq '{value}' is provided, the returned list
370-
includes only policy assignments that apply to the resource and assign
371-
the policy definition whose id is {value}. Three parameters plus the
372-
resource name are used to identify a specific resource. If the resource
373-
is not part of a parent resource (the more common case), the parent
374-
resource path should not be provided (or provided as ''). For example a
375-
web app could be specified as ({resourceProviderNamespace} ==
376-
'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites',
377-
{resourceName} == 'MyWebApp'). If the resource is part of a parent
378-
resource, then all parameters should be provided. For example a virtual
379-
machine DNS name could be specified as ({resourceProviderNamespace} ==
370+
includes all policy assignments of the policy definition whose id is
371+
{value} that apply to the resource. Three parameters plus the resource
372+
name are used to identify a specific resource. If the resource is not
373+
part of a parent resource (the more common case), the parent resource
374+
path should not be provided (or provided as ''). For example a web app
375+
could be specified as ({resourceProviderNamespace} == 'Microsoft.Web',
376+
{parentResourcePath} == '', {resourceType} == 'sites', {resourceName}
377+
== 'MyWebApp'). If the resource is part of a parent resource, then all
378+
parameters should be provided. For example a virtual machine DNS name
379+
could be specified as ({resourceProviderNamespace} ==
380380
'Microsoft.Compute', {parentResourcePath} ==
381381
'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames',
382382
{resourceName} == 'MyComputerName'). A convenient alternative to
@@ -487,9 +487,8 @@ def list(
487487
includes all policy assignments that apply to the subscription, which
488488
is everything in the unfiltered list except those applied to objects
489489
contained within the subscription. If $filter=policyDefinitionId eq
490-
'{value}' is provided, the returned list includes only policy
491-
assignments that apply to the subscription and assign the policy
492-
definition whose id is {value}.
490+
'{value}' is provided, the returned list includes all policy
491+
assignments of the policy definition whose id is {value}.
493492
494493
:param filter: The filter to apply on the operation. Valid values for
495494
$filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 ._configuration import PolicyClientConfiguration
13+
from ._policy_client import PolicyClient
14+
__all__ = ['PolicyClient', 'PolicyClientConfiguration']
15+
16+
from .version import VERSION
17+
18+
__version__ = VERSION
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
from msrestazure import AzureConfiguration
12+
13+
from .version import VERSION
14+
15+
16+
class PolicyClientConfiguration(AzureConfiguration):
17+
"""Configuration for PolicyClient
18+
Note that all parameters used to create this instance are saved as instance
19+
attributes.
20+
21+
:param credentials: Credentials needed for the client to connect to Azure.
22+
:type credentials: :mod:`A msrestazure Credentials
23+
object<msrestazure.azure_active_directory>`
24+
:param subscription_id: The ID of the target subscription.
25+
:type subscription_id: str
26+
:param str base_url: Service URL
27+
"""
28+
29+
def __init__(
30+
self, credentials, subscription_id, base_url=None):
31+
32+
if credentials is None:
33+
raise ValueError("Parameter 'credentials' must not be None.")
34+
if subscription_id is None:
35+
raise ValueError("Parameter 'subscription_id' must not be None.")
36+
if not base_url:
37+
base_url = 'https://management.azure.com'
38+
39+
super(PolicyClientConfiguration, self).__init__(base_url)
40+
41+
# Starting Autorest.Python 4.0.64, make connection pool activated by default
42+
self.keep_alive = True
43+
44+
self.add_user_agent('azure-mgmt-resource/{}'.format(VERSION))
45+
self.add_user_agent('Azure-SDK-For-Python')
46+
47+
self.credentials = credentials
48+
self.subscription_id = subscription_id
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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.service_client import SDKClient
13+
from msrest import Serializer, Deserializer
14+
15+
from ._configuration import PolicyClientConfiguration
16+
from .operations import PolicyAssignmentsOperations
17+
from .operations import PolicyDefinitionsOperations
18+
from .operations import PolicySetDefinitionsOperations
19+
from . import models
20+
21+
22+
class PolicyClient(SDKClient):
23+
"""To manage and control access to your resources, you can define customized policies and assign them at a scope.
24+
25+
:ivar config: Configuration for client.
26+
:vartype config: PolicyClientConfiguration
27+
28+
:ivar policy_assignments: PolicyAssignments operations
29+
:vartype policy_assignments: azure.mgmt.resource.policy.v2019_01_01.operations.PolicyAssignmentsOperations
30+
:ivar policy_definitions: PolicyDefinitions operations
31+
:vartype policy_definitions: azure.mgmt.resource.policy.v2019_01_01.operations.PolicyDefinitionsOperations
32+
:ivar policy_set_definitions: PolicySetDefinitions operations
33+
:vartype policy_set_definitions: azure.mgmt.resource.policy.v2019_01_01.operations.PolicySetDefinitionsOperations
34+
35+
:param credentials: Credentials needed for the client to connect to Azure.
36+
:type credentials: :mod:`A msrestazure Credentials
37+
object<msrestazure.azure_active_directory>`
38+
:param subscription_id: The ID of the target subscription.
39+
:type subscription_id: str
40+
:param str base_url: Service URL
41+
"""
42+
43+
def __init__(
44+
self, credentials, subscription_id, base_url=None):
45+
46+
self.config = PolicyClientConfiguration(credentials, subscription_id, base_url)
47+
super(PolicyClient, self).__init__(self.config.credentials, self.config)
48+
49+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
50+
self.api_version = '2019-01-01'
51+
self._serialize = Serializer(client_models)
52+
self._deserialize = Deserializer(client_models)
53+
54+
self.policy_assignments = PolicyAssignmentsOperations(
55+
self._client, self.config, self._serialize, self._deserialize)
56+
self.policy_definitions = PolicyDefinitionsOperations(
57+
self._client, self.config, self._serialize, self._deserialize)
58+
self.policy_set_definitions = PolicySetDefinitionsOperations(
59+
self._client, self.config, self._serialize, self._deserialize)

0 commit comments

Comments
 (0)