From 5cb47ee92153e7dafe8b068c14585d567dfaae0a Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 15 Sep 2020 22:39:46 +0000 Subject: [PATCH] Generated from b98d182eeab5322fa4cebb2ecb7f341e61a4f557 --- .../azure-mgmt-automanage/CHANGELOG.md | 5 + .../azure-mgmt-automanage/MANIFEST.in | 5 + .../azure-mgmt-automanage/README.md | 21 + .../azure-mgmt-automanage/azure/__init__.py | 1 + .../azure/mgmt/__init__.py | 1 + .../azure/mgmt/automanage/__init__.py | 19 + .../mgmt/automanage/_automanage_client.py | 64 ++ .../azure/mgmt/automanage/_configuration.py | 48 ++ .../azure/mgmt/automanage/models/__init__.py | 103 +++ .../models/_automanage_client_enums.py | 56 ++ .../azure/mgmt/automanage/models/_models.py | 717 ++++++++++++++++++ .../mgmt/automanage/models/_models_py3.py | 717 ++++++++++++++++++ .../mgmt/automanage/models/_paged_models.py | 66 ++ .../mgmt/automanage/operations/__init__.py | 22 + .../operations/_accounts_operations.py | 523 +++++++++++++ ...guration_profile_assignments_operations.py | 438 +++++++++++ ...guration_profile_preferences_operations.py | 534 +++++++++++++ .../mgmt/automanage/operations/_operations.py | 100 +++ .../azure/mgmt/automanage/version.py | 13 + .../azure-mgmt-automanage/sdk_packaging.toml | 8 + .../azure-mgmt-automanage/setup.cfg | 2 + sdk/automanage/azure-mgmt-automanage/setup.py | 90 +++ 22 files changed, 3553 insertions(+) create mode 100644 sdk/automanage/azure-mgmt-automanage/CHANGELOG.md create mode 100644 sdk/automanage/azure-mgmt-automanage/MANIFEST.in create mode 100644 sdk/automanage/azure-mgmt-automanage/README.md create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/__init__.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/__init__.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/__init__.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/_automanage_client.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/_configuration.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/__init__.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_automanage_client_enums.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_models.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_models_py3.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_paged_models.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/__init__.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_accounts_operations.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_configuration_profile_assignments_operations.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_configuration_profile_preferences_operations.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_operations.py create mode 100644 sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/version.py create mode 100644 sdk/automanage/azure-mgmt-automanage/sdk_packaging.toml create mode 100644 sdk/automanage/azure-mgmt-automanage/setup.cfg create mode 100644 sdk/automanage/azure-mgmt-automanage/setup.py diff --git a/sdk/automanage/azure-mgmt-automanage/CHANGELOG.md b/sdk/automanage/azure-mgmt-automanage/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/automanage/azure-mgmt-automanage/MANIFEST.in b/sdk/automanage/azure-mgmt-automanage/MANIFEST.in new file mode 100644 index 000000000000..a3cb07df8765 --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/automanage/azure-mgmt-automanage/README.md b/sdk/automanage/azure-mgmt-automanage/README.md new file mode 100644 index 000000000000..ba3cf7ffbde6 --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/README.md @@ -0,0 +1,21 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure MyService Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + + +# Usage + +For code examples, see [MyService Management](https://docs.microsoft.com/python/api/overview/azure/) +on docs.microsoft.com. + + +# 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. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-automanage%2FREADME.png) diff --git a/sdk/automanage/azure-mgmt-automanage/azure/__init__.py b/sdk/automanage/azure-mgmt-automanage/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/__init__.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/__init__.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/__init__.py new file mode 100644 index 000000000000..140006edca99 --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/__init__.py @@ -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 AutomanageClientConfiguration +from ._automanage_client import AutomanageClient +__all__ = ['AutomanageClient', 'AutomanageClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/_automanage_client.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/_automanage_client.py new file mode 100644 index 000000000000..f0aa8aab8dbd --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/_automanage_client.py @@ -0,0 +1,64 @@ +# 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 AutomanageClientConfiguration +from .operations import AccountsOperations +from .operations import ConfigurationProfileAssignmentsOperations +from .operations import ConfigurationProfilePreferencesOperations +from .operations import Operations +from . import models + + +class AutomanageClient(SDKClient): + """Automanage Client + + :ivar config: Configuration for client. + :vartype config: AutomanageClientConfiguration + + :ivar accounts: Accounts operations + :vartype accounts: azure.mgmt.automanage.operations.AccountsOperations + :ivar configuration_profile_assignments: ConfigurationProfileAssignments operations + :vartype configuration_profile_assignments: azure.mgmt.automanage.operations.ConfigurationProfileAssignmentsOperations + :ivar configuration_profile_preferences: ConfigurationProfilePreferences operations + :vartype configuration_profile_preferences: azure.mgmt.automanage.operations.ConfigurationProfilePreferencesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.automanage.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :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 = AutomanageClientConfiguration(credentials, subscription_id, base_url) + super(AutomanageClient, 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 = '2020-06-30-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.accounts = AccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.configuration_profile_assignments = ConfigurationProfileAssignmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.configuration_profile_preferences = ConfigurationProfilePreferencesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/_configuration.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/_configuration.py new file mode 100644 index 000000000000..9bfaeefec5a2 --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/_configuration.py @@ -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 AutomanageClientConfiguration(AzureConfiguration): + """Configuration for AutomanageClient + 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` + :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(AutomanageClientConfiguration, 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-automanage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/__init__.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/__init__.py new file mode 100644 index 000000000000..4b20694561cb --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/__init__.py @@ -0,0 +1,103 @@ +# 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 Account + from ._models_py3 import AccountIdentity + from ._models_py3 import AccountUpdate + from ._models_py3 import AzureEntityResource + from ._models_py3 import ConfigurationProfileAssignment + from ._models_py3 import ConfigurationProfileAssignmentCompliance + from ._models_py3 import ConfigurationProfileAssignmentProperties + from ._models_py3 import ConfigurationProfilePreference + from ._models_py3 import ConfigurationProfilePreferenceAntiMalware + from ._models_py3 import ConfigurationProfilePreferenceProperties + from ._models_py3 import ConfigurationProfilePreferenceUpdate + from ._models_py3 import ConfigurationProfilePreferenceVmBackup + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import ErrorResponseError + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import TrackedResource + from ._models_py3 import UpdateResource +except (SyntaxError, ImportError): + from ._models import Account + from ._models import AccountIdentity + from ._models import AccountUpdate + from ._models import AzureEntityResource + from ._models import ConfigurationProfileAssignment + from ._models import ConfigurationProfileAssignmentCompliance + from ._models import ConfigurationProfileAssignmentProperties + from ._models import ConfigurationProfilePreference + from ._models import ConfigurationProfilePreferenceAntiMalware + from ._models import ConfigurationProfilePreferenceProperties + from ._models import ConfigurationProfilePreferenceUpdate + from ._models import ConfigurationProfilePreferenceVmBackup + from ._models import ErrorAdditionalInfo + from ._models import ErrorResponse, ErrorResponseException + from ._models import ErrorResponseError + from ._models import Operation + from ._models import OperationDisplay + from ._models import ProxyResource + from ._models import Resource + from ._models import TrackedResource + from ._models import UpdateResource +from ._paged_models import AccountPaged +from ._paged_models import ConfigurationProfileAssignmentPaged +from ._paged_models import ConfigurationProfilePreferencePaged +from ._paged_models import OperationPaged +from ._automanage_client_enums import ( + ResourceIdentityType, + ConfigurationProfile, + ProvisioningState, + UpdateStatus, + EnableRealTimeProtection, + RunScheduledScan, + ScanType, +) + +__all__ = [ + 'Account', + 'AccountIdentity', + 'AccountUpdate', + 'AzureEntityResource', + 'ConfigurationProfileAssignment', + 'ConfigurationProfileAssignmentCompliance', + 'ConfigurationProfileAssignmentProperties', + 'ConfigurationProfilePreference', + 'ConfigurationProfilePreferenceAntiMalware', + 'ConfigurationProfilePreferenceProperties', + 'ConfigurationProfilePreferenceUpdate', + 'ConfigurationProfilePreferenceVmBackup', + 'ErrorAdditionalInfo', + 'ErrorResponse', 'ErrorResponseException', + 'ErrorResponseError', + 'Operation', + 'OperationDisplay', + 'ProxyResource', + 'Resource', + 'TrackedResource', + 'UpdateResource', + 'AccountPaged', + 'ConfigurationProfileAssignmentPaged', + 'ConfigurationProfilePreferencePaged', + 'OperationPaged', + 'ResourceIdentityType', + 'ConfigurationProfile', + 'ProvisioningState', + 'UpdateStatus', + 'EnableRealTimeProtection', + 'RunScheduledScan', + 'ScanType', +] diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_automanage_client_enums.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_automanage_client_enums.py new file mode 100644 index 000000000000..50f72d1021c1 --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_automanage_client_enums.py @@ -0,0 +1,56 @@ +# 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 enum import Enum + + +class ResourceIdentityType(str, Enum): + + system_assigned = "SystemAssigned" + none = "None" + + +class ConfigurationProfile(str, Enum): + + azurevirtualmachinebestpractices_dev_test = "Azure virtual machine best practices – Dev/Test" + azurevirtualmachinebestpractices_production = "Azure virtual machine best practices – Production" + + +class ProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + created = "Created" + + +class UpdateStatus(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + created = "Created" + + +class EnableRealTimeProtection(str, Enum): + + true = "True" + false = "False" + + +class RunScheduledScan(str, Enum): + + true = "True" + false = "False" + + +class ScanType(str, Enum): + + quick = "Quick" + full = "Full" diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_models.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_models.py new file mode 100644 index 000000000000..d40b7608d324 --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_models.py @@ -0,0 +1,717 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + + +class Account(TrackedResource): + """Definition of the Automanage account. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param identity: The identity of the Automanage account. + :type identity: ~azure.mgmt.automanage.models.AccountIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'AccountIdentity'}, + } + + def __init__(self, **kwargs): + super(Account, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + + +class AccountIdentity(Model): + """Identity for the Automanage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of Automanage account identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the Automanage account. + :vartype tenant_id: str + :param type: The type of identity used for the Automanage account. + Currently, the only supported type is 'SystemAssigned', which implicitly + creates an identity. Possible values include: 'SystemAssigned', 'None' + :type type: str or ~azure.mgmt.automanage.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, **kwargs): + super(AccountIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class UpdateResource(Model): + """Represents an update resource. + + :param tags: The tags of the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(UpdateResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class AccountUpdate(UpdateResource): + """Definition of the Automanage account. + + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param identity: The identity of the Automanage account. + :type identity: ~azure.mgmt.automanage.models.AccountIdentity + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'AccountIdentity'}, + } + + def __init__(self, **kwargs): + super(AccountUpdate, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + + +class ConfigurationProfileAssignment(ProxyResource): + """Configuration profile assignment is an association between a VM and + automanage profile configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param properties: Properties of the configuration profile assignment. + :type properties: + ~azure.mgmt.automanage.models.ConfigurationProfileAssignmentProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ConfigurationProfileAssignmentProperties'}, + } + + def __init__(self, **kwargs): + super(ConfigurationProfileAssignment, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ConfigurationProfileAssignmentCompliance(Model): + """The compliance status for the configuration profile assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update_status: The state of compliance, which only appears in the + response. Possible values include: 'Succeeded', 'Failed', 'Created' + :vartype update_status: str or ~azure.mgmt.automanage.models.UpdateStatus + """ + + _validation = { + 'update_status': {'readonly': True}, + } + + _attribute_map = { + 'update_status': {'key': 'updateStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConfigurationProfileAssignmentCompliance, self).__init__(**kwargs) + self.update_status = None + + +class ConfigurationProfileAssignmentProperties(Model): + """Automanage configuration profile assignment properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param configuration_profile: A value indicating configuration profile. + Possible values include: 'Azure virtual machine best practices – + Dev/Test', 'Azure virtual machine best practices – Production' + :type configuration_profile: str or + ~azure.mgmt.automanage.models.ConfigurationProfile + :param target_id: The target VM resource URI + :type target_id: str + :param account_id: The Automanage account ARM Resource URI + :type account_id: str + :param configuration_profile_preference_id: The configuration profile + custom preferences ARM resource URI + :type configuration_profile_preference_id: str + :ivar provisioning_state: The state of onboarding, which only appears in + the response. Possible values include: 'Succeeded', 'Failed', 'Created' + :vartype provisioning_state: str or + ~azure.mgmt.automanage.models.ProvisioningState + :param compliance: The configuration setting for the configuration + profile. + :type compliance: + ~azure.mgmt.automanage.models.ConfigurationProfileAssignmentCompliance + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'configuration_profile': {'key': 'configurationProfile', 'type': 'str'}, + 'target_id': {'key': 'targetId', 'type': 'str'}, + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'configuration_profile_preference_id': {'key': 'configurationProfilePreferenceId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'compliance': {'key': 'compliance', 'type': 'ConfigurationProfileAssignmentCompliance'}, + } + + def __init__(self, **kwargs): + super(ConfigurationProfileAssignmentProperties, self).__init__(**kwargs) + self.configuration_profile = kwargs.get('configuration_profile', None) + self.target_id = kwargs.get('target_id', None) + self.account_id = kwargs.get('account_id', None) + self.configuration_profile_preference_id = kwargs.get('configuration_profile_preference_id', None) + self.provisioning_state = None + self.compliance = kwargs.get('compliance', None) + + +class ConfigurationProfilePreference(TrackedResource): + """Definition of the configuration profile preference. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param properties: Properties of the configuration profile preference. + :type properties: + ~azure.mgmt.automanage.models.ConfigurationProfilePreferenceProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ConfigurationProfilePreferenceProperties'}, + } + + def __init__(self, **kwargs): + super(ConfigurationProfilePreference, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ConfigurationProfilePreferenceAntiMalware(Model): + """Automanage configuration profile Antimalware preferences. + + :param enable_real_time_protection: Enables or disables Real Time + Protection. Possible values include: 'True', 'False' + :type enable_real_time_protection: str or + ~azure.mgmt.automanage.models.EnableRealTimeProtection + :param exclusions: Extensions, Paths and Processes that must be excluded + from scan + :type exclusions: object + :param run_scheduled_scan: Enables or disables a periodic scan for + antimalware. Possible values include: 'True', 'False' + :type run_scheduled_scan: str or + ~azure.mgmt.automanage.models.RunScheduledScan + :param scan_type: Type of scheduled scan. Possible values include: + 'Quick', 'Full' + :type scan_type: str or ~azure.mgmt.automanage.models.ScanType + :param scan_day: Schedule scan settings day + :type scan_day: str + :param scan_time_in_minutes: Schedule scan settings time + :type scan_time_in_minutes: str + """ + + _attribute_map = { + 'enable_real_time_protection': {'key': 'enableRealTimeProtection', 'type': 'str'}, + 'exclusions': {'key': 'exclusions', 'type': 'object'}, + 'run_scheduled_scan': {'key': 'runScheduledScan', 'type': 'str'}, + 'scan_type': {'key': 'scanType', 'type': 'str'}, + 'scan_day': {'key': 'scanDay', 'type': 'str'}, + 'scan_time_in_minutes': {'key': 'scanTimeInMinutes', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConfigurationProfilePreferenceAntiMalware, self).__init__(**kwargs) + self.enable_real_time_protection = kwargs.get('enable_real_time_protection', None) + self.exclusions = kwargs.get('exclusions', None) + self.run_scheduled_scan = kwargs.get('run_scheduled_scan', None) + self.scan_type = kwargs.get('scan_type', None) + self.scan_day = kwargs.get('scan_day', None) + self.scan_time_in_minutes = kwargs.get('scan_time_in_minutes', None) + + +class ConfigurationProfilePreferenceProperties(Model): + """Automanage configuration profile preference properties. + + :param vm_backup: The custom preferences for Azure VM Backup. + :type vm_backup: + ~azure.mgmt.automanage.models.ConfigurationProfilePreferenceVmBackup + :param anti_malware: The custom preferences for Azure Antimalware. + :type anti_malware: + ~azure.mgmt.automanage.models.ConfigurationProfilePreferenceAntiMalware + """ + + _attribute_map = { + 'vm_backup': {'key': 'vmBackup', 'type': 'ConfigurationProfilePreferenceVmBackup'}, + 'anti_malware': {'key': 'antiMalware', 'type': 'ConfigurationProfilePreferenceAntiMalware'}, + } + + def __init__(self, **kwargs): + super(ConfigurationProfilePreferenceProperties, self).__init__(**kwargs) + self.vm_backup = kwargs.get('vm_backup', None) + self.anti_malware = kwargs.get('anti_malware', None) + + +class ConfigurationProfilePreferenceUpdate(UpdateResource): + """Definition of the configuration profile preference. + + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param properties: Properties of the configuration profile preference. + :type properties: + ~azure.mgmt.automanage.models.ConfigurationProfilePreferenceProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'ConfigurationProfilePreferenceProperties'}, + } + + def __init__(self, **kwargs): + super(ConfigurationProfilePreferenceUpdate, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ConfigurationProfilePreferenceVmBackup(Model): + """Automanage configuration profile VM Backup preferences. + + :param time_zone: TimeZone optional input as string. For example: Pacific + Standard Time + :type time_zone: str + :param instant_rp_retention_range_in_days: Instant RP retention policy + range in days + :type instant_rp_retention_range_in_days: int + :param retention_policy: Retention policy with the details on backup copy + retention ranges. + :type retention_policy: str + :param schedule_policy: Backup schedule specified as part of backup + policy. + :type schedule_policy: str + """ + + _attribute_map = { + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'instant_rp_retention_range_in_days': {'key': 'instantRpRetentionRangeInDays', 'type': 'int'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'str'}, + 'schedule_policy': {'key': 'schedulePolicy', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConfigurationProfilePreferenceVmBackup, self).__init__(**kwargs) + self.time_zone = kwargs.get('time_zone', None) + self.instant_rp_retention_range_in_days = kwargs.get('instant_rp_retention_range_in_days', None) + self.retention_policy = kwargs.get('retention_policy', None) + self.schedule_policy = kwargs.get('schedule_policy', None) + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """The resource management error response. + + :param error: The error object. + :type error: ~azure.mgmt.automanage.models.ErrorResponseError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ErrorResponseError(Model): + """The error object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.automanage.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.automanage.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class Operation(Model): + """Automanage REST API operation. + + :param name: Operation name: For ex. + providers/Microsoft.Automanage/configurationProfileAssignments/write or + read + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: str + :param display: Provider, Resource, Operation and description values. + :type display: ~azure.mgmt.automanage.models.OperationDisplay + :param status_code: Service provider: Microsoft.Automanage + :type status_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'status_code': {'key': 'properties.statusCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + self.status_code = kwargs.get('status_code', None) + + +class OperationDisplay(Model): + """Provider, Resource, Operation and description values. + + :param provider: Service provider: Microsoft.Automanage + :type provider: str + :param resource: Resource on which the operation is performed: For ex. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description about operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_models_py3.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_models_py3.py new file mode 100644 index 000000000000..297da2eb4f9f --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_models_py3.py @@ -0,0 +1,717 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class Account(TrackedResource): + """Definition of the Automanage account. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param identity: The identity of the Automanage account. + :type identity: ~azure.mgmt.automanage.models.AccountIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'AccountIdentity'}, + } + + def __init__(self, *, location: str, tags=None, identity=None, **kwargs) -> None: + super(Account, self).__init__(tags=tags, location=location, **kwargs) + self.identity = identity + + +class AccountIdentity(Model): + """Identity for the Automanage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of Automanage account identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the Automanage account. + :vartype tenant_id: str + :param type: The type of identity used for the Automanage account. + Currently, the only supported type is 'SystemAssigned', which implicitly + creates an identity. Possible values include: 'SystemAssigned', 'None' + :type type: str or ~azure.mgmt.automanage.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(AccountIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class UpdateResource(Model): + """Represents an update resource. + + :param tags: The tags of the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(UpdateResource, self).__init__(**kwargs) + self.tags = tags + + +class AccountUpdate(UpdateResource): + """Definition of the Automanage account. + + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param identity: The identity of the Automanage account. + :type identity: ~azure.mgmt.automanage.models.AccountIdentity + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'AccountIdentity'}, + } + + def __init__(self, *, tags=None, identity=None, **kwargs) -> None: + super(AccountUpdate, self).__init__(tags=tags, **kwargs) + self.identity = identity + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + + +class ConfigurationProfileAssignment(ProxyResource): + """Configuration profile assignment is an association between a VM and + automanage profile configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param properties: Properties of the configuration profile assignment. + :type properties: + ~azure.mgmt.automanage.models.ConfigurationProfileAssignmentProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ConfigurationProfileAssignmentProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(ConfigurationProfileAssignment, self).__init__(**kwargs) + self.properties = properties + + +class ConfigurationProfileAssignmentCompliance(Model): + """The compliance status for the configuration profile assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update_status: The state of compliance, which only appears in the + response. Possible values include: 'Succeeded', 'Failed', 'Created' + :vartype update_status: str or ~azure.mgmt.automanage.models.UpdateStatus + """ + + _validation = { + 'update_status': {'readonly': True}, + } + + _attribute_map = { + 'update_status': {'key': 'updateStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ConfigurationProfileAssignmentCompliance, self).__init__(**kwargs) + self.update_status = None + + +class ConfigurationProfileAssignmentProperties(Model): + """Automanage configuration profile assignment properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param configuration_profile: A value indicating configuration profile. + Possible values include: 'Azure virtual machine best practices – + Dev/Test', 'Azure virtual machine best practices – Production' + :type configuration_profile: str or + ~azure.mgmt.automanage.models.ConfigurationProfile + :param target_id: The target VM resource URI + :type target_id: str + :param account_id: The Automanage account ARM Resource URI + :type account_id: str + :param configuration_profile_preference_id: The configuration profile + custom preferences ARM resource URI + :type configuration_profile_preference_id: str + :ivar provisioning_state: The state of onboarding, which only appears in + the response. Possible values include: 'Succeeded', 'Failed', 'Created' + :vartype provisioning_state: str or + ~azure.mgmt.automanage.models.ProvisioningState + :param compliance: The configuration setting for the configuration + profile. + :type compliance: + ~azure.mgmt.automanage.models.ConfigurationProfileAssignmentCompliance + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'configuration_profile': {'key': 'configurationProfile', 'type': 'str'}, + 'target_id': {'key': 'targetId', 'type': 'str'}, + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'configuration_profile_preference_id': {'key': 'configurationProfilePreferenceId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'compliance': {'key': 'compliance', 'type': 'ConfigurationProfileAssignmentCompliance'}, + } + + def __init__(self, *, configuration_profile=None, target_id: str=None, account_id: str=None, configuration_profile_preference_id: str=None, compliance=None, **kwargs) -> None: + super(ConfigurationProfileAssignmentProperties, self).__init__(**kwargs) + self.configuration_profile = configuration_profile + self.target_id = target_id + self.account_id = account_id + self.configuration_profile_preference_id = configuration_profile_preference_id + self.provisioning_state = None + self.compliance = compliance + + +class ConfigurationProfilePreference(TrackedResource): + """Definition of the configuration profile preference. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param properties: Properties of the configuration profile preference. + :type properties: + ~azure.mgmt.automanage.models.ConfigurationProfilePreferenceProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ConfigurationProfilePreferenceProperties'}, + } + + def __init__(self, *, location: str, tags=None, properties=None, **kwargs) -> None: + super(ConfigurationProfilePreference, self).__init__(tags=tags, location=location, **kwargs) + self.properties = properties + + +class ConfigurationProfilePreferenceAntiMalware(Model): + """Automanage configuration profile Antimalware preferences. + + :param enable_real_time_protection: Enables or disables Real Time + Protection. Possible values include: 'True', 'False' + :type enable_real_time_protection: str or + ~azure.mgmt.automanage.models.EnableRealTimeProtection + :param exclusions: Extensions, Paths and Processes that must be excluded + from scan + :type exclusions: object + :param run_scheduled_scan: Enables or disables a periodic scan for + antimalware. Possible values include: 'True', 'False' + :type run_scheduled_scan: str or + ~azure.mgmt.automanage.models.RunScheduledScan + :param scan_type: Type of scheduled scan. Possible values include: + 'Quick', 'Full' + :type scan_type: str or ~azure.mgmt.automanage.models.ScanType + :param scan_day: Schedule scan settings day + :type scan_day: str + :param scan_time_in_minutes: Schedule scan settings time + :type scan_time_in_minutes: str + """ + + _attribute_map = { + 'enable_real_time_protection': {'key': 'enableRealTimeProtection', 'type': 'str'}, + 'exclusions': {'key': 'exclusions', 'type': 'object'}, + 'run_scheduled_scan': {'key': 'runScheduledScan', 'type': 'str'}, + 'scan_type': {'key': 'scanType', 'type': 'str'}, + 'scan_day': {'key': 'scanDay', 'type': 'str'}, + 'scan_time_in_minutes': {'key': 'scanTimeInMinutes', 'type': 'str'}, + } + + def __init__(self, *, enable_real_time_protection=None, exclusions=None, run_scheduled_scan=None, scan_type=None, scan_day: str=None, scan_time_in_minutes: str=None, **kwargs) -> None: + super(ConfigurationProfilePreferenceAntiMalware, self).__init__(**kwargs) + self.enable_real_time_protection = enable_real_time_protection + self.exclusions = exclusions + self.run_scheduled_scan = run_scheduled_scan + self.scan_type = scan_type + self.scan_day = scan_day + self.scan_time_in_minutes = scan_time_in_minutes + + +class ConfigurationProfilePreferenceProperties(Model): + """Automanage configuration profile preference properties. + + :param vm_backup: The custom preferences for Azure VM Backup. + :type vm_backup: + ~azure.mgmt.automanage.models.ConfigurationProfilePreferenceVmBackup + :param anti_malware: The custom preferences for Azure Antimalware. + :type anti_malware: + ~azure.mgmt.automanage.models.ConfigurationProfilePreferenceAntiMalware + """ + + _attribute_map = { + 'vm_backup': {'key': 'vmBackup', 'type': 'ConfigurationProfilePreferenceVmBackup'}, + 'anti_malware': {'key': 'antiMalware', 'type': 'ConfigurationProfilePreferenceAntiMalware'}, + } + + def __init__(self, *, vm_backup=None, anti_malware=None, **kwargs) -> None: + super(ConfigurationProfilePreferenceProperties, self).__init__(**kwargs) + self.vm_backup = vm_backup + self.anti_malware = anti_malware + + +class ConfigurationProfilePreferenceUpdate(UpdateResource): + """Definition of the configuration profile preference. + + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param properties: Properties of the configuration profile preference. + :type properties: + ~azure.mgmt.automanage.models.ConfigurationProfilePreferenceProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'ConfigurationProfilePreferenceProperties'}, + } + + def __init__(self, *, tags=None, properties=None, **kwargs) -> None: + super(ConfigurationProfilePreferenceUpdate, self).__init__(tags=tags, **kwargs) + self.properties = properties + + +class ConfigurationProfilePreferenceVmBackup(Model): + """Automanage configuration profile VM Backup preferences. + + :param time_zone: TimeZone optional input as string. For example: Pacific + Standard Time + :type time_zone: str + :param instant_rp_retention_range_in_days: Instant RP retention policy + range in days + :type instant_rp_retention_range_in_days: int + :param retention_policy: Retention policy with the details on backup copy + retention ranges. + :type retention_policy: str + :param schedule_policy: Backup schedule specified as part of backup + policy. + :type schedule_policy: str + """ + + _attribute_map = { + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'instant_rp_retention_range_in_days': {'key': 'instantRpRetentionRangeInDays', 'type': 'int'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'str'}, + 'schedule_policy': {'key': 'schedulePolicy', 'type': 'str'}, + } + + def __init__(self, *, time_zone: str=None, instant_rp_retention_range_in_days: int=None, retention_policy: str=None, schedule_policy: str=None, **kwargs) -> None: + super(ConfigurationProfilePreferenceVmBackup, self).__init__(**kwargs) + self.time_zone = time_zone + self.instant_rp_retention_range_in_days = instant_rp_retention_range_in_days + self.retention_policy = retention_policy + self.schedule_policy = schedule_policy + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """The resource management error response. + + :param error: The error object. + :type error: ~azure.mgmt.automanage.models.ErrorResponseError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ErrorResponseError(Model): + """The error object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.automanage.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.automanage.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class Operation(Model): + """Automanage REST API operation. + + :param name: Operation name: For ex. + providers/Microsoft.Automanage/configurationProfileAssignments/write or + read + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: str + :param display: Provider, Resource, Operation and description values. + :type display: ~azure.mgmt.automanage.models.OperationDisplay + :param status_code: Service provider: Microsoft.Automanage + :type status_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'status_code': {'key': 'properties.statusCode', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, is_data_action: str=None, display=None, status_code: str=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + self.status_code = status_code + + +class OperationDisplay(Model): + """Provider, Resource, Operation and description values. + + :param provider: Service provider: Microsoft.Automanage + :type provider: str + :param resource: Resource on which the operation is performed: For ex. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description about operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_paged_models.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_paged_models.py new file mode 100644 index 000000000000..bc187b07bf8e --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/models/_paged_models.py @@ -0,0 +1,66 @@ +# 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.paging import Paged + + +class AccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`Account ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Account]'} + } + + def __init__(self, *args, **kwargs): + + super(AccountPaged, self).__init__(*args, **kwargs) +class ConfigurationProfileAssignmentPaged(Paged): + """ + A paging container for iterating over a list of :class:`ConfigurationProfileAssignment ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ConfigurationProfileAssignment]'} + } + + def __init__(self, *args, **kwargs): + + super(ConfigurationProfileAssignmentPaged, self).__init__(*args, **kwargs) +class ConfigurationProfilePreferencePaged(Paged): + """ + A paging container for iterating over a list of :class:`ConfigurationProfilePreference ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ConfigurationProfilePreference]'} + } + + def __init__(self, *args, **kwargs): + + super(ConfigurationProfilePreferencePaged, self).__init__(*args, **kwargs) +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/__init__.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/__init__.py new file mode 100644 index 000000000000..87ef4ee1d646 --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/__init__.py @@ -0,0 +1,22 @@ +# 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 ._accounts_operations import AccountsOperations +from ._configuration_profile_assignments_operations import ConfigurationProfileAssignmentsOperations +from ._configuration_profile_preferences_operations import ConfigurationProfilePreferencesOperations +from ._operations import Operations + +__all__ = [ + 'AccountsOperations', + 'ConfigurationProfileAssignmentsOperations', + 'ConfigurationProfilePreferencesOperations', + 'Operations', +] diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_accounts_operations.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_accounts_operations.py new file mode 100644 index 000000000000..d13c47ab3695 --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_accounts_operations.py @@ -0,0 +1,523 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class AccountsOperations(object): + """AccountsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-06-30-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-30-preview" + + self.config = config + + + def _create_or_update_initial( + self, account_name, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Account') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Account', response) + if response.status_code == 201: + deserialized = self._deserialize('Account', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, account_name, resource_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates an Automanage Account. + + :param account_name: Name of the Automanage account. + :type account_name: str + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param parameters: Parameters supplied to create or update Automanage + account. + :type parameters: ~azure.mgmt.automanage.models.Account + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Account or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.automanage.models.Account] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.automanage.models.Account]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + account_name=account_name, + resource_group_name=resource_group_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Account', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts/{accountName}'} + + def get( + self, account_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get information about a Automanage account. + + :param account_name: The Automanage account name. + :type account_name: str + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Account or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automanage.models.Account or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Account', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts/{accountName}'} + + + def _delete_initial( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a Automanage account. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param account_name: Name of the Automanage account + :type account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts/{accountName}'} + + + def _update_initial( + self, account_name, resource_group_name, tags=None, identity=None, custom_headers=None, raw=False, **operation_config): + parameters = models.AccountUpdate(tags=tags, identity=identity) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AccountUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Account', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, account_name, resource_group_name, tags=None, identity=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates an Automanage Account. + + :param account_name: Name of the Automanage account. + :type account_name: str + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param identity: The identity of the Automanage account. + :type identity: ~azure.mgmt.automanage.models.AccountIdentity + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Account or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.automanage.models.Account] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.automanage.models.Account]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_initial( + account_name=account_name, + resource_group_name=resource_group_name, + tags=tags, + identity=identity, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Account', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts/{accountName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of Automanage accounts within a given resource group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Account + :rtype: + ~azure.mgmt.automanage.models.AccountPaged[~azure.mgmt.automanage.models.Account] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of Automanage accounts within a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Account + :rtype: + ~azure.mgmt.automanage.models.AccountPaged[~azure.mgmt.automanage.models.Account] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Automanage/accounts'} diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_configuration_profile_assignments_operations.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_configuration_profile_assignments_operations.py new file mode 100644 index 000000000000..d227d7af2146 --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_configuration_profile_assignments_operations.py @@ -0,0 +1,438 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ConfigurationProfileAssignmentsOperations(object): + """ConfigurationProfileAssignmentsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-06-30-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-30-preview" + + self.config = config + + + def _create_or_update_initial( + self, configuration_profile_assignment_name, resource_group_name, vm_name, properties=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ConfigurationProfileAssignment(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'configurationProfileAssignmentName': self._serialize.url("configuration_profile_assignment_name", configuration_profile_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ConfigurationProfileAssignment') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConfigurationProfileAssignment', response) + if response.status_code == 201: + deserialized = self._deserialize('ConfigurationProfileAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, configuration_profile_assignment_name, resource_group_name, vm_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates an association between a VM and Automanage configuration + profile. + + :param configuration_profile_assignment_name: Name of the + configuration profile assignment. Only default is supported. + :type configuration_profile_assignment_name: str + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param properties: Properties of the configuration profile assignment. + :type properties: + ~azure.mgmt.automanage.models.ConfigurationProfileAssignmentProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConfigurationProfileAssignment or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.automanage.models.ConfigurationProfileAssignment] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.automanage.models.ConfigurationProfileAssignment]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + configuration_profile_assignment_name=configuration_profile_assignment_name, + resource_group_name=resource_group_name, + vm_name=vm_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConfigurationProfileAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}'} + + def get( + self, resource_group_name, configuration_profile_assignment_name, vm_name, custom_headers=None, raw=False, **operation_config): + """Get information about a configuration profile assignment. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param configuration_profile_assignment_name: The configuration + profile assignment name. + :type configuration_profile_assignment_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConfigurationProfileAssignment or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.automanage.models.ConfigurationProfileAssignment + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'configurationProfileAssignmentName': self._serialize.url("configuration_profile_assignment_name", configuration_profile_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'vmName': self._serialize.url("vm_name", vm_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ConfigurationProfileAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}'} + + + def _delete_initial( + self, resource_group_name, configuration_profile_assignment_name, vm_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'configurationProfileAssignmentName': self._serialize.url("configuration_profile_assignment_name", configuration_profile_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'vmName': self._serialize.url("vm_name", vm_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, configuration_profile_assignment_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a configuration profile assignment. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param configuration_profile_assignment_name: Name of the + configuration profile assignment + :type configuration_profile_assignment_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + configuration_profile_assignment_name=configuration_profile_assignment_name, + vm_name=vm_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get list of configuration profile assignments. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConfigurationProfileAssignment + :rtype: + ~azure.mgmt.automanage.models.ConfigurationProfileAssignmentPaged[~azure.mgmt.automanage.models.ConfigurationProfileAssignment] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ConfigurationProfileAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfileAssignments'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Get list of configuration profile assignments under a given + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConfigurationProfileAssignment + :rtype: + ~azure.mgmt.automanage.models.ConfigurationProfileAssignmentPaged[~azure.mgmt.automanage.models.ConfigurationProfileAssignment] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ConfigurationProfileAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Automanage/configurationProfileAssignments'} diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_configuration_profile_preferences_operations.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_configuration_profile_preferences_operations.py new file mode 100644 index 000000000000..e4333f7d1299 --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_configuration_profile_preferences_operations.py @@ -0,0 +1,534 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ConfigurationProfilePreferencesOperations(object): + """ConfigurationProfilePreferencesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-06-30-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-30-preview" + + self.config = config + + + def _create_or_update_initial( + self, configuration_profile_preference_name, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'configurationProfilePreferenceName': self._serialize.url("configuration_profile_preference_name", configuration_profile_preference_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ConfigurationProfilePreference') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConfigurationProfilePreference', response) + if response.status_code == 201: + deserialized = self._deserialize('ConfigurationProfilePreference', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, configuration_profile_preference_name, resource_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a configuration profile preference. + + :param configuration_profile_preference_name: Name of the + configuration profile preference. + :type configuration_profile_preference_name: str + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param parameters: Parameters supplied to create or update + configuration profile preference. + :type parameters: + ~azure.mgmt.automanage.models.ConfigurationProfilePreference + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConfigurationProfilePreference or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.automanage.models.ConfigurationProfilePreference] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.automanage.models.ConfigurationProfilePreference]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + configuration_profile_preference_name=configuration_profile_preference_name, + resource_group_name=resource_group_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConfigurationProfilePreference', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfilePreferences/{configurationProfilePreferenceName}'} + + def get( + self, configuration_profile_preference_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get information about a configuration profile preference. + + :param configuration_profile_preference_name: The configuration + profile preference name. + :type configuration_profile_preference_name: str + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConfigurationProfilePreference or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.automanage.models.ConfigurationProfilePreference + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'configurationProfilePreferenceName': self._serialize.url("configuration_profile_preference_name", configuration_profile_preference_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ConfigurationProfilePreference', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfilePreferences/{configurationProfilePreferenceName}'} + + + def _delete_initial( + self, resource_group_name, configuration_profile_preference_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'configurationProfilePreferenceName': self._serialize.url("configuration_profile_preference_name", configuration_profile_preference_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, configuration_profile_preference_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a configuration profile preference. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param configuration_profile_preference_name: Name of the + configuration profile preference + :type configuration_profile_preference_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + configuration_profile_preference_name=configuration_profile_preference_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfilePreferences/{configurationProfilePreferenceName}'} + + + def _update_initial( + self, configuration_profile_preference_name, resource_group_name, tags=None, properties=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ConfigurationProfilePreferenceUpdate(tags=tags, properties=properties) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'configurationProfilePreferenceName': self._serialize.url("configuration_profile_preference_name", configuration_profile_preference_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ConfigurationProfilePreferenceUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConfigurationProfilePreference', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, configuration_profile_preference_name, resource_group_name, tags=None, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a configuration profile preference. + + :param configuration_profile_preference_name: Name of the + configuration profile preference. + :type configuration_profile_preference_name: str + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param properties: Properties of the configuration profile preference. + :type properties: + ~azure.mgmt.automanage.models.ConfigurationProfilePreferenceProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConfigurationProfilePreference or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.automanage.models.ConfigurationProfilePreference] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.automanage.models.ConfigurationProfilePreference]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_initial( + configuration_profile_preference_name=configuration_profile_preference_name, + resource_group_name=resource_group_name, + tags=tags, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConfigurationProfilePreference', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfilePreferences/{configurationProfilePreferenceName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of configuration profile preferences within a given + resource group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConfigurationProfilePreference + :rtype: + ~azure.mgmt.automanage.models.ConfigurationProfilePreferencePaged[~azure.mgmt.automanage.models.ConfigurationProfilePreference] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ConfigurationProfilePreferencePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfilePreferences'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of configuration profile preferences within a + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConfigurationProfilePreference + :rtype: + ~azure.mgmt.automanage.models.ConfigurationProfilePreferencePaged[~azure.mgmt.automanage.models.ConfigurationProfilePreference] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ConfigurationProfilePreferencePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Automanage/configurationProfilePreferences'} diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_operations.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_operations.py new file mode 100644 index 000000000000..ba8797a7e915 --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_operations.py @@ -0,0 +1,100 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-06-30-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-30-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Automanage REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.automanage.models.OperationPaged[~azure.mgmt.automanage.models.Operation] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Automanage/operations'} diff --git a/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/version.py b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + diff --git a/sdk/automanage/azure-mgmt-automanage/sdk_packaging.toml b/sdk/automanage/azure-mgmt-automanage/sdk_packaging.toml new file mode 100644 index 000000000000..479ebb50c61d --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-automanage" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/sdk/automanage/azure-mgmt-automanage/setup.cfg b/sdk/automanage/azure-mgmt-automanage/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/automanage/azure-mgmt-automanage/setup.py b/sdk/automanage/azure-mgmt-automanage/setup.py new file mode 100644 index 000000000000..94685c040ebe --- /dev/null +++ b/sdk/automanage/azure-mgmt-automanage/setup.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-automanage" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + long_description_content_type='text/markdown', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)