Skip to content

Commit

Permalink
[AutoPR] resources/resource-manager (#6834)
Browse files Browse the repository at this point in the history
* Generated from 6e7cafe31e550ebb35e76be3945898776f1afaa5 (#6129)

Update API version missed in Azure/azure-rest-api-specs#6276

* Generated from 7dd7493e50c01e2f7ceecd01127ab710280b0e32 (#6241)

chore: jsonfmt resources

* [AutoPR resources/resource-manager] Add deployment APIs at tenant scope (#6568)

* Generated from b42728c4632b9fbebd36431201aec7fbb71ede85

try #4.

* Generated from 51e50f12d99c49b499fcdc1c226d7bc749acf101

fix relative path.

* Generated from 520b56ac4a4e19581bd822b24a47a9cb5c37bc79

Fix resource group export result.

* Generated from b943cc534e5e853daa7e26704832b645ea02ef02

fix.

* Generated from 6a776881f4b88fce43ab2de7471e9b9659916ac9 (#6737)

Add 404 for HEAD APIs.

* Generated from d5154334bedc1a06875214e99338c61be88739fb (#6771)

Revert the changes for 2019-07-01/Microsoft.Resources.

* [AutoPR resources/resource-manager] Adding a baseline folder for new api version 2019-06-01 as a baseline. Content unchanged at the moment. I will do it soon (#6889)

* Generated from 75581e4277112188117db523a260ae818d949523

added stable/2019-06-01 version for Authorization RP

* Generated from edd74f0a1be6f17caa185525a63e594aef956acc

Addressed review comments.

* [AutoPR resources/resource-manager] Add ARM resources specs for 2019-08-01 (#6833)

* Generated from cfd5d39ddf70eaa415736e11e3e8f9050d14d96e

Create 2019-08-01 resources spec

* Generated from 8d17016c30349fe4d989967f46fca1b7a4197f75

Include final-state-via for export

* Generated from 70472dbb58d6ec33dba2388e49726b1a4dd3c114

Address PR feedback

* Generated from 70472dbb58d6ec33dba2388e49726b1a4dd3c114

Address PR feedback

* regenerated

* new version

* rerecorded tests
  • Loading branch information
AutorestCI authored and Zim Kalinowski committed Sep 3, 2019
1 parent ae99383 commit 299aa0e
Show file tree
Hide file tree
Showing 98 changed files with 29,574 additions and 2,377 deletions.
35 changes: 35 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,41 @@
Release History
===============

4.0.0 (2019-09-03)
++++++++++++++++++

**Features**

- Model PolicyAssignment has a new parameter enforcement_mode
- Added operation DeploymentOperations.get_at_scope
- Added operation DeploymentOperations.list_at_tenant_scope
- Added operation DeploymentOperations.get_at_tenant_scope
- Added operation DeploymentOperations.list_at_scope
- Added operation DeploymentsOperations.create_or_update_at_tenant_scope
- Added operation DeploymentsOperations.list_at_tenant_scope
- Added operation DeploymentsOperations.delete_at_scope
- Added operation DeploymentsOperations.cancel_at_tenant_scope
- Added operation DeploymentsOperations.list_at_scope
- Added operation DeploymentsOperations.get_at_scope
- Added operation DeploymentsOperations.export_template_at_tenant_scope
- Added operation DeploymentsOperations.validate_at_scope
- Added operation DeploymentsOperations.delete_at_tenant_scope
- Added operation DeploymentsOperations.export_template_at_scope
- Added operation DeploymentsOperations.validate_at_tenant_scope
- Added operation DeploymentsOperations.create_or_update_at_scope
- Added operation DeploymentsOperations.check_existence_at_tenant_scope
- Added operation DeploymentsOperations.check_existence_at_scope
- Added operation DeploymentsOperations.cancel_at_scope
- Added operation DeploymentsOperations.get_at_tenant_scope
- Added operation DeploymentsOperations.calculate_template_hash
- Added operation ProvidersOperations.list_at_tenant_scope
- Added operation ProvidersOperations.get_at_tenant_scope

**Breaking changes**

- Model DeploymentValidateResult no longer has parameter error
- Model ErrorResponse has a new signature

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

Expand Down
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 = '2019-01-01'
DEFAULT_API_VERSION = '2019-06-01'
_PROFILE_TAG = "azure.mgmt.resource.policy.PolicyClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand Down Expand Up @@ -79,6 +79,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 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>`
* 2019-06-01: :mod:`v2019_06_01.models<azure.mgmt.resource.policy.v2019_06_01.models>`
"""
if api_version == '2015-10-01-preview':
from .v2015_10_01_preview import models
Expand All @@ -101,6 +102,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2019-01-01':
from .v2019_01_01 import models
return models
elif api_version == '2019-06-01':
from .v2019_06_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
Expand All @@ -114,6 +118,7 @@ def policy_assignments(self):
* 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>`
* 2019-06-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2019_06_01.operations.PolicyAssignmentsOperations>`
"""
api_version = self._get_api_version('policy_assignments')
if api_version == '2015-10-01-preview':
Expand All @@ -130,6 +135,8 @@ def policy_assignments(self):
from .v2018_05_01.operations import PolicyAssignmentsOperations as OperationClass
elif api_version == '2019-01-01':
from .v2019_01_01.operations import PolicyAssignmentsOperations as OperationClass
elif api_version == '2019-06-01':
from .v2019_06_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 @@ -145,6 +152,7 @@ def policy_definitions(self):
* 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>`
* 2019-06-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2019_06_01.operations.PolicyDefinitionsOperations>`
"""
api_version = self._get_api_version('policy_definitions')
if api_version == '2015-10-01-preview':
Expand All @@ -161,6 +169,8 @@ def policy_definitions(self):
from .v2018_05_01.operations import PolicyDefinitionsOperations as OperationClass
elif api_version == '2019-01-01':
from .v2019_01_01.operations import PolicyDefinitionsOperations as OperationClass
elif api_version == '2019-06-01':
from .v2019_06_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 @@ -173,6 +183,7 @@ def policy_set_definitions(self):
* 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>`
* 2019-06-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2019_06_01.operations.PolicySetDefinitionsOperations>`
"""
api_version = self._get_api_version('policy_set_definitions')
if api_version == '2017-06-01-preview':
Expand All @@ -183,6 +194,8 @@ def policy_set_definitions(self):
from .v2018_05_01.operations import PolicySetDefinitionsOperations as OperationClass
elif api_version == '2019-01-01':
from .v2019_01_01.operations import PolicySetDefinitionsOperations as OperationClass
elif api_version == '2019-06-01':
from .v2019_06_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,4 +4,4 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from .v2019_01_01.models import *
from .v2019_06_01.models import *
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_06_01.operations.PolicyAssignmentsOperations
:ivar policy_definitions: PolicyDefinitions operations
:vartype policy_definitions: azure.mgmt.resource.policy.v2019_06_01.operations.PolicyDefinitionsOperations
:ivar policy_set_definitions: PolicySetDefinitions operations
:vartype policy_set_definitions: azure.mgmt.resource.policy.v2019_06_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-06-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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# 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.
# --------------------------------------------------------------------------

try:
from ._models_py3 import ErrorResponse, ErrorResponseException
from ._models_py3 import Identity
from ._models_py3 import PolicyAssignment
from ._models_py3 import PolicyDefinition
from ._models_py3 import PolicyDefinitionReference
from ._models_py3 import PolicySetDefinition
from ._models_py3 import PolicySku
except (SyntaxError, ImportError):
from ._models import ErrorResponse, ErrorResponseException
from ._models import Identity
from ._models import PolicyAssignment
from ._models import PolicyDefinition
from ._models import PolicyDefinitionReference
from ._models import PolicySetDefinition
from ._models import PolicySku
from ._paged_models import PolicyAssignmentPaged
from ._paged_models import PolicyDefinitionPaged
from ._paged_models import PolicySetDefinitionPaged
from ._policy_client_enums import (
EnforcementMode,
ResourceIdentityType,
PolicyType,
)

__all__ = [
'ErrorResponse', 'ErrorResponseException',
'Identity',
'PolicyAssignment',
'PolicyDefinition',
'PolicyDefinitionReference',
'PolicySetDefinition',
'PolicySku',
'PolicyAssignmentPaged',
'PolicyDefinitionPaged',
'PolicySetDefinitionPaged',
'EnforcementMode',
'ResourceIdentityType',
'PolicyType',
]
Loading

0 comments on commit 299aa0e

Please sign in to comment.