diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/CHANGELOG.md b/sdk/machinelearning/azure-mgmt-guestconfig/CHANGELOG.md new file mode 100644 index 000000000000..081f40898987 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0b1 (2021-07-13) + +* Initial Release diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/MANIFEST.in b/sdk/machinelearning/azure-mgmt-guestconfig/MANIFEST.in new file mode 100644 index 000000000000..3a9b6517412b --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/MANIFEST.in @@ -0,0 +1,6 @@ +include _meta.json +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/README.md b/sdk/machinelearning/azure-mgmt-guestconfig/README.md new file mode 100644 index 000000000000..81b5157b53c9 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/README.md @@ -0,0 +1,27 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure Guestconfig 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 + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [Guestconfig Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +# 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-guestconfig%2FREADME.png) diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/_meta.json b/sdk/machinelearning/azure-mgmt-guestconfig/_meta.json new file mode 100644 index 000000000000..acfcecc0577c --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.2", + "use": [ + "@autorest/python@5.8.1", + "@autorest/modelerfour@4.19.2" + ], + "commit": "33b8d6f7bf2eb081fe134333b0fc445777e488d6", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/guestconfiguration/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", + "readme": "specification/guestconfiguration/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/__init__.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/__init__.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/__init__.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/__init__.py new file mode 100644 index 000000000000..decfff5bcc08 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/__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 ._guest_configuration_client import GuestConfigurationClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['GuestConfigurationClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/_configuration.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/_configuration.py new file mode 100644 index 000000000000..9aa902bd4745 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/_configuration.py @@ -0,0 +1,71 @@ +# 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 typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class GuestConfigurationClientConfiguration(Configuration): + """Configuration for GuestConfigurationClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(GuestConfigurationClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-06-25" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-guestconfig/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/_guest_configuration_client.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/_guest_configuration_client.py new file mode 100644 index 000000000000..01babb7e9978 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/_guest_configuration_client.py @@ -0,0 +1,108 @@ +# 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 typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import GuestConfigurationClientConfiguration +from .operations import GuestConfigurationAssignmentsOperations +from .operations import GuestConfigurationAssignmentReportsOperations +from .operations import GuestConfigurationHCRPAssignmentsOperations +from .operations import GuestConfigurationHCRPAssignmentReportsOperations +from .operations import Operations +from . import models + + +class GuestConfigurationClient(object): + """Guest Configuration Client. + + :ivar guest_configuration_assignments: GuestConfigurationAssignmentsOperations operations + :vartype guest_configuration_assignments: azure.mgmt.guestconfig.operations.GuestConfigurationAssignmentsOperations + :ivar guest_configuration_assignment_reports: GuestConfigurationAssignmentReportsOperations operations + :vartype guest_configuration_assignment_reports: azure.mgmt.guestconfig.operations.GuestConfigurationAssignmentReportsOperations + :ivar guest_configuration_hcrp_assignments: GuestConfigurationHCRPAssignmentsOperations operations + :vartype guest_configuration_hcrp_assignments: azure.mgmt.guestconfig.operations.GuestConfigurationHCRPAssignmentsOperations + :ivar guest_configuration_hcrp_assignment_reports: GuestConfigurationHCRPAssignmentReportsOperations operations + :vartype guest_configuration_hcrp_assignment_reports: azure.mgmt.guestconfig.operations.GuestConfigurationHCRPAssignmentReportsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.guestconfig.operations.Operations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = GuestConfigurationClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.guest_configuration_assignments = GuestConfigurationAssignmentsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.guest_configuration_assignment_reports = GuestConfigurationAssignmentReportsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.guest_configuration_hcrp_assignments = GuestConfigurationHCRPAssignmentsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.guest_configuration_hcrp_assignment_reports = GuestConfigurationHCRPAssignmentReportsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> GuestConfigurationClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/_metadata.json b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/_metadata.json new file mode 100644 index 000000000000..8b0f39452c80 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/_metadata.json @@ -0,0 +1,107 @@ +{ + "chosen_version": "2020-06-25", + "total_api_version_list": ["2020-06-25"], + "client": { + "name": "GuestConfigurationClient", + "filename": "_guest_configuration_client", + "description": "Guest Configuration Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"GuestConfigurationClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"GuestConfigurationClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "guest_configuration_assignments": "GuestConfigurationAssignmentsOperations", + "guest_configuration_assignment_reports": "GuestConfigurationAssignmentReportsOperations", + "guest_configuration_hcrp_assignments": "GuestConfigurationHCRPAssignmentsOperations", + "guest_configuration_hcrp_assignment_reports": "GuestConfigurationHCRPAssignmentReportsOperations", + "operations": "Operations" + } +} \ No newline at end of file diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/_version.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/_version.py new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/_version.py @@ -0,0 +1,9 @@ +# 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 = "1.0.0b1" diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/__init__.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/__init__.py new file mode 100644 index 000000000000..87d64022a9db --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/__init__.py @@ -0,0 +1,10 @@ +# 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 ._guest_configuration_client import GuestConfigurationClient +__all__ = ['GuestConfigurationClient'] diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/_configuration.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/_configuration.py new file mode 100644 index 000000000000..7197706b1623 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/_configuration.py @@ -0,0 +1,67 @@ +# 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 typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class GuestConfigurationClientConfiguration(Configuration): + """Configuration for GuestConfigurationClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(GuestConfigurationClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-06-25" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-guestconfig/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/_guest_configuration_client.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/_guest_configuration_client.py new file mode 100644 index 000000000000..988d61a32321 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/_guest_configuration_client.py @@ -0,0 +1,101 @@ +# 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 typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import GuestConfigurationClientConfiguration +from .operations import GuestConfigurationAssignmentsOperations +from .operations import GuestConfigurationAssignmentReportsOperations +from .operations import GuestConfigurationHCRPAssignmentsOperations +from .operations import GuestConfigurationHCRPAssignmentReportsOperations +from .operations import Operations +from .. import models + + +class GuestConfigurationClient(object): + """Guest Configuration Client. + + :ivar guest_configuration_assignments: GuestConfigurationAssignmentsOperations operations + :vartype guest_configuration_assignments: azure.mgmt.guestconfig.aio.operations.GuestConfigurationAssignmentsOperations + :ivar guest_configuration_assignment_reports: GuestConfigurationAssignmentReportsOperations operations + :vartype guest_configuration_assignment_reports: azure.mgmt.guestconfig.aio.operations.GuestConfigurationAssignmentReportsOperations + :ivar guest_configuration_hcrp_assignments: GuestConfigurationHCRPAssignmentsOperations operations + :vartype guest_configuration_hcrp_assignments: azure.mgmt.guestconfig.aio.operations.GuestConfigurationHCRPAssignmentsOperations + :ivar guest_configuration_hcrp_assignment_reports: GuestConfigurationHCRPAssignmentReportsOperations operations + :vartype guest_configuration_hcrp_assignment_reports: azure.mgmt.guestconfig.aio.operations.GuestConfigurationHCRPAssignmentReportsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.guestconfig.aio.operations.Operations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = GuestConfigurationClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.guest_configuration_assignments = GuestConfigurationAssignmentsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.guest_configuration_assignment_reports = GuestConfigurationAssignmentReportsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.guest_configuration_hcrp_assignments = GuestConfigurationHCRPAssignmentsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.guest_configuration_hcrp_assignment_reports = GuestConfigurationHCRPAssignmentReportsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "GuestConfigurationClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/__init__.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/__init__.py new file mode 100644 index 000000000000..9ec9e96e98e5 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/__init__.py @@ -0,0 +1,21 @@ +# 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 ._guest_configuration_assignments_operations import GuestConfigurationAssignmentsOperations +from ._guest_configuration_assignment_reports_operations import GuestConfigurationAssignmentReportsOperations +from ._guest_configuration_hcrp_assignments_operations import GuestConfigurationHCRPAssignmentsOperations +from ._guest_configuration_hcrp_assignment_reports_operations import GuestConfigurationHCRPAssignmentReportsOperations +from ._operations import Operations + +__all__ = [ + 'GuestConfigurationAssignmentsOperations', + 'GuestConfigurationAssignmentReportsOperations', + 'GuestConfigurationHCRPAssignmentsOperations', + 'GuestConfigurationHCRPAssignmentReportsOperations', + 'Operations', +] diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_assignment_reports_operations.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_assignment_reports_operations.py new file mode 100644 index 000000000000..a3b276b4a139 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_assignment_reports_operations.py @@ -0,0 +1,171 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GuestConfigurationAssignmentReportsOperations: + """GuestConfigurationAssignmentReportsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.guestconfig.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + guest_configuration_assignment_name: str, + vm_name: str, + **kwargs: Any + ) -> "_models.GuestConfigurationAssignmentReportList": + """List all reports for the guest configuration assignment, latest report first. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: The guest configuration assignment name. + :type guest_configuration_assignment_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignmentReportList, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentReportList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentReportList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GuestConfigurationAssignmentReportList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}/reports'} # type: ignore + + async def get( + self, + resource_group_name: str, + guest_configuration_assignment_name: str, + report_id: str, + vm_name: str, + **kwargs: Any + ) -> "_models.GuestConfigurationAssignmentReport": + """Get a report for the guest configuration assignment, by reportId. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: The guest configuration assignment name. + :type guest_configuration_assignment_name: str + :param report_id: The GUID for the guest configuration assignment report. + :type report_id: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignmentReport, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentReport + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentReport"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'reportId': self._serialize.url("report_id", report_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GuestConfigurationAssignmentReport', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}/reports/{reportId}'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_assignments_operations.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_assignments_operations.py new file mode 100644 index 000000000000..cd28e6abc4d2 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_assignments_operations.py @@ -0,0 +1,315 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GuestConfigurationAssignmentsOperations: + """GuestConfigurationAssignmentsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.guestconfig.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create_or_update( + self, + guest_configuration_assignment_name: str, + resource_group_name: str, + vm_name: str, + parameters: "_models.GuestConfigurationAssignment", + **kwargs: Any + ) -> "_models.GuestConfigurationAssignment": + """Creates an association between a VM and guest configuration. + + :param guest_configuration_assignment_name: Name of the guest configuration assignment. + :type guest_configuration_assignment_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param parameters: Parameters supplied to the create or update guest configuration assignment. + :type parameters: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignment, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'GuestConfigurationAssignment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('GuestConfigurationAssignment', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GuestConfigurationAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + guest_configuration_assignment_name: str, + vm_name: str, + **kwargs: Any + ) -> "_models.GuestConfigurationAssignment": + """Get information about a guest configuration assignment. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: The guest configuration assignment name. + :type guest_configuration_assignment_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignment, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GuestConfigurationAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + guest_configuration_assignment_name: str, + vm_name: str, + **kwargs: Any + ) -> None: + """Delete a guest configuration assignment. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: Name of the guest configuration assignment. + :type guest_configuration_assignment_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}'} # type: ignore + + def list( + self, + resource_group_name: str, + vm_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.GuestConfigurationAssignmentList"]: + """List all guest configuration assignments for a virtual machine. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GuestConfigurationAssignmentList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('GuestConfigurationAssignmentList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_hcrp_assignment_reports_operations.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_hcrp_assignment_reports_operations.py new file mode 100644 index 000000000000..688dddd417e2 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_hcrp_assignment_reports_operations.py @@ -0,0 +1,171 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GuestConfigurationHCRPAssignmentReportsOperations: + """GuestConfigurationHCRPAssignmentReportsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.guestconfig.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + guest_configuration_assignment_name: str, + machine_name: str, + **kwargs: Any + ) -> "_models.GuestConfigurationAssignmentReportList": + """List all reports for the guest configuration assignment, latest report first. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: The guest configuration assignment name. + :type guest_configuration_assignment_name: str + :param machine_name: The name of the ARC machine. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignmentReportList, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentReportList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentReportList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GuestConfigurationAssignmentReportList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}/reports'} # type: ignore + + async def get( + self, + resource_group_name: str, + guest_configuration_assignment_name: str, + report_id: str, + machine_name: str, + **kwargs: Any + ) -> "_models.GuestConfigurationAssignmentReport": + """Get a report for the guest configuration assignment, by reportId. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: The guest configuration assignment name. + :type guest_configuration_assignment_name: str + :param report_id: The GUID for the guest configuration assignment report. + :type report_id: str + :param machine_name: The name of the ARC machine. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignmentReport, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentReport + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentReport"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'reportId': self._serialize.url("report_id", report_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GuestConfigurationAssignmentReport', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}/reports/{reportId}'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_hcrp_assignments_operations.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_hcrp_assignments_operations.py new file mode 100644 index 000000000000..363a7f8cb58c --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_hcrp_assignments_operations.py @@ -0,0 +1,315 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GuestConfigurationHCRPAssignmentsOperations: + """GuestConfigurationHCRPAssignmentsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.guestconfig.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create_or_update( + self, + guest_configuration_assignment_name: str, + resource_group_name: str, + machine_name: str, + parameters: "_models.GuestConfigurationAssignment", + **kwargs: Any + ) -> "_models.GuestConfigurationAssignment": + """Creates an association between a ARC machine and guest configuration. + + :param guest_configuration_assignment_name: Name of the guest configuration assignment. + :type guest_configuration_assignment_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param machine_name: The name of the ARC machine. + :type machine_name: str + :param parameters: Parameters supplied to the create or update guest configuration assignment. + :type parameters: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignment, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'GuestConfigurationAssignment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('GuestConfigurationAssignment', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GuestConfigurationAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + guest_configuration_assignment_name: str, + machine_name: str, + **kwargs: Any + ) -> "_models.GuestConfigurationAssignment": + """Get information about a guest configuration assignment. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: The guest configuration assignment name. + :type guest_configuration_assignment_name: str + :param machine_name: The name of the ARC machine. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignment, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GuestConfigurationAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + guest_configuration_assignment_name: str, + machine_name: str, + **kwargs: Any + ) -> None: + """Delete a guest configuration assignment. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: Name of the guest configuration assignment. + :type guest_configuration_assignment_name: str + :param machine_name: The name of the ARC machine. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}'} # type: ignore + + def list( + self, + resource_group_name: str, + machine_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.GuestConfigurationAssignmentList"]: + """List all guest configuration assignments for an ARC machine. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param machine_name: The name of the ARC machine. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GuestConfigurationAssignmentList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('GuestConfigurationAssignmentList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_operations.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_operations.py new file mode 100644 index 000000000000..7b7206df99df --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_operations.py @@ -0,0 +1,105 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.guestconfig.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.OperationList"]: + """Lists all of the available GuestConfiguration REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.guestconfig.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.GuestConfiguration/operations'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/__init__.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/__init__.py new file mode 100644 index 000000000000..1fbc819ce4c0 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/__init__.py @@ -0,0 +1,99 @@ +# 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 AssignmentInfo + from ._models_py3 import AssignmentReport + from ._models_py3 import AssignmentReportDetails + from ._models_py3 import AssignmentReportResource + from ._models_py3 import AssignmentReportResourceComplianceReason + from ._models_py3 import ConfigurationInfo + from ._models_py3 import ConfigurationParameter + from ._models_py3 import ConfigurationSetting + from ._models_py3 import ErrorResponse + from ._models_py3 import ErrorResponseError + from ._models_py3 import GuestConfigurationAssignment + from ._models_py3 import GuestConfigurationAssignmentList + from ._models_py3 import GuestConfigurationAssignmentProperties + from ._models_py3 import GuestConfigurationAssignmentReport + from ._models_py3 import GuestConfigurationAssignmentReportList + from ._models_py3 import GuestConfigurationAssignmentReportProperties + from ._models_py3 import GuestConfigurationNavigation + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationList + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import VMInfo +except (SyntaxError, ImportError): + from ._models import AssignmentInfo # type: ignore + from ._models import AssignmentReport # type: ignore + from ._models import AssignmentReportDetails # type: ignore + from ._models import AssignmentReportResource # type: ignore + from ._models import AssignmentReportResourceComplianceReason # type: ignore + from ._models import ConfigurationInfo # type: ignore + from ._models import ConfigurationParameter # type: ignore + from ._models import ConfigurationSetting # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import ErrorResponseError # type: ignore + from ._models import GuestConfigurationAssignment # type: ignore + from ._models import GuestConfigurationAssignmentList # type: ignore + from ._models import GuestConfigurationAssignmentProperties # type: ignore + from ._models import GuestConfigurationAssignmentReport # type: ignore + from ._models import GuestConfigurationAssignmentReportList # type: ignore + from ._models import GuestConfigurationAssignmentReportProperties # type: ignore + from ._models import GuestConfigurationNavigation # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationList # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import Resource # type: ignore + from ._models import VMInfo # type: ignore + +from ._guest_configuration_client_enums import ( + ActionAfterReboot, + AssignmentType, + ComplianceStatus, + ConfigurationMode, + Kind, + ProvisioningState, + Type, +) + +__all__ = [ + 'AssignmentInfo', + 'AssignmentReport', + 'AssignmentReportDetails', + 'AssignmentReportResource', + 'AssignmentReportResourceComplianceReason', + 'ConfigurationInfo', + 'ConfigurationParameter', + 'ConfigurationSetting', + 'ErrorResponse', + 'ErrorResponseError', + 'GuestConfigurationAssignment', + 'GuestConfigurationAssignmentList', + 'GuestConfigurationAssignmentProperties', + 'GuestConfigurationAssignmentReport', + 'GuestConfigurationAssignmentReportList', + 'GuestConfigurationAssignmentReportProperties', + 'GuestConfigurationNavigation', + 'Operation', + 'OperationDisplay', + 'OperationList', + 'ProxyResource', + 'Resource', + 'VMInfo', + 'ActionAfterReboot', + 'AssignmentType', + 'ComplianceStatus', + 'ConfigurationMode', + 'Kind', + 'ProvisioningState', + 'Type', +] diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_guest_configuration_client_enums.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_guest_configuration_client_enums.py new file mode 100644 index 000000000000..eda3b3097555 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_guest_configuration_client_enums.py @@ -0,0 +1,84 @@ +# 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, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ActionAfterReboot(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies what happens after a reboot during the application of a configuration. The possible + values are ContinueConfiguration and StopConfiguration + """ + + CONTINUE_CONFIGURATION = "ContinueConfiguration" + STOP_CONFIGURATION = "StopConfiguration" + +class AssignmentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the assignment type and execution of the configuration. Possible values are Audit, + DeployAndAutoCorrect, ApplyAndAutoCorrect and ApplyAndMonitor. + """ + + AUDIT = "Audit" + DEPLOY_AND_AUTO_CORRECT = "DeployAndAutoCorrect" + APPLY_AND_AUTO_CORRECT = "ApplyAndAutoCorrect" + APPLY_AND_MONITOR = "ApplyAndMonitor" + +class ComplianceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """A value indicating compliance status of the machine for the assigned guest configuration. + """ + + COMPLIANT = "Compliant" + NON_COMPLIANT = "NonCompliant" + PENDING = "Pending" + +class ConfigurationMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies how the LCM(Local Configuration Manager) actually applies the configuration to the + target nodes. Possible values are ApplyOnly, ApplyAndMonitor, and ApplyAndAutoCorrect. + """ + + APPLY_ONLY = "ApplyOnly" + APPLY_AND_MONITOR = "ApplyAndMonitor" + APPLY_AND_AUTO_CORRECT = "ApplyAndAutoCorrect" + +class Kind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Kind of the guest configuration. For example:DSC + """ + + DSC = "DSC" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The provisioning state, which only appears in the response. + """ + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + CREATED = "Created" + +class Type(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of report, Consistency or Initial + """ + + CONSISTENCY = "Consistency" + INITIAL = "Initial" diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_models.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_models.py new file mode 100644 index 000000000000..b3a277e772d4 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_models.py @@ -0,0 +1,843 @@ +# 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 azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AssignmentInfo(msrest.serialization.Model): + """Information about the guest configuration assignment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the guest configuration assignment. + :vartype name: str + :param configuration: Information about the configuration. + :type configuration: ~azure.mgmt.guestconfig.models.ConfigurationInfo + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'ConfigurationInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(AssignmentInfo, self).__init__(**kwargs) + self.name = None + self.configuration = kwargs.get('configuration', None) + + +class AssignmentReport(msrest.serialization.Model): + """AssignmentReport. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ARM resource id of the report for the guest configuration assignment. + :vartype id: str + :ivar report_id: GUID that identifies the guest configuration assignment report under a + subscription, resource group. + :vartype report_id: str + :param assignment: Configuration details of the guest configuration assignment. + :type assignment: ~azure.mgmt.guestconfig.models.AssignmentInfo + :param vm: Information about the VM. + :type vm: ~azure.mgmt.guestconfig.models.VMInfo + :ivar start_time: Start date and time of the guest configuration assignment compliance status + check. + :vartype start_time: ~datetime.datetime + :ivar end_time: End date and time of the guest configuration assignment compliance status + check. + :vartype end_time: ~datetime.datetime + :ivar compliance_status: A value indicating compliance status of the machine for the assigned + guest configuration. Possible values include: "Compliant", "NonCompliant", "Pending". + :vartype compliance_status: str or ~azure.mgmt.guestconfig.models.ComplianceStatus + :ivar operation_type: Type of report, Consistency or Initial. Possible values include: + "Consistency", "Initial". + :vartype operation_type: str or ~azure.mgmt.guestconfig.models.Type + :param resources: The list of resources for which guest configuration assignment compliance is + checked. + :type resources: list[~azure.mgmt.guestconfig.models.AssignmentReportResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'report_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'compliance_status': {'readonly': True}, + 'operation_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'report_id': {'key': 'reportId', 'type': 'str'}, + 'assignment': {'key': 'assignment', 'type': 'AssignmentInfo'}, + 'vm': {'key': 'vm', 'type': 'VMInfo'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'compliance_status': {'key': 'complianceStatus', 'type': 'str'}, + 'operation_type': {'key': 'operationType', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[AssignmentReportResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(AssignmentReport, self).__init__(**kwargs) + self.id = None + self.report_id = None + self.assignment = kwargs.get('assignment', None) + self.vm = kwargs.get('vm', None) + self.start_time = None + self.end_time = None + self.compliance_status = None + self.operation_type = None + self.resources = kwargs.get('resources', None) + + +class AssignmentReportDetails(msrest.serialization.Model): + """Details of the guest configuration assignment report. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar compliance_status: A value indicating compliance status of the machine for the assigned + guest configuration. Possible values include: "Compliant", "NonCompliant", "Pending". + :vartype compliance_status: str or ~azure.mgmt.guestconfig.models.ComplianceStatus + :ivar start_time: Start date and time of the guest configuration assignment compliance status + check. + :vartype start_time: ~datetime.datetime + :ivar end_time: End date and time of the guest configuration assignment compliance status + check. + :vartype end_time: ~datetime.datetime + :ivar job_id: GUID of the report. + :vartype job_id: str + :ivar operation_type: Type of report, Consistency or Initial. Possible values include: + "Consistency", "Initial". + :vartype operation_type: str or ~azure.mgmt.guestconfig.models.Type + :param resources: The list of resources for which guest configuration assignment compliance is + checked. + :type resources: list[~azure.mgmt.guestconfig.models.AssignmentReportResource] + """ + + _validation = { + 'compliance_status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'job_id': {'readonly': True}, + 'operation_type': {'readonly': True}, + } + + _attribute_map = { + 'compliance_status': {'key': 'complianceStatus', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'operation_type': {'key': 'operationType', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[AssignmentReportResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(AssignmentReportDetails, self).__init__(**kwargs) + self.compliance_status = None + self.start_time = None + self.end_time = None + self.job_id = None + self.operation_type = None + self.resources = kwargs.get('resources', None) + + +class AssignmentReportResource(msrest.serialization.Model): + """The guest configuration assignment resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar compliance_status: A value indicating compliance status of the machine for the assigned + guest configuration. Possible values include: "Compliant", "NonCompliant", "Pending". + :vartype compliance_status: str or ~azure.mgmt.guestconfig.models.ComplianceStatus + :ivar resource_id: Name of the guest configuration assignment resource setting. + :vartype resource_id: str + :param reasons: Compliance reason and reason code for a resource. + :type reasons: list[~azure.mgmt.guestconfig.models.AssignmentReportResourceComplianceReason] + :ivar properties: Properties of a guest configuration assignment resource. + :vartype properties: any + """ + + _validation = { + 'compliance_status': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'compliance_status': {'key': 'complianceStatus', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'reasons': {'key': 'reasons', 'type': '[AssignmentReportResourceComplianceReason]'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(AssignmentReportResource, self).__init__(**kwargs) + self.compliance_status = None + self.resource_id = None + self.reasons = kwargs.get('reasons', None) + self.properties = None + + +class AssignmentReportResourceComplianceReason(msrest.serialization.Model): + """Reason and code for the compliance of the guest configuration assignment resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar phrase: Reason for the compliance of the guest configuration assignment resource. + :vartype phrase: str + :ivar code: Code for the compliance of the guest configuration assignment resource. + :vartype code: str + """ + + _validation = { + 'phrase': {'readonly': True}, + 'code': {'readonly': True}, + } + + _attribute_map = { + 'phrase': {'key': 'phrase', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AssignmentReportResourceComplianceReason, self).__init__(**kwargs) + self.phrase = None + self.code = None + + +class ConfigurationInfo(msrest.serialization.Model): + """Information about the configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the configuration. + :vartype name: str + :ivar version: Version of the configuration. + :vartype version: str + """ + + _validation = { + 'name': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConfigurationInfo, self).__init__(**kwargs) + self.name = None + self.version = None + + +class ConfigurationParameter(msrest.serialization.Model): + """Represents a configuration parameter. + + :param name: Name of the configuration parameter. + :type name: str + :param value: Value of the configuration parameter. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConfigurationParameter, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class ConfigurationSetting(msrest.serialization.Model): + """Configuration setting of LCM (Local Configuration Manager). + + :param configuration_mode: Specifies how the LCM(Local Configuration Manager) actually applies + the configuration to the target nodes. Possible values are ApplyOnly, ApplyAndMonitor, and + ApplyAndAutoCorrect. Possible values include: "ApplyOnly", "ApplyAndMonitor", + "ApplyAndAutoCorrect". + :type configuration_mode: str or ~azure.mgmt.guestconfig.models.ConfigurationMode + :param allow_module_overwrite: If true - new configurations downloaded from the pull service + are allowed to overwrite the old ones on the target node. Otherwise, false. + :type allow_module_overwrite: bool + :param action_after_reboot: Specifies what happens after a reboot during the application of a + configuration. The possible values are ContinueConfiguration and StopConfiguration. Possible + values include: "ContinueConfiguration", "StopConfiguration". + :type action_after_reboot: str or ~azure.mgmt.guestconfig.models.ActionAfterReboot + :param refresh_frequency_mins: The time interval, in minutes, at which the LCM checks a pull + service to get updated configurations. This value is ignored if the LCM is not configured in + pull mode. The default value is 30. + :type refresh_frequency_mins: float + :param reboot_if_needed: Set this to true to automatically reboot the node after a + configuration that requires reboot is applied. Otherwise, you will have to manually reboot the + node for any configuration that requires it. The default value is false. To use this setting + when a reboot condition is enacted by something other than DSC (such as Windows Installer), + combine this setting with the xPendingReboot module. + :type reboot_if_needed: bool + :param configuration_mode_frequency_mins: How often, in minutes, the current configuration is + checked and applied. This property is ignored if the ConfigurationMode property is set to + ApplyOnly. The default value is 15. + :type configuration_mode_frequency_mins: float + """ + + _attribute_map = { + 'configuration_mode': {'key': 'configurationMode', 'type': 'str'}, + 'allow_module_overwrite': {'key': 'allowModuleOverwrite', 'type': 'bool'}, + 'action_after_reboot': {'key': 'actionAfterReboot', 'type': 'str'}, + 'refresh_frequency_mins': {'key': 'refreshFrequencyMins', 'type': 'float'}, + 'reboot_if_needed': {'key': 'rebootIfNeeded', 'type': 'bool'}, + 'configuration_mode_frequency_mins': {'key': 'configurationModeFrequencyMins', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(ConfigurationSetting, self).__init__(**kwargs) + self.configuration_mode = kwargs.get('configuration_mode', None) + self.allow_module_overwrite = kwargs.get('allow_module_overwrite', None) + self.action_after_reboot = kwargs.get('action_after_reboot', None) + self.refresh_frequency_mins = kwargs.get('refresh_frequency_mins', 30) + self.reboot_if_needed = kwargs.get('reboot_if_needed', None) + self.configuration_mode_frequency_mins = kwargs.get('configuration_mode_frequency_mins', 15) + + +class ErrorResponse(msrest.serialization.Model): + """Error response of an operation failure. + + :param error: + :type error: ~azure.mgmt.guestconfig.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 ErrorResponseError(msrest.serialization.Model): + """ErrorResponseError. + + :param code: Error code. + :type code: str + :param message: Detail error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class Resource(msrest.serialization.Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ARM resource id of the guest configuration assignment. + :vartype id: str + :param name: Name of the guest configuration assignment. + :type name: str + :param location: Region where the VM is located. + :type location: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.type = None + + +class ProxyResource(Resource): + """ARM proxy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ARM resource id of the guest configuration assignment. + :vartype id: str + :param name: Name of the guest configuration assignment. + :type name: str + :param location: Region where the VM is located. + :type location: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class GuestConfigurationAssignment(ProxyResource): + """Guest configuration assignment is an association between a machine and guest configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ARM resource id of the guest configuration assignment. + :vartype id: str + :param name: Name of the guest configuration assignment. + :type name: str + :param location: Region where the VM is located. + :type location: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the Guest configuration assignment. + :type properties: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'GuestConfigurationAssignmentProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(GuestConfigurationAssignment, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class GuestConfigurationAssignmentList(msrest.serialization.Model): + """The response of the list guest configuration assignment operation. + + :param value: Result of the list guest configuration assignment operation. + :type value: list[~azure.mgmt.guestconfig.models.GuestConfigurationAssignment] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GuestConfigurationAssignment]'}, + } + + def __init__( + self, + **kwargs + ): + super(GuestConfigurationAssignmentList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class GuestConfigurationAssignmentProperties(msrest.serialization.Model): + """Guest configuration assignment properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar target_resource_id: VM resource Id. + :vartype target_resource_id: str + :param guest_configuration: The guest configuration to assign. + :type guest_configuration: ~azure.mgmt.guestconfig.models.GuestConfigurationNavigation + :ivar compliance_status: A value indicating compliance status of the machine for the assigned + guest configuration. Possible values include: "Compliant", "NonCompliant", "Pending". + :vartype compliance_status: str or ~azure.mgmt.guestconfig.models.ComplianceStatus + :ivar last_compliance_status_checked: Date and time when last compliance status was checked. + :vartype last_compliance_status_checked: ~datetime.datetime + :ivar latest_report_id: Id of the latest report for the guest configuration assignment. + :vartype latest_report_id: str + :param latest_assignment_report: Last reported guest configuration assignment report. + :type latest_assignment_report: ~azure.mgmt.guestconfig.models.AssignmentReport + :param context: The source which initiated the guest configuration assignment. Ex: Azure + Policy. + :type context: str + :ivar assignment_hash: Combined hash of the configuration package and parameters. + :vartype assignment_hash: str + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Succeeded", "Failed", "Canceled", "Created". + :vartype provisioning_state: str or ~azure.mgmt.guestconfig.models.ProvisioningState + """ + + _validation = { + 'target_resource_id': {'readonly': True}, + 'compliance_status': {'readonly': True}, + 'last_compliance_status_checked': {'readonly': True}, + 'latest_report_id': {'readonly': True}, + 'assignment_hash': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'guest_configuration': {'key': 'guestConfiguration', 'type': 'GuestConfigurationNavigation'}, + 'compliance_status': {'key': 'complianceStatus', 'type': 'str'}, + 'last_compliance_status_checked': {'key': 'lastComplianceStatusChecked', 'type': 'iso-8601'}, + 'latest_report_id': {'key': 'latestReportId', 'type': 'str'}, + 'latest_assignment_report': {'key': 'latestAssignmentReport', 'type': 'AssignmentReport'}, + 'context': {'key': 'context', 'type': 'str'}, + 'assignment_hash': {'key': 'assignmentHash', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GuestConfigurationAssignmentProperties, self).__init__(**kwargs) + self.target_resource_id = None + self.guest_configuration = kwargs.get('guest_configuration', None) + self.compliance_status = None + self.last_compliance_status_checked = None + self.latest_report_id = None + self.latest_assignment_report = kwargs.get('latest_assignment_report', None) + self.context = kwargs.get('context', None) + self.assignment_hash = None + self.provisioning_state = None + + +class GuestConfigurationAssignmentReport(msrest.serialization.Model): + """Report for the guest configuration assignment. Report contains information such as compliance status, reason, and more. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ARM resource id of the report for the guest configuration assignment. + :vartype id: str + :ivar name: GUID that identifies the guest configuration assignment report under a + subscription, resource group. + :vartype name: str + :param properties: Properties of the guest configuration report. + :type properties: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentReportProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'GuestConfigurationAssignmentReportProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(GuestConfigurationAssignmentReport, self).__init__(**kwargs) + self.id = None + self.name = None + self.properties = kwargs.get('properties', None) + + +class GuestConfigurationAssignmentReportList(msrest.serialization.Model): + """List of guest configuration assignment reports. + + :param value: List of reports for the guest configuration. Report contains information such as + compliance status, reason and more. + :type value: list[~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentReport] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GuestConfigurationAssignmentReport]'}, + } + + def __init__( + self, + **kwargs + ): + super(GuestConfigurationAssignmentReportList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class GuestConfigurationAssignmentReportProperties(msrest.serialization.Model): + """Report for the guest configuration assignment. Report contains information such as compliance status, reason, and more. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar compliance_status: A value indicating compliance status of the machine for the assigned + guest configuration. Possible values include: "Compliant", "NonCompliant", "Pending". + :vartype compliance_status: str or ~azure.mgmt.guestconfig.models.ComplianceStatus + :ivar report_id: GUID that identifies the guest configuration assignment report under a + subscription, resource group. + :vartype report_id: str + :param assignment: Configuration details of the guest configuration assignment. + :type assignment: ~azure.mgmt.guestconfig.models.AssignmentInfo + :param vm: Information about the VM. + :type vm: ~azure.mgmt.guestconfig.models.VMInfo + :ivar start_time: Start date and time of the guest configuration assignment compliance status + check. + :vartype start_time: ~datetime.datetime + :ivar end_time: End date and time of the guest configuration assignment compliance status + check. + :vartype end_time: ~datetime.datetime + :param details: Details of the assignment report. + :type details: ~azure.mgmt.guestconfig.models.AssignmentReportDetails + """ + + _validation = { + 'compliance_status': {'readonly': True}, + 'report_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'compliance_status': {'key': 'complianceStatus', 'type': 'str'}, + 'report_id': {'key': 'reportId', 'type': 'str'}, + 'assignment': {'key': 'assignment', 'type': 'AssignmentInfo'}, + 'vm': {'key': 'vm', 'type': 'VMInfo'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'details': {'key': 'details', 'type': 'AssignmentReportDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(GuestConfigurationAssignmentReportProperties, self).__init__(**kwargs) + self.compliance_status = None + self.report_id = None + self.assignment = kwargs.get('assignment', None) + self.vm = kwargs.get('vm', None) + self.start_time = None + self.end_time = None + self.details = kwargs.get('details', None) + + +class GuestConfigurationNavigation(msrest.serialization.Model): + """Guest configuration is an artifact that encapsulates DSC configuration and its dependencies. The artifact is a zip file containing DSC configuration (as MOF) and dependent resources and other dependencies like modules. + + :param kind: Kind of the guest configuration. For example:DSC. Possible values include: "DSC". + :type kind: str or ~azure.mgmt.guestconfig.models.Kind + :param name: Name of the guest configuration. + :type name: str + :param version: Version of the guest configuration. + :type version: str + :param content_uri: Uri of the storage where guest configuration package is uploaded. + :type content_uri: str + :param content_hash: Combined hash of the guest configuration package and configuration + parameters. + :type content_hash: str + :param assignment_type: Specifies the assignment type and execution of the configuration. + Possible values are Audit, DeployAndAutoCorrect, ApplyAndAutoCorrect and ApplyAndMonitor. + Possible values include: "Audit", "DeployAndAutoCorrect", "ApplyAndAutoCorrect", + "ApplyAndMonitor". + :type assignment_type: str or ~azure.mgmt.guestconfig.models.AssignmentType + :param configuration_parameter: The configuration parameters for the guest configuration. + :type configuration_parameter: list[~azure.mgmt.guestconfig.models.ConfigurationParameter] + :param configuration_setting: The configuration setting for the guest configuration. + :type configuration_setting: ~azure.mgmt.guestconfig.models.ConfigurationSetting + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'content_uri': {'key': 'contentUri', 'type': 'str'}, + 'content_hash': {'key': 'contentHash', 'type': 'str'}, + 'assignment_type': {'key': 'assignmentType', 'type': 'str'}, + 'configuration_parameter': {'key': 'configurationParameter', 'type': '[ConfigurationParameter]'}, + 'configuration_setting': {'key': 'configurationSetting', 'type': 'ConfigurationSetting'}, + } + + def __init__( + self, + **kwargs + ): + super(GuestConfigurationNavigation, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.name = kwargs.get('name', None) + self.version = kwargs.get('version', None) + self.content_uri = kwargs.get('content_uri', None) + self.content_hash = kwargs.get('content_hash', None) + self.assignment_type = kwargs.get('assignment_type', None) + self.configuration_parameter = kwargs.get('configuration_parameter', None) + self.configuration_setting = kwargs.get('configuration_setting', None) + + +class Operation(msrest.serialization.Model): + """GuestConfiguration REST API operation. + + :param name: Operation name: For ex. + providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/write or read. + :type name: str + :param display: Provider, Resource, Operation and description values. + :type display: ~azure.mgmt.guestconfig.models.OperationDisplay + :param status_code: Service provider: Microsoft.GuestConfiguration. + :type status_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', '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.display = kwargs.get('display', None) + self.status_code = kwargs.get('status_code', None) + + +class OperationDisplay(msrest.serialization.Model): + """Provider, Resource, Operation and description values. + + :param provider: Service provider: Microsoft.GuestConfiguration. + :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) + + +class OperationList(msrest.serialization.Model): + """The response model for the list of Automation operations. + + :param value: List of Automation operations supported by the Automation resource provider. + :type value: list[~azure.mgmt.guestconfig.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class VMInfo(msrest.serialization.Model): + """Information about the VM. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Azure resource Id of the VM. + :vartype id: str + :ivar uuid: UUID(Universally Unique Identifier) of the VM. + :vartype uuid: str + """ + + _validation = { + 'id': {'readonly': True}, + 'uuid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'uuid': {'key': 'uuid', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VMInfo, self).__init__(**kwargs) + self.id = None + self.uuid = None diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_models_py3.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_models_py3.py new file mode 100644 index 000000000000..bce6b19cdec6 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_models_py3.py @@ -0,0 +1,916 @@ +# 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 typing import List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._guest_configuration_client_enums import * + + +class AssignmentInfo(msrest.serialization.Model): + """Information about the guest configuration assignment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the guest configuration assignment. + :vartype name: str + :param configuration: Information about the configuration. + :type configuration: ~azure.mgmt.guestconfig.models.ConfigurationInfo + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'ConfigurationInfo'}, + } + + def __init__( + self, + *, + configuration: Optional["ConfigurationInfo"] = None, + **kwargs + ): + super(AssignmentInfo, self).__init__(**kwargs) + self.name = None + self.configuration = configuration + + +class AssignmentReport(msrest.serialization.Model): + """AssignmentReport. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ARM resource id of the report for the guest configuration assignment. + :vartype id: str + :ivar report_id: GUID that identifies the guest configuration assignment report under a + subscription, resource group. + :vartype report_id: str + :param assignment: Configuration details of the guest configuration assignment. + :type assignment: ~azure.mgmt.guestconfig.models.AssignmentInfo + :param vm: Information about the VM. + :type vm: ~azure.mgmt.guestconfig.models.VMInfo + :ivar start_time: Start date and time of the guest configuration assignment compliance status + check. + :vartype start_time: ~datetime.datetime + :ivar end_time: End date and time of the guest configuration assignment compliance status + check. + :vartype end_time: ~datetime.datetime + :ivar compliance_status: A value indicating compliance status of the machine for the assigned + guest configuration. Possible values include: "Compliant", "NonCompliant", "Pending". + :vartype compliance_status: str or ~azure.mgmt.guestconfig.models.ComplianceStatus + :ivar operation_type: Type of report, Consistency or Initial. Possible values include: + "Consistency", "Initial". + :vartype operation_type: str or ~azure.mgmt.guestconfig.models.Type + :param resources: The list of resources for which guest configuration assignment compliance is + checked. + :type resources: list[~azure.mgmt.guestconfig.models.AssignmentReportResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'report_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'compliance_status': {'readonly': True}, + 'operation_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'report_id': {'key': 'reportId', 'type': 'str'}, + 'assignment': {'key': 'assignment', 'type': 'AssignmentInfo'}, + 'vm': {'key': 'vm', 'type': 'VMInfo'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'compliance_status': {'key': 'complianceStatus', 'type': 'str'}, + 'operation_type': {'key': 'operationType', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[AssignmentReportResource]'}, + } + + def __init__( + self, + *, + assignment: Optional["AssignmentInfo"] = None, + vm: Optional["VMInfo"] = None, + resources: Optional[List["AssignmentReportResource"]] = None, + **kwargs + ): + super(AssignmentReport, self).__init__(**kwargs) + self.id = None + self.report_id = None + self.assignment = assignment + self.vm = vm + self.start_time = None + self.end_time = None + self.compliance_status = None + self.operation_type = None + self.resources = resources + + +class AssignmentReportDetails(msrest.serialization.Model): + """Details of the guest configuration assignment report. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar compliance_status: A value indicating compliance status of the machine for the assigned + guest configuration. Possible values include: "Compliant", "NonCompliant", "Pending". + :vartype compliance_status: str or ~azure.mgmt.guestconfig.models.ComplianceStatus + :ivar start_time: Start date and time of the guest configuration assignment compliance status + check. + :vartype start_time: ~datetime.datetime + :ivar end_time: End date and time of the guest configuration assignment compliance status + check. + :vartype end_time: ~datetime.datetime + :ivar job_id: GUID of the report. + :vartype job_id: str + :ivar operation_type: Type of report, Consistency or Initial. Possible values include: + "Consistency", "Initial". + :vartype operation_type: str or ~azure.mgmt.guestconfig.models.Type + :param resources: The list of resources for which guest configuration assignment compliance is + checked. + :type resources: list[~azure.mgmt.guestconfig.models.AssignmentReportResource] + """ + + _validation = { + 'compliance_status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'job_id': {'readonly': True}, + 'operation_type': {'readonly': True}, + } + + _attribute_map = { + 'compliance_status': {'key': 'complianceStatus', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'operation_type': {'key': 'operationType', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[AssignmentReportResource]'}, + } + + def __init__( + self, + *, + resources: Optional[List["AssignmentReportResource"]] = None, + **kwargs + ): + super(AssignmentReportDetails, self).__init__(**kwargs) + self.compliance_status = None + self.start_time = None + self.end_time = None + self.job_id = None + self.operation_type = None + self.resources = resources + + +class AssignmentReportResource(msrest.serialization.Model): + """The guest configuration assignment resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar compliance_status: A value indicating compliance status of the machine for the assigned + guest configuration. Possible values include: "Compliant", "NonCompliant", "Pending". + :vartype compliance_status: str or ~azure.mgmt.guestconfig.models.ComplianceStatus + :ivar resource_id: Name of the guest configuration assignment resource setting. + :vartype resource_id: str + :param reasons: Compliance reason and reason code for a resource. + :type reasons: list[~azure.mgmt.guestconfig.models.AssignmentReportResourceComplianceReason] + :ivar properties: Properties of a guest configuration assignment resource. + :vartype properties: any + """ + + _validation = { + 'compliance_status': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'compliance_status': {'key': 'complianceStatus', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'reasons': {'key': 'reasons', 'type': '[AssignmentReportResourceComplianceReason]'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__( + self, + *, + reasons: Optional[List["AssignmentReportResourceComplianceReason"]] = None, + **kwargs + ): + super(AssignmentReportResource, self).__init__(**kwargs) + self.compliance_status = None + self.resource_id = None + self.reasons = reasons + self.properties = None + + +class AssignmentReportResourceComplianceReason(msrest.serialization.Model): + """Reason and code for the compliance of the guest configuration assignment resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar phrase: Reason for the compliance of the guest configuration assignment resource. + :vartype phrase: str + :ivar code: Code for the compliance of the guest configuration assignment resource. + :vartype code: str + """ + + _validation = { + 'phrase': {'readonly': True}, + 'code': {'readonly': True}, + } + + _attribute_map = { + 'phrase': {'key': 'phrase', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AssignmentReportResourceComplianceReason, self).__init__(**kwargs) + self.phrase = None + self.code = None + + +class ConfigurationInfo(msrest.serialization.Model): + """Information about the configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the configuration. + :vartype name: str + :ivar version: Version of the configuration. + :vartype version: str + """ + + _validation = { + 'name': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConfigurationInfo, self).__init__(**kwargs) + self.name = None + self.version = None + + +class ConfigurationParameter(msrest.serialization.Model): + """Represents a configuration parameter. + + :param name: Name of the configuration parameter. + :type name: str + :param value: Value of the configuration parameter. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(ConfigurationParameter, self).__init__(**kwargs) + self.name = name + self.value = value + + +class ConfigurationSetting(msrest.serialization.Model): + """Configuration setting of LCM (Local Configuration Manager). + + :param configuration_mode: Specifies how the LCM(Local Configuration Manager) actually applies + the configuration to the target nodes. Possible values are ApplyOnly, ApplyAndMonitor, and + ApplyAndAutoCorrect. Possible values include: "ApplyOnly", "ApplyAndMonitor", + "ApplyAndAutoCorrect". + :type configuration_mode: str or ~azure.mgmt.guestconfig.models.ConfigurationMode + :param allow_module_overwrite: If true - new configurations downloaded from the pull service + are allowed to overwrite the old ones on the target node. Otherwise, false. + :type allow_module_overwrite: bool + :param action_after_reboot: Specifies what happens after a reboot during the application of a + configuration. The possible values are ContinueConfiguration and StopConfiguration. Possible + values include: "ContinueConfiguration", "StopConfiguration". + :type action_after_reboot: str or ~azure.mgmt.guestconfig.models.ActionAfterReboot + :param refresh_frequency_mins: The time interval, in minutes, at which the LCM checks a pull + service to get updated configurations. This value is ignored if the LCM is not configured in + pull mode. The default value is 30. + :type refresh_frequency_mins: float + :param reboot_if_needed: Set this to true to automatically reboot the node after a + configuration that requires reboot is applied. Otherwise, you will have to manually reboot the + node for any configuration that requires it. The default value is false. To use this setting + when a reboot condition is enacted by something other than DSC (such as Windows Installer), + combine this setting with the xPendingReboot module. + :type reboot_if_needed: bool + :param configuration_mode_frequency_mins: How often, in minutes, the current configuration is + checked and applied. This property is ignored if the ConfigurationMode property is set to + ApplyOnly. The default value is 15. + :type configuration_mode_frequency_mins: float + """ + + _attribute_map = { + 'configuration_mode': {'key': 'configurationMode', 'type': 'str'}, + 'allow_module_overwrite': {'key': 'allowModuleOverwrite', 'type': 'bool'}, + 'action_after_reboot': {'key': 'actionAfterReboot', 'type': 'str'}, + 'refresh_frequency_mins': {'key': 'refreshFrequencyMins', 'type': 'float'}, + 'reboot_if_needed': {'key': 'rebootIfNeeded', 'type': 'bool'}, + 'configuration_mode_frequency_mins': {'key': 'configurationModeFrequencyMins', 'type': 'float'}, + } + + def __init__( + self, + *, + configuration_mode: Optional[Union[str, "ConfigurationMode"]] = None, + allow_module_overwrite: Optional[bool] = None, + action_after_reboot: Optional[Union[str, "ActionAfterReboot"]] = None, + refresh_frequency_mins: Optional[float] = 30, + reboot_if_needed: Optional[bool] = None, + configuration_mode_frequency_mins: Optional[float] = 15, + **kwargs + ): + super(ConfigurationSetting, self).__init__(**kwargs) + self.configuration_mode = configuration_mode + self.allow_module_overwrite = allow_module_overwrite + self.action_after_reboot = action_after_reboot + self.refresh_frequency_mins = refresh_frequency_mins + self.reboot_if_needed = reboot_if_needed + self.configuration_mode_frequency_mins = configuration_mode_frequency_mins + + +class ErrorResponse(msrest.serialization.Model): + """Error response of an operation failure. + + :param error: + :type error: ~azure.mgmt.guestconfig.models.ErrorResponseError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + } + + def __init__( + self, + *, + error: Optional["ErrorResponseError"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseError(msrest.serialization.Model): + """ErrorResponseError. + + :param code: Error code. + :type code: str + :param message: Detail error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorResponseError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class Resource(msrest.serialization.Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ARM resource id of the guest configuration assignment. + :vartype id: str + :param name: Name of the guest configuration assignment. + :type name: str + :param location: Region where the VM is located. + :type location: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + location: Optional[str] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = name + self.location = location + self.type = None + + +class ProxyResource(Resource): + """ARM proxy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ARM resource id of the guest configuration assignment. + :vartype id: str + :param name: Name of the guest configuration assignment. + :type name: str + :param location: Region where the VM is located. + :type location: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + location: Optional[str] = None, + **kwargs + ): + super(ProxyResource, self).__init__(name=name, location=location, **kwargs) + + +class GuestConfigurationAssignment(ProxyResource): + """Guest configuration assignment is an association between a machine and guest configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ARM resource id of the guest configuration assignment. + :vartype id: str + :param name: Name of the guest configuration assignment. + :type name: str + :param location: Region where the VM is located. + :type location: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the Guest configuration assignment. + :type properties: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'GuestConfigurationAssignmentProperties'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + location: Optional[str] = None, + properties: Optional["GuestConfigurationAssignmentProperties"] = None, + **kwargs + ): + super(GuestConfigurationAssignment, self).__init__(name=name, location=location, **kwargs) + self.properties = properties + + +class GuestConfigurationAssignmentList(msrest.serialization.Model): + """The response of the list guest configuration assignment operation. + + :param value: Result of the list guest configuration assignment operation. + :type value: list[~azure.mgmt.guestconfig.models.GuestConfigurationAssignment] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GuestConfigurationAssignment]'}, + } + + def __init__( + self, + *, + value: Optional[List["GuestConfigurationAssignment"]] = None, + **kwargs + ): + super(GuestConfigurationAssignmentList, self).__init__(**kwargs) + self.value = value + + +class GuestConfigurationAssignmentProperties(msrest.serialization.Model): + """Guest configuration assignment properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar target_resource_id: VM resource Id. + :vartype target_resource_id: str + :param guest_configuration: The guest configuration to assign. + :type guest_configuration: ~azure.mgmt.guestconfig.models.GuestConfigurationNavigation + :ivar compliance_status: A value indicating compliance status of the machine for the assigned + guest configuration. Possible values include: "Compliant", "NonCompliant", "Pending". + :vartype compliance_status: str or ~azure.mgmt.guestconfig.models.ComplianceStatus + :ivar last_compliance_status_checked: Date and time when last compliance status was checked. + :vartype last_compliance_status_checked: ~datetime.datetime + :ivar latest_report_id: Id of the latest report for the guest configuration assignment. + :vartype latest_report_id: str + :param latest_assignment_report: Last reported guest configuration assignment report. + :type latest_assignment_report: ~azure.mgmt.guestconfig.models.AssignmentReport + :param context: The source which initiated the guest configuration assignment. Ex: Azure + Policy. + :type context: str + :ivar assignment_hash: Combined hash of the configuration package and parameters. + :vartype assignment_hash: str + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Succeeded", "Failed", "Canceled", "Created". + :vartype provisioning_state: str or ~azure.mgmt.guestconfig.models.ProvisioningState + """ + + _validation = { + 'target_resource_id': {'readonly': True}, + 'compliance_status': {'readonly': True}, + 'last_compliance_status_checked': {'readonly': True}, + 'latest_report_id': {'readonly': True}, + 'assignment_hash': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'guest_configuration': {'key': 'guestConfiguration', 'type': 'GuestConfigurationNavigation'}, + 'compliance_status': {'key': 'complianceStatus', 'type': 'str'}, + 'last_compliance_status_checked': {'key': 'lastComplianceStatusChecked', 'type': 'iso-8601'}, + 'latest_report_id': {'key': 'latestReportId', 'type': 'str'}, + 'latest_assignment_report': {'key': 'latestAssignmentReport', 'type': 'AssignmentReport'}, + 'context': {'key': 'context', 'type': 'str'}, + 'assignment_hash': {'key': 'assignmentHash', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + guest_configuration: Optional["GuestConfigurationNavigation"] = None, + latest_assignment_report: Optional["AssignmentReport"] = None, + context: Optional[str] = None, + **kwargs + ): + super(GuestConfigurationAssignmentProperties, self).__init__(**kwargs) + self.target_resource_id = None + self.guest_configuration = guest_configuration + self.compliance_status = None + self.last_compliance_status_checked = None + self.latest_report_id = None + self.latest_assignment_report = latest_assignment_report + self.context = context + self.assignment_hash = None + self.provisioning_state = None + + +class GuestConfigurationAssignmentReport(msrest.serialization.Model): + """Report for the guest configuration assignment. Report contains information such as compliance status, reason, and more. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ARM resource id of the report for the guest configuration assignment. + :vartype id: str + :ivar name: GUID that identifies the guest configuration assignment report under a + subscription, resource group. + :vartype name: str + :param properties: Properties of the guest configuration report. + :type properties: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentReportProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'GuestConfigurationAssignmentReportProperties'}, + } + + def __init__( + self, + *, + properties: Optional["GuestConfigurationAssignmentReportProperties"] = None, + **kwargs + ): + super(GuestConfigurationAssignmentReport, self).__init__(**kwargs) + self.id = None + self.name = None + self.properties = properties + + +class GuestConfigurationAssignmentReportList(msrest.serialization.Model): + """List of guest configuration assignment reports. + + :param value: List of reports for the guest configuration. Report contains information such as + compliance status, reason and more. + :type value: list[~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentReport] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GuestConfigurationAssignmentReport]'}, + } + + def __init__( + self, + *, + value: Optional[List["GuestConfigurationAssignmentReport"]] = None, + **kwargs + ): + super(GuestConfigurationAssignmentReportList, self).__init__(**kwargs) + self.value = value + + +class GuestConfigurationAssignmentReportProperties(msrest.serialization.Model): + """Report for the guest configuration assignment. Report contains information such as compliance status, reason, and more. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar compliance_status: A value indicating compliance status of the machine for the assigned + guest configuration. Possible values include: "Compliant", "NonCompliant", "Pending". + :vartype compliance_status: str or ~azure.mgmt.guestconfig.models.ComplianceStatus + :ivar report_id: GUID that identifies the guest configuration assignment report under a + subscription, resource group. + :vartype report_id: str + :param assignment: Configuration details of the guest configuration assignment. + :type assignment: ~azure.mgmt.guestconfig.models.AssignmentInfo + :param vm: Information about the VM. + :type vm: ~azure.mgmt.guestconfig.models.VMInfo + :ivar start_time: Start date and time of the guest configuration assignment compliance status + check. + :vartype start_time: ~datetime.datetime + :ivar end_time: End date and time of the guest configuration assignment compliance status + check. + :vartype end_time: ~datetime.datetime + :param details: Details of the assignment report. + :type details: ~azure.mgmt.guestconfig.models.AssignmentReportDetails + """ + + _validation = { + 'compliance_status': {'readonly': True}, + 'report_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'compliance_status': {'key': 'complianceStatus', 'type': 'str'}, + 'report_id': {'key': 'reportId', 'type': 'str'}, + 'assignment': {'key': 'assignment', 'type': 'AssignmentInfo'}, + 'vm': {'key': 'vm', 'type': 'VMInfo'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'details': {'key': 'details', 'type': 'AssignmentReportDetails'}, + } + + def __init__( + self, + *, + assignment: Optional["AssignmentInfo"] = None, + vm: Optional["VMInfo"] = None, + details: Optional["AssignmentReportDetails"] = None, + **kwargs + ): + super(GuestConfigurationAssignmentReportProperties, self).__init__(**kwargs) + self.compliance_status = None + self.report_id = None + self.assignment = assignment + self.vm = vm + self.start_time = None + self.end_time = None + self.details = details + + +class GuestConfigurationNavigation(msrest.serialization.Model): + """Guest configuration is an artifact that encapsulates DSC configuration and its dependencies. The artifact is a zip file containing DSC configuration (as MOF) and dependent resources and other dependencies like modules. + + :param kind: Kind of the guest configuration. For example:DSC. Possible values include: "DSC". + :type kind: str or ~azure.mgmt.guestconfig.models.Kind + :param name: Name of the guest configuration. + :type name: str + :param version: Version of the guest configuration. + :type version: str + :param content_uri: Uri of the storage where guest configuration package is uploaded. + :type content_uri: str + :param content_hash: Combined hash of the guest configuration package and configuration + parameters. + :type content_hash: str + :param assignment_type: Specifies the assignment type and execution of the configuration. + Possible values are Audit, DeployAndAutoCorrect, ApplyAndAutoCorrect and ApplyAndMonitor. + Possible values include: "Audit", "DeployAndAutoCorrect", "ApplyAndAutoCorrect", + "ApplyAndMonitor". + :type assignment_type: str or ~azure.mgmt.guestconfig.models.AssignmentType + :param configuration_parameter: The configuration parameters for the guest configuration. + :type configuration_parameter: list[~azure.mgmt.guestconfig.models.ConfigurationParameter] + :param configuration_setting: The configuration setting for the guest configuration. + :type configuration_setting: ~azure.mgmt.guestconfig.models.ConfigurationSetting + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'content_uri': {'key': 'contentUri', 'type': 'str'}, + 'content_hash': {'key': 'contentHash', 'type': 'str'}, + 'assignment_type': {'key': 'assignmentType', 'type': 'str'}, + 'configuration_parameter': {'key': 'configurationParameter', 'type': '[ConfigurationParameter]'}, + 'configuration_setting': {'key': 'configurationSetting', 'type': 'ConfigurationSetting'}, + } + + def __init__( + self, + *, + kind: Optional[Union[str, "Kind"]] = None, + name: Optional[str] = None, + version: Optional[str] = None, + content_uri: Optional[str] = None, + content_hash: Optional[str] = None, + assignment_type: Optional[Union[str, "AssignmentType"]] = None, + configuration_parameter: Optional[List["ConfigurationParameter"]] = None, + configuration_setting: Optional["ConfigurationSetting"] = None, + **kwargs + ): + super(GuestConfigurationNavigation, self).__init__(**kwargs) + self.kind = kind + self.name = name + self.version = version + self.content_uri = content_uri + self.content_hash = content_hash + self.assignment_type = assignment_type + self.configuration_parameter = configuration_parameter + self.configuration_setting = configuration_setting + + +class Operation(msrest.serialization.Model): + """GuestConfiguration REST API operation. + + :param name: Operation name: For ex. + providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/write or read. + :type name: str + :param display: Provider, Resource, Operation and description values. + :type display: ~azure.mgmt.guestconfig.models.OperationDisplay + :param status_code: Service provider: Microsoft.GuestConfiguration. + :type status_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'status_code': {'key': 'properties.statusCode', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + status_code: Optional[str] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.status_code = status_code + + +class OperationDisplay(msrest.serialization.Model): + """Provider, Resource, Operation and description values. + + :param provider: Service provider: Microsoft.GuestConfiguration. + :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: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationList(msrest.serialization.Model): + """The response model for the list of Automation operations. + + :param value: List of Automation operations supported by the Automation resource provider. + :type value: list[~azure.mgmt.guestconfig.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + *, + value: Optional[List["Operation"]] = None, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.value = value + + +class VMInfo(msrest.serialization.Model): + """Information about the VM. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Azure resource Id of the VM. + :vartype id: str + :ivar uuid: UUID(Universally Unique Identifier) of the VM. + :vartype uuid: str + """ + + _validation = { + 'id': {'readonly': True}, + 'uuid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'uuid': {'key': 'uuid', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VMInfo, self).__init__(**kwargs) + self.id = None + self.uuid = None diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/__init__.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/__init__.py new file mode 100644 index 000000000000..9ec9e96e98e5 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/__init__.py @@ -0,0 +1,21 @@ +# 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 ._guest_configuration_assignments_operations import GuestConfigurationAssignmentsOperations +from ._guest_configuration_assignment_reports_operations import GuestConfigurationAssignmentReportsOperations +from ._guest_configuration_hcrp_assignments_operations import GuestConfigurationHCRPAssignmentsOperations +from ._guest_configuration_hcrp_assignment_reports_operations import GuestConfigurationHCRPAssignmentReportsOperations +from ._operations import Operations + +__all__ = [ + 'GuestConfigurationAssignmentsOperations', + 'GuestConfigurationAssignmentReportsOperations', + 'GuestConfigurationHCRPAssignmentsOperations', + 'GuestConfigurationHCRPAssignmentReportsOperations', + 'Operations', +] diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_assignment_reports_operations.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_assignment_reports_operations.py new file mode 100644 index 000000000000..fcd6da97a0c6 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_assignment_reports_operations.py @@ -0,0 +1,177 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GuestConfigurationAssignmentReportsOperations(object): + """GuestConfigurationAssignmentReportsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.guestconfig.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + guest_configuration_assignment_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GuestConfigurationAssignmentReportList" + """List all reports for the guest configuration assignment, latest report first. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: The guest configuration assignment name. + :type guest_configuration_assignment_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignmentReportList, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentReportList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentReportList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GuestConfigurationAssignmentReportList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}/reports'} # type: ignore + + def get( + self, + resource_group_name, # type: str + guest_configuration_assignment_name, # type: str + report_id, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GuestConfigurationAssignmentReport" + """Get a report for the guest configuration assignment, by reportId. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: The guest configuration assignment name. + :type guest_configuration_assignment_name: str + :param report_id: The GUID for the guest configuration assignment report. + :type report_id: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignmentReport, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentReport + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentReport"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'reportId': self._serialize.url("report_id", report_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GuestConfigurationAssignmentReport', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}/reports/{reportId}'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_assignments_operations.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_assignments_operations.py new file mode 100644 index 000000000000..f518307777cd --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_assignments_operations.py @@ -0,0 +1,323 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GuestConfigurationAssignmentsOperations(object): + """GuestConfigurationAssignmentsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.guestconfig.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create_or_update( + self, + guest_configuration_assignment_name, # type: str + resource_group_name, # type: str + vm_name, # type: str + parameters, # type: "_models.GuestConfigurationAssignment" + **kwargs # type: Any + ): + # type: (...) -> "_models.GuestConfigurationAssignment" + """Creates an association between a VM and guest configuration. + + :param guest_configuration_assignment_name: Name of the guest configuration assignment. + :type guest_configuration_assignment_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param parameters: Parameters supplied to the create or update guest configuration assignment. + :type parameters: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignment, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'GuestConfigurationAssignment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('GuestConfigurationAssignment', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GuestConfigurationAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + guest_configuration_assignment_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GuestConfigurationAssignment" + """Get information about a guest configuration assignment. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: The guest configuration assignment name. + :type guest_configuration_assignment_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignment, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GuestConfigurationAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + guest_configuration_assignment_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a guest configuration assignment. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: Name of the guest configuration assignment. + :type guest_configuration_assignment_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + vm_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GuestConfigurationAssignmentList"] + """List all guest configuration assignments for a virtual machine. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GuestConfigurationAssignmentList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('GuestConfigurationAssignmentList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_hcrp_assignment_reports_operations.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_hcrp_assignment_reports_operations.py new file mode 100644 index 000000000000..0a6ae622a3b6 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_hcrp_assignment_reports_operations.py @@ -0,0 +1,177 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GuestConfigurationHCRPAssignmentReportsOperations(object): + """GuestConfigurationHCRPAssignmentReportsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.guestconfig.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + guest_configuration_assignment_name, # type: str + machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GuestConfigurationAssignmentReportList" + """List all reports for the guest configuration assignment, latest report first. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: The guest configuration assignment name. + :type guest_configuration_assignment_name: str + :param machine_name: The name of the ARC machine. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignmentReportList, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentReportList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentReportList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GuestConfigurationAssignmentReportList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}/reports'} # type: ignore + + def get( + self, + resource_group_name, # type: str + guest_configuration_assignment_name, # type: str + report_id, # type: str + machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GuestConfigurationAssignmentReport" + """Get a report for the guest configuration assignment, by reportId. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: The guest configuration assignment name. + :type guest_configuration_assignment_name: str + :param report_id: The GUID for the guest configuration assignment report. + :type report_id: str + :param machine_name: The name of the ARC machine. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignmentReport, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentReport + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentReport"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'reportId': self._serialize.url("report_id", report_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GuestConfigurationAssignmentReport', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}/reports/{reportId}'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_hcrp_assignments_operations.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_hcrp_assignments_operations.py new file mode 100644 index 000000000000..a50b5cd21b17 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_hcrp_assignments_operations.py @@ -0,0 +1,323 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GuestConfigurationHCRPAssignmentsOperations(object): + """GuestConfigurationHCRPAssignmentsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.guestconfig.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create_or_update( + self, + guest_configuration_assignment_name, # type: str + resource_group_name, # type: str + machine_name, # type: str + parameters, # type: "_models.GuestConfigurationAssignment" + **kwargs # type: Any + ): + # type: (...) -> "_models.GuestConfigurationAssignment" + """Creates an association between a ARC machine and guest configuration. + + :param guest_configuration_assignment_name: Name of the guest configuration assignment. + :type guest_configuration_assignment_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param machine_name: The name of the ARC machine. + :type machine_name: str + :param parameters: Parameters supplied to the create or update guest configuration assignment. + :type parameters: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignment, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'GuestConfigurationAssignment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('GuestConfigurationAssignment', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GuestConfigurationAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + guest_configuration_assignment_name, # type: str + machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GuestConfigurationAssignment" + """Get information about a guest configuration assignment. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: The guest configuration assignment name. + :type guest_configuration_assignment_name: str + :param machine_name: The name of the ARC machine. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestConfigurationAssignment, or the result of cls(response) + :rtype: ~azure.mgmt.guestconfig.models.GuestConfigurationAssignment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GuestConfigurationAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + guest_configuration_assignment_name, # type: str + machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a guest configuration assignment. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param guest_configuration_assignment_name: Name of the guest configuration assignment. + :type guest_configuration_assignment_name: str + :param machine_name: The name of the ARC machine. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'guestConfigurationAssignmentName': self._serialize.url("guest_configuration_assignment_name", guest_configuration_assignment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GuestConfigurationAssignmentList"] + """List all guest configuration assignments for an ARC machine. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param machine_name: The name of the ARC machine. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GuestConfigurationAssignmentList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('GuestConfigurationAssignmentList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_operations.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_operations.py new file mode 100644 index 000000000000..13554fcf0736 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_operations.py @@ -0,0 +1,110 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.guestconfig.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationList"] + """Lists all of the available GuestConfiguration REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.guestconfig.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.GuestConfiguration/operations'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/py.typed b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/sdk_packaging.toml b/sdk/machinelearning/azure-mgmt-guestconfig/sdk_packaging.toml new file mode 100644 index 000000000000..724f575a8c6e --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/sdk_packaging.toml @@ -0,0 +1,9 @@ +[packaging] +package_name = "azure-mgmt-guestconfig" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Guestconfig Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/setup.cfg b/sdk/machinelearning/azure-mgmt-guestconfig/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/setup.py b/sdk/machinelearning/azure-mgmt-guestconfig/setup.py new file mode 100644 index 000000000000..74d639205ec4 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-guestconfig/setup.py @@ -0,0 +1,91 @@ +#!/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-guestconfig" +PACKAGE_PPRINT_NAME = "Guestconfig 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', + 'Programming Language :: Python :: 3.9', + '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.6.21', + 'azure-common~=1.1', + 'azure-mgmt-core>=1.2.0,<2.0.0', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +) diff --git a/shared_requirements.txt b/shared_requirements.txt index 2bb0076566bf..da2905f5c2ce 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -317,4 +317,5 @@ opentelemetry-sdk<2.0.0,>=1.0.0 #override azure-mgmt-costmanagement msrest>=0.6.21 #override azure-mgmt-testbase msrest>=0.6.21 #override azure-mgmt-agrifood msrest>=0.6.21 +#override azure-mgmt-guestconfig msrest>=0.6.21 #override azure-mgmt-recoveryservices msrest>=0.6.21