diff --git a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/__init__.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/__init__.py index 990c1acb90b2..736fae6b6b22 100644 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/__init__.py +++ b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .microsoft_serial_console_client import MicrosoftSerialConsoleClient -from .version import VERSION +from ._configuration import MicrosoftSerialConsoleClientConfiguration +from ._microsoft_serial_console_client import MicrosoftSerialConsoleClient +__all__ = ['MicrosoftSerialConsoleClient', 'MicrosoftSerialConsoleClientConfiguration'] -__all__ = ['MicrosoftSerialConsoleClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/_configuration.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/_configuration.py new file mode 100644 index 000000000000..3bca217d1214 --- /dev/null +++ b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/_configuration.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class 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: Subscription ID which uniquely identifies the + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call requiring it. + :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) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + 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 diff --git a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/_microsoft_serial_console_client.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/_microsoft_serial_console_client.py new file mode 100644 index 000000000000..7a9dab5fa6f3 --- /dev/null +++ b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/_microsoft_serial_console_client.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import MicrosoftSerialConsoleClientConfiguration +from .operations import MicrosoftSerialConsoleClientOperationsMixin +from . import models + + +class MicrosoftSerialConsoleClient(MicrosoftSerialConsoleClientOperationsMixin, SDKClient): + """The Azure Serial Console allows you to access the serial console of a Virtual Machine or VM scale set instance + + :ivar config: Configuration for client. + :vartype config: MicrosoftSerialConsoleClientConfiguration + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription ID which uniquely identifies the + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call requiring it. + :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) + diff --git a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/microsoft_serial_console_client.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/microsoft_serial_console_client.py deleted file mode 100644 index 51a47232645c..000000000000 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/microsoft_serial_console_client.py +++ /dev/null @@ -1,91 +0,0 @@ -# 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/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/__init__.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/__init__.py index 793c2e2fe05b..243551914d02 100644 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/__init__.py +++ b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/__init__.py @@ -10,22 +10,28 @@ # -------------------------------------------------------------------------- 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 + from ._models_py3 import DisableSerialConsoleResult + from ._models_py3 import EnableSerialConsoleResult + from ._models_py3 import GetSerialConsoleSubscriptionNotFound + from ._models_py3 import SerialConsoleOperations + from ._models_py3 import SerialConsoleOperationsValueItem + from ._models_py3 import SerialConsoleOperationsValueItemDisplay + from ._models_py3 import SerialConsoleStatus 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 + from ._models import DisableSerialConsoleResult + from ._models import EnableSerialConsoleResult + from ._models import GetSerialConsoleSubscriptionNotFound + from ._models import SerialConsoleOperations + from ._models import SerialConsoleOperationsValueItem + from ._models import SerialConsoleOperationsValueItemDisplay + from ._models import SerialConsoleStatus __all__ = [ - 'SerialConsoleGetResult', - 'GetDisabledResult', - 'SetDisabledResult', - 'DeploymentValidateResult', 'DeploymentValidateResultException', + 'DisableSerialConsoleResult', + 'EnableSerialConsoleResult', + 'GetSerialConsoleSubscriptionNotFound', 'SerialConsoleOperations', + 'SerialConsoleOperationsValueItem', + 'SerialConsoleOperationsValueItemDisplay', + 'SerialConsoleStatus', ] diff --git a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/_models.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/_models.py new file mode 100644 index 000000000000..7178dc60db55 --- /dev/null +++ b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/_models.py @@ -0,0 +1,168 @@ +# 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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class DisableSerialConsoleResult(Model): + """Serial Console Disable Result. + + Returns whether or not Serial Console is disabled. + + :param disabled: Whether or not Serial Console is disabled. + :type disabled: bool + """ + + _attribute_map = { + 'disabled': {'key': 'disabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(DisableSerialConsoleResult, self).__init__(**kwargs) + self.disabled = kwargs.get('disabled', None) + + +class EnableSerialConsoleResult(Model): + """Serial Console Enable Result. + + Returns whether or not Serial Console is disabled (enabled). + + :param disabled: Whether or not Serial Console is disabled (enabled). + :type disabled: bool + """ + + _attribute_map = { + 'disabled': {'key': 'disabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(EnableSerialConsoleResult, self).__init__(**kwargs) + self.disabled = kwargs.get('disabled', None) + + +class GetSerialConsoleSubscriptionNotFound(Model): + """Serial Console subscription not found. + + Error saying that the provided subscription could not be found. + + :param code: Error code + :type code: str + :param message: Subscription not found message + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GetSerialConsoleSubscriptionNotFound, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class SerialConsoleOperations(Model): + """Serial Console operations. + + Serial Console operations. + + :param value: A list of Serial Console operations + :type value: + list[~azure.mgmt.serialconsole.models.SerialConsoleOperationsValueItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SerialConsoleOperationsValueItem]'}, + } + + def __init__(self, **kwargs): + super(SerialConsoleOperations, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class SerialConsoleOperationsValueItem(Model): + """SerialConsoleOperationsValueItem. + + :param name: + :type name: str + :param is_data_action: + :type is_data_action: str + :param display: + :type display: + ~azure.mgmt.serialconsole.models.SerialConsoleOperationsValueItemDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'SerialConsoleOperationsValueItemDisplay'}, + } + + def __init__(self, **kwargs): + super(SerialConsoleOperationsValueItem, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + + +class SerialConsoleOperationsValueItemDisplay(Model): + """SerialConsoleOperationsValueItemDisplay. + + :param provider: + :type provider: str + :param resource: + :type resource: str + :param operation: + :type operation: str + :param description: + :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(SerialConsoleOperationsValueItemDisplay, 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 SerialConsoleStatus(Model): + """Serial Console GET Result. + + Returns whether or not Serial Console is disabled. + + :param disabled: Whether or not Serial Console is disabled. + :type disabled: bool + """ + + _attribute_map = { + 'disabled': {'key': 'disabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SerialConsoleStatus, self).__init__(**kwargs) + self.disabled = kwargs.get('disabled', None) diff --git a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/_models_py3.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/_models_py3.py new file mode 100644 index 000000000000..74c456e7581e --- /dev/null +++ b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/_models_py3.py @@ -0,0 +1,168 @@ +# 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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class DisableSerialConsoleResult(Model): + """Serial Console Disable Result. + + Returns whether or not Serial Console is disabled. + + :param disabled: Whether or not Serial Console is disabled. + :type disabled: bool + """ + + _attribute_map = { + 'disabled': {'key': 'disabled', 'type': 'bool'}, + } + + def __init__(self, *, disabled: bool=None, **kwargs) -> None: + super(DisableSerialConsoleResult, self).__init__(**kwargs) + self.disabled = disabled + + +class EnableSerialConsoleResult(Model): + """Serial Console Enable Result. + + Returns whether or not Serial Console is disabled (enabled). + + :param disabled: Whether or not Serial Console is disabled (enabled). + :type disabled: bool + """ + + _attribute_map = { + 'disabled': {'key': 'disabled', 'type': 'bool'}, + } + + def __init__(self, *, disabled: bool=None, **kwargs) -> None: + super(EnableSerialConsoleResult, self).__init__(**kwargs) + self.disabled = disabled + + +class GetSerialConsoleSubscriptionNotFound(Model): + """Serial Console subscription not found. + + Error saying that the provided subscription could not be found. + + :param code: Error code + :type code: str + :param message: Subscription not found message + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(GetSerialConsoleSubscriptionNotFound, self).__init__(**kwargs) + self.code = code + self.message = message + + +class SerialConsoleOperations(Model): + """Serial Console operations. + + Serial Console operations. + + :param value: A list of Serial Console operations + :type value: + list[~azure.mgmt.serialconsole.models.SerialConsoleOperationsValueItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SerialConsoleOperationsValueItem]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(SerialConsoleOperations, self).__init__(**kwargs) + self.value = value + + +class SerialConsoleOperationsValueItem(Model): + """SerialConsoleOperationsValueItem. + + :param name: + :type name: str + :param is_data_action: + :type is_data_action: str + :param display: + :type display: + ~azure.mgmt.serialconsole.models.SerialConsoleOperationsValueItemDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'SerialConsoleOperationsValueItemDisplay'}, + } + + def __init__(self, *, name: str=None, is_data_action: str=None, display=None, **kwargs) -> None: + super(SerialConsoleOperationsValueItem, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + + +class SerialConsoleOperationsValueItemDisplay(Model): + """SerialConsoleOperationsValueItemDisplay. + + :param provider: + :type provider: str + :param resource: + :type resource: str + :param operation: + :type operation: str + :param description: + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(SerialConsoleOperationsValueItemDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class SerialConsoleStatus(Model): + """Serial Console GET Result. + + Returns whether or not Serial Console is disabled. + + :param disabled: Whether or not Serial Console is disabled. + :type disabled: bool + """ + + _attribute_map = { + 'disabled': {'key': 'disabled', 'type': 'bool'}, + } + + def __init__(self, *, disabled: bool=None, **kwargs) -> None: + super(SerialConsoleStatus, self).__init__(**kwargs) + self.disabled = disabled diff --git a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/deployment_validate_result.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/deployment_validate_result.py deleted file mode 100644 index 836055f68dc2..000000000000 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/deployment_validate_result.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/deployment_validate_result_py3.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/deployment_validate_result_py3.py deleted file mode 100644 index 3b79f288ffee..000000000000 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/deployment_validate_result_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/get_disabled_result.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/get_disabled_result.py deleted file mode 100644 index c69c47234ec3..000000000000 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/get_disabled_result.py +++ /dev/null @@ -1,31 +0,0 @@ -# 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/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/get_disabled_result_py3.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/get_disabled_result_py3.py deleted file mode 100644 index f85cfd2104ec..000000000000 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/get_disabled_result_py3.py +++ /dev/null @@ -1,31 +0,0 @@ -# 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/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_get_result.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_get_result.py deleted file mode 100644 index 341766f24ed0..000000000000 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_get_result.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_get_result_py3.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_get_result_py3.py deleted file mode 100644 index f04e7e788305..000000000000 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_get_result_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_operations.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_operations.py deleted file mode 100644 index d10dc90ca5ad..000000000000 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_operations.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_operations_py3.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_operations_py3.py deleted file mode 100644 index e8646a046ead..000000000000 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/serial_console_operations_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/set_disabled_result.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/set_disabled_result.py deleted file mode 100644 index 3117105e7cd4..000000000000 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/set_disabled_result.py +++ /dev/null @@ -1,31 +0,0 @@ -# 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/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/set_disabled_result_py3.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/set_disabled_result_py3.py deleted file mode 100644 index 97dab865915e..000000000000 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/models/set_disabled_result_py3.py +++ /dev/null @@ -1,31 +0,0 @@ -# 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/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/__init__.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/__init__.py index be2504c5c37b..f9aead8a2d10 100644 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/__init__.py +++ b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/__init__.py @@ -9,12 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .list_operations import ListOperations -from .list_console_operations import ListConsoleOperations -from .console_operations import ConsoleOperations +from ._microsoft_serial_console_client_operations import MicrosoftSerialConsoleClientOperationsMixin __all__ = [ - 'ListOperations', - 'ListConsoleOperations', - 'ConsoleOperations', + 'MicrosoftSerialConsoleClientOperationsMixin', ] diff --git a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/_microsoft_serial_console_client_operations.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/_microsoft_serial_console_client_operations.py new file mode 100644 index 000000000000..24e0d6adfcd5 --- /dev/null +++ b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/_microsoft_serial_console_client_operations.py @@ -0,0 +1,255 @@ +# 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.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from .. import models +import uuid + + +class MicrosoftSerialConsoleClientOperationsMixin(object): + + def list_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.list_operations.metadata['url'] + + # 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 + list_operations.metadata = {'url': '/providers/Microsoft.SerialConsole/operations'} + + def get_console_status( + self, default, custom_headers=None, raw=False, **operation_config): + """Get the disabled status for a subscription. + + Gets whether or not Serial Console is disabled for a given + subscription. + + :param default: Default parameter. Leave the value as "default". + :type default: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_console_status.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'default': self._serialize.url("default", 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, 404]: + 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('SerialConsoleStatus', response) + if response.status_code == 404: + deserialized = self._deserialize('GetSerialConsoleSubscriptionNotFound', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_console_status.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}'} + + def disable_console( + self, default, custom_headers=None, raw=False, **operation_config): + """Disable Serial Console for a subscription. + + Disables the Serial Console service for all VMs and VM scale sets in + the provided subscription. + + :param default: Default parameter. Leave the value as "default". + :type default: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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("default", 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, 404]: + 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('DisableSerialConsoleResult', response) + if response.status_code == 404: + deserialized = self._deserialize('GetSerialConsoleSubscriptionNotFound', 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'} + + def enable_console( + self, default, custom_headers=None, raw=False, **operation_config): + """Enable Serial Console for a subscription. + + Enables the Serial Console service for all VMs and VM scale sets in the + provided subscription. + + :param default: Default parameter. Leave the value as "default". + :type default: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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("default", 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, 404]: + 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('EnableSerialConsoleResult', response) + if response.status_code == 404: + deserialized = self._deserialize('GetSerialConsoleSubscriptionNotFound', 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'} diff --git a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/console_operations.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/console_operations.py deleted file mode 100644 index 6ff8a438b692..000000000000 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/console_operations.py +++ /dev/null @@ -1,151 +0,0 @@ -# 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/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/list_console_operations.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/list_console_operations.py deleted file mode 100644 index abd0da85b32d..000000000000 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/list_console_operations.py +++ /dev/null @@ -1,95 +0,0 @@ -# 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/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/list_operations.py b/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/list_operations.py deleted file mode 100644 index adae5854c192..000000000000 --- a/sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/operations/list_operations.py +++ /dev/null @@ -1,94 +0,0 @@ -# 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'}