From e5f101ee76e07d11d6aa9a647057f96f24e524a5 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 30 Apr 2019 16:54:11 +0000 Subject: [PATCH 1/2] Generated from b8020f415b349449c80d146b0ac6ca69a75fd0b4 Add TypeScript readme for Serial Console --- .../azure/mgmt/serialconsole/__init__.py | 18 +++ .../microsoft_serial_console_client.py | 91 +++++++++++ .../mgmt/serialconsole/models/__init__.py | 31 ++++ .../models/deployment_validate_result.py | 43 +++++ .../models/deployment_validate_result_py3.py | 43 +++++ .../models/get_disabled_result.py | 31 ++++ .../models/get_disabled_result_py3.py | 31 ++++ .../models/serial_console_get_result.py | 30 ++++ .../models/serial_console_get_result_py3.py | 30 ++++ .../models/serial_console_operations.py | 30 ++++ .../models/serial_console_operations_py3.py | 30 ++++ .../models/set_disabled_result.py | 31 ++++ .../models/set_disabled_result_py3.py | 31 ++++ .../mgmt/serialconsole/operations/__init__.py | 20 +++ .../operations/console_operations.py | 151 ++++++++++++++++++ .../operations/list_console_operations.py | 95 +++++++++++ .../operations/list_operations.py | 94 +++++++++++ .../azure/mgmt/serialconsole/version.py | 13 ++ 18 files changed, 843 insertions(+) create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/__init__.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/microsoft_serial_console_client.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/__init__.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/deployment_validate_result.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/deployment_validate_result_py3.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/get_disabled_result.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/get_disabled_result_py3.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_get_result.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_get_result_py3.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_operations.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_operations_py3.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/set_disabled_result.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/set_disabled_result_py3.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/__init__.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/console_operations.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/list_console_operations.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/list_operations.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/serialconsole/version.py diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/__init__.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/__init__.py new file mode 100644 index 000000000000..990c1acb90b2 --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/__init__.py @@ -0,0 +1,18 @@ +# 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 .microsoft_serial_console_client import MicrosoftSerialConsoleClient +from .version import VERSION + +__all__ = ['MicrosoftSerialConsoleClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/microsoft_serial_console_client.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/microsoft_serial_console_client.py new file mode 100644 index 000000000000..51a47232645c --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/microsoft_serial_console_client.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.list_operations import ListOperations +from .operations.list_console_operations import ListConsoleOperations +from .operations.console_operations import ConsoleOperations +from . import models + + +class MicrosoftSerialConsoleClientConfiguration(AzureConfiguration): + """Configuration for MicrosoftSerialConsoleClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(MicrosoftSerialConsoleClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-serialconsole/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class MicrosoftSerialConsoleClient(SDKClient): + """Azure Virtual Machine Serial Console allows you to access serial console of a Virtual Machine + + :ivar config: Configuration for client. + :vartype config: MicrosoftSerialConsoleClientConfiguration + + :ivar list: List operations + :vartype list: azure.mgmt.serialconsole.operations.ListOperations + :ivar list_console: ListConsole operations + :vartype list_console: azure.mgmt.serialconsole.operations.ListConsoleOperations + :ivar console: Console operations + :vartype console: azure.mgmt.serialconsole.operations.ConsoleOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = MicrosoftSerialConsoleClientConfiguration(credentials, subscription_id, base_url) + super(MicrosoftSerialConsoleClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-05-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.list = ListOperations( + self._client, self.config, self._serialize, self._deserialize) + self.list_console = ListConsoleOperations( + self._client, self.config, self._serialize, self._deserialize) + self.console = ConsoleOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/__init__.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/__init__.py new file mode 100644 index 000000000000..793c2e2fe05b --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/__init__.py @@ -0,0 +1,31 @@ +# 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 .serial_console_get_result_py3 import SerialConsoleGetResult + from .get_disabled_result_py3 import GetDisabledResult + from .set_disabled_result_py3 import SetDisabledResult + from .deployment_validate_result_py3 import DeploymentValidateResult, DeploymentValidateResultException + from .serial_console_operations_py3 import SerialConsoleOperations +except (SyntaxError, ImportError): + from .serial_console_get_result import SerialConsoleGetResult + from .get_disabled_result import GetDisabledResult + from .set_disabled_result import SetDisabledResult + from .deployment_validate_result import DeploymentValidateResult, DeploymentValidateResultException + from .serial_console_operations import SerialConsoleOperations + +__all__ = [ + 'SerialConsoleGetResult', + 'GetDisabledResult', + 'SetDisabledResult', + 'DeploymentValidateResult', 'DeploymentValidateResultException', + 'SerialConsoleOperations', +] diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/deployment_validate_result.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/deployment_validate_result.py new file mode 100644 index 000000000000..836055f68dc2 --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/deployment_validate_result.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class DeploymentValidateResult(Model): + """Details on Failure. + + Details on Failure. + + :param error_message: Error message + :type error_message: str + """ + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeploymentValidateResult, self).__init__(**kwargs) + self.error_message = kwargs.get('error_message', None) + + +class DeploymentValidateResultException(HttpOperationError): + """Server responsed with exception of type: 'DeploymentValidateResult'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(DeploymentValidateResultException, self).__init__(deserialize, response, 'DeploymentValidateResult', *args) diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/deployment_validate_result_py3.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/deployment_validate_result_py3.py new file mode 100644 index 000000000000..3b79f288ffee --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/deployment_validate_result_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class DeploymentValidateResult(Model): + """Details on Failure. + + Details on Failure. + + :param error_message: Error message + :type error_message: str + """ + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, *, error_message: str=None, **kwargs) -> None: + super(DeploymentValidateResult, self).__init__(**kwargs) + self.error_message = error_message + + +class DeploymentValidateResultException(HttpOperationError): + """Server responsed with exception of type: 'DeploymentValidateResult'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(DeploymentValidateResultException, self).__init__(deserialize, response, 'DeploymentValidateResult', *args) diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/get_disabled_result.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/get_disabled_result.py new file mode 100644 index 000000000000..c69c47234ec3 --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/get_disabled_result.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GetDisabledResult(Model): + """Get Disabled result. + + Returns whether or not Serial Console is disabled for this given + subscription. + + :param disabled: Disabled result + :type disabled: bool + """ + + _attribute_map = { + 'disabled': {'key': 'disabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(GetDisabledResult, self).__init__(**kwargs) + self.disabled = kwargs.get('disabled', None) diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/get_disabled_result_py3.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/get_disabled_result_py3.py new file mode 100644 index 000000000000..f85cfd2104ec --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/get_disabled_result_py3.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GetDisabledResult(Model): + """Get Disabled result. + + Returns whether or not Serial Console is disabled for this given + subscription. + + :param disabled: Disabled result + :type disabled: bool + """ + + _attribute_map = { + 'disabled': {'key': 'disabled', 'type': 'bool'}, + } + + def __init__(self, *, disabled: bool=None, **kwargs) -> None: + super(GetDisabledResult, self).__init__(**kwargs) + self.disabled = disabled diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_get_result.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_get_result.py new file mode 100644 index 000000000000..341766f24ed0 --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_get_result.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SerialConsoleGetResult(Model): + """Serial Console GET Result. + + Returns whether or not Serial Console is disabled. + + :param value: Whether or not Serial Console is disabled. + :type value: bool + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SerialConsoleGetResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_get_result_py3.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_get_result_py3.py new file mode 100644 index 000000000000..f04e7e788305 --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_get_result_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SerialConsoleGetResult(Model): + """Serial Console GET Result. + + Returns whether or not Serial Console is disabled. + + :param value: Whether or not Serial Console is disabled. + :type value: bool + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'bool'}, + } + + def __init__(self, *, value: bool=None, **kwargs) -> None: + super(SerialConsoleGetResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_operations.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_operations.py new file mode 100644 index 000000000000..d10dc90ca5ad --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_operations.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SerialConsoleOperations(Model): + """Serial Console operations. + + Serial Console operations. + + :param value: Serial Console operations + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SerialConsoleOperations, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_operations_py3.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_operations_py3.py new file mode 100644 index 000000000000..e8646a046ead --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_operations_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SerialConsoleOperations(Model): + """Serial Console operations. + + Serial Console operations. + + :param value: Serial Console operations + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, **kwargs) -> None: + super(SerialConsoleOperations, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/set_disabled_result.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/set_disabled_result.py new file mode 100644 index 000000000000..3117105e7cd4 --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/set_disabled_result.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SetDisabledResult(Model): + """Set Disabled result. + + Sets disable status and returns whether or not Serial Console is now + disabled for this given subscription. + + :param disabled: Disabled result + :type disabled: bool + """ + + _attribute_map = { + 'disabled': {'key': 'disabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SetDisabledResult, self).__init__(**kwargs) + self.disabled = kwargs.get('disabled', None) diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/set_disabled_result_py3.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/set_disabled_result_py3.py new file mode 100644 index 000000000000..97dab865915e --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/set_disabled_result_py3.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SetDisabledResult(Model): + """Set Disabled result. + + Sets disable status and returns whether or not Serial Console is now + disabled for this given subscription. + + :param disabled: Disabled result + :type disabled: bool + """ + + _attribute_map = { + 'disabled': {'key': 'disabled', 'type': 'bool'}, + } + + def __init__(self, *, disabled: bool=None, **kwargs) -> None: + super(SetDisabledResult, self).__init__(**kwargs) + self.disabled = disabled diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/__init__.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/__init__.py new file mode 100644 index 000000000000..be2504c5c37b --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/__init__.py @@ -0,0 +1,20 @@ +# 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 .list_operations import ListOperations +from .list_console_operations import ListConsoleOperations +from .console_operations import ConsoleOperations + +__all__ = [ + 'ListOperations', + 'ListConsoleOperations', + 'ConsoleOperations', +] diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/console_operations.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/console_operations.py new file mode 100644 index 000000000000..6ff8a438b692 --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/console_operations.py @@ -0,0 +1,151 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ConsoleOperations(object): + """ConsoleOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-05-01". + :ivar default: Default string modeled as parameter for URL to work correctly. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01" + self.default = "default" + + self.config = config + + def enable_console( + self, custom_headers=None, raw=False, **operation_config): + """Enables Serial Console for a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SetDisabledResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.serialconsole.models.SetDisabledResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DeploymentValidateResultException` + """ + # Construct URL + url = self.enable_console.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'default': self._serialize.url("self.default", self.default, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DeploymentValidateResultException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SetDisabledResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + enable_console.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/enableConsole'} + + def disable_console( + self, custom_headers=None, raw=False, **operation_config): + """Disables Serial Console for a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SetDisabledResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.serialconsole.models.SetDisabledResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DeploymentValidateResultException` + """ + # Construct URL + url = self.disable_console.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'default': self._serialize.url("self.default", self.default, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DeploymentValidateResultException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SetDisabledResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + disable_console.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/disableConsole'} diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/list_console_operations.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/list_console_operations.py new file mode 100644 index 000000000000..abd0da85b32d --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/list_console_operations.py @@ -0,0 +1,95 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ListConsoleOperations(object): + """ListConsoleOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-05-01". + :ivar default: Default string modeled as parameter for URL to work correctly. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01" + self.default = "default" + + self.config = config + + def disabled( + self, custom_headers=None, raw=False, **operation_config): + """Gets if Serial Console is disabled for a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GetDisabledResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.serialconsole.models.GetDisabledResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DeploymentValidateResultException` + """ + # Construct URL + url = self.disabled.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'default': self._serialize.url("self.default", self.default, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DeploymentValidateResultException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GetDisabledResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + disabled.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}'} diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/list_operations.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/list_operations.py new file mode 100644 index 000000000000..adae5854c192 --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/list_operations.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ListOperations(object): + """ListOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01" + + self.config = config + + def operations( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of Serial Console API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SerialConsoleOperations or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.serialconsole.models.SerialConsoleOperations or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.operations.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SerialConsoleOperations', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + operations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/operations'} diff --git a/azure-mgmt-serialconsole/azure/mgmt/serialconsole/version.py b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/serialconsole/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + From d122b0809a7471e625df92ffabd3581b21e5cff1 Mon Sep 17 00:00:00 2001 From: azuresdkci Date: Tue, 30 Apr 2019 17:04:50 +0000 Subject: [PATCH 2/2] Packaging update of azure-mgmt-serialconsole --- azure-mgmt-serialconsole/HISTORY.rst | 9 ++ azure-mgmt-serialconsole/MANIFEST.in | 5 ++ azure-mgmt-serialconsole/README.rst | 33 +++++++ azure-mgmt-serialconsole/azure/__init__.py | 1 + .../azure/mgmt/__init__.py | 1 + azure-mgmt-serialconsole/sdk_packaging.toml | 8 ++ azure-mgmt-serialconsole/setup.cfg | 2 + azure-mgmt-serialconsole/setup.py | 88 +++++++++++++++++++ 8 files changed, 147 insertions(+) create mode 100644 azure-mgmt-serialconsole/HISTORY.rst create mode 100644 azure-mgmt-serialconsole/MANIFEST.in create mode 100644 azure-mgmt-serialconsole/README.rst create mode 100644 azure-mgmt-serialconsole/azure/__init__.py create mode 100644 azure-mgmt-serialconsole/azure/mgmt/__init__.py create mode 100644 azure-mgmt-serialconsole/sdk_packaging.toml create mode 100644 azure-mgmt-serialconsole/setup.cfg create mode 100644 azure-mgmt-serialconsole/setup.py diff --git a/azure-mgmt-serialconsole/HISTORY.rst b/azure-mgmt-serialconsole/HISTORY.rst new file mode 100644 index 000000000000..8924d5d6c445 --- /dev/null +++ b/azure-mgmt-serialconsole/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (1970-01-01) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-serialconsole/MANIFEST.in b/azure-mgmt-serialconsole/MANIFEST.in new file mode 100644 index 000000000000..e4884efef41b --- /dev/null +++ b/azure-mgmt-serialconsole/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-serialconsole/README.rst b/azure-mgmt-serialconsole/README.rst new file mode 100644 index 000000000000..2e6a85e35007 --- /dev/null +++ b/azure-mgmt-serialconsole/README.rst @@ -0,0 +1,33 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-serialconsole%2FREADME.png diff --git a/azure-mgmt-serialconsole/azure/__init__.py b/azure-mgmt-serialconsole/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-serialconsole/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-serialconsole/azure/mgmt/__init__.py b/azure-mgmt-serialconsole/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-serialconsole/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-serialconsole/sdk_packaging.toml b/azure-mgmt-serialconsole/sdk_packaging.toml new file mode 100644 index 000000000000..9ba7948941c1 --- /dev/null +++ b/azure-mgmt-serialconsole/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-serialconsole" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/azure-mgmt-serialconsole/setup.cfg b/azure-mgmt-serialconsole/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-mgmt-serialconsole/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-mgmt-serialconsole/setup.py b/azure-mgmt-serialconsole/setup.py new file mode 100644 index 000000000000..4cab0c2df150 --- /dev/null +++ b/azure-mgmt-serialconsole/setup.py @@ -0,0 +1,88 @@ +#!/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-serialconsole" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), '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.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', + 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.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)