diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/__init__.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/__init__.py new file mode 100644 index 000000000000..f9bfb9ad7773 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/__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 .server_management import ServerManagement +from .version import VERSION + +__all__ = ['ServerManagement'] + +__version__ = VERSION + diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/__init__.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/__init__.py new file mode 100644 index 000000000000..87cbba9d6f0a --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/__init__.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .resource_py3 import Resource + from .encryption_jwk_resource_py3 import EncryptionJwkResource + from .gateway_status_py3 import GatewayStatus + from .gateway_resource_py3 import GatewayResource + from .gateway_profile_py3 import GatewayProfile + from .gateway_parameters_py3 import GatewayParameters + from .node_resource_py3 import NodeResource + from .node_parameters_py3 import NodeParameters + from .session_resource_py3 import SessionResource + from .session_parameters_py3 import SessionParameters + from .version_py3 import Version + from .power_shell_session_resource_py3 import PowerShellSessionResource + from .prompt_field_description_py3 import PromptFieldDescription + from .power_shell_command_result_py3 import PowerShellCommandResult + from .power_shell_command_results_py3 import PowerShellCommandResults + from .power_shell_command_status_py3 import PowerShellCommandStatus + from .power_shell_session_resources_py3 import PowerShellSessionResources + from .power_shell_command_parameters_py3 import PowerShellCommandParameters + from .prompt_message_response_py3 import PromptMessageResponse + from .power_shell_tab_completion_parameters_py3 import PowerShellTabCompletionParameters + from .power_shell_tab_completion_results_py3 import PowerShellTabCompletionResults + from .error_py3 import Error, ErrorException +except (SyntaxError, ImportError): + from .resource import Resource + from .encryption_jwk_resource import EncryptionJwkResource + from .gateway_status import GatewayStatus + from .gateway_resource import GatewayResource + from .gateway_profile import GatewayProfile + from .gateway_parameters import GatewayParameters + from .node_resource import NodeResource + from .node_parameters import NodeParameters + from .session_resource import SessionResource + from .session_parameters import SessionParameters + from .version import Version + from .power_shell_session_resource import PowerShellSessionResource + from .prompt_field_description import PromptFieldDescription + from .power_shell_command_result import PowerShellCommandResult + from .power_shell_command_results import PowerShellCommandResults + from .power_shell_command_status import PowerShellCommandStatus + from .power_shell_session_resources import PowerShellSessionResources + from .power_shell_command_parameters import PowerShellCommandParameters + from .prompt_message_response import PromptMessageResponse + from .power_shell_tab_completion_parameters import PowerShellTabCompletionParameters + from .power_shell_tab_completion_results import PowerShellTabCompletionResults + from .error import Error, ErrorException +from .gateway_resource_paged import GatewayResourcePaged +from .node_resource_paged import NodeResourcePaged +from .server_management_enums import ( + UpgradeMode, + RetentionPeriod, + CredentialDataFormat, + PromptFieldType, + GatewayExpandOption, + PowerShellExpandOption, +) + +__all__ = [ + 'Resource', + 'EncryptionJwkResource', + 'GatewayStatus', + 'GatewayResource', + 'GatewayProfile', + 'GatewayParameters', + 'NodeResource', + 'NodeParameters', + 'SessionResource', + 'SessionParameters', + 'Version', + 'PowerShellSessionResource', + 'PromptFieldDescription', + 'PowerShellCommandResult', + 'PowerShellCommandResults', + 'PowerShellCommandStatus', + 'PowerShellSessionResources', + 'PowerShellCommandParameters', + 'PromptMessageResponse', + 'PowerShellTabCompletionParameters', + 'PowerShellTabCompletionResults', + 'Error', 'ErrorException', + 'GatewayResourcePaged', + 'NodeResourcePaged', + 'UpgradeMode', + 'RetentionPeriod', + 'CredentialDataFormat', + 'PromptFieldType', + 'GatewayExpandOption', + 'PowerShellExpandOption', +] diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/encryption_jwk_resource.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/encryption_jwk_resource.py new file mode 100644 index 000000000000..a070ee7deb07 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/encryption_jwk_resource.py @@ -0,0 +1,40 @@ +# 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 EncryptionJwkResource(Model): + """The public key of the gateway. + + :param kty: + :type kty: str + :param alg: + :type alg: str + :param e: + :type e: str + :param n: + :type n: str + """ + + _attribute_map = { + 'kty': {'key': 'kty', 'type': 'str'}, + 'alg': {'key': 'alg', 'type': 'str'}, + 'e': {'key': 'e', 'type': 'str'}, + 'n': {'key': 'n', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EncryptionJwkResource, self).__init__(**kwargs) + self.kty = kwargs.get('kty', None) + self.alg = kwargs.get('alg', None) + self.e = kwargs.get('e', None) + self.n = kwargs.get('n', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/encryption_jwk_resource_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/encryption_jwk_resource_py3.py new file mode 100644 index 000000000000..601b269f660c --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/encryption_jwk_resource_py3.py @@ -0,0 +1,40 @@ +# 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 EncryptionJwkResource(Model): + """The public key of the gateway. + + :param kty: + :type kty: str + :param alg: + :type alg: str + :param e: + :type e: str + :param n: + :type n: str + """ + + _attribute_map = { + 'kty': {'key': 'kty', 'type': 'str'}, + 'alg': {'key': 'alg', 'type': 'str'}, + 'e': {'key': 'e', 'type': 'str'}, + 'n': {'key': 'n', 'type': 'str'}, + } + + def __init__(self, *, kty: str=None, alg: str=None, e: str=None, n: str=None, **kwargs) -> None: + super(EncryptionJwkResource, self).__init__(**kwargs) + self.kty = kty + self.alg = alg + self.e = e + self.n = n diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/error.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/error.py new file mode 100644 index 000000000000..a325ec8c2077 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/error.py @@ -0,0 +1,49 @@ +# 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 Error(Model): + """Error message. + + :param code: + :type code: int + :param message: + :type message: str + :param fields: + :type fields: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'int'}, + 'message': {'key': 'message', 'type': 'str'}, + 'fields': {'key': 'fields', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.fields = kwargs.get('fields', None) + + +class ErrorException(HttpOperationError): + """Server responsed with exception of type: 'Error'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/error_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/error_py3.py new file mode 100644 index 000000000000..4b1acc5b414c --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/error_py3.py @@ -0,0 +1,49 @@ +# 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 Error(Model): + """Error message. + + :param code: + :type code: int + :param message: + :type message: str + :param fields: + :type fields: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'int'}, + 'message': {'key': 'message', 'type': 'str'}, + 'fields': {'key': 'fields', 'type': 'str'}, + } + + def __init__(self, *, code: int=None, message: str=None, fields: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.fields = fields + + +class ErrorException(HttpOperationError): + """Server responsed with exception of type: 'Error'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_parameters.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_parameters.py new file mode 100644 index 000000000000..80f36badae5b --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_parameters.py @@ -0,0 +1,39 @@ +# 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 GatewayParameters(Model): + """Collection of parameters for operations on a gateway resource. + + :param location: Location of the resource. + :type location: str + :param tags: Resource tags. + :type tags: object + :param upgrade_mode: The upgradeMode property gives the flexibility to + gateway to auto upgrade itself. If properties value not specified, then we + assume upgradeMode = Automatic. Possible values include: 'Manual', + 'Automatic' + :type upgrade_mode: str or ~azure.mgmt.servermanagement.models.UpgradeMode + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, + 'upgrade_mode': {'key': 'properties.upgradeMode', 'type': 'UpgradeMode'}, + } + + def __init__(self, **kwargs): + super(GatewayParameters, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.upgrade_mode = kwargs.get('upgrade_mode', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_parameters_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_parameters_py3.py new file mode 100644 index 000000000000..23e01a68cf70 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_parameters_py3.py @@ -0,0 +1,39 @@ +# 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 GatewayParameters(Model): + """Collection of parameters for operations on a gateway resource. + + :param location: Location of the resource. + :type location: str + :param tags: Resource tags. + :type tags: object + :param upgrade_mode: The upgradeMode property gives the flexibility to + gateway to auto upgrade itself. If properties value not specified, then we + assume upgradeMode = Automatic. Possible values include: 'Manual', + 'Automatic' + :type upgrade_mode: str or ~azure.mgmt.servermanagement.models.UpgradeMode + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, + 'upgrade_mode': {'key': 'properties.upgradeMode', 'type': 'UpgradeMode'}, + } + + def __init__(self, *, location: str=None, tags=None, upgrade_mode=None, **kwargs) -> None: + super(GatewayParameters, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.upgrade_mode = upgrade_mode diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_profile.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_profile.py new file mode 100644 index 000000000000..26a1720120b1 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_profile.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayProfile(Model): + """JSON properties that the gateway service uses know how to communicate with + the resource. + + :param data_plane_service_base_address: The Dataplane connection URL. + :type data_plane_service_base_address: str + :param gateway_id: The ID of the gateway. + :type gateway_id: str + :param environment: The environment for the gateway (DEV, DogFood, or + Production). + :type environment: str + :param upgrade_manifest_url: Gateway upgrade manifest URL. + :type upgrade_manifest_url: str + :param messaging_namespace: Messaging namespace. + :type messaging_namespace: str + :param messaging_account: Messaging Account. + :type messaging_account: str + :param messaging_key: Messaging Key. + :type messaging_key: str + :param request_queue: Request queue name. + :type request_queue: str + :param response_topic: Response topic name. + :type response_topic: str + :param status_blob_signature: The gateway status blob SAS URL. + :type status_blob_signature: str + """ + + _attribute_map = { + 'data_plane_service_base_address': {'key': 'dataPlaneServiceBaseAddress', 'type': 'str'}, + 'gateway_id': {'key': 'gatewayId', 'type': 'str'}, + 'environment': {'key': 'environment', 'type': 'str'}, + 'upgrade_manifest_url': {'key': 'upgradeManifestUrl', 'type': 'str'}, + 'messaging_namespace': {'key': 'messagingNamespace', 'type': 'str'}, + 'messaging_account': {'key': 'messagingAccount', 'type': 'str'}, + 'messaging_key': {'key': 'messagingKey', 'type': 'str'}, + 'request_queue': {'key': 'requestQueue', 'type': 'str'}, + 'response_topic': {'key': 'responseTopic', 'type': 'str'}, + 'status_blob_signature': {'key': 'statusBlobSignature', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GatewayProfile, self).__init__(**kwargs) + self.data_plane_service_base_address = kwargs.get('data_plane_service_base_address', None) + self.gateway_id = kwargs.get('gateway_id', None) + self.environment = kwargs.get('environment', None) + self.upgrade_manifest_url = kwargs.get('upgrade_manifest_url', None) + self.messaging_namespace = kwargs.get('messaging_namespace', None) + self.messaging_account = kwargs.get('messaging_account', None) + self.messaging_key = kwargs.get('messaging_key', None) + self.request_queue = kwargs.get('request_queue', None) + self.response_topic = kwargs.get('response_topic', None) + self.status_blob_signature = kwargs.get('status_blob_signature', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_profile_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_profile_py3.py new file mode 100644 index 000000000000..d72d4ab59a09 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_profile_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayProfile(Model): + """JSON properties that the gateway service uses know how to communicate with + the resource. + + :param data_plane_service_base_address: The Dataplane connection URL. + :type data_plane_service_base_address: str + :param gateway_id: The ID of the gateway. + :type gateway_id: str + :param environment: The environment for the gateway (DEV, DogFood, or + Production). + :type environment: str + :param upgrade_manifest_url: Gateway upgrade manifest URL. + :type upgrade_manifest_url: str + :param messaging_namespace: Messaging namespace. + :type messaging_namespace: str + :param messaging_account: Messaging Account. + :type messaging_account: str + :param messaging_key: Messaging Key. + :type messaging_key: str + :param request_queue: Request queue name. + :type request_queue: str + :param response_topic: Response topic name. + :type response_topic: str + :param status_blob_signature: The gateway status blob SAS URL. + :type status_blob_signature: str + """ + + _attribute_map = { + 'data_plane_service_base_address': {'key': 'dataPlaneServiceBaseAddress', 'type': 'str'}, + 'gateway_id': {'key': 'gatewayId', 'type': 'str'}, + 'environment': {'key': 'environment', 'type': 'str'}, + 'upgrade_manifest_url': {'key': 'upgradeManifestUrl', 'type': 'str'}, + 'messaging_namespace': {'key': 'messagingNamespace', 'type': 'str'}, + 'messaging_account': {'key': 'messagingAccount', 'type': 'str'}, + 'messaging_key': {'key': 'messagingKey', 'type': 'str'}, + 'request_queue': {'key': 'requestQueue', 'type': 'str'}, + 'response_topic': {'key': 'responseTopic', 'type': 'str'}, + 'status_blob_signature': {'key': 'statusBlobSignature', 'type': 'str'}, + } + + def __init__(self, *, data_plane_service_base_address: str=None, gateway_id: str=None, environment: str=None, upgrade_manifest_url: str=None, messaging_namespace: str=None, messaging_account: str=None, messaging_key: str=None, request_queue: str=None, response_topic: str=None, status_blob_signature: str=None, **kwargs) -> None: + super(GatewayProfile, self).__init__(**kwargs) + self.data_plane_service_base_address = data_plane_service_base_address + self.gateway_id = gateway_id + self.environment = environment + self.upgrade_manifest_url = upgrade_manifest_url + self.messaging_namespace = messaging_namespace + self.messaging_account = messaging_account + self.messaging_key = messaging_key + self.request_queue = request_queue + self.response_topic = response_topic + self.status_blob_signature = status_blob_signature diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_resource.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_resource.py new file mode 100644 index 000000000000..3daa373a0066 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_resource.py @@ -0,0 +1,98 @@ +# 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 .resource import Resource + + +class GatewayResource(Resource): + """Data model for an arm gateway resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Manager Resource ID. + :vartype id: str + :ivar type: Resource Manager Resource Type. + :vartype type: str + :ivar name: Resource Manager Resource Name. + :vartype name: str + :ivar location: Resource Manager Resource Location. + :vartype location: str + :param tags: Resource Manager Resource Tags. + :type tags: dict[str, str] + :param etag: + :type etag: str + :param created: UTC date and time when gateway was first added to + management service. + :type created: datetime + :param updated: UTC date and time when node was last updated. + :type updated: datetime + :param upgrade_mode: The upgradeMode property gives the flexibility to + gateway to auto upgrade itself. If properties value not specified, then we + assume upgradeMode = Automatic. Possible values include: 'Manual', + 'Automatic' + :type upgrade_mode: str or ~azure.mgmt.servermanagement.models.UpgradeMode + :param desired_version: Latest available MSI version. + :type desired_version: str + :param instances: Names of the nodes in the gateway. + :type instances: list[~azure.mgmt.servermanagement.models.GatewayStatus] + :param active_message_count: Number of active messages. + :type active_message_count: int + :param latest_published_msi_version: Last published MSI version. + :type latest_published_msi_version: str + :param published_time_utc: The date/time of the last published gateway. + :type published_time_utc: datetime + :ivar installer_download: Installer download uri. + :vartype installer_download: str + :ivar minimum_version: Minimum gateway version. + :vartype minimum_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'installer_download': {'readonly': True}, + 'minimum_version': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'created': {'key': 'properties.created', 'type': 'iso-8601'}, + 'updated': {'key': 'properties.updated', 'type': 'iso-8601'}, + 'upgrade_mode': {'key': 'properties.upgradeMode', 'type': 'UpgradeMode'}, + 'desired_version': {'key': 'properties.desiredVersion', 'type': 'str'}, + 'instances': {'key': 'properties.instances', 'type': '[GatewayStatus]'}, + 'active_message_count': {'key': 'properties.activeMessageCount', 'type': 'int'}, + 'latest_published_msi_version': {'key': 'properties.latestPublishedMsiVersion', 'type': 'str'}, + 'published_time_utc': {'key': 'properties.publishedTimeUtc', 'type': 'iso-8601'}, + 'installer_download': {'key': 'properties.installerDownload', 'type': 'str'}, + 'minimum_version': {'key': 'properties.minimumVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GatewayResource, self).__init__(**kwargs) + self.created = kwargs.get('created', None) + self.updated = kwargs.get('updated', None) + self.upgrade_mode = kwargs.get('upgrade_mode', None) + self.desired_version = kwargs.get('desired_version', None) + self.instances = kwargs.get('instances', None) + self.active_message_count = kwargs.get('active_message_count', None) + self.latest_published_msi_version = kwargs.get('latest_published_msi_version', None) + self.published_time_utc = kwargs.get('published_time_utc', None) + self.installer_download = None + self.minimum_version = None diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_resource_paged.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_resource_paged.py new file mode 100644 index 000000000000..c6baf826808d --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_resource_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class GatewayResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`GatewayResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[GatewayResource]'} + } + + def __init__(self, *args, **kwargs): + + super(GatewayResourcePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_resource_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_resource_py3.py new file mode 100644 index 000000000000..d33ae745c14e --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_resource_py3.py @@ -0,0 +1,98 @@ +# 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 .resource_py3 import Resource + + +class GatewayResource(Resource): + """Data model for an arm gateway resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Manager Resource ID. + :vartype id: str + :ivar type: Resource Manager Resource Type. + :vartype type: str + :ivar name: Resource Manager Resource Name. + :vartype name: str + :ivar location: Resource Manager Resource Location. + :vartype location: str + :param tags: Resource Manager Resource Tags. + :type tags: dict[str, str] + :param etag: + :type etag: str + :param created: UTC date and time when gateway was first added to + management service. + :type created: datetime + :param updated: UTC date and time when node was last updated. + :type updated: datetime + :param upgrade_mode: The upgradeMode property gives the flexibility to + gateway to auto upgrade itself. If properties value not specified, then we + assume upgradeMode = Automatic. Possible values include: 'Manual', + 'Automatic' + :type upgrade_mode: str or ~azure.mgmt.servermanagement.models.UpgradeMode + :param desired_version: Latest available MSI version. + :type desired_version: str + :param instances: Names of the nodes in the gateway. + :type instances: list[~azure.mgmt.servermanagement.models.GatewayStatus] + :param active_message_count: Number of active messages. + :type active_message_count: int + :param latest_published_msi_version: Last published MSI version. + :type latest_published_msi_version: str + :param published_time_utc: The date/time of the last published gateway. + :type published_time_utc: datetime + :ivar installer_download: Installer download uri. + :vartype installer_download: str + :ivar minimum_version: Minimum gateway version. + :vartype minimum_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'installer_download': {'readonly': True}, + 'minimum_version': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'created': {'key': 'properties.created', 'type': 'iso-8601'}, + 'updated': {'key': 'properties.updated', 'type': 'iso-8601'}, + 'upgrade_mode': {'key': 'properties.upgradeMode', 'type': 'UpgradeMode'}, + 'desired_version': {'key': 'properties.desiredVersion', 'type': 'str'}, + 'instances': {'key': 'properties.instances', 'type': '[GatewayStatus]'}, + 'active_message_count': {'key': 'properties.activeMessageCount', 'type': 'int'}, + 'latest_published_msi_version': {'key': 'properties.latestPublishedMsiVersion', 'type': 'str'}, + 'published_time_utc': {'key': 'properties.publishedTimeUtc', 'type': 'iso-8601'}, + 'installer_download': {'key': 'properties.installerDownload', 'type': 'str'}, + 'minimum_version': {'key': 'properties.minimumVersion', 'type': 'str'}, + } + + def __init__(self, *, tags=None, etag: str=None, created=None, updated=None, upgrade_mode=None, desired_version: str=None, instances=None, active_message_count: int=None, latest_published_msi_version: str=None, published_time_utc=None, **kwargs) -> None: + super(GatewayResource, self).__init__(tags=tags, etag=etag, **kwargs) + self.created = created + self.updated = updated + self.upgrade_mode = upgrade_mode + self.desired_version = desired_version + self.instances = instances + self.active_message_count = active_message_count + self.latest_published_msi_version = latest_published_msi_version + self.published_time_utc = published_time_utc + self.installer_download = None + self.minimum_version = None diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_status.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_status.py new file mode 100644 index 000000000000..876e24df9f97 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_status.py @@ -0,0 +1,126 @@ +# 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 GatewayStatus(Model): + """Expanded gateway status information. + + :param available_memory_mbyte: The available memory on the gateway host + machine in megabytes. + :type available_memory_mbyte: float + :param gateway_cpu_utilization_percent: The CPU utilization of the gateway + process (numeric value between 0 and 100). + :type gateway_cpu_utilization_percent: float + :param total_cpu_utilization_percent: CPU Utilization of the whole system. + :type total_cpu_utilization_percent: float + :param gateway_version: The version of the gateway that is installed on + the system. + :type gateway_version: str + :param friendly_os_name: The Plaintext description of the OS on the + gateway. + :type friendly_os_name: str + :param installed_date: The date the gateway was installed. + :type installed_date: datetime + :param logical_processor_count: Number of logical processors in the + gateway system. + :type logical_processor_count: int + :param name: The computer name of the gateway system. + :type name: str + :param gateway_id: The gateway resource ID. + :type gateway_id: str + :param gateway_working_set_mbyte: The working set size of the gateway + process in megabytes. + :type gateway_working_set_mbyte: float + :param status_updated: UTC date and time when gateway status was last + updated. + :type status_updated: datetime + :param group_policy_error: The group policy error. + :type group_policy_error: str + :param allow_gateway_group_policy_status: Status of the + allowGatewayGroupPolicy setting. + :type allow_gateway_group_policy_status: bool + :param require_mfa_group_policy_status: Status of the + requireMfaGroupPolicy setting. + :type require_mfa_group_policy_status: bool + :param encryption_certificate_thumbprint: Thumbprint of the encryption + certificate. + :type encryption_certificate_thumbprint: str + :param secondary_encryption_certificate_thumbprint: Secondary thumbprint + of the encryption certificate. + :type secondary_encryption_certificate_thumbprint: str + :param encryption_jwk: The encryption certificate key. + :type encryption_jwk: + ~azure.mgmt.servermanagement.models.EncryptionJwkResource + :param secondary_encryption_jwk: The secondary encryption certificate key. + :type secondary_encryption_jwk: + ~azure.mgmt.servermanagement.models.EncryptionJwkResource + :param active_message_count: Active message count. + :type active_message_count: int + :param latest_published_msi_version: Latest published version of the + gateway install MSI. + :type latest_published_msi_version: str + :param published_time_utc: Gateway install MSI published time. + :type published_time_utc: datetime + """ + + _validation = { + 'gateway_cpu_utilization_percent': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'available_memory_mbyte': {'key': 'availableMemoryMByte', 'type': 'float'}, + 'gateway_cpu_utilization_percent': {'key': 'gatewayCpuUtilizationPercent', 'type': 'float'}, + 'total_cpu_utilization_percent': {'key': 'totalCpuUtilizationPercent', 'type': 'float'}, + 'gateway_version': {'key': 'gatewayVersion', 'type': 'str'}, + 'friendly_os_name': {'key': 'friendlyOsName', 'type': 'str'}, + 'installed_date': {'key': 'installedDate', 'type': 'iso-8601'}, + 'logical_processor_count': {'key': 'logicalProcessorCount', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'gateway_id': {'key': 'gatewayId', 'type': 'str'}, + 'gateway_working_set_mbyte': {'key': 'gatewayWorkingSetMByte', 'type': 'float'}, + 'status_updated': {'key': 'statusUpdated', 'type': 'iso-8601'}, + 'group_policy_error': {'key': 'groupPolicyError', 'type': 'str'}, + 'allow_gateway_group_policy_status': {'key': 'allowGatewayGroupPolicyStatus', 'type': 'bool'}, + 'require_mfa_group_policy_status': {'key': 'requireMfaGroupPolicyStatus', 'type': 'bool'}, + 'encryption_certificate_thumbprint': {'key': 'encryptionCertificateThumbprint', 'type': 'str'}, + 'secondary_encryption_certificate_thumbprint': {'key': 'secondaryEncryptionCertificateThumbprint', 'type': 'str'}, + 'encryption_jwk': {'key': 'encryptionJwk', 'type': 'EncryptionJwkResource'}, + 'secondary_encryption_jwk': {'key': 'secondaryEncryptionJwk', 'type': 'EncryptionJwkResource'}, + 'active_message_count': {'key': 'activeMessageCount', 'type': 'int'}, + 'latest_published_msi_version': {'key': 'latestPublishedMsiVersion', 'type': 'str'}, + 'published_time_utc': {'key': 'publishedTimeUtc', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(GatewayStatus, self).__init__(**kwargs) + self.available_memory_mbyte = kwargs.get('available_memory_mbyte', None) + self.gateway_cpu_utilization_percent = kwargs.get('gateway_cpu_utilization_percent', None) + self.total_cpu_utilization_percent = kwargs.get('total_cpu_utilization_percent', None) + self.gateway_version = kwargs.get('gateway_version', None) + self.friendly_os_name = kwargs.get('friendly_os_name', None) + self.installed_date = kwargs.get('installed_date', None) + self.logical_processor_count = kwargs.get('logical_processor_count', None) + self.name = kwargs.get('name', None) + self.gateway_id = kwargs.get('gateway_id', None) + self.gateway_working_set_mbyte = kwargs.get('gateway_working_set_mbyte', None) + self.status_updated = kwargs.get('status_updated', None) + self.group_policy_error = kwargs.get('group_policy_error', None) + self.allow_gateway_group_policy_status = kwargs.get('allow_gateway_group_policy_status', None) + self.require_mfa_group_policy_status = kwargs.get('require_mfa_group_policy_status', None) + self.encryption_certificate_thumbprint = kwargs.get('encryption_certificate_thumbprint', None) + self.secondary_encryption_certificate_thumbprint = kwargs.get('secondary_encryption_certificate_thumbprint', None) + self.encryption_jwk = kwargs.get('encryption_jwk', None) + self.secondary_encryption_jwk = kwargs.get('secondary_encryption_jwk', None) + self.active_message_count = kwargs.get('active_message_count', None) + self.latest_published_msi_version = kwargs.get('latest_published_msi_version', None) + self.published_time_utc = kwargs.get('published_time_utc', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_status_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_status_py3.py new file mode 100644 index 000000000000..f0c1a6b69e7c --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/gateway_status_py3.py @@ -0,0 +1,126 @@ +# 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 GatewayStatus(Model): + """Expanded gateway status information. + + :param available_memory_mbyte: The available memory on the gateway host + machine in megabytes. + :type available_memory_mbyte: float + :param gateway_cpu_utilization_percent: The CPU utilization of the gateway + process (numeric value between 0 and 100). + :type gateway_cpu_utilization_percent: float + :param total_cpu_utilization_percent: CPU Utilization of the whole system. + :type total_cpu_utilization_percent: float + :param gateway_version: The version of the gateway that is installed on + the system. + :type gateway_version: str + :param friendly_os_name: The Plaintext description of the OS on the + gateway. + :type friendly_os_name: str + :param installed_date: The date the gateway was installed. + :type installed_date: datetime + :param logical_processor_count: Number of logical processors in the + gateway system. + :type logical_processor_count: int + :param name: The computer name of the gateway system. + :type name: str + :param gateway_id: The gateway resource ID. + :type gateway_id: str + :param gateway_working_set_mbyte: The working set size of the gateway + process in megabytes. + :type gateway_working_set_mbyte: float + :param status_updated: UTC date and time when gateway status was last + updated. + :type status_updated: datetime + :param group_policy_error: The group policy error. + :type group_policy_error: str + :param allow_gateway_group_policy_status: Status of the + allowGatewayGroupPolicy setting. + :type allow_gateway_group_policy_status: bool + :param require_mfa_group_policy_status: Status of the + requireMfaGroupPolicy setting. + :type require_mfa_group_policy_status: bool + :param encryption_certificate_thumbprint: Thumbprint of the encryption + certificate. + :type encryption_certificate_thumbprint: str + :param secondary_encryption_certificate_thumbprint: Secondary thumbprint + of the encryption certificate. + :type secondary_encryption_certificate_thumbprint: str + :param encryption_jwk: The encryption certificate key. + :type encryption_jwk: + ~azure.mgmt.servermanagement.models.EncryptionJwkResource + :param secondary_encryption_jwk: The secondary encryption certificate key. + :type secondary_encryption_jwk: + ~azure.mgmt.servermanagement.models.EncryptionJwkResource + :param active_message_count: Active message count. + :type active_message_count: int + :param latest_published_msi_version: Latest published version of the + gateway install MSI. + :type latest_published_msi_version: str + :param published_time_utc: Gateway install MSI published time. + :type published_time_utc: datetime + """ + + _validation = { + 'gateway_cpu_utilization_percent': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'available_memory_mbyte': {'key': 'availableMemoryMByte', 'type': 'float'}, + 'gateway_cpu_utilization_percent': {'key': 'gatewayCpuUtilizationPercent', 'type': 'float'}, + 'total_cpu_utilization_percent': {'key': 'totalCpuUtilizationPercent', 'type': 'float'}, + 'gateway_version': {'key': 'gatewayVersion', 'type': 'str'}, + 'friendly_os_name': {'key': 'friendlyOsName', 'type': 'str'}, + 'installed_date': {'key': 'installedDate', 'type': 'iso-8601'}, + 'logical_processor_count': {'key': 'logicalProcessorCount', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'gateway_id': {'key': 'gatewayId', 'type': 'str'}, + 'gateway_working_set_mbyte': {'key': 'gatewayWorkingSetMByte', 'type': 'float'}, + 'status_updated': {'key': 'statusUpdated', 'type': 'iso-8601'}, + 'group_policy_error': {'key': 'groupPolicyError', 'type': 'str'}, + 'allow_gateway_group_policy_status': {'key': 'allowGatewayGroupPolicyStatus', 'type': 'bool'}, + 'require_mfa_group_policy_status': {'key': 'requireMfaGroupPolicyStatus', 'type': 'bool'}, + 'encryption_certificate_thumbprint': {'key': 'encryptionCertificateThumbprint', 'type': 'str'}, + 'secondary_encryption_certificate_thumbprint': {'key': 'secondaryEncryptionCertificateThumbprint', 'type': 'str'}, + 'encryption_jwk': {'key': 'encryptionJwk', 'type': 'EncryptionJwkResource'}, + 'secondary_encryption_jwk': {'key': 'secondaryEncryptionJwk', 'type': 'EncryptionJwkResource'}, + 'active_message_count': {'key': 'activeMessageCount', 'type': 'int'}, + 'latest_published_msi_version': {'key': 'latestPublishedMsiVersion', 'type': 'str'}, + 'published_time_utc': {'key': 'publishedTimeUtc', 'type': 'iso-8601'}, + } + + def __init__(self, *, available_memory_mbyte: float=None, gateway_cpu_utilization_percent: float=None, total_cpu_utilization_percent: float=None, gateway_version: str=None, friendly_os_name: str=None, installed_date=None, logical_processor_count: int=None, name: str=None, gateway_id: str=None, gateway_working_set_mbyte: float=None, status_updated=None, group_policy_error: str=None, allow_gateway_group_policy_status: bool=None, require_mfa_group_policy_status: bool=None, encryption_certificate_thumbprint: str=None, secondary_encryption_certificate_thumbprint: str=None, encryption_jwk=None, secondary_encryption_jwk=None, active_message_count: int=None, latest_published_msi_version: str=None, published_time_utc=None, **kwargs) -> None: + super(GatewayStatus, self).__init__(**kwargs) + self.available_memory_mbyte = available_memory_mbyte + self.gateway_cpu_utilization_percent = gateway_cpu_utilization_percent + self.total_cpu_utilization_percent = total_cpu_utilization_percent + self.gateway_version = gateway_version + self.friendly_os_name = friendly_os_name + self.installed_date = installed_date + self.logical_processor_count = logical_processor_count + self.name = name + self.gateway_id = gateway_id + self.gateway_working_set_mbyte = gateway_working_set_mbyte + self.status_updated = status_updated + self.group_policy_error = group_policy_error + self.allow_gateway_group_policy_status = allow_gateway_group_policy_status + self.require_mfa_group_policy_status = require_mfa_group_policy_status + self.encryption_certificate_thumbprint = encryption_certificate_thumbprint + self.secondary_encryption_certificate_thumbprint = secondary_encryption_certificate_thumbprint + self.encryption_jwk = encryption_jwk + self.secondary_encryption_jwk = secondary_encryption_jwk + self.active_message_count = active_message_count + self.latest_published_msi_version = latest_published_msi_version + self.published_time_utc = published_time_utc diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_parameters.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_parameters.py new file mode 100644 index 000000000000..67bbe2b8c0a8 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_parameters.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NodeParameters(Model): + """Parameter collection for operations on arm node resource. + + :param location: Location of the resource. + :type location: str + :param tags: Resource tags. + :type tags: object + :param gateway_id: Gateway ID which will manage this node. + :type gateway_id: str + :param connection_name: myhost.domain.com + :type connection_name: str + :param user_name: User name to be used to connect to node. + :type user_name: str + :param password: Password associated with user name. + :type password: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, + 'gateway_id': {'key': 'properties.gatewayId', 'type': 'str'}, + 'connection_name': {'key': 'properties.connectionName', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NodeParameters, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.gateway_id = kwargs.get('gateway_id', None) + self.connection_name = kwargs.get('connection_name', None) + self.user_name = kwargs.get('user_name', None) + self.password = kwargs.get('password', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_parameters_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_parameters_py3.py new file mode 100644 index 000000000000..9a5c67376dca --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_parameters_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NodeParameters(Model): + """Parameter collection for operations on arm node resource. + + :param location: Location of the resource. + :type location: str + :param tags: Resource tags. + :type tags: object + :param gateway_id: Gateway ID which will manage this node. + :type gateway_id: str + :param connection_name: myhost.domain.com + :type connection_name: str + :param user_name: User name to be used to connect to node. + :type user_name: str + :param password: Password associated with user name. + :type password: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'object'}, + 'gateway_id': {'key': 'properties.gatewayId', 'type': 'str'}, + 'connection_name': {'key': 'properties.connectionName', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, gateway_id: str=None, connection_name: str=None, user_name: str=None, password: str=None, **kwargs) -> None: + super(NodeParameters, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.gateway_id = gateway_id + self.connection_name = connection_name + self.user_name = user_name + self.password = password diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_resource.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_resource.py new file mode 100644 index 000000000000..ac2051a80222 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_resource.py @@ -0,0 +1,69 @@ +# 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 .resource import Resource + + +class NodeResource(Resource): + """A Node Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Manager Resource ID. + :vartype id: str + :ivar type: Resource Manager Resource Type. + :vartype type: str + :ivar name: Resource Manager Resource Name. + :vartype name: str + :ivar location: Resource Manager Resource Location. + :vartype location: str + :param tags: Resource Manager Resource Tags. + :type tags: dict[str, str] + :param etag: + :type etag: str + :param gateway_id: ID of the gateway. + :type gateway_id: str + :param connection_name: myhost.domain.com + :type connection_name: str + :param created: UTC date and time when node was first added to management + service. + :type created: datetime + :param updated: UTC date and time when node was last updated. + :type updated: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'gateway_id': {'key': 'properties.gatewayId', 'type': 'str'}, + 'connection_name': {'key': 'properties.connectionName', 'type': 'str'}, + 'created': {'key': 'properties.created', 'type': 'iso-8601'}, + 'updated': {'key': 'properties.updated', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(NodeResource, self).__init__(**kwargs) + self.gateway_id = kwargs.get('gateway_id', None) + self.connection_name = kwargs.get('connection_name', None) + self.created = kwargs.get('created', None) + self.updated = kwargs.get('updated', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_resource_paged.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_resource_paged.py new file mode 100644 index 000000000000..3ee6445fc117 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_resource_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class NodeResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`NodeResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[NodeResource]'} + } + + def __init__(self, *args, **kwargs): + + super(NodeResourcePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_resource_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_resource_py3.py new file mode 100644 index 000000000000..99934a08adee --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/node_resource_py3.py @@ -0,0 +1,69 @@ +# 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 .resource_py3 import Resource + + +class NodeResource(Resource): + """A Node Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Manager Resource ID. + :vartype id: str + :ivar type: Resource Manager Resource Type. + :vartype type: str + :ivar name: Resource Manager Resource Name. + :vartype name: str + :ivar location: Resource Manager Resource Location. + :vartype location: str + :param tags: Resource Manager Resource Tags. + :type tags: dict[str, str] + :param etag: + :type etag: str + :param gateway_id: ID of the gateway. + :type gateway_id: str + :param connection_name: myhost.domain.com + :type connection_name: str + :param created: UTC date and time when node was first added to management + service. + :type created: datetime + :param updated: UTC date and time when node was last updated. + :type updated: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'gateway_id': {'key': 'properties.gatewayId', 'type': 'str'}, + 'connection_name': {'key': 'properties.connectionName', 'type': 'str'}, + 'created': {'key': 'properties.created', 'type': 'iso-8601'}, + 'updated': {'key': 'properties.updated', 'type': 'iso-8601'}, + } + + def __init__(self, *, tags=None, etag: str=None, gateway_id: str=None, connection_name: str=None, created=None, updated=None, **kwargs) -> None: + super(NodeResource, self).__init__(tags=tags, etag=etag, **kwargs) + self.gateway_id = gateway_id + self.connection_name = connection_name + self.created = created + self.updated = updated diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_parameters.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_parameters.py new file mode 100644 index 000000000000..5eaca9f78758 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_parameters.py @@ -0,0 +1,28 @@ +# 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 PowerShellCommandParameters(Model): + """The parameters to a PowerShell script execution command. + + :param command: Script to execute. + :type command: str + """ + + _attribute_map = { + 'command': {'key': 'properties.command', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PowerShellCommandParameters, self).__init__(**kwargs) + self.command = kwargs.get('command', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_parameters_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_parameters_py3.py new file mode 100644 index 000000000000..eb21026682ff --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_parameters_py3.py @@ -0,0 +1,28 @@ +# 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 PowerShellCommandParameters(Model): + """The parameters to a PowerShell script execution command. + + :param command: Script to execute. + :type command: str + """ + + _attribute_map = { + 'command': {'key': 'properties.command', 'type': 'str'}, + } + + def __init__(self, *, command: str=None, **kwargs) -> None: + super(PowerShellCommandParameters, self).__init__(**kwargs) + self.command = command diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_result.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_result.py new file mode 100644 index 000000000000..a2c160e4c35b --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_result.py @@ -0,0 +1,69 @@ +# 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 PowerShellCommandResult(Model): + """Results from invoking a PowerShell command. + + :param message_type: The type of message. + :type message_type: int + :param foreground_color: The HTML color string representing the foreground + color. + :type foreground_color: str + :param background_color: The HTML color string representing the background + color. + :type background_color: str + :param value: Actual result text from the PowerShell Command. + :type value: str + :param prompt: The interactive prompt message. + :type prompt: str + :param exit_code: The exit code from a executable that was called from + PowerShell. + :type exit_code: int + :param id: ID of the prompt message. + :type id: int + :param caption: Text that precedes the prompt. + :type caption: str + :param message: Text of the prompt. + :type message: str + :param descriptions: Collection of PromptFieldDescription objects that + contains the user input. + :type descriptions: + list[~azure.mgmt.servermanagement.models.PromptFieldDescription] + """ + + _attribute_map = { + 'message_type': {'key': 'messageType', 'type': 'int'}, + 'foreground_color': {'key': 'foregroundColor', 'type': 'str'}, + 'background_color': {'key': 'backgroundColor', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'prompt': {'key': 'prompt', 'type': 'str'}, + 'exit_code': {'key': 'exitCode', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'int'}, + 'caption': {'key': 'caption', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'descriptions': {'key': 'descriptions', 'type': '[PromptFieldDescription]'}, + } + + def __init__(self, **kwargs): + super(PowerShellCommandResult, self).__init__(**kwargs) + self.message_type = kwargs.get('message_type', None) + self.foreground_color = kwargs.get('foreground_color', None) + self.background_color = kwargs.get('background_color', None) + self.value = kwargs.get('value', None) + self.prompt = kwargs.get('prompt', None) + self.exit_code = kwargs.get('exit_code', None) + self.id = kwargs.get('id', None) + self.caption = kwargs.get('caption', None) + self.message = kwargs.get('message', None) + self.descriptions = kwargs.get('descriptions', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_result_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_result_py3.py new file mode 100644 index 000000000000..21902a1b26c3 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_result_py3.py @@ -0,0 +1,69 @@ +# 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 PowerShellCommandResult(Model): + """Results from invoking a PowerShell command. + + :param message_type: The type of message. + :type message_type: int + :param foreground_color: The HTML color string representing the foreground + color. + :type foreground_color: str + :param background_color: The HTML color string representing the background + color. + :type background_color: str + :param value: Actual result text from the PowerShell Command. + :type value: str + :param prompt: The interactive prompt message. + :type prompt: str + :param exit_code: The exit code from a executable that was called from + PowerShell. + :type exit_code: int + :param id: ID of the prompt message. + :type id: int + :param caption: Text that precedes the prompt. + :type caption: str + :param message: Text of the prompt. + :type message: str + :param descriptions: Collection of PromptFieldDescription objects that + contains the user input. + :type descriptions: + list[~azure.mgmt.servermanagement.models.PromptFieldDescription] + """ + + _attribute_map = { + 'message_type': {'key': 'messageType', 'type': 'int'}, + 'foreground_color': {'key': 'foregroundColor', 'type': 'str'}, + 'background_color': {'key': 'backgroundColor', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'prompt': {'key': 'prompt', 'type': 'str'}, + 'exit_code': {'key': 'exitCode', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'int'}, + 'caption': {'key': 'caption', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'descriptions': {'key': 'descriptions', 'type': '[PromptFieldDescription]'}, + } + + def __init__(self, *, message_type: int=None, foreground_color: str=None, background_color: str=None, value: str=None, prompt: str=None, exit_code: int=None, id: int=None, caption: str=None, message: str=None, descriptions=None, **kwargs) -> None: + super(PowerShellCommandResult, self).__init__(**kwargs) + self.message_type = message_type + self.foreground_color = foreground_color + self.background_color = background_color + self.value = value + self.prompt = prompt + self.exit_code = exit_code + self.id = id + self.caption = caption + self.message = message + self.descriptions = descriptions diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_results.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_results.py new file mode 100644 index 000000000000..22614fcf2bbd --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_results.py @@ -0,0 +1,41 @@ +# 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 PowerShellCommandResults(Model): + """A collection of results from a PowerShell command. + + :param results: + :type results: + list[~azure.mgmt.servermanagement.models.PowerShellCommandResult] + :param pssession: + :type pssession: str + :param command: + :type command: str + :param completed: + :type completed: bool + """ + + _attribute_map = { + 'results': {'key': 'results', 'type': '[PowerShellCommandResult]'}, + 'pssession': {'key': 'pssession', 'type': 'str'}, + 'command': {'key': 'command', 'type': 'str'}, + 'completed': {'key': 'completed', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(PowerShellCommandResults, self).__init__(**kwargs) + self.results = kwargs.get('results', None) + self.pssession = kwargs.get('pssession', None) + self.command = kwargs.get('command', None) + self.completed = kwargs.get('completed', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_results_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_results_py3.py new file mode 100644 index 000000000000..baf9a0d5251b --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_results_py3.py @@ -0,0 +1,41 @@ +# 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 PowerShellCommandResults(Model): + """A collection of results from a PowerShell command. + + :param results: + :type results: + list[~azure.mgmt.servermanagement.models.PowerShellCommandResult] + :param pssession: + :type pssession: str + :param command: + :type command: str + :param completed: + :type completed: bool + """ + + _attribute_map = { + 'results': {'key': 'results', 'type': '[PowerShellCommandResult]'}, + 'pssession': {'key': 'pssession', 'type': 'str'}, + 'command': {'key': 'command', 'type': 'str'}, + 'completed': {'key': 'completed', 'type': 'bool'}, + } + + def __init__(self, *, results=None, pssession: str=None, command: str=None, completed: bool=None, **kwargs) -> None: + super(PowerShellCommandResults, self).__init__(**kwargs) + self.results = results + self.pssession = pssession + self.command = command + self.completed = completed diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_status.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_status.py new file mode 100644 index 000000000000..1ba9c03d39a2 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_status.py @@ -0,0 +1,69 @@ +# 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 .resource import Resource + + +class PowerShellCommandStatus(Resource): + """Result status from invoking a PowerShell command. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Manager Resource ID. + :vartype id: str + :ivar type: Resource Manager Resource Type. + :vartype type: str + :ivar name: Resource Manager Resource Name. + :vartype name: str + :ivar location: Resource Manager Resource Location. + :vartype location: str + :param tags: Resource Manager Resource Tags. + :type tags: dict[str, str] + :param etag: + :type etag: str + :param results: + :type results: + list[~azure.mgmt.servermanagement.models.PowerShellCommandResult] + :param pssession: + :type pssession: str + :param command: + :type command: str + :param completed: + :type completed: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'results': {'key': 'properties.results', 'type': '[PowerShellCommandResult]'}, + 'pssession': {'key': 'properties.pssession', 'type': 'str'}, + 'command': {'key': 'properties.command', 'type': 'str'}, + 'completed': {'key': 'properties.completed', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(PowerShellCommandStatus, self).__init__(**kwargs) + self.results = kwargs.get('results', None) + self.pssession = kwargs.get('pssession', None) + self.command = kwargs.get('command', None) + self.completed = kwargs.get('completed', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_status_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_status_py3.py new file mode 100644 index 000000000000..5e636cfde548 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_command_status_py3.py @@ -0,0 +1,69 @@ +# 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 .resource_py3 import Resource + + +class PowerShellCommandStatus(Resource): + """Result status from invoking a PowerShell command. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Manager Resource ID. + :vartype id: str + :ivar type: Resource Manager Resource Type. + :vartype type: str + :ivar name: Resource Manager Resource Name. + :vartype name: str + :ivar location: Resource Manager Resource Location. + :vartype location: str + :param tags: Resource Manager Resource Tags. + :type tags: dict[str, str] + :param etag: + :type etag: str + :param results: + :type results: + list[~azure.mgmt.servermanagement.models.PowerShellCommandResult] + :param pssession: + :type pssession: str + :param command: + :type command: str + :param completed: + :type completed: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'results': {'key': 'properties.results', 'type': '[PowerShellCommandResult]'}, + 'pssession': {'key': 'properties.pssession', 'type': 'str'}, + 'command': {'key': 'properties.command', 'type': 'str'}, + 'completed': {'key': 'properties.completed', 'type': 'bool'}, + } + + def __init__(self, *, tags=None, etag: str=None, results=None, pssession: str=None, command: str=None, completed: bool=None, **kwargs) -> None: + super(PowerShellCommandStatus, self).__init__(tags=tags, etag=etag, **kwargs) + self.results = results + self.pssession = pssession + self.command = command + self.completed = completed diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_session_resource.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_session_resource.py new file mode 100644 index 000000000000..0a4f76640c43 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_session_resource.py @@ -0,0 +1,82 @@ +# 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 .resource import Resource + + +class PowerShellSessionResource(Resource): + """A PowerShell session resource (practically equivalent to a runspace + instance). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Manager Resource ID. + :vartype id: str + :ivar type: Resource Manager Resource Type. + :vartype type: str + :ivar name: Resource Manager Resource Name. + :vartype name: str + :ivar location: Resource Manager Resource Location. + :vartype location: str + :param tags: Resource Manager Resource Tags. + :type tags: dict[str, str] + :param etag: + :type etag: str + :param session_id: The PowerShell Session ID. + :type session_id: str + :param state: The runspace state. + :type state: str + :param runspace_availability: The availability of the runspace. + :type runspace_availability: str + :param disconnected_on: Timestamp of last time the service disconnected + from the runspace. + :type disconnected_on: datetime + :param expires_on: Timestamp when the runspace expires. + :type expires_on: datetime + :param version: + :type version: ~azure.mgmt.servermanagement.models.Version + :param power_shell_session_resource_name: Name of the runspace. + :type power_shell_session_resource_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'session_id': {'key': 'properties.sessionId', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'runspace_availability': {'key': 'properties.runspaceAvailability', 'type': 'str'}, + 'disconnected_on': {'key': 'properties.disconnectedOn', 'type': 'iso-8601'}, + 'expires_on': {'key': 'properties.expiresOn', 'type': 'iso-8601'}, + 'version': {'key': 'properties.version', 'type': 'Version'}, + 'power_shell_session_resource_name': {'key': 'properties.name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PowerShellSessionResource, self).__init__(**kwargs) + self.session_id = kwargs.get('session_id', None) + self.state = kwargs.get('state', None) + self.runspace_availability = kwargs.get('runspace_availability', None) + self.disconnected_on = kwargs.get('disconnected_on', None) + self.expires_on = kwargs.get('expires_on', None) + self.version = kwargs.get('version', None) + self.power_shell_session_resource_name = kwargs.get('power_shell_session_resource_name', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_session_resource_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_session_resource_py3.py new file mode 100644 index 000000000000..ff6820a53a3f --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_session_resource_py3.py @@ -0,0 +1,82 @@ +# 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 .resource_py3 import Resource + + +class PowerShellSessionResource(Resource): + """A PowerShell session resource (practically equivalent to a runspace + instance). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Manager Resource ID. + :vartype id: str + :ivar type: Resource Manager Resource Type. + :vartype type: str + :ivar name: Resource Manager Resource Name. + :vartype name: str + :ivar location: Resource Manager Resource Location. + :vartype location: str + :param tags: Resource Manager Resource Tags. + :type tags: dict[str, str] + :param etag: + :type etag: str + :param session_id: The PowerShell Session ID. + :type session_id: str + :param state: The runspace state. + :type state: str + :param runspace_availability: The availability of the runspace. + :type runspace_availability: str + :param disconnected_on: Timestamp of last time the service disconnected + from the runspace. + :type disconnected_on: datetime + :param expires_on: Timestamp when the runspace expires. + :type expires_on: datetime + :param version: + :type version: ~azure.mgmt.servermanagement.models.Version + :param power_shell_session_resource_name: Name of the runspace. + :type power_shell_session_resource_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'session_id': {'key': 'properties.sessionId', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'runspace_availability': {'key': 'properties.runspaceAvailability', 'type': 'str'}, + 'disconnected_on': {'key': 'properties.disconnectedOn', 'type': 'iso-8601'}, + 'expires_on': {'key': 'properties.expiresOn', 'type': 'iso-8601'}, + 'version': {'key': 'properties.version', 'type': 'Version'}, + 'power_shell_session_resource_name': {'key': 'properties.name', 'type': 'str'}, + } + + def __init__(self, *, tags=None, etag: str=None, session_id: str=None, state: str=None, runspace_availability: str=None, disconnected_on=None, expires_on=None, version=None, power_shell_session_resource_name: str=None, **kwargs) -> None: + super(PowerShellSessionResource, self).__init__(tags=tags, etag=etag, **kwargs) + self.session_id = session_id + self.state = state + self.runspace_availability = runspace_availability + self.disconnected_on = disconnected_on + self.expires_on = expires_on + self.version = version + self.power_shell_session_resource_name = power_shell_session_resource_name diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_session_resources.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_session_resources.py new file mode 100644 index 000000000000..b99dafb3142e --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_session_resources.py @@ -0,0 +1,33 @@ +# 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 PowerShellSessionResources(Model): + """A collection of PowerShell session resources. + + :param value: Collection of PowerShell session resources. + :type value: + list[~azure.mgmt.servermanagement.models.PowerShellSessionResource] + :param next_link: The URL to the next set of resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PowerShellSessionResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PowerShellSessionResources, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_session_resources_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_session_resources_py3.py new file mode 100644 index 000000000000..bf1cc33e8c3e --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_session_resources_py3.py @@ -0,0 +1,33 @@ +# 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 PowerShellSessionResources(Model): + """A collection of PowerShell session resources. + + :param value: Collection of PowerShell session resources. + :type value: + list[~azure.mgmt.servermanagement.models.PowerShellSessionResource] + :param next_link: The URL to the next set of resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PowerShellSessionResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(PowerShellSessionResources, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_tab_completion_parameters.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_tab_completion_parameters.py new file mode 100644 index 000000000000..3174fed15f18 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_tab_completion_parameters.py @@ -0,0 +1,28 @@ +# 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 PowerShellTabCompletionParameters(Model): + """Collection of parameters for PowerShell tab completion. + + :param command: Command to get tab completion for. + :type command: str + """ + + _attribute_map = { + 'command': {'key': 'command', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PowerShellTabCompletionParameters, self).__init__(**kwargs) + self.command = kwargs.get('command', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_tab_completion_parameters_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_tab_completion_parameters_py3.py new file mode 100644 index 000000000000..aea7a99ecb8e --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_tab_completion_parameters_py3.py @@ -0,0 +1,28 @@ +# 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 PowerShellTabCompletionParameters(Model): + """Collection of parameters for PowerShell tab completion. + + :param command: Command to get tab completion for. + :type command: str + """ + + _attribute_map = { + 'command': {'key': 'command', 'type': 'str'}, + } + + def __init__(self, *, command: str=None, **kwargs) -> None: + super(PowerShellTabCompletionParameters, self).__init__(**kwargs) + self.command = command diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_tab_completion_results.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_tab_completion_results.py new file mode 100644 index 000000000000..65ff03f2dfb9 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_tab_completion_results.py @@ -0,0 +1,29 @@ +# 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 PowerShellTabCompletionResults(Model): + """An array of strings representing the different values that can be selected + through. + + :param results: + :type results: list[str] + """ + + _attribute_map = { + 'results': {'key': 'results', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PowerShellTabCompletionResults, self).__init__(**kwargs) + self.results = kwargs.get('results', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_tab_completion_results_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_tab_completion_results_py3.py new file mode 100644 index 000000000000..e0c7c8c3cb55 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/power_shell_tab_completion_results_py3.py @@ -0,0 +1,29 @@ +# 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 PowerShellTabCompletionResults(Model): + """An array of strings representing the different values that can be selected + through. + + :param results: + :type results: list[str] + """ + + _attribute_map = { + 'results': {'key': 'results', 'type': '[str]'}, + } + + def __init__(self, *, results=None, **kwargs) -> None: + super(PowerShellTabCompletionResults, self).__init__(**kwargs) + self.results = results diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/prompt_field_description.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/prompt_field_description.py new file mode 100644 index 000000000000..cf2c60183a05 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/prompt_field_description.py @@ -0,0 +1,47 @@ +# 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 PromptFieldDescription(Model): + """Field description for the implementation of PSHostUserInterface.Prompt. + + :param name: The name of the prompt. + :type name: str + :param label: The label text of the prompt. + :type label: str + :param help_message: The help message of the prompt. + :type help_message: str + :param prompt_field_type_is_list: When set to 'true' the prompt field type + is a list of values. + :type prompt_field_type_is_list: bool + :param prompt_field_type: Possible values include: 'String', + 'SecureString', 'Credential' + :type prompt_field_type: str or + ~azure.mgmt.servermanagement.models.PromptFieldType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'help_message': {'key': 'helpMessage', 'type': 'str'}, + 'prompt_field_type_is_list': {'key': 'promptFieldTypeIsList', 'type': 'bool'}, + 'prompt_field_type': {'key': 'promptFieldType', 'type': 'PromptFieldType'}, + } + + def __init__(self, **kwargs): + super(PromptFieldDescription, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.label = kwargs.get('label', None) + self.help_message = kwargs.get('help_message', None) + self.prompt_field_type_is_list = kwargs.get('prompt_field_type_is_list', None) + self.prompt_field_type = kwargs.get('prompt_field_type', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/prompt_field_description_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/prompt_field_description_py3.py new file mode 100644 index 000000000000..89998c0d9b86 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/prompt_field_description_py3.py @@ -0,0 +1,47 @@ +# 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 PromptFieldDescription(Model): + """Field description for the implementation of PSHostUserInterface.Prompt. + + :param name: The name of the prompt. + :type name: str + :param label: The label text of the prompt. + :type label: str + :param help_message: The help message of the prompt. + :type help_message: str + :param prompt_field_type_is_list: When set to 'true' the prompt field type + is a list of values. + :type prompt_field_type_is_list: bool + :param prompt_field_type: Possible values include: 'String', + 'SecureString', 'Credential' + :type prompt_field_type: str or + ~azure.mgmt.servermanagement.models.PromptFieldType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'help_message': {'key': 'helpMessage', 'type': 'str'}, + 'prompt_field_type_is_list': {'key': 'promptFieldTypeIsList', 'type': 'bool'}, + 'prompt_field_type': {'key': 'promptFieldType', 'type': 'PromptFieldType'}, + } + + def __init__(self, *, name: str=None, label: str=None, help_message: str=None, prompt_field_type_is_list: bool=None, prompt_field_type=None, **kwargs) -> None: + super(PromptFieldDescription, self).__init__(**kwargs) + self.name = name + self.label = label + self.help_message = help_message + self.prompt_field_type_is_list = prompt_field_type_is_list + self.prompt_field_type = prompt_field_type diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/prompt_message_response.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/prompt_message_response.py new file mode 100644 index 000000000000..815987451724 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/prompt_message_response.py @@ -0,0 +1,28 @@ +# 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 PromptMessageResponse(Model): + """The response to a prompt message. + + :param response: The list of responses a cmdlet expects. + :type response: list[str] + """ + + _attribute_map = { + 'response': {'key': 'response', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PromptMessageResponse, self).__init__(**kwargs) + self.response = kwargs.get('response', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/prompt_message_response_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/prompt_message_response_py3.py new file mode 100644 index 000000000000..928188579c43 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/prompt_message_response_py3.py @@ -0,0 +1,28 @@ +# 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 PromptMessageResponse(Model): + """The response to a prompt message. + + :param response: The list of responses a cmdlet expects. + :type response: list[str] + """ + + _attribute_map = { + 'response': {'key': 'response', 'type': '[str]'}, + } + + def __init__(self, *, response=None, **kwargs) -> None: + super(PromptMessageResponse, self).__init__(**kwargs) + self.response = response diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/resource.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/resource.py new file mode 100644 index 000000000000..ba1f26517966 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/resource.py @@ -0,0 +1,58 @@ +# 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 Resource(Model): + """Resource Manager Resource Information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Manager Resource ID. + :vartype id: str + :ivar type: Resource Manager Resource Type. + :vartype type: str + :ivar name: Resource Manager Resource Name. + :vartype name: str + :ivar location: Resource Manager Resource Location. + :vartype location: str + :param tags: Resource Manager Resource Tags. + :type tags: dict[str, str] + :param etag: + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.location = None + self.tags = kwargs.get('tags', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/resource_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/resource_py3.py new file mode 100644 index 000000000000..582be923ec2c --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/resource_py3.py @@ -0,0 +1,58 @@ +# 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 Resource(Model): + """Resource Manager Resource Information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Manager Resource ID. + :vartype id: str + :ivar type: Resource Manager Resource Type. + :vartype type: str + :ivar name: Resource Manager Resource Name. + :vartype name: str + :ivar location: Resource Manager Resource Location. + :vartype location: str + :param tags: Resource Manager Resource Tags. + :type tags: dict[str, str] + :param etag: + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, tags=None, etag: str=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.location = None + self.tags = tags + self.etag = etag diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/server_management_enums.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/server_management_enums.py new file mode 100644 index 000000000000..919d0713b223 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/server_management_enums.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class UpgradeMode(str, Enum): + + manual = "Manual" + automatic = "Automatic" + + +class RetentionPeriod(str, Enum): + + session = "Session" + persistent = "Persistent" + + +class CredentialDataFormat(str, Enum): + + rsa_encrypted = "RsaEncrypted" + + +class PromptFieldType(str, Enum): + + string = "String" + secure_string = "SecureString" + credential = "Credential" + + +class GatewayExpandOption(str, Enum): + + status = "status" + download = "download" + + +class PowerShellExpandOption(str, Enum): + + output = "output" diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/session_parameters.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/session_parameters.py new file mode 100644 index 000000000000..2c424a77bd4b --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/session_parameters.py @@ -0,0 +1,49 @@ +# 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 SessionParameters(Model): + """Parameter collection for creation and other operations on sessions. + + :param user_name: Encrypted User name to be used to connect to node. + :type user_name: str + :param password: Encrypted Password associated with user name. + :type password: str + :param retention_period: Session retention period. Possible values + include: 'Session', 'Persistent' + :type retention_period: str or + ~azure.mgmt.servermanagement.models.RetentionPeriod + :param credential_data_format: Credential data format. Possible values + include: 'RsaEncrypted' + :type credential_data_format: str or + ~azure.mgmt.servermanagement.models.CredentialDataFormat + :param encryption_certificate_thumbprint: Encryption certificate + thumbprint. + :type encryption_certificate_thumbprint: str + """ + + _attribute_map = { + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'retention_period': {'key': 'properties.retentionPeriod', 'type': 'RetentionPeriod'}, + 'credential_data_format': {'key': 'properties.credentialDataFormat', 'type': 'CredentialDataFormat'}, + 'encryption_certificate_thumbprint': {'key': 'properties.EncryptionCertificateThumbprint', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SessionParameters, self).__init__(**kwargs) + self.user_name = kwargs.get('user_name', None) + self.password = kwargs.get('password', None) + self.retention_period = kwargs.get('retention_period', None) + self.credential_data_format = kwargs.get('credential_data_format', None) + self.encryption_certificate_thumbprint = kwargs.get('encryption_certificate_thumbprint', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/session_parameters_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/session_parameters_py3.py new file mode 100644 index 000000000000..45126e945096 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/session_parameters_py3.py @@ -0,0 +1,49 @@ +# 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 SessionParameters(Model): + """Parameter collection for creation and other operations on sessions. + + :param user_name: Encrypted User name to be used to connect to node. + :type user_name: str + :param password: Encrypted Password associated with user name. + :type password: str + :param retention_period: Session retention period. Possible values + include: 'Session', 'Persistent' + :type retention_period: str or + ~azure.mgmt.servermanagement.models.RetentionPeriod + :param credential_data_format: Credential data format. Possible values + include: 'RsaEncrypted' + :type credential_data_format: str or + ~azure.mgmt.servermanagement.models.CredentialDataFormat + :param encryption_certificate_thumbprint: Encryption certificate + thumbprint. + :type encryption_certificate_thumbprint: str + """ + + _attribute_map = { + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'retention_period': {'key': 'properties.retentionPeriod', 'type': 'RetentionPeriod'}, + 'credential_data_format': {'key': 'properties.credentialDataFormat', 'type': 'CredentialDataFormat'}, + 'encryption_certificate_thumbprint': {'key': 'properties.EncryptionCertificateThumbprint', 'type': 'str'}, + } + + def __init__(self, *, user_name: str=None, password: str=None, retention_period=None, credential_data_format=None, encryption_certificate_thumbprint: str=None, **kwargs) -> None: + super(SessionParameters, self).__init__(**kwargs) + self.user_name = user_name + self.password = password + self.retention_period = retention_period + self.credential_data_format = credential_data_format + self.encryption_certificate_thumbprint = encryption_certificate_thumbprint diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/session_resource.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/session_resource.py new file mode 100644 index 000000000000..2023d8cf54d1 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/session_resource.py @@ -0,0 +1,65 @@ +# 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 .resource import Resource + + +class SessionResource(Resource): + """The session object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Manager Resource ID. + :vartype id: str + :ivar type: Resource Manager Resource Type. + :vartype type: str + :ivar name: Resource Manager Resource Name. + :vartype name: str + :ivar location: Resource Manager Resource Location. + :vartype location: str + :param tags: Resource Manager Resource Tags. + :type tags: dict[str, str] + :param etag: + :type etag: str + :param user_name: The username connecting to the session. + :type user_name: str + :param created: UTC date and time when node was first added to management + service. + :type created: datetime + :param updated: UTC date and time when node was last updated. + :type updated: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'created': {'key': 'properties.created', 'type': 'iso-8601'}, + 'updated': {'key': 'properties.updated', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SessionResource, self).__init__(**kwargs) + self.user_name = kwargs.get('user_name', None) + self.created = kwargs.get('created', None) + self.updated = kwargs.get('updated', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/session_resource_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/session_resource_py3.py new file mode 100644 index 000000000000..7bb8f4b7341f --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/session_resource_py3.py @@ -0,0 +1,65 @@ +# 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 .resource_py3 import Resource + + +class SessionResource(Resource): + """The session object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Manager Resource ID. + :vartype id: str + :ivar type: Resource Manager Resource Type. + :vartype type: str + :ivar name: Resource Manager Resource Name. + :vartype name: str + :ivar location: Resource Manager Resource Location. + :vartype location: str + :param tags: Resource Manager Resource Tags. + :type tags: dict[str, str] + :param etag: + :type etag: str + :param user_name: The username connecting to the session. + :type user_name: str + :param created: UTC date and time when node was first added to management + service. + :type created: datetime + :param updated: UTC date and time when node was last updated. + :type updated: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'created': {'key': 'properties.created', 'type': 'iso-8601'}, + 'updated': {'key': 'properties.updated', 'type': 'iso-8601'}, + } + + def __init__(self, *, tags=None, etag: str=None, user_name: str=None, created=None, updated=None, **kwargs) -> None: + super(SessionResource, self).__init__(tags=tags, etag=etag, **kwargs) + self.user_name = user_name + self.created = created + self.updated = updated diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/version.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/version.py new file mode 100644 index 000000000000..ad73ac50205a --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/version.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Version(Model): + """A multipart-numeric version number. + + :param major: The leftmost number of the version. + :type major: int + :param minor: The second leftmost number of the version. + :type minor: int + :param build: The third number of the version. + :type build: int + :param revision: The fourth number of the version. + :type revision: int + :param major_revision: The MSW of the fourth part. + :type major_revision: int + :param minor_revision: The LSW of the fourth part. + :type minor_revision: int + """ + + _attribute_map = { + 'major': {'key': 'major', 'type': 'int'}, + 'minor': {'key': 'minor', 'type': 'int'}, + 'build': {'key': 'build', 'type': 'int'}, + 'revision': {'key': 'revision', 'type': 'int'}, + 'major_revision': {'key': 'majorRevision', 'type': 'int'}, + 'minor_revision': {'key': 'minorRevision', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Version, self).__init__(**kwargs) + self.major = kwargs.get('major', None) + self.minor = kwargs.get('minor', None) + self.build = kwargs.get('build', None) + self.revision = kwargs.get('revision', None) + self.major_revision = kwargs.get('major_revision', None) + self.minor_revision = kwargs.get('minor_revision', None) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/version_py3.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/version_py3.py new file mode 100644 index 000000000000..81a59f657708 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/models/version_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Version(Model): + """A multipart-numeric version number. + + :param major: The leftmost number of the version. + :type major: int + :param minor: The second leftmost number of the version. + :type minor: int + :param build: The third number of the version. + :type build: int + :param revision: The fourth number of the version. + :type revision: int + :param major_revision: The MSW of the fourth part. + :type major_revision: int + :param minor_revision: The LSW of the fourth part. + :type minor_revision: int + """ + + _attribute_map = { + 'major': {'key': 'major', 'type': 'int'}, + 'minor': {'key': 'minor', 'type': 'int'}, + 'build': {'key': 'build', 'type': 'int'}, + 'revision': {'key': 'revision', 'type': 'int'}, + 'major_revision': {'key': 'majorRevision', 'type': 'int'}, + 'minor_revision': {'key': 'minorRevision', 'type': 'int'}, + } + + def __init__(self, *, major: int=None, minor: int=None, build: int=None, revision: int=None, major_revision: int=None, minor_revision: int=None, **kwargs) -> None: + super(Version, self).__init__(**kwargs) + self.major = major + self.minor = minor + self.build = build + self.revision = revision + self.major_revision = major_revision + self.minor_revision = minor_revision diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/__init__.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/__init__.py new file mode 100644 index 000000000000..ce47cb521bf1 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .gateway_operations import GatewayOperations +from .node_operations import NodeOperations +from .session_operations import SessionOperations +from .power_shell_operations import PowerShellOperations + +__all__ = [ + 'GatewayOperations', + 'NodeOperations', + 'SessionOperations', + 'PowerShellOperations', +] diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/gateway_operations.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/gateway_operations.py new file mode 100644 index 000000000000..433dfaf81973 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/gateway_operations.py @@ -0,0 +1,774 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class GatewayOperations(object): + """GatewayOperations 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: Client API Version. Constant value: "2016-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-07-01-preview" + + self.config = config + + + def _create_initial( + self, resource_group_name, gateway_name, location=None, tags=None, upgrade_mode=None, custom_headers=None, raw=False, **operation_config): + gateway_parameters = models.GatewayParameters(location=location, tags=tags, upgrade_mode=upgrade_mode) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$') + } + 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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(gateway_parameters, 'GatewayParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GatewayResource', response) + if response.status_code == 201: + deserialized = self._deserialize('GatewayResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, gateway_name, location=None, tags=None, upgrade_mode=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a ManagementService gateway. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param gateway_name: The gateway name (256 characters maximum). + :type gateway_name: str + :param location: Location of the resource. + :type location: str + :param tags: Resource tags. + :type tags: object + :param upgrade_mode: The upgradeMode property gives the flexibility to + gateway to auto upgrade itself. If properties value not specified, + then we assume upgradeMode = Automatic. Possible values include: + 'Manual', 'Automatic' + :type upgrade_mode: str or + ~azure.mgmt.servermanagement.models.UpgradeMode + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servermanagement.models.GatewayResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servermanagement.models.GatewayResource]] + :raises: + :class:`ErrorException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + location=location, + tags=tags, + upgrade_mode=upgrade_mode, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GatewayResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}'} + + + def _update_initial( + self, resource_group_name, gateway_name, location=None, tags=None, upgrade_mode=None, custom_headers=None, raw=False, **operation_config): + gateway_parameters = models.GatewayParameters(location=location, tags=tags, upgrade_mode=upgrade_mode) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$') + } + 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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(gateway_parameters, 'GatewayParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GatewayResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, gateway_name, location=None, tags=None, upgrade_mode=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a gateway belonging to a resource group. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param gateway_name: The gateway name (256 characters maximum). + :type gateway_name: str + :param location: Location of the resource. + :type location: str + :param tags: Resource tags. + :type tags: object + :param upgrade_mode: The upgradeMode property gives the flexibility to + gateway to auto upgrade itself. If properties value not specified, + then we assume upgradeMode = Automatic. Possible values include: + 'Manual', 'Automatic' + :type upgrade_mode: str or + ~azure.mgmt.servermanagement.models.UpgradeMode + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servermanagement.models.GatewayResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servermanagement.models.GatewayResource]] + :raises: + :class:`ErrorException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + location=location, + tags=tags, + upgrade_mode=upgrade_mode, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GatewayResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}'} + + def delete( + self, resource_group_name, gateway_name, custom_headers=None, raw=False, **operation_config): + """Deletes a gateway from a resource group. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param gateway_name: The gateway name (256 characters maximum). + :type gateway_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$') + } + 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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}'} + + def get( + self, resource_group_name, gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets a gateway. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param gateway_name: The gateway name (256 characters maximum) + :type gateway_name: str + :param expand: Gets subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the + URI for every service call. Possible values include: 'status', + 'download' + :type expand: str or + ~azure.mgmt.servermanagement.models.GatewayExpandOption + :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: GatewayResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servermanagement.models.GatewayResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$') + } + 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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'GatewayExpandOption') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GatewayResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Returns gateways in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of GatewayResource + :rtype: + ~azure.mgmt.servermanagement.models.GatewayResourcePaged[~azure.mgmt.servermanagement.models.GatewayResource] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.GatewayResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.GatewayResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServerManagement/gateways'} + + def list_for_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Returns gateways in a resource group. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of GatewayResource + :rtype: + ~azure.mgmt.servermanagement.models.GatewayResourcePaged[~azure.mgmt.servermanagement.models.GatewayResource] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_for_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.GatewayResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.GatewayResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_for_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways'} + + + def _upgrade_initial( + self, resource_group_name, gateway_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.upgrade.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$') + } + 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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def upgrade( + self, resource_group_name, gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Upgrades a gateway. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param gateway_name: The gateway name (256 characters maximum). + :type gateway_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorException` + """ + raw_result = self._upgrade_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + upgrade.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}/upgradetolatest'} + + + def _regenerate_profile_initial( + self, resource_group_name, gateway_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.regenerate_profile.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$') + } + 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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def regenerate_profile( + self, resource_group_name, gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Regenerate a gateway's profile. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param gateway_name: The gateway name (256 characters maximum). + :type gateway_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorException` + """ + raw_result = self._regenerate_profile_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + regenerate_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}/regenerateprofile'} + + + def _get_profile_initial( + self, resource_group_name, gateway_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.get_profile.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$') + } + 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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GatewayProfile', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_profile( + self, resource_group_name, gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Gets a gateway profile. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param gateway_name: The gateway name (256 characters maximum). + :type gateway_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayProfile or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servermanagement.models.GatewayProfile] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servermanagement.models.GatewayProfile]] + :raises: + :class:`ErrorException` + """ + raw_result = self._get_profile_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GatewayProfile', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}/profile'} diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/node_operations.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/node_operations.py new file mode 100644 index 000000000000..e3e54dc74fe3 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/node_operations.py @@ -0,0 +1,523 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class NodeOperations(object): + """NodeOperations 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: Client API Version. Constant value: "2016-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-07-01-preview" + + self.config = config + + + def _create_initial( + self, resource_group_name, node_name, location=None, tags=None, gateway_id=None, connection_name=None, user_name=None, password=None, custom_headers=None, raw=False, **operation_config): + gateway_parameters = models.NodeParameters(location=location, tags=tags, gateway_id=gateway_id, connection_name=connection_name, user_name=user_name, password=password) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'nodeName': self._serialize.url("node_name", node_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$') + } + 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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(gateway_parameters, 'NodeParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NodeResource', response) + if response.status_code == 201: + deserialized = self._deserialize('NodeResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, node_name, location=None, tags=None, gateway_id=None, connection_name=None, user_name=None, password=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a management node. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param node_name: The node name (256 characters maximum). + :type node_name: str + :param location: Location of the resource. + :type location: str + :param tags: Resource tags. + :type tags: object + :param gateway_id: Gateway ID which will manage this node. + :type gateway_id: str + :param connection_name: myhost.domain.com + :type connection_name: str + :param user_name: User name to be used to connect to node. + :type user_name: str + :param password: Password associated with user name. + :type password: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NodeResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servermanagement.models.NodeResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servermanagement.models.NodeResource]] + :raises: + :class:`ErrorException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + node_name=node_name, + location=location, + tags=tags, + gateway_id=gateway_id, + connection_name=connection_name, + user_name=user_name, + password=password, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('NodeResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}'} + + + def _update_initial( + self, resource_group_name, node_name, location=None, tags=None, gateway_id=None, connection_name=None, user_name=None, password=None, custom_headers=None, raw=False, **operation_config): + node_parameters = models.NodeParameters(location=location, tags=tags, gateway_id=gateway_id, connection_name=connection_name, user_name=user_name, password=password) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'nodeName': self._serialize.url("node_name", node_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$') + } + 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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(node_parameters, 'NodeParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NodeResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, node_name, location=None, tags=None, gateway_id=None, connection_name=None, user_name=None, password=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a management node. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param node_name: The node name (256 characters maximum). + :type node_name: str + :param location: Location of the resource. + :type location: str + :param tags: Resource tags. + :type tags: object + :param gateway_id: Gateway ID which will manage this node. + :type gateway_id: str + :param connection_name: myhost.domain.com + :type connection_name: str + :param user_name: User name to be used to connect to node. + :type user_name: str + :param password: Password associated with user name. + :type password: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NodeResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servermanagement.models.NodeResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servermanagement.models.NodeResource]] + :raises: + :class:`ErrorException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + node_name=node_name, + location=location, + tags=tags, + gateway_id=gateway_id, + connection_name=connection_name, + user_name=user_name, + password=password, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('NodeResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}'} + + def delete( + self, resource_group_name, node_name, custom_headers=None, raw=False, **operation_config): + """deletes a management node. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param node_name: The node name (256 characters maximum). + :type node_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'nodeName': self._serialize.url("node_name", node_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$') + } + 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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}'} + + def get( + self, resource_group_name, node_name, custom_headers=None, raw=False, **operation_config): + """Gets a management node. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param node_name: The node name (256 characters maximum). + :type node_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NodeResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servermanagement.models.NodeResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'nodeName': self._serialize.url("node_name", node_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$') + } + 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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NodeResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists nodes in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NodeResource + :rtype: + ~azure.mgmt.servermanagement.models.NodeResourcePaged[~azure.mgmt.servermanagement.models.NodeResource] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.NodeResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NodeResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServerManagement/nodes'} + + def list_for_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists nodes in a resource group. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NodeResource + :rtype: + ~azure.mgmt.servermanagement.models.NodeResourcePaged[~azure.mgmt.servermanagement.models.NodeResource] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_for_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.NodeResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NodeResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_for_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes'} diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/power_shell_operations.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/power_shell_operations.py new file mode 100644 index 000000000000..b472ff10b4e4 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/power_shell_operations.py @@ -0,0 +1,673 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PowerShellOperations(object): + """PowerShellOperations 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: Client API Version. Constant value: "2016-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-07-01-preview" + + self.config = config + + def list_session( + self, resource_group_name, node_name, session, custom_headers=None, raw=False, **operation_config): + """Gets a list of the active sessions. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param node_name: The node name (256 characters maximum). + :type node_name: str + :param session: The sessionId from the user. + :type session: 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: PowerShellSessionResources or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servermanagement.models.PowerShellSessionResources + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.list_session.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'nodeName': self._serialize.url("node_name", node_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'session': self._serialize.url("session", session, '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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PowerShellSessionResources', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_session.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions'} + + + def _create_session_initial( + self, resource_group_name, node_name, session, pssession, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_session.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'nodeName': self._serialize.url("node_name", node_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'session': self._serialize.url("session", session, 'str'), + 'pssession': self._serialize.url("pssession", pssession, '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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PowerShellSessionResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_session( + self, resource_group_name, node_name, session, pssession, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a PowerShell session. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param node_name: The node name (256 characters maximum). + :type node_name: str + :param session: The sessionId from the user. + :type session: str + :param pssession: The PowerShell sessionId from the user. + :type pssession: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PowerShellSessionResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servermanagement.models.PowerShellSessionResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servermanagement.models.PowerShellSessionResource]] + :raises: + :class:`ErrorException` + """ + raw_result = self._create_session_initial( + resource_group_name=resource_group_name, + node_name=node_name, + session=session, + pssession=pssession, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PowerShellSessionResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_session.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}'} + + def get_command_status( + self, resource_group_name, node_name, session, pssession, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the status of a command. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param node_name: The node name (256 characters maximum). + :type node_name: str + :param session: The sessionId from the user. + :type session: str + :param pssession: The PowerShell sessionId from the user. + :type pssession: str + :param expand: Gets current output from an ongoing call. Possible + values include: 'output' + :type expand: str or + ~azure.mgmt.servermanagement.models.PowerShellExpandOption + :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: PowerShellCommandStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servermanagement.models.PowerShellCommandStatus or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.get_command_status.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'nodeName': self._serialize.url("node_name", node_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'session': self._serialize.url("session", session, 'str'), + 'pssession': self._serialize.url("pssession", pssession, '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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'PowerShellExpandOption') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PowerShellCommandStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_command_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}'} + + + def _update_command_initial( + self, resource_group_name, node_name, session, pssession, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update_command.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'nodeName': self._serialize.url("node_name", node_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'session': self._serialize.url("session", session, 'str'), + 'pssession': self._serialize.url("pssession", pssession, '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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PowerShellCommandResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_command( + self, resource_group_name, node_name, session, pssession, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a running PowerShell command with more data. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param node_name: The node name (256 characters maximum). + :type node_name: str + :param session: The sessionId from the user. + :type session: str + :param pssession: The PowerShell sessionId from the user. + :type pssession: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PowerShellCommandResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servermanagement.models.PowerShellCommandResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servermanagement.models.PowerShellCommandResults]] + :raises: + :class:`ErrorException` + """ + raw_result = self._update_command_initial( + resource_group_name=resource_group_name, + node_name=node_name, + session=session, + pssession=pssession, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PowerShellCommandResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}'} + + + def _invoke_command_initial( + self, resource_group_name, node_name, session, pssession, command=None, custom_headers=None, raw=False, **operation_config): + power_shell_command_parameters = models.PowerShellCommandParameters(command=command) + + # Construct URL + url = self.invoke_command.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'nodeName': self._serialize.url("node_name", node_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'session': self._serialize.url("session", session, 'str'), + 'pssession': self._serialize.url("pssession", pssession, '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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(power_shell_command_parameters, 'PowerShellCommandParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PowerShellCommandResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def invoke_command( + self, resource_group_name, node_name, session, pssession, command=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a PowerShell script and invokes it. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param node_name: The node name (256 characters maximum). + :type node_name: str + :param session: The sessionId from the user. + :type session: str + :param pssession: The PowerShell sessionId from the user. + :type pssession: str + :param command: Script to execute. + :type command: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PowerShellCommandResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servermanagement.models.PowerShellCommandResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servermanagement.models.PowerShellCommandResults]] + :raises: + :class:`ErrorException` + """ + raw_result = self._invoke_command_initial( + resource_group_name=resource_group_name, + node_name=node_name, + session=session, + pssession=pssession, + command=command, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PowerShellCommandResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + invoke_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}/invokeCommand'} + + + def _cancel_command_initial( + self, resource_group_name, node_name, session, pssession, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.cancel_command.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'nodeName': self._serialize.url("node_name", node_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'session': self._serialize.url("session", session, 'str'), + 'pssession': self._serialize.url("pssession", pssession, '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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PowerShellCommandResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def cancel_command( + self, resource_group_name, node_name, session, pssession, custom_headers=None, raw=False, polling=True, **operation_config): + """Cancels a PowerShell command. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param node_name: The node name (256 characters maximum). + :type node_name: str + :param session: The sessionId from the user. + :type session: str + :param pssession: The PowerShell sessionId from the user. + :type pssession: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PowerShellCommandResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servermanagement.models.PowerShellCommandResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servermanagement.models.PowerShellCommandResults]] + :raises: + :class:`ErrorException` + """ + raw_result = self._cancel_command_initial( + resource_group_name=resource_group_name, + node_name=node_name, + session=session, + pssession=pssession, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PowerShellCommandResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + cancel_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}/cancel'} + + def tab_completion( + self, resource_group_name, node_name, session, pssession, command=None, custom_headers=None, raw=False, **operation_config): + """Gets tab completion values for a command. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param node_name: The node name (256 characters maximum). + :type node_name: str + :param session: The sessionId from the user. + :type session: str + :param pssession: The PowerShell sessionId from the user. + :type pssession: str + :param command: Command to get tab completion for. + :type command: 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: PowerShellTabCompletionResults or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.servermanagement.models.PowerShellTabCompletionResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + power_shell_tab_completion_paramters = models.PowerShellTabCompletionParameters(command=command) + + # Construct URL + url = self.tab_completion.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'nodeName': self._serialize.url("node_name", node_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'session': self._serialize.url("session", session, 'str'), + 'pssession': self._serialize.url("pssession", pssession, '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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(power_shell_tab_completion_paramters, 'PowerShellTabCompletionParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PowerShellTabCompletionResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + tab_completion.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}/tab'} diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/session_operations.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/session_operations.py new file mode 100644 index 000000000000..d09930240e2b --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/operations/session_operations.py @@ -0,0 +1,286 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class SessionOperations(object): + """SessionOperations 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: Client API Version. Constant value: "2016-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-07-01-preview" + + self.config = config + + + def _create_initial( + self, resource_group_name, node_name, session, user_name=None, password=None, retention_period=None, credential_data_format=None, encryption_certificate_thumbprint=None, custom_headers=None, raw=False, **operation_config): + session_parameters = models.SessionParameters(user_name=user_name, password=password, retention_period=retention_period, credential_data_format=credential_data_format, encryption_certificate_thumbprint=encryption_certificate_thumbprint) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'nodeName': self._serialize.url("node_name", node_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'session': self._serialize.url("session", session, '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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(session_parameters, 'SessionParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SessionResource', response) + if response.status_code == 201: + deserialized = self._deserialize('SessionResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, node_name, session, user_name=None, password=None, retention_period=None, credential_data_format=None, encryption_certificate_thumbprint=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a session for a node. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param node_name: The node name (256 characters maximum). + :type node_name: str + :param session: The sessionId from the user. + :type session: str + :param user_name: Encrypted User name to be used to connect to node. + :type user_name: str + :param password: Encrypted Password associated with user name. + :type password: str + :param retention_period: Session retention period. Possible values + include: 'Session', 'Persistent' + :type retention_period: str or + ~azure.mgmt.servermanagement.models.RetentionPeriod + :param credential_data_format: Credential data format. Possible values + include: 'RsaEncrypted' + :type credential_data_format: str or + ~azure.mgmt.servermanagement.models.CredentialDataFormat + :param encryption_certificate_thumbprint: Encryption certificate + thumbprint. + :type encryption_certificate_thumbprint: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SessionResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servermanagement.models.SessionResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servermanagement.models.SessionResource]] + :raises: + :class:`ErrorException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + node_name=node_name, + session=session, + user_name=user_name, + password=password, + retention_period=retention_period, + credential_data_format=credential_data_format, + encryption_certificate_thumbprint=encryption_certificate_thumbprint, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('SessionResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}'} + + def delete( + self, resource_group_name, node_name, session, custom_headers=None, raw=False, **operation_config): + """Deletes a session for a node. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param node_name: The node name (256 characters maximum). + :type node_name: str + :param session: The sessionId from the user. + :type session: 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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'nodeName': self._serialize.url("node_name", node_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'session': self._serialize.url("session", session, '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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}'} + + def get( + self, resource_group_name, node_name, session, custom_headers=None, raw=False, **operation_config): + """Gets a session for a node. + + :param resource_group_name: The resource group name uniquely + identifies the resource group within the user subscriptionId. + :type resource_group_name: str + :param node_name: The node name (256 characters maximum). + :type node_name: str + :param session: The sessionId from the user. + :type session: 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: SessionResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servermanagement.models.SessionResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=3, pattern=r'[a-zA-Z0-9]+'), + 'nodeName': self._serialize.url("node_name", node_name, 'str', max_length=256, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'session': self._serialize.url("session", session, '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['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SessionResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}'} diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/server_management.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/server_management.py new file mode 100644 index 000000000000..ed4e2fe97245 --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/server_management.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.gateway_operations import GatewayOperations +from .operations.node_operations import NodeOperations +from .operations.session_operations import SessionOperations +from .operations.power_shell_operations import PowerShellOperations +from . import models + + +class ServerManagementConfiguration(AzureConfiguration): + """Configuration for ServerManagement + 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: Gets subscription credentials which uniquely + identify Microsoft Azure subscription. The subscription ID forms part of + the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, 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(ServerManagementConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-servermanagement/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class ServerManagement(SDKClient): + """REST API for Azure Server Management Service. + + :ivar config: Configuration for client. + :vartype config: ServerManagementConfiguration + + :ivar gateway: Gateway operations + :vartype gateway: azure.mgmt.servermanagement.operations.GatewayOperations + :ivar node: Node operations + :vartype node: azure.mgmt.servermanagement.operations.NodeOperations + :ivar session: Session operations + :vartype session: azure.mgmt.servermanagement.operations.SessionOperations + :ivar power_shell: PowerShell operations + :vartype power_shell: azure.mgmt.servermanagement.operations.PowerShellOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription credentials which uniquely + identify Microsoft Azure subscription. The subscription ID forms part of + the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ServerManagementConfiguration(credentials, subscription_id, base_url) + super(ServerManagement, 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 = '2016-07-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.gateway = GatewayOperations( + self._client, self.config, self._serialize, self._deserialize) + self.node = NodeOperations( + self._client, self.config, self._serialize, self._deserialize) + self.session = SessionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.power_shell = PowerShellOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-servermanagement/azure/mgmt/servermanagement/version.py b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/version.py new file mode 100644 index 000000000000..dc28aa685c5b --- /dev/null +++ b/azure-mgmt-servermanagement/azure/mgmt/servermanagement/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 = "2016-07-01-preview" +