diff --git a/azure-mgmt-labservices/HISTORY.rst b/azure-mgmt-labservices/HISTORY.rst new file mode 100644 index 000000000000..8924d5d6c445 --- /dev/null +++ b/azure-mgmt-labservices/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (1970-01-01) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-labservices/MANIFEST.in b/azure-mgmt-labservices/MANIFEST.in new file mode 100644 index 000000000000..6ceb27f7a96e --- /dev/null +++ b/azure-mgmt-labservices/MANIFEST.in @@ -0,0 +1,4 @@ +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-labservices/README.rst b/azure-mgmt-labservices/README.rst new file mode 100644 index 000000000000..45de4e6b43dd --- /dev/null +++ b/azure-mgmt-labservices/README.rst @@ -0,0 +1,49 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Compatibility +============= + +**IMPORTANT**: If you have an earlier version of the azure package +(version < 1.0), you should uninstall it before installing this package. + +You can check the version using pip: + +.. code:: shell + + pip freeze + +If you see azure==0.11.0 (or any version below 1.0), uninstall it first: + +.. code:: shell + + pip uninstall azure + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. diff --git a/azure-mgmt-labservices/azure/__init__.py b/azure-mgmt-labservices/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-labservices/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-labservices/azure/mgmt/__init__.py b/azure-mgmt-labservices/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/__init__.py b/azure-mgmt-labservices/azure/mgmt/labservices/__init__.py new file mode 100644 index 000000000000..cb64fb511499 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/__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 .managed_labs_client import ManagedLabsClient +from .version import VERSION + +__all__ = ['ManagedLabsClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/managed_labs_client.py b/azure-mgmt-labservices/azure/mgmt/labservices/managed_labs_client.py new file mode 100644 index 000000000000..b02920e5e5be --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/managed_labs_client.py @@ -0,0 +1,121 @@ +# 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.provider_operations import ProviderOperations +from .operations.global_users_operations import GlobalUsersOperations +from .operations.lab_accounts_operations import LabAccountsOperations +from .operations.operations import Operations +from .operations.gallery_images_operations import GalleryImagesOperations +from .operations.labs_operations import LabsOperations +from .operations.environment_settings_operations import EnvironmentSettingsOperations +from .operations.environments_operations import EnvironmentsOperations +from .operations.users_operations import UsersOperations +from . import models + + +class ManagedLabsClientConfiguration(AzureConfiguration): + """Configuration for ManagedLabsClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription ID. + :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(ManagedLabsClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-labservices/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class ManagedLabsClient(SDKClient): + """The Managed Labs Client. + + :ivar config: Configuration for client. + :vartype config: ManagedLabsClientConfiguration + + :ivar provider_operations: ProviderOperations operations + :vartype provider_operations: azure.mgmt.labservices.operations.ProviderOperations + :ivar global_users: GlobalUsers operations + :vartype global_users: azure.mgmt.labservices.operations.GlobalUsersOperations + :ivar lab_accounts: LabAccounts operations + :vartype lab_accounts: azure.mgmt.labservices.operations.LabAccountsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.labservices.operations.Operations + :ivar gallery_images: GalleryImages operations + :vartype gallery_images: azure.mgmt.labservices.operations.GalleryImagesOperations + :ivar labs: Labs operations + :vartype labs: azure.mgmt.labservices.operations.LabsOperations + :ivar environment_settings: EnvironmentSettings operations + :vartype environment_settings: azure.mgmt.labservices.operations.EnvironmentSettingsOperations + :ivar environments: Environments operations + :vartype environments: azure.mgmt.labservices.operations.EnvironmentsOperations + :ivar users: Users operations + :vartype users: azure.mgmt.labservices.operations.UsersOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ManagedLabsClientConfiguration(credentials, subscription_id, base_url) + super(ManagedLabsClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-10-15' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.provider_operations = ProviderOperations( + self._client, self.config, self._serialize, self._deserialize) + self.global_users = GlobalUsersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.lab_accounts = LabAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.gallery_images = GalleryImagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.labs = LabsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.environment_settings = EnvironmentSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.environments = EnvironmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.users = UsersOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/__init__.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/__init__.py new file mode 100644 index 000000000000..6509942e1d19 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/__init__.py @@ -0,0 +1,225 @@ +# 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 .add_users_payload_py3 import AddUsersPayload + from .reference_vm_creation_parameters_py3 import ReferenceVmCreationParameters + from .resource_setting_creation_parameters_py3 import ResourceSettingCreationParameters + from .environment_setting_creation_parameters_py3 import EnvironmentSettingCreationParameters + from .lab_creation_parameters_py3 import LabCreationParameters + from .create_lab_properties_py3 import CreateLabProperties + from .resource_set_py3 import ResourceSet + from .network_interface_py3 import NetworkInterface + from .latest_operation_result_py3 import LatestOperationResult + from .environment_py3 import Environment + from .virtual_machine_details_py3 import VirtualMachineDetails + from .environment_details_py3 import EnvironmentDetails + from .resource_set_fragment_py3 import ResourceSetFragment + from .environment_fragment_py3 import EnvironmentFragment + from .environment_operations_payload_py3 import EnvironmentOperationsPayload + from .vm_state_details_py3 import VmStateDetails + from .reference_vm_py3 import ReferenceVm + from .resource_settings_py3 import ResourceSettings + from .environment_setting_py3 import EnvironmentSetting + from .reference_vm_fragment_py3 import ReferenceVmFragment + from .resource_settings_fragment_py3 import ResourceSettingsFragment + from .environment_setting_fragment_py3 import EnvironmentSettingFragment + from .size_info_py3 import SizeInfo + from .environment_size_py3 import EnvironmentSize + from .size_info_fragment_py3 import SizeInfoFragment + from .environment_size_fragment_py3 import EnvironmentSizeFragment + from .gallery_image_reference_py3 import GalleryImageReference + from .gallery_image_py3 import GalleryImage + from .gallery_image_fragment_py3 import GalleryImageFragment + from .gallery_image_reference_fragment_py3 import GalleryImageReferenceFragment + from .get_environment_response_py3 import GetEnvironmentResponse + from .get_personal_preferences_response_py3 import GetPersonalPreferencesResponse + from .size_availability_py3 import SizeAvailability + from .regional_availability_py3 import RegionalAvailability + from .get_regional_availability_response_py3 import GetRegionalAvailabilityResponse + from .lab_py3 import Lab + from .size_configuration_properties_py3 import SizeConfigurationProperties + from .lab_account_py3 import LabAccount + from .lab_account_fragment_py3 import LabAccountFragment + from .lab_details_py3 import LabDetails + from .lab_fragment_py3 import LabFragment + from .list_environments_payload_py3 import ListEnvironmentsPayload + from .list_environments_response_py3 import ListEnvironmentsResponse + from .list_labs_response_py3 import ListLabsResponse + from .operation_batch_status_payload_py3 import OperationBatchStatusPayload + from .operation_batch_status_response_item_py3 import OperationBatchStatusResponseItem + from .operation_batch_status_response_py3 import OperationBatchStatusResponse + from .operation_error_py3 import OperationError + from .operation_metadata_display_py3 import OperationMetadataDisplay + from .operation_metadata_py3 import OperationMetadata + from .operation_result_py3 import OperationResult + from .operation_status_payload_py3 import OperationStatusPayload + from .operation_status_response_py3 import OperationStatusResponse + from .personal_perferences_operations_payload_py3 import PersonalPerferencesOperationsPayload + from .publish_payload_py3 import PublishPayload + from .register_payload_py3 import RegisterPayload + from .reset_password_payload_py3 import ResetPasswordPayload + from .resource_py3 import Resource + from .size_configuration_properties_fragment_py3 import SizeConfigurationPropertiesFragment + from .user_py3 import User + from .user_fragment_py3 import UserFragment +except (SyntaxError, ImportError): + from .add_users_payload import AddUsersPayload + from .reference_vm_creation_parameters import ReferenceVmCreationParameters + from .resource_setting_creation_parameters import ResourceSettingCreationParameters + from .environment_setting_creation_parameters import EnvironmentSettingCreationParameters + from .lab_creation_parameters import LabCreationParameters + from .create_lab_properties import CreateLabProperties + from .resource_set import ResourceSet + from .network_interface import NetworkInterface + from .latest_operation_result import LatestOperationResult + from .environment import Environment + from .virtual_machine_details import VirtualMachineDetails + from .environment_details import EnvironmentDetails + from .resource_set_fragment import ResourceSetFragment + from .environment_fragment import EnvironmentFragment + from .environment_operations_payload import EnvironmentOperationsPayload + from .vm_state_details import VmStateDetails + from .reference_vm import ReferenceVm + from .resource_settings import ResourceSettings + from .environment_setting import EnvironmentSetting + from .reference_vm_fragment import ReferenceVmFragment + from .resource_settings_fragment import ResourceSettingsFragment + from .environment_setting_fragment import EnvironmentSettingFragment + from .size_info import SizeInfo + from .environment_size import EnvironmentSize + from .size_info_fragment import SizeInfoFragment + from .environment_size_fragment import EnvironmentSizeFragment + from .gallery_image_reference import GalleryImageReference + from .gallery_image import GalleryImage + from .gallery_image_fragment import GalleryImageFragment + from .gallery_image_reference_fragment import GalleryImageReferenceFragment + from .get_environment_response import GetEnvironmentResponse + from .get_personal_preferences_response import GetPersonalPreferencesResponse + from .size_availability import SizeAvailability + from .regional_availability import RegionalAvailability + from .get_regional_availability_response import GetRegionalAvailabilityResponse + from .lab import Lab + from .size_configuration_properties import SizeConfigurationProperties + from .lab_account import LabAccount + from .lab_account_fragment import LabAccountFragment + from .lab_details import LabDetails + from .lab_fragment import LabFragment + from .list_environments_payload import ListEnvironmentsPayload + from .list_environments_response import ListEnvironmentsResponse + from .list_labs_response import ListLabsResponse + from .operation_batch_status_payload import OperationBatchStatusPayload + from .operation_batch_status_response_item import OperationBatchStatusResponseItem + from .operation_batch_status_response import OperationBatchStatusResponse + from .operation_error import OperationError + from .operation_metadata_display import OperationMetadataDisplay + from .operation_metadata import OperationMetadata + from .operation_result import OperationResult + from .operation_status_payload import OperationStatusPayload + from .operation_status_response import OperationStatusResponse + from .personal_perferences_operations_payload import PersonalPerferencesOperationsPayload + from .publish_payload import PublishPayload + from .register_payload import RegisterPayload + from .reset_password_payload import ResetPasswordPayload + from .resource import Resource + from .size_configuration_properties_fragment import SizeConfigurationPropertiesFragment + from .user import User + from .user_fragment import UserFragment +from .operation_metadata_paged import OperationMetadataPaged +from .lab_account_paged import LabAccountPaged +from .gallery_image_paged import GalleryImagePaged +from .lab_paged import LabPaged +from .environment_setting_paged import EnvironmentSettingPaged +from .environment_paged import EnvironmentPaged +from .user_paged import UserPaged +from .managed_labs_client_enums import ( + ManagedLabVmSize, + PublishingState, + ConfigurationState, + LabUserAccessMode, + AddRemove, +) + +__all__ = [ + 'AddUsersPayload', + 'ReferenceVmCreationParameters', + 'ResourceSettingCreationParameters', + 'EnvironmentSettingCreationParameters', + 'LabCreationParameters', + 'CreateLabProperties', + 'ResourceSet', + 'NetworkInterface', + 'LatestOperationResult', + 'Environment', + 'VirtualMachineDetails', + 'EnvironmentDetails', + 'ResourceSetFragment', + 'EnvironmentFragment', + 'EnvironmentOperationsPayload', + 'VmStateDetails', + 'ReferenceVm', + 'ResourceSettings', + 'EnvironmentSetting', + 'ReferenceVmFragment', + 'ResourceSettingsFragment', + 'EnvironmentSettingFragment', + 'SizeInfo', + 'EnvironmentSize', + 'SizeInfoFragment', + 'EnvironmentSizeFragment', + 'GalleryImageReference', + 'GalleryImage', + 'GalleryImageFragment', + 'GalleryImageReferenceFragment', + 'GetEnvironmentResponse', + 'GetPersonalPreferencesResponse', + 'SizeAvailability', + 'RegionalAvailability', + 'GetRegionalAvailabilityResponse', + 'Lab', + 'SizeConfigurationProperties', + 'LabAccount', + 'LabAccountFragment', + 'LabDetails', + 'LabFragment', + 'ListEnvironmentsPayload', + 'ListEnvironmentsResponse', + 'ListLabsResponse', + 'OperationBatchStatusPayload', + 'OperationBatchStatusResponseItem', + 'OperationBatchStatusResponse', + 'OperationError', + 'OperationMetadataDisplay', + 'OperationMetadata', + 'OperationResult', + 'OperationStatusPayload', + 'OperationStatusResponse', + 'PersonalPerferencesOperationsPayload', + 'PublishPayload', + 'RegisterPayload', + 'ResetPasswordPayload', + 'Resource', + 'SizeConfigurationPropertiesFragment', + 'User', + 'UserFragment', + 'OperationMetadataPaged', + 'LabAccountPaged', + 'GalleryImagePaged', + 'LabPaged', + 'EnvironmentSettingPaged', + 'EnvironmentPaged', + 'UserPaged', + 'ManagedLabVmSize', + 'PublishingState', + 'ConfigurationState', + 'LabUserAccessMode', + 'AddRemove', +] diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/add_users_payload.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/add_users_payload.py new file mode 100644 index 000000000000..8bf385a4f6a4 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/add_users_payload.py @@ -0,0 +1,35 @@ +# 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 AddUsersPayload(Model): + """Payload for Add Users operation on a Lab. + + All required parameters must be populated in order to send to Azure. + + :param email_addresses: Required. List of user emails addresses to add to + the lab. + :type email_addresses: list[str] + """ + + _validation = { + 'email_addresses': {'required': True}, + } + + _attribute_map = { + 'email_addresses': {'key': 'emailAddresses', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AddUsersPayload, self).__init__(**kwargs) + self.email_addresses = kwargs.get('email_addresses', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/add_users_payload_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/add_users_payload_py3.py new file mode 100644 index 000000000000..142c59932d55 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/add_users_payload_py3.py @@ -0,0 +1,35 @@ +# 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 AddUsersPayload(Model): + """Payload for Add Users operation on a Lab. + + All required parameters must be populated in order to send to Azure. + + :param email_addresses: Required. List of user emails addresses to add to + the lab. + :type email_addresses: list[str] + """ + + _validation = { + 'email_addresses': {'required': True}, + } + + _attribute_map = { + 'email_addresses': {'key': 'emailAddresses', 'type': '[str]'}, + } + + def __init__(self, *, email_addresses, **kwargs) -> None: + super(AddUsersPayload, self).__init__(**kwargs) + self.email_addresses = email_addresses diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/create_lab_properties.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/create_lab_properties.py new file mode 100644 index 000000000000..7b009374229f --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/create_lab_properties.py @@ -0,0 +1,55 @@ +# 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 CreateLabProperties(Model): + """Properties for creating a managed lab and a default environment setting. + + All required parameters must be populated in order to send to Azure. + + :param environment_setting_creation_parameters: Settings related to + creating an environment setting + :type environment_setting_creation_parameters: + ~azure.mgmt.labservices.models.EnvironmentSettingCreationParameters + :param lab_creation_parameters: Required. Settings related to creating a + lab + :type lab_creation_parameters: + ~azure.mgmt.labservices.models.LabCreationParameters + :param name: Required. The name of the resource + :type name: str + :param location: The location of the resource + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'lab_creation_parameters': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'environment_setting_creation_parameters': {'key': 'environmentSettingCreationParameters', 'type': 'EnvironmentSettingCreationParameters'}, + 'lab_creation_parameters': {'key': 'labCreationParameters', 'type': 'LabCreationParameters'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(CreateLabProperties, self).__init__(**kwargs) + self.environment_setting_creation_parameters = kwargs.get('environment_setting_creation_parameters', None) + self.lab_creation_parameters = kwargs.get('lab_creation_parameters', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/create_lab_properties_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/create_lab_properties_py3.py new file mode 100644 index 000000000000..74aeccad66e0 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/create_lab_properties_py3.py @@ -0,0 +1,55 @@ +# 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 CreateLabProperties(Model): + """Properties for creating a managed lab and a default environment setting. + + All required parameters must be populated in order to send to Azure. + + :param environment_setting_creation_parameters: Settings related to + creating an environment setting + :type environment_setting_creation_parameters: + ~azure.mgmt.labservices.models.EnvironmentSettingCreationParameters + :param lab_creation_parameters: Required. Settings related to creating a + lab + :type lab_creation_parameters: + ~azure.mgmt.labservices.models.LabCreationParameters + :param name: Required. The name of the resource + :type name: str + :param location: The location of the resource + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'lab_creation_parameters': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'environment_setting_creation_parameters': {'key': 'environmentSettingCreationParameters', 'type': 'EnvironmentSettingCreationParameters'}, + 'lab_creation_parameters': {'key': 'labCreationParameters', 'type': 'LabCreationParameters'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, lab_creation_parameters, name: str, environment_setting_creation_parameters=None, location: str=None, tags=None, **kwargs) -> None: + super(CreateLabProperties, self).__init__(**kwargs) + self.environment_setting_creation_parameters = environment_setting_creation_parameters + self.lab_creation_parameters = lab_creation_parameters + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment.py new file mode 100644 index 000000000000..4f7a2fa05b07 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment.py @@ -0,0 +1,114 @@ +# 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 Environment(Resource): + """Represents an environment instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param resource_sets: The set of a VM and the setting id it was created + for + :type resource_sets: ~azure.mgmt.labservices.models.ResourceSet + :ivar claimed_by_user_object_id: The AAD object Id of the user who has + claimed the environment + :vartype claimed_by_user_object_id: str + :ivar claimed_by_user_principal_id: The user principal Id of the user who + has claimed the environment + :vartype claimed_by_user_principal_id: str + :ivar claimed_by_user_name: The name or email address of the user who has + claimed the environment + :vartype claimed_by_user_name: str + :ivar is_claimed: Is the environment claimed or not + :vartype is_claimed: bool + :ivar last_known_power_state: Last known power state of the environment + :vartype last_known_power_state: str + :ivar network_interface: Network details of the environment + :vartype network_interface: + ~azure.mgmt.labservices.models.NetworkInterface + :ivar total_usage: How long the environment has been used by a lab user + :vartype total_usage: timedelta + :ivar password_last_reset: When the password was last reset on the + environment. + :vartype password_last_reset: datetime + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + :ivar latest_operation_result: The details of the latest operation. ex: + status, error + :vartype latest_operation_result: + ~azure.mgmt.labservices.models.LatestOperationResult + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'claimed_by_user_object_id': {'readonly': True}, + 'claimed_by_user_principal_id': {'readonly': True}, + 'claimed_by_user_name': {'readonly': True}, + 'is_claimed': {'readonly': True}, + 'last_known_power_state': {'readonly': True}, + 'network_interface': {'readonly': True}, + 'total_usage': {'readonly': True}, + 'password_last_reset': {'readonly': True}, + 'latest_operation_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource_sets': {'key': 'properties.resourceSets', 'type': 'ResourceSet'}, + 'claimed_by_user_object_id': {'key': 'properties.claimedByUserObjectId', 'type': 'str'}, + 'claimed_by_user_principal_id': {'key': 'properties.claimedByUserPrincipalId', 'type': 'str'}, + 'claimed_by_user_name': {'key': 'properties.claimedByUserName', 'type': 'str'}, + 'is_claimed': {'key': 'properties.isClaimed', 'type': 'bool'}, + 'last_known_power_state': {'key': 'properties.lastKnownPowerState', 'type': 'str'}, + 'network_interface': {'key': 'properties.networkInterface', 'type': 'NetworkInterface'}, + 'total_usage': {'key': 'properties.totalUsage', 'type': 'duration'}, + 'password_last_reset': {'key': 'properties.passwordLastReset', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + 'latest_operation_result': {'key': 'properties.latestOperationResult', 'type': 'LatestOperationResult'}, + } + + def __init__(self, **kwargs): + super(Environment, self).__init__(**kwargs) + self.resource_sets = kwargs.get('resource_sets', None) + self.claimed_by_user_object_id = None + self.claimed_by_user_principal_id = None + self.claimed_by_user_name = None + self.is_claimed = None + self.last_known_power_state = None + self.network_interface = None + self.total_usage = None + self.password_last_reset = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.unique_identifier = kwargs.get('unique_identifier', None) + self.latest_operation_result = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_details.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_details.py new file mode 100644 index 000000000000..078f494dd450 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_details.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 msrest.serialization import Model + + +class EnvironmentDetails(Model): + """This represents the details about a User's environment and its state. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the Environment + :vartype name: str + :ivar description: Description of the Environment + :vartype description: str + :ivar id: Resource Id of the environment + :vartype id: str + :ivar provisioning_state: The provisioning state of the environment. This + also includes LabIsFull and NotYetProvisioned status. + :vartype provisioning_state: str + :ivar virtual_machine_details: Details of backing DTL virtual machine with + compute and network details. + :vartype virtual_machine_details: + ~azure.mgmt.labservices.models.VirtualMachineDetails + :ivar latest_operation_result: The details of the latest operation. ex: + status, error + :vartype latest_operation_result: + ~azure.mgmt.labservices.models.LatestOperationResult + :ivar environment_state: Publishing state of the environment setting + Possible values are Creating, Created, Failed + :vartype environment_state: str + :ivar total_usage: How long the environment has been used by a lab user + :vartype total_usage: timedelta + :ivar password_last_reset: When the password was last reset on the + environment. + :vartype password_last_reset: datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'description': {'readonly': True}, + 'id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'virtual_machine_details': {'readonly': True}, + 'latest_operation_result': {'readonly': True}, + 'environment_state': {'readonly': True}, + 'total_usage': {'readonly': True}, + 'password_last_reset': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'virtual_machine_details': {'key': 'virtualMachineDetails', 'type': 'VirtualMachineDetails'}, + 'latest_operation_result': {'key': 'latestOperationResult', 'type': 'LatestOperationResult'}, + 'environment_state': {'key': 'environmentState', 'type': 'str'}, + 'total_usage': {'key': 'totalUsage', 'type': 'duration'}, + 'password_last_reset': {'key': 'passwordLastReset', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(EnvironmentDetails, self).__init__(**kwargs) + self.name = None + self.description = None + self.id = None + self.provisioning_state = None + self.virtual_machine_details = None + self.latest_operation_result = None + self.environment_state = None + self.total_usage = None + self.password_last_reset = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_details_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_details_py3.py new file mode 100644 index 000000000000..6487145edf0a --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_details_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 msrest.serialization import Model + + +class EnvironmentDetails(Model): + """This represents the details about a User's environment and its state. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the Environment + :vartype name: str + :ivar description: Description of the Environment + :vartype description: str + :ivar id: Resource Id of the environment + :vartype id: str + :ivar provisioning_state: The provisioning state of the environment. This + also includes LabIsFull and NotYetProvisioned status. + :vartype provisioning_state: str + :ivar virtual_machine_details: Details of backing DTL virtual machine with + compute and network details. + :vartype virtual_machine_details: + ~azure.mgmt.labservices.models.VirtualMachineDetails + :ivar latest_operation_result: The details of the latest operation. ex: + status, error + :vartype latest_operation_result: + ~azure.mgmt.labservices.models.LatestOperationResult + :ivar environment_state: Publishing state of the environment setting + Possible values are Creating, Created, Failed + :vartype environment_state: str + :ivar total_usage: How long the environment has been used by a lab user + :vartype total_usage: timedelta + :ivar password_last_reset: When the password was last reset on the + environment. + :vartype password_last_reset: datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'description': {'readonly': True}, + 'id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'virtual_machine_details': {'readonly': True}, + 'latest_operation_result': {'readonly': True}, + 'environment_state': {'readonly': True}, + 'total_usage': {'readonly': True}, + 'password_last_reset': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'virtual_machine_details': {'key': 'virtualMachineDetails', 'type': 'VirtualMachineDetails'}, + 'latest_operation_result': {'key': 'latestOperationResult', 'type': 'LatestOperationResult'}, + 'environment_state': {'key': 'environmentState', 'type': 'str'}, + 'total_usage': {'key': 'totalUsage', 'type': 'duration'}, + 'password_last_reset': {'key': 'passwordLastReset', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(EnvironmentDetails, self).__init__(**kwargs) + self.name = None + self.description = None + self.id = None + self.provisioning_state = None + self.virtual_machine_details = None + self.latest_operation_result = None + self.environment_state = None + self.total_usage = None + self.password_last_reset = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_fragment.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_fragment.py new file mode 100644 index 000000000000..49ea0c34b195 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_fragment.py @@ -0,0 +1,62 @@ +# 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 EnvironmentFragment(Resource): + """Represents an environment instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param resource_sets: The set of a VM and the setting id it was created + for + :type resource_sets: ~azure.mgmt.labservices.models.ResourceSetFragment + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource_sets': {'key': 'properties.resourceSets', 'type': 'ResourceSetFragment'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnvironmentFragment, self).__init__(**kwargs) + self.resource_sets = kwargs.get('resource_sets', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.unique_identifier = kwargs.get('unique_identifier', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_fragment_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_fragment_py3.py new file mode 100644 index 000000000000..42786e4c0662 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_fragment_py3.py @@ -0,0 +1,62 @@ +# 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 EnvironmentFragment(Resource): + """Represents an environment instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param resource_sets: The set of a VM and the setting id it was created + for + :type resource_sets: ~azure.mgmt.labservices.models.ResourceSetFragment + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource_sets': {'key': 'properties.resourceSets', 'type': 'ResourceSetFragment'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, resource_sets=None, provisioning_state: str=None, unique_identifier: str=None, **kwargs) -> None: + super(EnvironmentFragment, self).__init__(location=location, tags=tags, **kwargs) + self.resource_sets = resource_sets + self.provisioning_state = provisioning_state + self.unique_identifier = unique_identifier diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_operations_payload.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_operations_payload.py new file mode 100644 index 000000000000..863d2103fcc0 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_operations_payload.py @@ -0,0 +1,35 @@ +# 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 EnvironmentOperationsPayload(Model): + """Represents payload for any Environment operations like get, start, stop, + connect. + + All required parameters must be populated in order to send to Azure. + + :param environment_id: Required. The resourceId of the environment + :type environment_id: str + """ + + _validation = { + 'environment_id': {'required': True}, + } + + _attribute_map = { + 'environment_id': {'key': 'environmentId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnvironmentOperationsPayload, self).__init__(**kwargs) + self.environment_id = kwargs.get('environment_id', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_operations_payload_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_operations_payload_py3.py new file mode 100644 index 000000000000..30b0c38f6da2 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_operations_payload_py3.py @@ -0,0 +1,35 @@ +# 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 EnvironmentOperationsPayload(Model): + """Represents payload for any Environment operations like get, start, stop, + connect. + + All required parameters must be populated in order to send to Azure. + + :param environment_id: Required. The resourceId of the environment + :type environment_id: str + """ + + _validation = { + 'environment_id': {'required': True}, + } + + _attribute_map = { + 'environment_id': {'key': 'environmentId', 'type': 'str'}, + } + + def __init__(self, *, environment_id: str, **kwargs) -> None: + super(EnvironmentOperationsPayload, self).__init__(**kwargs) + self.environment_id = environment_id diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_paged.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_paged.py new file mode 100644 index 000000000000..af729b0d945c --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_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 EnvironmentPaged(Paged): + """ + A paging container for iterating over a list of :class:`Environment ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Environment]'} + } + + def __init__(self, *args, **kwargs): + + super(EnvironmentPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_py3.py new file mode 100644 index 000000000000..0546ef4e9c66 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_py3.py @@ -0,0 +1,114 @@ +# 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 Environment(Resource): + """Represents an environment instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param resource_sets: The set of a VM and the setting id it was created + for + :type resource_sets: ~azure.mgmt.labservices.models.ResourceSet + :ivar claimed_by_user_object_id: The AAD object Id of the user who has + claimed the environment + :vartype claimed_by_user_object_id: str + :ivar claimed_by_user_principal_id: The user principal Id of the user who + has claimed the environment + :vartype claimed_by_user_principal_id: str + :ivar claimed_by_user_name: The name or email address of the user who has + claimed the environment + :vartype claimed_by_user_name: str + :ivar is_claimed: Is the environment claimed or not + :vartype is_claimed: bool + :ivar last_known_power_state: Last known power state of the environment + :vartype last_known_power_state: str + :ivar network_interface: Network details of the environment + :vartype network_interface: + ~azure.mgmt.labservices.models.NetworkInterface + :ivar total_usage: How long the environment has been used by a lab user + :vartype total_usage: timedelta + :ivar password_last_reset: When the password was last reset on the + environment. + :vartype password_last_reset: datetime + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + :ivar latest_operation_result: The details of the latest operation. ex: + status, error + :vartype latest_operation_result: + ~azure.mgmt.labservices.models.LatestOperationResult + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'claimed_by_user_object_id': {'readonly': True}, + 'claimed_by_user_principal_id': {'readonly': True}, + 'claimed_by_user_name': {'readonly': True}, + 'is_claimed': {'readonly': True}, + 'last_known_power_state': {'readonly': True}, + 'network_interface': {'readonly': True}, + 'total_usage': {'readonly': True}, + 'password_last_reset': {'readonly': True}, + 'latest_operation_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource_sets': {'key': 'properties.resourceSets', 'type': 'ResourceSet'}, + 'claimed_by_user_object_id': {'key': 'properties.claimedByUserObjectId', 'type': 'str'}, + 'claimed_by_user_principal_id': {'key': 'properties.claimedByUserPrincipalId', 'type': 'str'}, + 'claimed_by_user_name': {'key': 'properties.claimedByUserName', 'type': 'str'}, + 'is_claimed': {'key': 'properties.isClaimed', 'type': 'bool'}, + 'last_known_power_state': {'key': 'properties.lastKnownPowerState', 'type': 'str'}, + 'network_interface': {'key': 'properties.networkInterface', 'type': 'NetworkInterface'}, + 'total_usage': {'key': 'properties.totalUsage', 'type': 'duration'}, + 'password_last_reset': {'key': 'properties.passwordLastReset', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + 'latest_operation_result': {'key': 'properties.latestOperationResult', 'type': 'LatestOperationResult'}, + } + + def __init__(self, *, location: str=None, tags=None, resource_sets=None, provisioning_state: str=None, unique_identifier: str=None, **kwargs) -> None: + super(Environment, self).__init__(location=location, tags=tags, **kwargs) + self.resource_sets = resource_sets + self.claimed_by_user_object_id = None + self.claimed_by_user_principal_id = None + self.claimed_by_user_name = None + self.is_claimed = None + self.last_known_power_state = None + self.network_interface = None + self.total_usage = None + self.password_last_reset = None + self.provisioning_state = provisioning_state + self.unique_identifier = unique_identifier + self.latest_operation_result = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting.py new file mode 100644 index 000000000000..4707f0531a14 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting.py @@ -0,0 +1,107 @@ +# 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 EnvironmentSetting(Resource): + """Represents settings of an environment, from which environment instances + would be created. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar publishing_state: Describes the readiness of this environment + setting. Possible values include: 'Draft', 'Publishing', 'Published', + 'PublishFailed', 'Scaling' + :vartype publishing_state: str or + ~azure.mgmt.labservices.models.PublishingState + :param configuration_state: Describes the user's progress in configuring + their environment setting. Possible values include: 'NotApplicable', + 'Completed' + :type configuration_state: str or + ~azure.mgmt.labservices.models.ConfigurationState + :param description: Describes the environment and its resource settings + :type description: str + :param title: Brief title describing the environment and its resource + settings + :type title: str + :param resource_settings: Required. The resource specific settings + :type resource_settings: ~azure.mgmt.labservices.models.ResourceSettings + :ivar last_changed: Time when the template VM was last changed. + :vartype last_changed: datetime + :ivar last_published: Time when the template VM was last sent for + publishing. + :vartype last_published: datetime + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + :ivar latest_operation_result: The details of the latest operation. ex: + status, error + :vartype latest_operation_result: + ~azure.mgmt.labservices.models.LatestOperationResult + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'publishing_state': {'readonly': True}, + 'resource_settings': {'required': True}, + 'last_changed': {'readonly': True}, + 'last_published': {'readonly': True}, + 'latest_operation_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_state': {'key': 'properties.publishingState', 'type': 'str'}, + 'configuration_state': {'key': 'properties.configurationState', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'resource_settings': {'key': 'properties.resourceSettings', 'type': 'ResourceSettings'}, + 'last_changed': {'key': 'properties.lastChanged', 'type': 'iso-8601'}, + 'last_published': {'key': 'properties.lastPublished', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + 'latest_operation_result': {'key': 'properties.latestOperationResult', 'type': 'LatestOperationResult'}, + } + + def __init__(self, **kwargs): + super(EnvironmentSetting, self).__init__(**kwargs) + self.publishing_state = None + self.configuration_state = kwargs.get('configuration_state', None) + self.description = kwargs.get('description', None) + self.title = kwargs.get('title', None) + self.resource_settings = kwargs.get('resource_settings', None) + self.last_changed = None + self.last_published = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.unique_identifier = kwargs.get('unique_identifier', None) + self.latest_operation_result = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_creation_parameters.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_creation_parameters.py new file mode 100644 index 000000000000..64af9f7e7006 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_creation_parameters.py @@ -0,0 +1,36 @@ +# 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 EnvironmentSettingCreationParameters(Model): + """Settings related to creating an environment setting. + + All required parameters must be populated in order to send to Azure. + + :param resource_setting_creation_parameters: Required. The resource + specific settings + :type resource_setting_creation_parameters: + ~azure.mgmt.labservices.models.ResourceSettingCreationParameters + """ + + _validation = { + 'resource_setting_creation_parameters': {'required': True}, + } + + _attribute_map = { + 'resource_setting_creation_parameters': {'key': 'resourceSettingCreationParameters', 'type': 'ResourceSettingCreationParameters'}, + } + + def __init__(self, **kwargs): + super(EnvironmentSettingCreationParameters, self).__init__(**kwargs) + self.resource_setting_creation_parameters = kwargs.get('resource_setting_creation_parameters', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_creation_parameters_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_creation_parameters_py3.py new file mode 100644 index 000000000000..27e58933f77b --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_creation_parameters_py3.py @@ -0,0 +1,36 @@ +# 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 EnvironmentSettingCreationParameters(Model): + """Settings related to creating an environment setting. + + All required parameters must be populated in order to send to Azure. + + :param resource_setting_creation_parameters: Required. The resource + specific settings + :type resource_setting_creation_parameters: + ~azure.mgmt.labservices.models.ResourceSettingCreationParameters + """ + + _validation = { + 'resource_setting_creation_parameters': {'required': True}, + } + + _attribute_map = { + 'resource_setting_creation_parameters': {'key': 'resourceSettingCreationParameters', 'type': 'ResourceSettingCreationParameters'}, + } + + def __init__(self, *, resource_setting_creation_parameters, **kwargs) -> None: + super(EnvironmentSettingCreationParameters, self).__init__(**kwargs) + self.resource_setting_creation_parameters = resource_setting_creation_parameters diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_fragment.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_fragment.py new file mode 100644 index 000000000000..4c0d874ef2e2 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_fragment.py @@ -0,0 +1,79 @@ +# 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 EnvironmentSettingFragment(Resource): + """Represents settings of an environment, from which environment instances + would be created. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param configuration_state: Describes the user's progress in configuring + their environment setting. Possible values include: 'NotApplicable', + 'Completed' + :type configuration_state: str or + ~azure.mgmt.labservices.models.ConfigurationState + :param description: Describes the environment and its resource settings + :type description: str + :param title: Brief title describing the environment and its resource + settings + :type title: str + :param resource_settings: The resource specific settings + :type resource_settings: + ~azure.mgmt.labservices.models.ResourceSettingsFragment + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'configuration_state': {'key': 'properties.configurationState', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'resource_settings': {'key': 'properties.resourceSettings', 'type': 'ResourceSettingsFragment'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnvironmentSettingFragment, self).__init__(**kwargs) + self.configuration_state = kwargs.get('configuration_state', None) + self.description = kwargs.get('description', None) + self.title = kwargs.get('title', None) + self.resource_settings = kwargs.get('resource_settings', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.unique_identifier = kwargs.get('unique_identifier', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_fragment_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_fragment_py3.py new file mode 100644 index 000000000000..c7d3c076bda1 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_fragment_py3.py @@ -0,0 +1,79 @@ +# 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 EnvironmentSettingFragment(Resource): + """Represents settings of an environment, from which environment instances + would be created. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param configuration_state: Describes the user's progress in configuring + their environment setting. Possible values include: 'NotApplicable', + 'Completed' + :type configuration_state: str or + ~azure.mgmt.labservices.models.ConfigurationState + :param description: Describes the environment and its resource settings + :type description: str + :param title: Brief title describing the environment and its resource + settings + :type title: str + :param resource_settings: The resource specific settings + :type resource_settings: + ~azure.mgmt.labservices.models.ResourceSettingsFragment + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'configuration_state': {'key': 'properties.configurationState', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'resource_settings': {'key': 'properties.resourceSettings', 'type': 'ResourceSettingsFragment'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, configuration_state=None, description: str=None, title: str=None, resource_settings=None, provisioning_state: str=None, unique_identifier: str=None, **kwargs) -> None: + super(EnvironmentSettingFragment, self).__init__(location=location, tags=tags, **kwargs) + self.configuration_state = configuration_state + self.description = description + self.title = title + self.resource_settings = resource_settings + self.provisioning_state = provisioning_state + self.unique_identifier = unique_identifier diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_paged.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_paged.py new file mode 100644 index 000000000000..3bd929e6f0a6 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_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 EnvironmentSettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`EnvironmentSetting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EnvironmentSetting]'} + } + + def __init__(self, *args, **kwargs): + + super(EnvironmentSettingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_py3.py new file mode 100644 index 000000000000..13dbc93757a5 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_setting_py3.py @@ -0,0 +1,107 @@ +# 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 EnvironmentSetting(Resource): + """Represents settings of an environment, from which environment instances + would be created. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar publishing_state: Describes the readiness of this environment + setting. Possible values include: 'Draft', 'Publishing', 'Published', + 'PublishFailed', 'Scaling' + :vartype publishing_state: str or + ~azure.mgmt.labservices.models.PublishingState + :param configuration_state: Describes the user's progress in configuring + their environment setting. Possible values include: 'NotApplicable', + 'Completed' + :type configuration_state: str or + ~azure.mgmt.labservices.models.ConfigurationState + :param description: Describes the environment and its resource settings + :type description: str + :param title: Brief title describing the environment and its resource + settings + :type title: str + :param resource_settings: Required. The resource specific settings + :type resource_settings: ~azure.mgmt.labservices.models.ResourceSettings + :ivar last_changed: Time when the template VM was last changed. + :vartype last_changed: datetime + :ivar last_published: Time when the template VM was last sent for + publishing. + :vartype last_published: datetime + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + :ivar latest_operation_result: The details of the latest operation. ex: + status, error + :vartype latest_operation_result: + ~azure.mgmt.labservices.models.LatestOperationResult + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'publishing_state': {'readonly': True}, + 'resource_settings': {'required': True}, + 'last_changed': {'readonly': True}, + 'last_published': {'readonly': True}, + 'latest_operation_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_state': {'key': 'properties.publishingState', 'type': 'str'}, + 'configuration_state': {'key': 'properties.configurationState', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'resource_settings': {'key': 'properties.resourceSettings', 'type': 'ResourceSettings'}, + 'last_changed': {'key': 'properties.lastChanged', 'type': 'iso-8601'}, + 'last_published': {'key': 'properties.lastPublished', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + 'latest_operation_result': {'key': 'properties.latestOperationResult', 'type': 'LatestOperationResult'}, + } + + def __init__(self, *, resource_settings, location: str=None, tags=None, configuration_state=None, description: str=None, title: str=None, provisioning_state: str=None, unique_identifier: str=None, **kwargs) -> None: + super(EnvironmentSetting, self).__init__(location=location, tags=tags, **kwargs) + self.publishing_state = None + self.configuration_state = configuration_state + self.description = description + self.title = title + self.resource_settings = resource_settings + self.last_changed = None + self.last_published = None + self.provisioning_state = provisioning_state + self.unique_identifier = unique_identifier + self.latest_operation_result = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_size.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_size.py new file mode 100644 index 000000000000..f6df57028796 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_size.py @@ -0,0 +1,61 @@ +# 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 EnvironmentSize(Model): + """Represents a size category supported by this Lab Account (small, medium or + large). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The size category. Possible values include: 'Basic', + 'Standard', 'Performance' + :type name: str or ~azure.mgmt.labservices.models.ManagedLabVmSize + :param vm_sizes: Represents a set of compute sizes that can serve this + given size type + :type vm_sizes: list[~azure.mgmt.labservices.models.SizeInfo] + :ivar max_price: The pay-as-you-go dollar price per hour this size will + cost. It does not include discounts and may not reflect the actual price + the size will cost. This is the maximum price of all prices within this + tier. + :vartype max_price: decimal.Decimal + :ivar min_number_of_cores: The number of cores a VM of this size has. This + is the minimum number of cores within this tier. + :vartype min_number_of_cores: int + :ivar min_memory: The amount of memory available (in GB). This is the + minimum amount of memory within this tier. + :vartype min_memory: float + """ + + _validation = { + 'max_price': {'readonly': True}, + 'min_number_of_cores': {'readonly': True}, + 'min_memory': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'vm_sizes': {'key': 'vmSizes', 'type': '[SizeInfo]'}, + 'max_price': {'key': 'maxPrice', 'type': 'decimal'}, + 'min_number_of_cores': {'key': 'minNumberOfCores', 'type': 'int'}, + 'min_memory': {'key': 'minMemory', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(EnvironmentSize, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.vm_sizes = kwargs.get('vm_sizes', None) + self.max_price = None + self.min_number_of_cores = None + self.min_memory = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_size_fragment.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_size_fragment.py new file mode 100644 index 000000000000..2835e0451103 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_size_fragment.py @@ -0,0 +1,35 @@ +# 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 EnvironmentSizeFragment(Model): + """Represents a size category supported by this Lab Account (small, medium or + large). + + :param name: The size category. Possible values include: 'Basic', + 'Standard', 'Performance' + :type name: str or ~azure.mgmt.labservices.models.ManagedLabVmSize + :param vm_sizes: Represents a set of compute sizes that can serve this + given size type + :type vm_sizes: list[~azure.mgmt.labservices.models.SizeInfoFragment] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'vm_sizes': {'key': 'vmSizes', 'type': '[SizeInfoFragment]'}, + } + + def __init__(self, **kwargs): + super(EnvironmentSizeFragment, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.vm_sizes = kwargs.get('vm_sizes', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_size_fragment_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_size_fragment_py3.py new file mode 100644 index 000000000000..766bc95f2f4e --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_size_fragment_py3.py @@ -0,0 +1,35 @@ +# 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 EnvironmentSizeFragment(Model): + """Represents a size category supported by this Lab Account (small, medium or + large). + + :param name: The size category. Possible values include: 'Basic', + 'Standard', 'Performance' + :type name: str or ~azure.mgmt.labservices.models.ManagedLabVmSize + :param vm_sizes: Represents a set of compute sizes that can serve this + given size type + :type vm_sizes: list[~azure.mgmt.labservices.models.SizeInfoFragment] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'vm_sizes': {'key': 'vmSizes', 'type': '[SizeInfoFragment]'}, + } + + def __init__(self, *, name=None, vm_sizes=None, **kwargs) -> None: + super(EnvironmentSizeFragment, self).__init__(**kwargs) + self.name = name + self.vm_sizes = vm_sizes diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_size_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_size_py3.py new file mode 100644 index 000000000000..9fe59ae52aa4 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/environment_size_py3.py @@ -0,0 +1,61 @@ +# 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 EnvironmentSize(Model): + """Represents a size category supported by this Lab Account (small, medium or + large). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The size category. Possible values include: 'Basic', + 'Standard', 'Performance' + :type name: str or ~azure.mgmt.labservices.models.ManagedLabVmSize + :param vm_sizes: Represents a set of compute sizes that can serve this + given size type + :type vm_sizes: list[~azure.mgmt.labservices.models.SizeInfo] + :ivar max_price: The pay-as-you-go dollar price per hour this size will + cost. It does not include discounts and may not reflect the actual price + the size will cost. This is the maximum price of all prices within this + tier. + :vartype max_price: decimal.Decimal + :ivar min_number_of_cores: The number of cores a VM of this size has. This + is the minimum number of cores within this tier. + :vartype min_number_of_cores: int + :ivar min_memory: The amount of memory available (in GB). This is the + minimum amount of memory within this tier. + :vartype min_memory: float + """ + + _validation = { + 'max_price': {'readonly': True}, + 'min_number_of_cores': {'readonly': True}, + 'min_memory': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'vm_sizes': {'key': 'vmSizes', 'type': '[SizeInfo]'}, + 'max_price': {'key': 'maxPrice', 'type': 'decimal'}, + 'min_number_of_cores': {'key': 'minNumberOfCores', 'type': 'int'}, + 'min_memory': {'key': 'minMemory', 'type': 'float'}, + } + + def __init__(self, *, name=None, vm_sizes=None, **kwargs) -> None: + super(EnvironmentSize, self).__init__(**kwargs) + self.name = name + self.vm_sizes = vm_sizes + self.max_price = None + self.min_number_of_cores = None + self.min_memory = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image.py new file mode 100644 index 000000000000..0ba1e179ecda --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image.py @@ -0,0 +1,109 @@ +# 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 GalleryImage(Resource): + """Represents an image from the Azure Marketplace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar author: The author of the gallery image. + :vartype author: str + :ivar created_date: The creation date of the gallery image. + :vartype created_date: datetime + :ivar description: The description of the gallery image. + :vartype description: str + :ivar image_reference: The image reference of the gallery image. + :vartype image_reference: + ~azure.mgmt.labservices.models.GalleryImageReference + :ivar icon: The icon of the gallery image. + :vartype icon: str + :param is_enabled: Indicates whether this gallery image is enabled. + :type is_enabled: bool + :param is_override: Indicates whether this gallery has been overridden for + this lab account + :type is_override: bool + :ivar plan_id: The third party plan that applies to this image + :vartype plan_id: str + :param is_plan_authorized: Indicates if the plan has been authorized for + programmatic deployment. + :type is_plan_authorized: bool + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + :ivar latest_operation_result: The details of the latest operation. ex: + status, error + :vartype latest_operation_result: + ~azure.mgmt.labservices.models.LatestOperationResult + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'author': {'readonly': True}, + 'created_date': {'readonly': True}, + 'description': {'readonly': True}, + 'image_reference': {'readonly': True}, + 'icon': {'readonly': True}, + 'plan_id': {'readonly': True}, + 'latest_operation_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'image_reference': {'key': 'properties.imageReference', 'type': 'GalleryImageReference'}, + 'icon': {'key': 'properties.icon', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'is_override': {'key': 'properties.isOverride', 'type': 'bool'}, + 'plan_id': {'key': 'properties.planId', 'type': 'str'}, + 'is_plan_authorized': {'key': 'properties.isPlanAuthorized', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + 'latest_operation_result': {'key': 'properties.latestOperationResult', 'type': 'LatestOperationResult'}, + } + + def __init__(self, **kwargs): + super(GalleryImage, self).__init__(**kwargs) + self.author = None + self.created_date = None + self.description = None + self.image_reference = None + self.icon = None + self.is_enabled = kwargs.get('is_enabled', None) + self.is_override = kwargs.get('is_override', None) + self.plan_id = None + self.is_plan_authorized = kwargs.get('is_plan_authorized', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.unique_identifier = kwargs.get('unique_identifier', None) + self.latest_operation_result = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_fragment.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_fragment.py new file mode 100644 index 000000000000..2d41f4c4edf5 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_fragment.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class GalleryImageFragment(Resource): + """Represents an image from the Azure Marketplace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param is_enabled: Indicates whether this gallery image is enabled. + :type is_enabled: bool + :param is_override: Indicates whether this gallery has been overridden for + this lab account + :type is_override: bool + :param is_plan_authorized: Indicates if the plan has been authorized for + programmatic deployment. + :type is_plan_authorized: bool + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'is_override': {'key': 'properties.isOverride', 'type': 'bool'}, + 'is_plan_authorized': {'key': 'properties.isPlanAuthorized', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GalleryImageFragment, self).__init__(**kwargs) + self.is_enabled = kwargs.get('is_enabled', None) + self.is_override = kwargs.get('is_override', None) + self.is_plan_authorized = kwargs.get('is_plan_authorized', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.unique_identifier = kwargs.get('unique_identifier', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_fragment_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_fragment_py3.py new file mode 100644 index 000000000000..a58ba7b04c72 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_fragment_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class GalleryImageFragment(Resource): + """Represents an image from the Azure Marketplace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param is_enabled: Indicates whether this gallery image is enabled. + :type is_enabled: bool + :param is_override: Indicates whether this gallery has been overridden for + this lab account + :type is_override: bool + :param is_plan_authorized: Indicates if the plan has been authorized for + programmatic deployment. + :type is_plan_authorized: bool + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'is_override': {'key': 'properties.isOverride', 'type': 'bool'}, + 'is_plan_authorized': {'key': 'properties.isPlanAuthorized', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, is_enabled: bool=None, is_override: bool=None, is_plan_authorized: bool=None, provisioning_state: str=None, unique_identifier: str=None, **kwargs) -> None: + super(GalleryImageFragment, self).__init__(location=location, tags=tags, **kwargs) + self.is_enabled = is_enabled + self.is_override = is_override + self.is_plan_authorized = is_plan_authorized + self.provisioning_state = provisioning_state + self.unique_identifier = unique_identifier diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_paged.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_paged.py new file mode 100644 index 000000000000..11d7722be5cc --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_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 GalleryImagePaged(Paged): + """ + A paging container for iterating over a list of :class:`GalleryImage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[GalleryImage]'} + } + + def __init__(self, *args, **kwargs): + + super(GalleryImagePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_py3.py new file mode 100644 index 000000000000..9af22442c2d1 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_py3.py @@ -0,0 +1,109 @@ +# 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 GalleryImage(Resource): + """Represents an image from the Azure Marketplace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar author: The author of the gallery image. + :vartype author: str + :ivar created_date: The creation date of the gallery image. + :vartype created_date: datetime + :ivar description: The description of the gallery image. + :vartype description: str + :ivar image_reference: The image reference of the gallery image. + :vartype image_reference: + ~azure.mgmt.labservices.models.GalleryImageReference + :ivar icon: The icon of the gallery image. + :vartype icon: str + :param is_enabled: Indicates whether this gallery image is enabled. + :type is_enabled: bool + :param is_override: Indicates whether this gallery has been overridden for + this lab account + :type is_override: bool + :ivar plan_id: The third party plan that applies to this image + :vartype plan_id: str + :param is_plan_authorized: Indicates if the plan has been authorized for + programmatic deployment. + :type is_plan_authorized: bool + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + :ivar latest_operation_result: The details of the latest operation. ex: + status, error + :vartype latest_operation_result: + ~azure.mgmt.labservices.models.LatestOperationResult + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'author': {'readonly': True}, + 'created_date': {'readonly': True}, + 'description': {'readonly': True}, + 'image_reference': {'readonly': True}, + 'icon': {'readonly': True}, + 'plan_id': {'readonly': True}, + 'latest_operation_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'image_reference': {'key': 'properties.imageReference', 'type': 'GalleryImageReference'}, + 'icon': {'key': 'properties.icon', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'is_override': {'key': 'properties.isOverride', 'type': 'bool'}, + 'plan_id': {'key': 'properties.planId', 'type': 'str'}, + 'is_plan_authorized': {'key': 'properties.isPlanAuthorized', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + 'latest_operation_result': {'key': 'properties.latestOperationResult', 'type': 'LatestOperationResult'}, + } + + def __init__(self, *, location: str=None, tags=None, is_enabled: bool=None, is_override: bool=None, is_plan_authorized: bool=None, provisioning_state: str=None, unique_identifier: str=None, **kwargs) -> None: + super(GalleryImage, self).__init__(location=location, tags=tags, **kwargs) + self.author = None + self.created_date = None + self.description = None + self.image_reference = None + self.icon = None + self.is_enabled = is_enabled + self.is_override = is_override + self.plan_id = None + self.is_plan_authorized = is_plan_authorized + self.provisioning_state = provisioning_state + self.unique_identifier = unique_identifier + self.latest_operation_result = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_reference.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_reference.py new file mode 100644 index 000000000000..c896911316fd --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_reference.py @@ -0,0 +1,44 @@ +# 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 GalleryImageReference(Model): + """The reference information for an Azure Marketplace image. + + :param offer: The offer of the gallery image. + :type offer: str + :param publisher: The publisher of the gallery image. + :type publisher: str + :param sku: The SKU of the gallery image. + :type sku: str + :param os_type: The OS type of the gallery image. + :type os_type: str + :param version: The version of the gallery image. + :type version: str + """ + + _attribute_map = { + 'offer': {'key': 'offer', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GalleryImageReference, self).__init__(**kwargs) + self.offer = kwargs.get('offer', None) + self.publisher = kwargs.get('publisher', None) + self.sku = kwargs.get('sku', None) + self.os_type = kwargs.get('os_type', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_reference_fragment.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_reference_fragment.py new file mode 100644 index 000000000000..6bd266dbfbd8 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_reference_fragment.py @@ -0,0 +1,44 @@ +# 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 GalleryImageReferenceFragment(Model): + """The reference information for an Azure Marketplace image. + + :param offer: The offer of the gallery image. + :type offer: str + :param publisher: The publisher of the gallery image. + :type publisher: str + :param sku: The SKU of the gallery image. + :type sku: str + :param os_type: The OS type of the gallery image. + :type os_type: str + :param version: The version of the gallery image. + :type version: str + """ + + _attribute_map = { + 'offer': {'key': 'offer', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GalleryImageReferenceFragment, self).__init__(**kwargs) + self.offer = kwargs.get('offer', None) + self.publisher = kwargs.get('publisher', None) + self.sku = kwargs.get('sku', None) + self.os_type = kwargs.get('os_type', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_reference_fragment_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_reference_fragment_py3.py new file mode 100644 index 000000000000..3ebbfa4662f7 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_reference_fragment_py3.py @@ -0,0 +1,44 @@ +# 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 GalleryImageReferenceFragment(Model): + """The reference information for an Azure Marketplace image. + + :param offer: The offer of the gallery image. + :type offer: str + :param publisher: The publisher of the gallery image. + :type publisher: str + :param sku: The SKU of the gallery image. + :type sku: str + :param os_type: The OS type of the gallery image. + :type os_type: str + :param version: The version of the gallery image. + :type version: str + """ + + _attribute_map = { + 'offer': {'key': 'offer', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, offer: str=None, publisher: str=None, sku: str=None, os_type: str=None, version: str=None, **kwargs) -> None: + super(GalleryImageReferenceFragment, self).__init__(**kwargs) + self.offer = offer + self.publisher = publisher + self.sku = sku + self.os_type = os_type + self.version = version diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_reference_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_reference_py3.py new file mode 100644 index 000000000000..2541dc5b63e9 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/gallery_image_reference_py3.py @@ -0,0 +1,44 @@ +# 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 GalleryImageReference(Model): + """The reference information for an Azure Marketplace image. + + :param offer: The offer of the gallery image. + :type offer: str + :param publisher: The publisher of the gallery image. + :type publisher: str + :param sku: The SKU of the gallery image. + :type sku: str + :param os_type: The OS type of the gallery image. + :type os_type: str + :param version: The version of the gallery image. + :type version: str + """ + + _attribute_map = { + 'offer': {'key': 'offer', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, offer: str=None, publisher: str=None, sku: str=None, os_type: str=None, version: str=None, **kwargs) -> None: + super(GalleryImageReference, self).__init__(**kwargs) + self.offer = offer + self.publisher = publisher + self.sku = sku + self.os_type = os_type + self.version = version diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/get_environment_response.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/get_environment_response.py new file mode 100644 index 000000000000..0e722691b6f9 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/get_environment_response.py @@ -0,0 +1,35 @@ +# 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 GetEnvironmentResponse(Model): + """Represents the environments details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar environment: Details of the environment + :vartype environment: ~azure.mgmt.labservices.models.EnvironmentDetails + """ + + _validation = { + 'environment': {'readonly': True}, + } + + _attribute_map = { + 'environment': {'key': 'environment', 'type': 'EnvironmentDetails'}, + } + + def __init__(self, **kwargs): + super(GetEnvironmentResponse, self).__init__(**kwargs) + self.environment = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/get_environment_response_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/get_environment_response_py3.py new file mode 100644 index 000000000000..63c18c5eee2e --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/get_environment_response_py3.py @@ -0,0 +1,35 @@ +# 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 GetEnvironmentResponse(Model): + """Represents the environments details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar environment: Details of the environment + :vartype environment: ~azure.mgmt.labservices.models.EnvironmentDetails + """ + + _validation = { + 'environment': {'readonly': True}, + } + + _attribute_map = { + 'environment': {'key': 'environment', 'type': 'EnvironmentDetails'}, + } + + def __init__(self, **kwargs) -> None: + super(GetEnvironmentResponse, self).__init__(**kwargs) + self.environment = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/get_personal_preferences_response.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/get_personal_preferences_response.py new file mode 100644 index 000000000000..f710508ef545 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/get_personal_preferences_response.py @@ -0,0 +1,32 @@ +# 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 GetPersonalPreferencesResponse(Model): + """Represents the PersonalPreferences for the user. + + :param id: Id to be used by the cache orchestrator + :type id: str + :param favorite_lab_resource_ids: Array of favorite lab resource ids + :type favorite_lab_resource_ids: list[str] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'favorite_lab_resource_ids': {'key': 'favoriteLabResourceIds', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(GetPersonalPreferencesResponse, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.favorite_lab_resource_ids = kwargs.get('favorite_lab_resource_ids', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/get_personal_preferences_response_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/get_personal_preferences_response_py3.py new file mode 100644 index 000000000000..a3beb9def352 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/get_personal_preferences_response_py3.py @@ -0,0 +1,32 @@ +# 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 GetPersonalPreferencesResponse(Model): + """Represents the PersonalPreferences for the user. + + :param id: Id to be used by the cache orchestrator + :type id: str + :param favorite_lab_resource_ids: Array of favorite lab resource ids + :type favorite_lab_resource_ids: list[str] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'favorite_lab_resource_ids': {'key': 'favoriteLabResourceIds', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, favorite_lab_resource_ids=None, **kwargs) -> None: + super(GetPersonalPreferencesResponse, self).__init__(**kwargs) + self.id = id + self.favorite_lab_resource_ids = favorite_lab_resource_ids diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/get_regional_availability_response.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/get_regional_availability_response.py new file mode 100644 index 000000000000..8d69b07b19a4 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/get_regional_availability_response.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GetRegionalAvailabilityResponse(Model): + """The response model from the GetRegionalAvailability action. + + :param regional_availability: Availability information for different size + categories per region + :type regional_availability: + list[~azure.mgmt.labservices.models.RegionalAvailability] + """ + + _attribute_map = { + 'regional_availability': {'key': 'regionalAvailability', 'type': '[RegionalAvailability]'}, + } + + def __init__(self, **kwargs): + super(GetRegionalAvailabilityResponse, self).__init__(**kwargs) + self.regional_availability = kwargs.get('regional_availability', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/get_regional_availability_response_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/get_regional_availability_response_py3.py new file mode 100644 index 000000000000..06aaa2a30358 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/get_regional_availability_response_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GetRegionalAvailabilityResponse(Model): + """The response model from the GetRegionalAvailability action. + + :param regional_availability: Availability information for different size + categories per region + :type regional_availability: + list[~azure.mgmt.labservices.models.RegionalAvailability] + """ + + _attribute_map = { + 'regional_availability': {'key': 'regionalAvailability', 'type': '[RegionalAvailability]'}, + } + + def __init__(self, *, regional_availability=None, **kwargs) -> None: + super(GetRegionalAvailabilityResponse, self).__init__(**kwargs) + self.regional_availability = regional_availability diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/lab.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab.py new file mode 100644 index 000000000000..a9cc33b0ae91 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Lab(Resource): + """Represents a lab. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param max_users_in_lab: Maximum number of users allowed in the lab. + :type max_users_in_lab: int + :ivar user_quota: Maximum value MaxUsersInLab can be set to, as specified + by the service + :vartype user_quota: int + :ivar invitation_code: Invitation code that users can use to join a lab. + :vartype invitation_code: str + :ivar created_by_object_id: Object id of the user that created the lab. + :vartype created_by_object_id: str + :param usage_quota: Maximum duration a user can use an environment for in + the lab. + :type usage_quota: timedelta + :param user_access_mode: Lab user access mode (open to all vs. restricted + to those listed on the lab). Possible values include: 'Restricted', 'Open' + :type user_access_mode: str or + ~azure.mgmt.labservices.models.LabUserAccessMode + :ivar created_by_user_principal_name: Lab creator name + :vartype created_by_user_principal_name: str + :ivar created_date: Creation date for the lab + :vartype created_date: datetime + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + :ivar latest_operation_result: The details of the latest operation. ex: + status, error + :vartype latest_operation_result: + ~azure.mgmt.labservices.models.LatestOperationResult + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'user_quota': {'readonly': True}, + 'invitation_code': {'readonly': True}, + 'created_by_object_id': {'readonly': True}, + 'created_by_user_principal_name': {'readonly': True}, + 'created_date': {'readonly': True}, + 'latest_operation_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'max_users_in_lab': {'key': 'properties.maxUsersInLab', 'type': 'int'}, + 'user_quota': {'key': 'properties.userQuota', 'type': 'int'}, + 'invitation_code': {'key': 'properties.invitationCode', 'type': 'str'}, + 'created_by_object_id': {'key': 'properties.createdByObjectId', 'type': 'str'}, + 'usage_quota': {'key': 'properties.usageQuota', 'type': 'duration'}, + 'user_access_mode': {'key': 'properties.userAccessMode', 'type': 'str'}, + 'created_by_user_principal_name': {'key': 'properties.createdByUserPrincipalName', 'type': 'str'}, + 'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + 'latest_operation_result': {'key': 'properties.latestOperationResult', 'type': 'LatestOperationResult'}, + } + + def __init__(self, **kwargs): + super(Lab, self).__init__(**kwargs) + self.max_users_in_lab = kwargs.get('max_users_in_lab', None) + self.user_quota = None + self.invitation_code = None + self.created_by_object_id = None + self.usage_quota = kwargs.get('usage_quota', None) + self.user_access_mode = kwargs.get('user_access_mode', None) + self.created_by_user_principal_name = None + self.created_date = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.unique_identifier = kwargs.get('unique_identifier', None) + self.latest_operation_result = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account.py new file mode 100644 index 000000000000..537d5c688c09 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account.py @@ -0,0 +1,75 @@ +# 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 LabAccount(Resource): + """Represents a lab account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar size_configuration: Represents the size configuration under the lab + account + :vartype size_configuration: + ~azure.mgmt.labservices.models.SizeConfigurationProperties + :param enabled_region_selection: Represents if region selection is enabled + :type enabled_region_selection: bool + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + :ivar latest_operation_result: The details of the latest operation. ex: + status, error + :vartype latest_operation_result: + ~azure.mgmt.labservices.models.LatestOperationResult + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'size_configuration': {'readonly': True}, + 'latest_operation_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'size_configuration': {'key': 'properties.sizeConfiguration', 'type': 'SizeConfigurationProperties'}, + 'enabled_region_selection': {'key': 'properties.enabledRegionSelection', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + 'latest_operation_result': {'key': 'properties.latestOperationResult', 'type': 'LatestOperationResult'}, + } + + def __init__(self, **kwargs): + super(LabAccount, self).__init__(**kwargs) + self.size_configuration = None + self.enabled_region_selection = kwargs.get('enabled_region_selection', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.unique_identifier = kwargs.get('unique_identifier', None) + self.latest_operation_result = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account_fragment.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account_fragment.py new file mode 100644 index 000000000000..0e3a2fb1fa18 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account_fragment.py @@ -0,0 +1,61 @@ +# 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 LabAccountFragment(Resource): + """Represents a lab account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param enabled_region_selection: Represents if region selection is enabled + :type enabled_region_selection: bool + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'enabled_region_selection': {'key': 'properties.enabledRegionSelection', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LabAccountFragment, self).__init__(**kwargs) + self.enabled_region_selection = kwargs.get('enabled_region_selection', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.unique_identifier = kwargs.get('unique_identifier', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account_fragment_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account_fragment_py3.py new file mode 100644 index 000000000000..1b756767f9ae --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account_fragment_py3.py @@ -0,0 +1,61 @@ +# 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 LabAccountFragment(Resource): + """Represents a lab account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param enabled_region_selection: Represents if region selection is enabled + :type enabled_region_selection: bool + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'enabled_region_selection': {'key': 'properties.enabledRegionSelection', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, enabled_region_selection: bool=None, provisioning_state: str=None, unique_identifier: str=None, **kwargs) -> None: + super(LabAccountFragment, self).__init__(location=location, tags=tags, **kwargs) + self.enabled_region_selection = enabled_region_selection + self.provisioning_state = provisioning_state + self.unique_identifier = unique_identifier diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account_paged.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account_paged.py new file mode 100644 index 000000000000..7afe303f6608 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account_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 LabAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`LabAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[LabAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(LabAccountPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account_py3.py new file mode 100644 index 000000000000..f992a42065bc --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_account_py3.py @@ -0,0 +1,75 @@ +# 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 LabAccount(Resource): + """Represents a lab account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar size_configuration: Represents the size configuration under the lab + account + :vartype size_configuration: + ~azure.mgmt.labservices.models.SizeConfigurationProperties + :param enabled_region_selection: Represents if region selection is enabled + :type enabled_region_selection: bool + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + :ivar latest_operation_result: The details of the latest operation. ex: + status, error + :vartype latest_operation_result: + ~azure.mgmt.labservices.models.LatestOperationResult + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'size_configuration': {'readonly': True}, + 'latest_operation_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'size_configuration': {'key': 'properties.sizeConfiguration', 'type': 'SizeConfigurationProperties'}, + 'enabled_region_selection': {'key': 'properties.enabledRegionSelection', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + 'latest_operation_result': {'key': 'properties.latestOperationResult', 'type': 'LatestOperationResult'}, + } + + def __init__(self, *, location: str=None, tags=None, enabled_region_selection: bool=None, provisioning_state: str=None, unique_identifier: str=None, **kwargs) -> None: + super(LabAccount, self).__init__(location=location, tags=tags, **kwargs) + self.size_configuration = None + self.enabled_region_selection = enabled_region_selection + self.provisioning_state = provisioning_state + self.unique_identifier = unique_identifier + self.latest_operation_result = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_creation_parameters.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_creation_parameters.py new file mode 100644 index 000000000000..7280ce9fa06b --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_creation_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 LabCreationParameters(Model): + """Settings related to creating a lab. + + :param max_users_in_lab: Maximum number of users allowed in the lab. + :type max_users_in_lab: int + """ + + _attribute_map = { + 'max_users_in_lab': {'key': 'maxUsersInLab', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(LabCreationParameters, self).__init__(**kwargs) + self.max_users_in_lab = kwargs.get('max_users_in_lab', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_creation_parameters_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_creation_parameters_py3.py new file mode 100644 index 000000000000..577bce48c8ef --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_creation_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 LabCreationParameters(Model): + """Settings related to creating a lab. + + :param max_users_in_lab: Maximum number of users allowed in the lab. + :type max_users_in_lab: int + """ + + _attribute_map = { + 'max_users_in_lab': {'key': 'maxUsersInLab', 'type': 'int'}, + } + + def __init__(self, *, max_users_in_lab: int=None, **kwargs) -> None: + super(LabCreationParameters, self).__init__(**kwargs) + self.max_users_in_lab = max_users_in_lab diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_details.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_details.py new file mode 100644 index 000000000000..54fde666c07e --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_details.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 LabDetails(Model): + """This represents the details about a lab that the User is in, and its state. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: Name of the lab + :type name: str + :param provisioning_state: The provisioning state of the lab. + :type provisioning_state: str + :param id: The Id of the lab. + :type id: str + :ivar usage_quota: The maximum duration a user can use a VM in this lab. + :vartype usage_quota: timedelta + """ + + _validation = { + 'usage_quota': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'usage_quota': {'key': 'usageQuota', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(LabDetails, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.id = kwargs.get('id', None) + self.usage_quota = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_details_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_details_py3.py new file mode 100644 index 000000000000..b8b3fb7f8318 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_details_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 LabDetails(Model): + """This represents the details about a lab that the User is in, and its state. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: Name of the lab + :type name: str + :param provisioning_state: The provisioning state of the lab. + :type provisioning_state: str + :param id: The Id of the lab. + :type id: str + :ivar usage_quota: The maximum duration a user can use a VM in this lab. + :vartype usage_quota: timedelta + """ + + _validation = { + 'usage_quota': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'usage_quota': {'key': 'usageQuota', 'type': 'duration'}, + } + + def __init__(self, *, name: str=None, provisioning_state: str=None, id: str=None, **kwargs) -> None: + super(LabDetails, self).__init__(**kwargs) + self.name = name + self.provisioning_state = provisioning_state + self.id = id + self.usage_quota = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_fragment.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_fragment.py new file mode 100644 index 000000000000..9b63fe6ca330 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_fragment.py @@ -0,0 +1,72 @@ +# 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 LabFragment(Resource): + """Represents a lab. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param max_users_in_lab: Maximum number of users allowed in the lab. + :type max_users_in_lab: int + :param usage_quota: Maximum duration a user can use an environment for in + the lab. + :type usage_quota: timedelta + :param user_access_mode: Lab user access mode (open to all vs. restricted + to those listed on the lab). Possible values include: 'Restricted', 'Open' + :type user_access_mode: str or + ~azure.mgmt.labservices.models.LabUserAccessMode + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'max_users_in_lab': {'key': 'properties.maxUsersInLab', 'type': 'int'}, + 'usage_quota': {'key': 'properties.usageQuota', 'type': 'duration'}, + 'user_access_mode': {'key': 'properties.userAccessMode', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LabFragment, self).__init__(**kwargs) + self.max_users_in_lab = kwargs.get('max_users_in_lab', None) + self.usage_quota = kwargs.get('usage_quota', None) + self.user_access_mode = kwargs.get('user_access_mode', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.unique_identifier = kwargs.get('unique_identifier', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_fragment_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_fragment_py3.py new file mode 100644 index 000000000000..5bb9ec205733 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_fragment_py3.py @@ -0,0 +1,72 @@ +# 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 LabFragment(Resource): + """Represents a lab. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param max_users_in_lab: Maximum number of users allowed in the lab. + :type max_users_in_lab: int + :param usage_quota: Maximum duration a user can use an environment for in + the lab. + :type usage_quota: timedelta + :param user_access_mode: Lab user access mode (open to all vs. restricted + to those listed on the lab). Possible values include: 'Restricted', 'Open' + :type user_access_mode: str or + ~azure.mgmt.labservices.models.LabUserAccessMode + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'max_users_in_lab': {'key': 'properties.maxUsersInLab', 'type': 'int'}, + 'usage_quota': {'key': 'properties.usageQuota', 'type': 'duration'}, + 'user_access_mode': {'key': 'properties.userAccessMode', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, max_users_in_lab: int=None, usage_quota=None, user_access_mode=None, provisioning_state: str=None, unique_identifier: str=None, **kwargs) -> None: + super(LabFragment, self).__init__(location=location, tags=tags, **kwargs) + self.max_users_in_lab = max_users_in_lab + self.usage_quota = usage_quota + self.user_access_mode = user_access_mode + self.provisioning_state = provisioning_state + self.unique_identifier = unique_identifier diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_paged.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_paged.py new file mode 100644 index 000000000000..d95bfb5c5d5e --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_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 LabPaged(Paged): + """ + A paging container for iterating over a list of :class:`Lab ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Lab]'} + } + + def __init__(self, *args, **kwargs): + + super(LabPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_py3.py new file mode 100644 index 000000000000..0905de316eeb --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/lab_py3.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Lab(Resource): + """Represents a lab. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param max_users_in_lab: Maximum number of users allowed in the lab. + :type max_users_in_lab: int + :ivar user_quota: Maximum value MaxUsersInLab can be set to, as specified + by the service + :vartype user_quota: int + :ivar invitation_code: Invitation code that users can use to join a lab. + :vartype invitation_code: str + :ivar created_by_object_id: Object id of the user that created the lab. + :vartype created_by_object_id: str + :param usage_quota: Maximum duration a user can use an environment for in + the lab. + :type usage_quota: timedelta + :param user_access_mode: Lab user access mode (open to all vs. restricted + to those listed on the lab). Possible values include: 'Restricted', 'Open' + :type user_access_mode: str or + ~azure.mgmt.labservices.models.LabUserAccessMode + :ivar created_by_user_principal_name: Lab creator name + :vartype created_by_user_principal_name: str + :ivar created_date: Creation date for the lab + :vartype created_date: datetime + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + :ivar latest_operation_result: The details of the latest operation. ex: + status, error + :vartype latest_operation_result: + ~azure.mgmt.labservices.models.LatestOperationResult + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'user_quota': {'readonly': True}, + 'invitation_code': {'readonly': True}, + 'created_by_object_id': {'readonly': True}, + 'created_by_user_principal_name': {'readonly': True}, + 'created_date': {'readonly': True}, + 'latest_operation_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'max_users_in_lab': {'key': 'properties.maxUsersInLab', 'type': 'int'}, + 'user_quota': {'key': 'properties.userQuota', 'type': 'int'}, + 'invitation_code': {'key': 'properties.invitationCode', 'type': 'str'}, + 'created_by_object_id': {'key': 'properties.createdByObjectId', 'type': 'str'}, + 'usage_quota': {'key': 'properties.usageQuota', 'type': 'duration'}, + 'user_access_mode': {'key': 'properties.userAccessMode', 'type': 'str'}, + 'created_by_user_principal_name': {'key': 'properties.createdByUserPrincipalName', 'type': 'str'}, + 'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + 'latest_operation_result': {'key': 'properties.latestOperationResult', 'type': 'LatestOperationResult'}, + } + + def __init__(self, *, location: str=None, tags=None, max_users_in_lab: int=None, usage_quota=None, user_access_mode=None, provisioning_state: str=None, unique_identifier: str=None, **kwargs) -> None: + super(Lab, self).__init__(location=location, tags=tags, **kwargs) + self.max_users_in_lab = max_users_in_lab + self.user_quota = None + self.invitation_code = None + self.created_by_object_id = None + self.usage_quota = usage_quota + self.user_access_mode = user_access_mode + self.created_by_user_principal_name = None + self.created_date = None + self.provisioning_state = provisioning_state + self.unique_identifier = unique_identifier + self.latest_operation_result = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/latest_operation_result.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/latest_operation_result.py new file mode 100644 index 000000000000..dfc12fbd0cfc --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/latest_operation_result.py @@ -0,0 +1,60 @@ +# 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 LatestOperationResult(Model): + """Details of the status of an operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The current status of the operation. + :vartype status: str + :ivar error_code: Error code on failure. + :vartype error_code: str + :ivar error_message: The error message. + :vartype error_message: str + :ivar request_uri: Request URI of the operation. + :vartype request_uri: str + :ivar http_method: The HttpMethod - PUT/POST/DELETE for the operation. + :vartype http_method: str + :ivar operation_url: The URL to use to check long-running operation status + :vartype operation_url: str + """ + + _validation = { + 'status': {'readonly': True}, + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'request_uri': {'readonly': True}, + 'http_method': {'readonly': True}, + 'operation_url': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + 'http_method': {'key': 'httpMethod', 'type': 'str'}, + 'operation_url': {'key': 'operationUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LatestOperationResult, self).__init__(**kwargs) + self.status = None + self.error_code = None + self.error_message = None + self.request_uri = None + self.http_method = None + self.operation_url = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/latest_operation_result_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/latest_operation_result_py3.py new file mode 100644 index 000000000000..55a3aa1f0a64 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/latest_operation_result_py3.py @@ -0,0 +1,60 @@ +# 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 LatestOperationResult(Model): + """Details of the status of an operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The current status of the operation. + :vartype status: str + :ivar error_code: Error code on failure. + :vartype error_code: str + :ivar error_message: The error message. + :vartype error_message: str + :ivar request_uri: Request URI of the operation. + :vartype request_uri: str + :ivar http_method: The HttpMethod - PUT/POST/DELETE for the operation. + :vartype http_method: str + :ivar operation_url: The URL to use to check long-running operation status + :vartype operation_url: str + """ + + _validation = { + 'status': {'readonly': True}, + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'request_uri': {'readonly': True}, + 'http_method': {'readonly': True}, + 'operation_url': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + 'http_method': {'key': 'httpMethod', 'type': 'str'}, + 'operation_url': {'key': 'operationUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(LatestOperationResult, self).__init__(**kwargs) + self.status = None + self.error_code = None + self.error_message = None + self.request_uri = None + self.http_method = None + self.operation_url = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/list_environments_payload.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/list_environments_payload.py new file mode 100644 index 000000000000..9101f0a5751a --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/list_environments_payload.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 ListEnvironmentsPayload(Model): + """Represents the payload to list environments owned by a user. + + :param lab_id: The resource Id of the lab + :type lab_id: str + """ + + _attribute_map = { + 'lab_id': {'key': 'labId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListEnvironmentsPayload, self).__init__(**kwargs) + self.lab_id = kwargs.get('lab_id', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/list_environments_payload_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/list_environments_payload_py3.py new file mode 100644 index 000000000000..5523518b2572 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/list_environments_payload_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 ListEnvironmentsPayload(Model): + """Represents the payload to list environments owned by a user. + + :param lab_id: The resource Id of the lab + :type lab_id: str + """ + + _attribute_map = { + 'lab_id': {'key': 'labId', 'type': 'str'}, + } + + def __init__(self, *, lab_id: str=None, **kwargs) -> None: + super(ListEnvironmentsPayload, self).__init__(**kwargs) + self.lab_id = lab_id diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/list_environments_response.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/list_environments_response.py new file mode 100644 index 000000000000..4a1d2764bffc --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/list_environments_response.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 ListEnvironmentsResponse(Model): + """Represents the list of environments owned by a user. + + :param environments: List of all the evironments + :type environments: + list[~azure.mgmt.labservices.models.EnvironmentDetails] + """ + + _attribute_map = { + 'environments': {'key': 'environments', 'type': '[EnvironmentDetails]'}, + } + + def __init__(self, **kwargs): + super(ListEnvironmentsResponse, self).__init__(**kwargs) + self.environments = kwargs.get('environments', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/list_environments_response_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/list_environments_response_py3.py new file mode 100644 index 000000000000..9500ba940ea4 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/list_environments_response_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 ListEnvironmentsResponse(Model): + """Represents the list of environments owned by a user. + + :param environments: List of all the evironments + :type environments: + list[~azure.mgmt.labservices.models.EnvironmentDetails] + """ + + _attribute_map = { + 'environments': {'key': 'environments', 'type': '[EnvironmentDetails]'}, + } + + def __init__(self, *, environments=None, **kwargs) -> None: + super(ListEnvironmentsResponse, self).__init__(**kwargs) + self.environments = environments diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/list_labs_response.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/list_labs_response.py new file mode 100644 index 000000000000..8bfeaab72b80 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/list_labs_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 ListLabsResponse(Model): + """Lists the labs owned by a user. + + :param labs: List of all the labs + :type labs: list[~azure.mgmt.labservices.models.LabDetails] + """ + + _attribute_map = { + 'labs': {'key': 'labs', 'type': '[LabDetails]'}, + } + + def __init__(self, **kwargs): + super(ListLabsResponse, self).__init__(**kwargs) + self.labs = kwargs.get('labs', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/list_labs_response_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/list_labs_response_py3.py new file mode 100644 index 000000000000..e26d6f32a8d4 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/list_labs_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 ListLabsResponse(Model): + """Lists the labs owned by a user. + + :param labs: List of all the labs + :type labs: list[~azure.mgmt.labservices.models.LabDetails] + """ + + _attribute_map = { + 'labs': {'key': 'labs', 'type': '[LabDetails]'}, + } + + def __init__(self, *, labs=None, **kwargs) -> None: + super(ListLabsResponse, self).__init__(**kwargs) + self.labs = labs diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/managed_labs_client_enums.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/managed_labs_client_enums.py new file mode 100644 index 000000000000..9e95220206ee --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/managed_labs_client_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 ManagedLabVmSize(str, Enum): + + basic = "Basic" #: The base VM size + standard = "Standard" #: The standard or default VM size + performance = "Performance" #: The most performant VM size + + +class PublishingState(str, Enum): + + draft = "Draft" #: Initial state of an environment setting. + publishing = "Publishing" #: Currently provisioning resources. + published = "Published" #: All resources are currently provisioned. + publish_failed = "PublishFailed" #: Failed to provision all the necessary resources. + scaling = "Scaling" #: Currently provisioning resources without recreating VM image. + + +class ConfigurationState(str, Enum): + + not_applicable = "NotApplicable" #: User either hasn't started configuring their template +or they haven't started the configuration process. + completed = "Completed" #: User is finished modifying the template. + + +class LabUserAccessMode(str, Enum): + + restricted = "Restricted" #: Only users registered with the lab can access VMs. + open = "Open" #: Any user can register with the lab and access its VMs. + + +class AddRemove(str, Enum): + + add = "Add" #: Indicates that a user is adding a favorite lab + remove = "Remove" #: Indicates that a user is removing a favorite lab diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/network_interface.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/network_interface.py new file mode 100644 index 000000000000..e85b24980c9f --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/network_interface.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterface(Model): + """Network details of the environment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar private_ip_address: PrivateIp address of the Compute VM + :vartype private_ip_address: str + :ivar ssh_authority: Connection information for Linux + :vartype ssh_authority: str + :ivar rdp_authority: Connection information for Windows + :vartype rdp_authority: str + :ivar username: Username of the VM + :vartype username: str + """ + + _validation = { + 'private_ip_address': {'readonly': True}, + 'ssh_authority': {'readonly': True}, + 'rdp_authority': {'readonly': True}, + 'username': {'readonly': True}, + } + + _attribute_map = { + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'ssh_authority': {'key': 'sshAuthority', 'type': 'str'}, + 'rdp_authority': {'key': 'rdpAuthority', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkInterface, self).__init__(**kwargs) + self.private_ip_address = None + self.ssh_authority = None + self.rdp_authority = None + self.username = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/network_interface_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/network_interface_py3.py new file mode 100644 index 000000000000..1c39a57b6f5e --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/network_interface_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterface(Model): + """Network details of the environment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar private_ip_address: PrivateIp address of the Compute VM + :vartype private_ip_address: str + :ivar ssh_authority: Connection information for Linux + :vartype ssh_authority: str + :ivar rdp_authority: Connection information for Windows + :vartype rdp_authority: str + :ivar username: Username of the VM + :vartype username: str + """ + + _validation = { + 'private_ip_address': {'readonly': True}, + 'ssh_authority': {'readonly': True}, + 'rdp_authority': {'readonly': True}, + 'username': {'readonly': True}, + } + + _attribute_map = { + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'ssh_authority': {'key': 'sshAuthority', 'type': 'str'}, + 'rdp_authority': {'key': 'rdpAuthority', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(NetworkInterface, self).__init__(**kwargs) + self.private_ip_address = None + self.ssh_authority = None + self.rdp_authority = None + self.username = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_payload.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_payload.py new file mode 100644 index 000000000000..be790b18fc09 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_payload.py @@ -0,0 +1,34 @@ +# 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 OperationBatchStatusPayload(Model): + """Payload to get the status of an operation. + + All required parameters must be populated in order to send to Azure. + + :param urls: Required. The operation url of long running operation + :type urls: list[str] + """ + + _validation = { + 'urls': {'required': True}, + } + + _attribute_map = { + 'urls': {'key': 'urls', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(OperationBatchStatusPayload, self).__init__(**kwargs) + self.urls = kwargs.get('urls', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_payload_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_payload_py3.py new file mode 100644 index 000000000000..457e2b0eece5 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_payload_py3.py @@ -0,0 +1,34 @@ +# 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 OperationBatchStatusPayload(Model): + """Payload to get the status of an operation. + + All required parameters must be populated in order to send to Azure. + + :param urls: Required. The operation url of long running operation + :type urls: list[str] + """ + + _validation = { + 'urls': {'required': True}, + } + + _attribute_map = { + 'urls': {'key': 'urls', 'type': '[str]'}, + } + + def __init__(self, *, urls, **kwargs) -> None: + super(OperationBatchStatusPayload, self).__init__(**kwargs) + self.urls = urls diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_response.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_response.py new file mode 100644 index 000000000000..39e507e334af --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_response.py @@ -0,0 +1,37 @@ +# 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 OperationBatchStatusResponse(Model): + """Status Details of the long running operation for an environment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar items: Gets a collection of items that contain the operation url and + status. + :vartype items: + list[~azure.mgmt.labservices.models.OperationBatchStatusResponseItem] + """ + + _validation = { + 'items': {'readonly': True}, + } + + _attribute_map = { + 'items': {'key': 'items', 'type': '[OperationBatchStatusResponseItem]'}, + } + + def __init__(self, **kwargs): + super(OperationBatchStatusResponse, self).__init__(**kwargs) + self.items = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_response_item.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_response_item.py new file mode 100644 index 000000000000..1e4ddbb6a238 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_response_item.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 OperationBatchStatusResponseItem(Model): + """Represents the status of an operation that used the batch API. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar operation_url: status of the long running operation for an + environment + :vartype operation_url: str + :ivar status: status of the long running operation for an environment + :vartype status: str + """ + + _validation = { + 'operation_url': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'operation_url': {'key': 'operationUrl', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationBatchStatusResponseItem, self).__init__(**kwargs) + self.operation_url = None + self.status = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_response_item_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_response_item_py3.py new file mode 100644 index 000000000000..2c063e09aee0 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_response_item_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 OperationBatchStatusResponseItem(Model): + """Represents the status of an operation that used the batch API. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar operation_url: status of the long running operation for an + environment + :vartype operation_url: str + :ivar status: status of the long running operation for an environment + :vartype status: str + """ + + _validation = { + 'operation_url': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'operation_url': {'key': 'operationUrl', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationBatchStatusResponseItem, self).__init__(**kwargs) + self.operation_url = None + self.status = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_response_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_response_py3.py new file mode 100644 index 000000000000..77b561da09f8 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_batch_status_response_py3.py @@ -0,0 +1,37 @@ +# 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 OperationBatchStatusResponse(Model): + """Status Details of the long running operation for an environment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar items: Gets a collection of items that contain the operation url and + status. + :vartype items: + list[~azure.mgmt.labservices.models.OperationBatchStatusResponseItem] + """ + + _validation = { + 'items': {'readonly': True}, + } + + _attribute_map = { + 'items': {'key': 'items', 'type': '[OperationBatchStatusResponseItem]'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationBatchStatusResponse, self).__init__(**kwargs) + self.items = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_error.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_error.py new file mode 100644 index 000000000000..5ee1f80b2712 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_error.py @@ -0,0 +1,32 @@ +# 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 OperationError(Model): + """Error details for the operation in case of a failure. + + :param code: The error code of the operation error. + :type code: str + :param message: The error message of the operation error. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_error_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_error_py3.py new file mode 100644 index 000000000000..19c57b944297 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_error_py3.py @@ -0,0 +1,32 @@ +# 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 OperationError(Model): + """Error details for the operation in case of a failure. + + :param code: The error code of the operation error. + :type code: str + :param message: The error message of the operation error. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(OperationError, self).__init__(**kwargs) + self.code = code + self.message = message diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata.py new file mode 100644 index 000000000000..27fac9dfad61 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata.py @@ -0,0 +1,32 @@ +# 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 OperationMetadata(Model): + """The REST API operation supported by ManagedLab ResourceProvider. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that describes the operations + :type display: ~azure.mgmt.labservices.models.OperationMetadataDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationMetadataDisplay'}, + } + + def __init__(self, **kwargs): + super(OperationMetadata, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata_display.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata_display.py new file mode 100644 index 000000000000..c20b0b519d3e --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata_display.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 OperationMetadataDisplay(Model): + """The object that describes the operations. + + :param provider: Friendly name of the resource provider + :type provider: str + :param resource: Resource type on which the operation is performed. + :type resource: str + :param operation: Operation type: read, write, delete, listKeys/action, + etc. + :type operation: str + :param description: Friendly name of the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationMetadataDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata_display_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata_display_py3.py new file mode 100644 index 000000000000..a566cc55bfe8 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata_display_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 OperationMetadataDisplay(Model): + """The object that describes the operations. + + :param provider: Friendly name of the resource provider + :type provider: str + :param resource: Resource type on which the operation is performed. + :type resource: str + :param operation: Operation type: read, write, delete, listKeys/action, + etc. + :type operation: str + :param description: Friendly name of the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationMetadataDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata_paged.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata_paged.py new file mode 100644 index 000000000000..492b88426e8a --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata_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 OperationMetadataPaged(Paged): + """ + A paging container for iterating over a list of :class:`OperationMetadata ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OperationMetadata]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationMetadataPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata_py3.py new file mode 100644 index 000000000000..85c9bfdb59dc --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_metadata_py3.py @@ -0,0 +1,32 @@ +# 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 OperationMetadata(Model): + """The REST API operation supported by ManagedLab ResourceProvider. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that describes the operations + :type display: ~azure.mgmt.labservices.models.OperationMetadataDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationMetadataDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(OperationMetadata, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_result.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_result.py new file mode 100644 index 000000000000..658f846f2070 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_result.py @@ -0,0 +1,32 @@ +# 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 OperationResult(Model): + """An Operation Result. + + :param status: The operation status. + :type status: str + :param error: Error details for the operation in case of a failure. + :type error: ~azure.mgmt.labservices.models.OperationError + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'OperationError'}, + } + + def __init__(self, **kwargs): + super(OperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_result_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_result_py3.py new file mode 100644 index 000000000000..576ba6dd1e97 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_result_py3.py @@ -0,0 +1,32 @@ +# 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 OperationResult(Model): + """An Operation Result. + + :param status: The operation status. + :type status: str + :param error: Error details for the operation in case of a failure. + :type error: ~azure.mgmt.labservices.models.OperationError + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'OperationError'}, + } + + def __init__(self, *, status: str=None, error=None, **kwargs) -> None: + super(OperationResult, self).__init__(**kwargs) + self.status = status + self.error = error diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_status_payload.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_status_payload.py new file mode 100644 index 000000000000..a85e15804143 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_status_payload.py @@ -0,0 +1,35 @@ +# 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 OperationStatusPayload(Model): + """Payload to get the status of an operation. + + All required parameters must be populated in order to send to Azure. + + :param operation_url: Required. The operation url of long running + operation + :type operation_url: str + """ + + _validation = { + 'operation_url': {'required': True}, + } + + _attribute_map = { + 'operation_url': {'key': 'operationUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationStatusPayload, self).__init__(**kwargs) + self.operation_url = kwargs.get('operation_url', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_status_payload_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_status_payload_py3.py new file mode 100644 index 000000000000..0734f92a52c7 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_status_payload_py3.py @@ -0,0 +1,35 @@ +# 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 OperationStatusPayload(Model): + """Payload to get the status of an operation. + + All required parameters must be populated in order to send to Azure. + + :param operation_url: Required. The operation url of long running + operation + :type operation_url: str + """ + + _validation = { + 'operation_url': {'required': True}, + } + + _attribute_map = { + 'operation_url': {'key': 'operationUrl', 'type': 'str'}, + } + + def __init__(self, *, operation_url: str, **kwargs) -> None: + super(OperationStatusPayload, self).__init__(**kwargs) + self.operation_url = operation_url diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_status_response.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_status_response.py new file mode 100644 index 000000000000..9d1eae6fa35b --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_status_response.py @@ -0,0 +1,35 @@ +# 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 OperationStatusResponse(Model): + """Status Details of the long running operation for an environment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: status of the long running operation for an environment + :vartype status: str + """ + + _validation = { + 'status': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationStatusResponse, self).__init__(**kwargs) + self.status = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_status_response_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_status_response_py3.py new file mode 100644 index 000000000000..706880003394 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/operation_status_response_py3.py @@ -0,0 +1,35 @@ +# 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 OperationStatusResponse(Model): + """Status Details of the long running operation for an environment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: status of the long running operation for an environment + :vartype status: str + """ + + _validation = { + 'status': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationStatusResponse, self).__init__(**kwargs) + self.status = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/personal_perferences_operations_payload.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/personal_perferences_operations_payload.py new file mode 100644 index 000000000000..785f512009ec --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/personal_perferences_operations_payload.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 PersonalPerferencesOperationsPayload(Model): + """Represents payload for any Environment operations like get, start, stop, + connect. + + :param lab_account_resource_id: Resource Id of the lab account + :type lab_account_resource_id: str + :param add_remove: Enum indicating if user is adding or removing a + favorite lab. Possible values include: 'Add', 'Remove' + :type add_remove: str or ~azure.mgmt.labservices.models.AddRemove + :param lab_resource_id: Resource Id of the lab to add/remove from the + favorites list + :type lab_resource_id: str + """ + + _attribute_map = { + 'lab_account_resource_id': {'key': 'labAccountResourceId', 'type': 'str'}, + 'add_remove': {'key': 'addRemove', 'type': 'str'}, + 'lab_resource_id': {'key': 'labResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PersonalPerferencesOperationsPayload, self).__init__(**kwargs) + self.lab_account_resource_id = kwargs.get('lab_account_resource_id', None) + self.add_remove = kwargs.get('add_remove', None) + self.lab_resource_id = kwargs.get('lab_resource_id', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/personal_perferences_operations_payload_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/personal_perferences_operations_payload_py3.py new file mode 100644 index 000000000000..0f98d1f27109 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/personal_perferences_operations_payload_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 PersonalPerferencesOperationsPayload(Model): + """Represents payload for any Environment operations like get, start, stop, + connect. + + :param lab_account_resource_id: Resource Id of the lab account + :type lab_account_resource_id: str + :param add_remove: Enum indicating if user is adding or removing a + favorite lab. Possible values include: 'Add', 'Remove' + :type add_remove: str or ~azure.mgmt.labservices.models.AddRemove + :param lab_resource_id: Resource Id of the lab to add/remove from the + favorites list + :type lab_resource_id: str + """ + + _attribute_map = { + 'lab_account_resource_id': {'key': 'labAccountResourceId', 'type': 'str'}, + 'add_remove': {'key': 'addRemove', 'type': 'str'}, + 'lab_resource_id': {'key': 'labResourceId', 'type': 'str'}, + } + + def __init__(self, *, lab_account_resource_id: str=None, add_remove=None, lab_resource_id: str=None, **kwargs) -> None: + super(PersonalPerferencesOperationsPayload, self).__init__(**kwargs) + self.lab_account_resource_id = lab_account_resource_id + self.add_remove = add_remove + self.lab_resource_id = lab_resource_id diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/publish_payload.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/publish_payload.py new file mode 100644 index 000000000000..08a2c2e55240 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/publish_payload.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 PublishPayload(Model): + """Payload for Publish operation on EnvironmentSetting. + + :param use_existing_image: Whether to use existing VM custom image when + publishing. + :type use_existing_image: bool + """ + + _attribute_map = { + 'use_existing_image': {'key': 'useExistingImage', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(PublishPayload, self).__init__(**kwargs) + self.use_existing_image = kwargs.get('use_existing_image', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/publish_payload_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/publish_payload_py3.py new file mode 100644 index 000000000000..414ac442de84 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/publish_payload_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 PublishPayload(Model): + """Payload for Publish operation on EnvironmentSetting. + + :param use_existing_image: Whether to use existing VM custom image when + publishing. + :type use_existing_image: bool + """ + + _attribute_map = { + 'use_existing_image': {'key': 'useExistingImage', 'type': 'bool'}, + } + + def __init__(self, *, use_existing_image: bool=None, **kwargs) -> None: + super(PublishPayload, self).__init__(**kwargs) + self.use_existing_image = use_existing_image diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm.py new file mode 100644 index 000000000000..1fdb9cb86be5 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm.py @@ -0,0 +1,53 @@ +# 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 ReferenceVm(Model): + """Details of a Reference Vm. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param user_name: Required. The username of the virtual machine + :type user_name: str + :param password: The password of the virtual machine. This will be set to + null in GET resource API + :type password: str + :ivar vm_state_details: The state details for the reference virtual + machine. + :vartype vm_state_details: ~azure.mgmt.labservices.models.VmStateDetails + :ivar vm_resource_id: VM resource Id for the environment + :vartype vm_resource_id: str + """ + + _validation = { + 'user_name': {'required': True}, + 'vm_state_details': {'readonly': True}, + 'vm_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'vm_state_details': {'key': 'vmStateDetails', 'type': 'VmStateDetails'}, + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ReferenceVm, self).__init__(**kwargs) + self.user_name = kwargs.get('user_name', None) + self.password = kwargs.get('password', None) + self.vm_state_details = None + self.vm_resource_id = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_creation_parameters.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_creation_parameters.py new file mode 100644 index 000000000000..f31b53dd2436 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_creation_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 ReferenceVmCreationParameters(Model): + """Creation parameters for Reference Vm. + + All required parameters must be populated in order to send to Azure. + + :param user_name: Required. The username of the virtual machine + :type user_name: str + :param password: Required. The password of the virtual machine. + :type password: str + """ + + _validation = { + 'user_name': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ReferenceVmCreationParameters, self).__init__(**kwargs) + self.user_name = kwargs.get('user_name', None) + self.password = kwargs.get('password', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_creation_parameters_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_creation_parameters_py3.py new file mode 100644 index 000000000000..780e1703546d --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_creation_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 ReferenceVmCreationParameters(Model): + """Creation parameters for Reference Vm. + + All required parameters must be populated in order to send to Azure. + + :param user_name: Required. The username of the virtual machine + :type user_name: str + :param password: Required. The password of the virtual machine. + :type password: str + """ + + _validation = { + 'user_name': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, user_name: str, password: str, **kwargs) -> None: + super(ReferenceVmCreationParameters, self).__init__(**kwargs) + self.user_name = user_name + self.password = password diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_fragment.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_fragment.py new file mode 100644 index 000000000000..06a58e0b9810 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_fragment.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 ReferenceVmFragment(Model): + """Details of a Reference Vm. + + :param user_name: The username of the virtual machine + :type user_name: str + :param password: The password of the virtual machine. This will be set to + null in GET resource API + :type password: str + """ + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ReferenceVmFragment, self).__init__(**kwargs) + self.user_name = kwargs.get('user_name', None) + self.password = kwargs.get('password', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_fragment_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_fragment_py3.py new file mode 100644 index 000000000000..d00b2ac53111 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_fragment_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 ReferenceVmFragment(Model): + """Details of a Reference Vm. + + :param user_name: The username of the virtual machine + :type user_name: str + :param password: The password of the virtual machine. This will be set to + null in GET resource API + :type password: str + """ + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, user_name: str=None, password: str=None, **kwargs) -> None: + super(ReferenceVmFragment, self).__init__(**kwargs) + self.user_name = user_name + self.password = password diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_py3.py new file mode 100644 index 000000000000..802d4e589372 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/reference_vm_py3.py @@ -0,0 +1,53 @@ +# 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 ReferenceVm(Model): + """Details of a Reference Vm. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param user_name: Required. The username of the virtual machine + :type user_name: str + :param password: The password of the virtual machine. This will be set to + null in GET resource API + :type password: str + :ivar vm_state_details: The state details for the reference virtual + machine. + :vartype vm_state_details: ~azure.mgmt.labservices.models.VmStateDetails + :ivar vm_resource_id: VM resource Id for the environment + :vartype vm_resource_id: str + """ + + _validation = { + 'user_name': {'required': True}, + 'vm_state_details': {'readonly': True}, + 'vm_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'vm_state_details': {'key': 'vmStateDetails', 'type': 'VmStateDetails'}, + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + } + + def __init__(self, *, user_name: str, password: str=None, **kwargs) -> None: + super(ReferenceVm, self).__init__(**kwargs) + self.user_name = user_name + self.password = password + self.vm_state_details = None + self.vm_resource_id = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/regional_availability.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/regional_availability.py new file mode 100644 index 000000000000..989f34ed1056 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/regional_availability.py @@ -0,0 +1,34 @@ +# 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 RegionalAvailability(Model): + """The availability information of sizes across regions. + + :param region: Corresponding region + :type region: str + :param size_availabilities: List of all the size information for the + region + :type size_availabilities: + list[~azure.mgmt.labservices.models.SizeAvailability] + """ + + _attribute_map = { + 'region': {'key': 'region', 'type': 'str'}, + 'size_availabilities': {'key': 'sizeAvailabilities', 'type': '[SizeAvailability]'}, + } + + def __init__(self, **kwargs): + super(RegionalAvailability, self).__init__(**kwargs) + self.region = kwargs.get('region', None) + self.size_availabilities = kwargs.get('size_availabilities', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/regional_availability_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/regional_availability_py3.py new file mode 100644 index 000000000000..cb11cf25a3b4 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/regional_availability_py3.py @@ -0,0 +1,34 @@ +# 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 RegionalAvailability(Model): + """The availability information of sizes across regions. + + :param region: Corresponding region + :type region: str + :param size_availabilities: List of all the size information for the + region + :type size_availabilities: + list[~azure.mgmt.labservices.models.SizeAvailability] + """ + + _attribute_map = { + 'region': {'key': 'region', 'type': 'str'}, + 'size_availabilities': {'key': 'sizeAvailabilities', 'type': '[SizeAvailability]'}, + } + + def __init__(self, *, region: str=None, size_availabilities=None, **kwargs) -> None: + super(RegionalAvailability, self).__init__(**kwargs) + self.region = region + self.size_availabilities = size_availabilities diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/register_payload.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/register_payload.py new file mode 100644 index 000000000000..9b4881e43759 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/register_payload.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 RegisterPayload(Model): + """Represents payload for Register action. + + :param registration_code: The registration code of the lab. + :type registration_code: str + """ + + _attribute_map = { + 'registration_code': {'key': 'registrationCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegisterPayload, self).__init__(**kwargs) + self.registration_code = kwargs.get('registration_code', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/register_payload_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/register_payload_py3.py new file mode 100644 index 000000000000..45b5818601b9 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/register_payload_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 RegisterPayload(Model): + """Represents payload for Register action. + + :param registration_code: The registration code of the lab. + :type registration_code: str + """ + + _attribute_map = { + 'registration_code': {'key': 'registrationCode', 'type': 'str'}, + } + + def __init__(self, *, registration_code: str=None, **kwargs) -> None: + super(RegisterPayload, self).__init__(**kwargs) + self.registration_code = registration_code diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/reset_password_payload.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/reset_password_payload.py new file mode 100644 index 000000000000..d4522d8b96e2 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/reset_password_payload.py @@ -0,0 +1,42 @@ +# 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 ResetPasswordPayload(Model): + """Represents the payload for resetting passwords. + + All required parameters must be populated in order to send to Azure. + + :param environment_id: Required. The resourceId of the environment + :type environment_id: str + :param username: The username for which the password will be reset. + :type username: str + :param password: The password to assign to the user specified in + :type password: str + """ + + _validation = { + 'environment_id': {'required': True}, + } + + _attribute_map = { + 'environment_id': {'key': 'environmentId', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResetPasswordPayload, self).__init__(**kwargs) + self.environment_id = kwargs.get('environment_id', None) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/reset_password_payload_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/reset_password_payload_py3.py new file mode 100644 index 000000000000..22f4e438de34 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/reset_password_payload_py3.py @@ -0,0 +1,42 @@ +# 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 ResetPasswordPayload(Model): + """Represents the payload for resetting passwords. + + All required parameters must be populated in order to send to Azure. + + :param environment_id: Required. The resourceId of the environment + :type environment_id: str + :param username: The username for which the password will be reset. + :type username: str + :param password: The password to assign to the user specified in + :type password: str + """ + + _validation = { + 'environment_id': {'required': True}, + } + + _attribute_map = { + 'environment_id': {'key': 'environmentId', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, environment_id: str, username: str=None, password: str=None, **kwargs) -> None: + super(ResetPasswordPayload, self).__init__(**kwargs) + self.environment_id = environment_id + self.username = username + self.password = password diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/resource.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource.py new file mode 100644 index 000000000000..f25b57698413 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource.py @@ -0,0 +1,53 @@ +# 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): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_py3.py new file mode 100644 index 000000000000..e59df581aa79 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_py3.py @@ -0,0 +1,53 @@ +# 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): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_set.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_set.py new file mode 100644 index 000000000000..46c8f339a894 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_set.py @@ -0,0 +1,32 @@ +# 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 ResourceSet(Model): + """Represents a VM and the setting Id it was created for. + + :param vm_resource_id: VM resource Id for the environment + :type vm_resource_id: str + :param resource_setting_id: resourceSettingId for the environment + :type resource_setting_id: str + """ + + _attribute_map = { + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + 'resource_setting_id': {'key': 'resourceSettingId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceSet, self).__init__(**kwargs) + self.vm_resource_id = kwargs.get('vm_resource_id', None) + self.resource_setting_id = kwargs.get('resource_setting_id', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_set_fragment.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_set_fragment.py new file mode 100644 index 000000000000..5e5c9607332c --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_set_fragment.py @@ -0,0 +1,32 @@ +# 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 ResourceSetFragment(Model): + """Represents a VM and the setting Id it was created for. + + :param vm_resource_id: VM resource Id for the environment + :type vm_resource_id: str + :param resource_setting_id: resourceSettingId for the environment + :type resource_setting_id: str + """ + + _attribute_map = { + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + 'resource_setting_id': {'key': 'resourceSettingId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceSetFragment, self).__init__(**kwargs) + self.vm_resource_id = kwargs.get('vm_resource_id', None) + self.resource_setting_id = kwargs.get('resource_setting_id', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_set_fragment_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_set_fragment_py3.py new file mode 100644 index 000000000000..7685f707cc4c --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_set_fragment_py3.py @@ -0,0 +1,32 @@ +# 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 ResourceSetFragment(Model): + """Represents a VM and the setting Id it was created for. + + :param vm_resource_id: VM resource Id for the environment + :type vm_resource_id: str + :param resource_setting_id: resourceSettingId for the environment + :type resource_setting_id: str + """ + + _attribute_map = { + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + 'resource_setting_id': {'key': 'resourceSettingId', 'type': 'str'}, + } + + def __init__(self, *, vm_resource_id: str=None, resource_setting_id: str=None, **kwargs) -> None: + super(ResourceSetFragment, self).__init__(**kwargs) + self.vm_resource_id = vm_resource_id + self.resource_setting_id = resource_setting_id diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_set_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_set_py3.py new file mode 100644 index 000000000000..4576f681bdf8 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_set_py3.py @@ -0,0 +1,32 @@ +# 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 ResourceSet(Model): + """Represents a VM and the setting Id it was created for. + + :param vm_resource_id: VM resource Id for the environment + :type vm_resource_id: str + :param resource_setting_id: resourceSettingId for the environment + :type resource_setting_id: str + """ + + _attribute_map = { + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + 'resource_setting_id': {'key': 'resourceSettingId', 'type': 'str'}, + } + + def __init__(self, *, vm_resource_id: str=None, resource_setting_id: str=None, **kwargs) -> None: + super(ResourceSet, self).__init__(**kwargs) + self.vm_resource_id = vm_resource_id + self.resource_setting_id = resource_setting_id diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_setting_creation_parameters.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_setting_creation_parameters.py new file mode 100644 index 000000000000..9db4e8e1fea8 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_setting_creation_parameters.py @@ -0,0 +1,55 @@ +# 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 ResourceSettingCreationParameters(Model): + """Represents resource specific settings. + + All required parameters must be populated in order to send to Azure. + + :param location: The location where the virtual machine will live + :type location: str + :param name: The name of the resource setting + :type name: str + :param gallery_image_resource_id: Required. The resource id of the gallery + image used for creating the virtual machine + :type gallery_image_resource_id: str + :param size: The size of the virtual machine. Possible values include: + 'Basic', 'Standard', 'Performance' + :type size: str or ~azure.mgmt.labservices.models.ManagedLabVmSize + :param reference_vm_creation_parameters: Required. Creation parameters for + Reference Vm + :type reference_vm_creation_parameters: + ~azure.mgmt.labservices.models.ReferenceVmCreationParameters + """ + + _validation = { + 'gallery_image_resource_id': {'required': True}, + 'reference_vm_creation_parameters': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'gallery_image_resource_id': {'key': 'galleryImageResourceId', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'reference_vm_creation_parameters': {'key': 'referenceVmCreationParameters', 'type': 'ReferenceVmCreationParameters'}, + } + + def __init__(self, **kwargs): + super(ResourceSettingCreationParameters, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.name = kwargs.get('name', None) + self.gallery_image_resource_id = kwargs.get('gallery_image_resource_id', None) + self.size = kwargs.get('size', None) + self.reference_vm_creation_parameters = kwargs.get('reference_vm_creation_parameters', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_setting_creation_parameters_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_setting_creation_parameters_py3.py new file mode 100644 index 000000000000..b64e493ef95f --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_setting_creation_parameters_py3.py @@ -0,0 +1,55 @@ +# 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 ResourceSettingCreationParameters(Model): + """Represents resource specific settings. + + All required parameters must be populated in order to send to Azure. + + :param location: The location where the virtual machine will live + :type location: str + :param name: The name of the resource setting + :type name: str + :param gallery_image_resource_id: Required. The resource id of the gallery + image used for creating the virtual machine + :type gallery_image_resource_id: str + :param size: The size of the virtual machine. Possible values include: + 'Basic', 'Standard', 'Performance' + :type size: str or ~azure.mgmt.labservices.models.ManagedLabVmSize + :param reference_vm_creation_parameters: Required. Creation parameters for + Reference Vm + :type reference_vm_creation_parameters: + ~azure.mgmt.labservices.models.ReferenceVmCreationParameters + """ + + _validation = { + 'gallery_image_resource_id': {'required': True}, + 'reference_vm_creation_parameters': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'gallery_image_resource_id': {'key': 'galleryImageResourceId', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'reference_vm_creation_parameters': {'key': 'referenceVmCreationParameters', 'type': 'ReferenceVmCreationParameters'}, + } + + def __init__(self, *, gallery_image_resource_id: str, reference_vm_creation_parameters, location: str=None, name: str=None, size=None, **kwargs) -> None: + super(ResourceSettingCreationParameters, self).__init__(**kwargs) + self.location = location + self.name = name + self.gallery_image_resource_id = gallery_image_resource_id + self.size = size + self.reference_vm_creation_parameters = reference_vm_creation_parameters diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_settings.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_settings.py new file mode 100644 index 000000000000..eefadba0d7df --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_settings.py @@ -0,0 +1,63 @@ +# 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 ResourceSettings(Model): + """Represents resource specific settings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The unique id of the resource setting + :vartype id: str + :param gallery_image_resource_id: The resource id of the gallery image + used for creating the virtual machine + :type gallery_image_resource_id: str + :ivar image_name: The name of the image used to created the environment + setting + :vartype image_name: str + :param size: The size of the virtual machine. Possible values include: + 'Basic', 'Standard', 'Performance' + :type size: str or ~azure.mgmt.labservices.models.ManagedLabVmSize + :ivar cores: The translated compute cores of the virtual machine + :vartype cores: int + :param reference_vm: Required. Details specific to Reference Vm + :type reference_vm: ~azure.mgmt.labservices.models.ReferenceVm + """ + + _validation = { + 'id': {'readonly': True}, + 'image_name': {'readonly': True}, + 'cores': {'readonly': True}, + 'reference_vm': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'gallery_image_resource_id': {'key': 'galleryImageResourceId', 'type': 'str'}, + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'cores': {'key': 'cores', 'type': 'int'}, + 'reference_vm': {'key': 'referenceVm', 'type': 'ReferenceVm'}, + } + + def __init__(self, **kwargs): + super(ResourceSettings, self).__init__(**kwargs) + self.id = None + self.gallery_image_resource_id = kwargs.get('gallery_image_resource_id', None) + self.image_name = None + self.size = kwargs.get('size', None) + self.cores = None + self.reference_vm = kwargs.get('reference_vm', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_settings_fragment.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_settings_fragment.py new file mode 100644 index 000000000000..fca7a4cd5f3f --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_settings_fragment.py @@ -0,0 +1,38 @@ +# 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 ResourceSettingsFragment(Model): + """Represents resource specific settings. + + :param gallery_image_resource_id: The resource id of the gallery image + used for creating the virtual machine + :type gallery_image_resource_id: str + :param size: The size of the virtual machine. Possible values include: + 'Basic', 'Standard', 'Performance' + :type size: str or ~azure.mgmt.labservices.models.ManagedLabVmSize + :param reference_vm: Details specific to Reference Vm + :type reference_vm: ~azure.mgmt.labservices.models.ReferenceVmFragment + """ + + _attribute_map = { + 'gallery_image_resource_id': {'key': 'galleryImageResourceId', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'reference_vm': {'key': 'referenceVm', 'type': 'ReferenceVmFragment'}, + } + + def __init__(self, **kwargs): + super(ResourceSettingsFragment, self).__init__(**kwargs) + self.gallery_image_resource_id = kwargs.get('gallery_image_resource_id', None) + self.size = kwargs.get('size', None) + self.reference_vm = kwargs.get('reference_vm', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_settings_fragment_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_settings_fragment_py3.py new file mode 100644 index 000000000000..f896caa9c4fb --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_settings_fragment_py3.py @@ -0,0 +1,38 @@ +# 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 ResourceSettingsFragment(Model): + """Represents resource specific settings. + + :param gallery_image_resource_id: The resource id of the gallery image + used for creating the virtual machine + :type gallery_image_resource_id: str + :param size: The size of the virtual machine. Possible values include: + 'Basic', 'Standard', 'Performance' + :type size: str or ~azure.mgmt.labservices.models.ManagedLabVmSize + :param reference_vm: Details specific to Reference Vm + :type reference_vm: ~azure.mgmt.labservices.models.ReferenceVmFragment + """ + + _attribute_map = { + 'gallery_image_resource_id': {'key': 'galleryImageResourceId', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'reference_vm': {'key': 'referenceVm', 'type': 'ReferenceVmFragment'}, + } + + def __init__(self, *, gallery_image_resource_id: str=None, size=None, reference_vm=None, **kwargs) -> None: + super(ResourceSettingsFragment, self).__init__(**kwargs) + self.gallery_image_resource_id = gallery_image_resource_id + self.size = size + self.reference_vm = reference_vm diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_settings_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_settings_py3.py new file mode 100644 index 000000000000..9199b8d69cd3 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/resource_settings_py3.py @@ -0,0 +1,63 @@ +# 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 ResourceSettings(Model): + """Represents resource specific settings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The unique id of the resource setting + :vartype id: str + :param gallery_image_resource_id: The resource id of the gallery image + used for creating the virtual machine + :type gallery_image_resource_id: str + :ivar image_name: The name of the image used to created the environment + setting + :vartype image_name: str + :param size: The size of the virtual machine. Possible values include: + 'Basic', 'Standard', 'Performance' + :type size: str or ~azure.mgmt.labservices.models.ManagedLabVmSize + :ivar cores: The translated compute cores of the virtual machine + :vartype cores: int + :param reference_vm: Required. Details specific to Reference Vm + :type reference_vm: ~azure.mgmt.labservices.models.ReferenceVm + """ + + _validation = { + 'id': {'readonly': True}, + 'image_name': {'readonly': True}, + 'cores': {'readonly': True}, + 'reference_vm': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'gallery_image_resource_id': {'key': 'galleryImageResourceId', 'type': 'str'}, + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'cores': {'key': 'cores', 'type': 'int'}, + 'reference_vm': {'key': 'referenceVm', 'type': 'ReferenceVm'}, + } + + def __init__(self, *, reference_vm, gallery_image_resource_id: str=None, size=None, **kwargs) -> None: + super(ResourceSettings, self).__init__(**kwargs) + self.id = None + self.gallery_image_resource_id = gallery_image_resource_id + self.image_name = None + self.size = size + self.cores = None + self.reference_vm = reference_vm diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/size_availability.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_availability.py new file mode 100644 index 000000000000..ee8d5b424130 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_availability.py @@ -0,0 +1,34 @@ +# 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 SizeAvailability(Model): + """Represents the size information. + + :param size_category: The category of the size (Basic, Standard, + Performance). Possible values include: 'Basic', 'Standard', 'Performance' + :type size_category: str or + ~azure.mgmt.labservices.models.ManagedLabVmSize + :param is_available: Whether or not this size category is available + :type is_available: bool + """ + + _attribute_map = { + 'size_category': {'key': 'sizeCategory', 'type': 'str'}, + 'is_available': {'key': 'isAvailable', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SizeAvailability, self).__init__(**kwargs) + self.size_category = kwargs.get('size_category', None) + self.is_available = kwargs.get('is_available', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/size_availability_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_availability_py3.py new file mode 100644 index 000000000000..398efa071812 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_availability_py3.py @@ -0,0 +1,34 @@ +# 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 SizeAvailability(Model): + """Represents the size information. + + :param size_category: The category of the size (Basic, Standard, + Performance). Possible values include: 'Basic', 'Standard', 'Performance' + :type size_category: str or + ~azure.mgmt.labservices.models.ManagedLabVmSize + :param is_available: Whether or not this size category is available + :type is_available: bool + """ + + _attribute_map = { + 'size_category': {'key': 'sizeCategory', 'type': 'str'}, + 'is_available': {'key': 'isAvailable', 'type': 'bool'}, + } + + def __init__(self, *, size_category=None, is_available: bool=None, **kwargs) -> None: + super(SizeAvailability, self).__init__(**kwargs) + self.size_category = size_category + self.is_available = is_available diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/size_configuration_properties.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_configuration_properties.py new file mode 100644 index 000000000000..13dcc52d45a4 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_configuration_properties.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SizeConfigurationProperties(Model): + """Represents the size configuration under the lab account. + + :param environment_sizes: Represents a list of size categories supported + by this Lab Account (Small, Medium, Large) + :type environment_sizes: + list[~azure.mgmt.labservices.models.EnvironmentSize] + """ + + _attribute_map = { + 'environment_sizes': {'key': 'environmentSizes', 'type': '[EnvironmentSize]'}, + } + + def __init__(self, **kwargs): + super(SizeConfigurationProperties, self).__init__(**kwargs) + self.environment_sizes = kwargs.get('environment_sizes', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/size_configuration_properties_fragment.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_configuration_properties_fragment.py new file mode 100644 index 000000000000..eb7eff82c145 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_configuration_properties_fragment.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SizeConfigurationPropertiesFragment(Model): + """Represents the size configuration under the lab account. + + :param environment_sizes: Represents a list of size categories supported + by this Lab Account (Small, Medium, Large) + :type environment_sizes: + list[~azure.mgmt.labservices.models.EnvironmentSizeFragment] + """ + + _attribute_map = { + 'environment_sizes': {'key': 'environmentSizes', 'type': '[EnvironmentSizeFragment]'}, + } + + def __init__(self, **kwargs): + super(SizeConfigurationPropertiesFragment, self).__init__(**kwargs) + self.environment_sizes = kwargs.get('environment_sizes', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/size_configuration_properties_fragment_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_configuration_properties_fragment_py3.py new file mode 100644 index 000000000000..97adc249de04 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_configuration_properties_fragment_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SizeConfigurationPropertiesFragment(Model): + """Represents the size configuration under the lab account. + + :param environment_sizes: Represents a list of size categories supported + by this Lab Account (Small, Medium, Large) + :type environment_sizes: + list[~azure.mgmt.labservices.models.EnvironmentSizeFragment] + """ + + _attribute_map = { + 'environment_sizes': {'key': 'environmentSizes', 'type': '[EnvironmentSizeFragment]'}, + } + + def __init__(self, *, environment_sizes=None, **kwargs) -> None: + super(SizeConfigurationPropertiesFragment, self).__init__(**kwargs) + self.environment_sizes = environment_sizes diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/size_configuration_properties_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_configuration_properties_py3.py new file mode 100644 index 000000000000..b8f4af4d2a24 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_configuration_properties_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SizeConfigurationProperties(Model): + """Represents the size configuration under the lab account. + + :param environment_sizes: Represents a list of size categories supported + by this Lab Account (Small, Medium, Large) + :type environment_sizes: + list[~azure.mgmt.labservices.models.EnvironmentSize] + """ + + _attribute_map = { + 'environment_sizes': {'key': 'environmentSizes', 'type': '[EnvironmentSize]'}, + } + + def __init__(self, *, environment_sizes=None, **kwargs) -> None: + super(SizeConfigurationProperties, self).__init__(**kwargs) + self.environment_sizes = environment_sizes diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/size_info.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_info.py new file mode 100644 index 000000000000..62a8e7df716c --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_info.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SizeInfo(Model): + """Contains detailed information about a size. + + :param compute_size: Represents the actual compute size, e.g. + Standard_A2_v2. + :type compute_size: str + :param price: The pay-as-you-go price per hour this size will cost. It + does not include discounts and may not reflect the actual price the size + will cost. + :type price: decimal.Decimal + :param number_of_cores: The number of cores a VM of this size has. + :type number_of_cores: int + :param memory: The amount of memory available (in GB). + :type memory: float + """ + + _attribute_map = { + 'compute_size': {'key': 'computeSize', 'type': 'str'}, + 'price': {'key': 'price', 'type': 'decimal'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'memory': {'key': 'memory', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(SizeInfo, self).__init__(**kwargs) + self.compute_size = kwargs.get('compute_size', None) + self.price = kwargs.get('price', None) + self.number_of_cores = kwargs.get('number_of_cores', None) + self.memory = kwargs.get('memory', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/size_info_fragment.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_info_fragment.py new file mode 100644 index 000000000000..5b82e28a6a9b --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_info_fragment.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SizeInfoFragment(Model): + """Contains detailed information about a size. + + :param compute_size: Represents the actual compute size, e.g. + Standard_A2_v2. + :type compute_size: str + :param price: The pay-as-you-go price per hour this size will cost. It + does not include discounts and may not reflect the actual price the size + will cost. + :type price: decimal.Decimal + :param number_of_cores: The number of cores a VM of this size has. + :type number_of_cores: int + :param memory: The amount of memory available (in GB). + :type memory: float + """ + + _attribute_map = { + 'compute_size': {'key': 'computeSize', 'type': 'str'}, + 'price': {'key': 'price', 'type': 'decimal'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'memory': {'key': 'memory', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(SizeInfoFragment, self).__init__(**kwargs) + self.compute_size = kwargs.get('compute_size', None) + self.price = kwargs.get('price', None) + self.number_of_cores = kwargs.get('number_of_cores', None) + self.memory = kwargs.get('memory', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/size_info_fragment_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_info_fragment_py3.py new file mode 100644 index 000000000000..4fc27b1010ba --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_info_fragment_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SizeInfoFragment(Model): + """Contains detailed information about a size. + + :param compute_size: Represents the actual compute size, e.g. + Standard_A2_v2. + :type compute_size: str + :param price: The pay-as-you-go price per hour this size will cost. It + does not include discounts and may not reflect the actual price the size + will cost. + :type price: decimal.Decimal + :param number_of_cores: The number of cores a VM of this size has. + :type number_of_cores: int + :param memory: The amount of memory available (in GB). + :type memory: float + """ + + _attribute_map = { + 'compute_size': {'key': 'computeSize', 'type': 'str'}, + 'price': {'key': 'price', 'type': 'decimal'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'memory': {'key': 'memory', 'type': 'float'}, + } + + def __init__(self, *, compute_size: str=None, price=None, number_of_cores: int=None, memory: float=None, **kwargs) -> None: + super(SizeInfoFragment, self).__init__(**kwargs) + self.compute_size = compute_size + self.price = price + self.number_of_cores = number_of_cores + self.memory = memory diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/size_info_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_info_py3.py new file mode 100644 index 000000000000..f09fcbfcfce0 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/size_info_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SizeInfo(Model): + """Contains detailed information about a size. + + :param compute_size: Represents the actual compute size, e.g. + Standard_A2_v2. + :type compute_size: str + :param price: The pay-as-you-go price per hour this size will cost. It + does not include discounts and may not reflect the actual price the size + will cost. + :type price: decimal.Decimal + :param number_of_cores: The number of cores a VM of this size has. + :type number_of_cores: int + :param memory: The amount of memory available (in GB). + :type memory: float + """ + + _attribute_map = { + 'compute_size': {'key': 'computeSize', 'type': 'str'}, + 'price': {'key': 'price', 'type': 'decimal'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'memory': {'key': 'memory', 'type': 'float'}, + } + + def __init__(self, *, compute_size: str=None, price=None, number_of_cores: int=None, memory: float=None, **kwargs) -> None: + super(SizeInfo, self).__init__(**kwargs) + self.compute_size = compute_size + self.price = price + self.number_of_cores = number_of_cores + self.memory = memory diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/user.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/user.py new file mode 100644 index 000000000000..503d524d43af --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/user.py @@ -0,0 +1,93 @@ +# 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 User(Resource): + """The User registered to a lab. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar email: The user email address, as it was specified during + registration. + :vartype email: str + :ivar family_name: The user family name, as it was specified during + registration. + :vartype family_name: str + :ivar given_name: The user given name, as it was specified during + registration. + :vartype given_name: str + :ivar tenant_id: The user tenant ID, as it was specified during + registration. + :vartype tenant_id: str + :ivar total_usage: How long the user has used his VMs in this lab + :vartype total_usage: timedelta + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + :ivar latest_operation_result: The details of the latest operation. ex: + status, error + :vartype latest_operation_result: + ~azure.mgmt.labservices.models.LatestOperationResult + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'email': {'readonly': True}, + 'family_name': {'readonly': True}, + 'given_name': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'total_usage': {'readonly': True}, + 'latest_operation_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + 'family_name': {'key': 'properties.familyName', 'type': 'str'}, + 'given_name': {'key': 'properties.givenName', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'total_usage': {'key': 'properties.totalUsage', 'type': 'duration'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + 'latest_operation_result': {'key': 'properties.latestOperationResult', 'type': 'LatestOperationResult'}, + } + + def __init__(self, **kwargs): + super(User, self).__init__(**kwargs) + self.email = None + self.family_name = None + self.given_name = None + self.tenant_id = None + self.total_usage = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.unique_identifier = kwargs.get('unique_identifier', None) + self.latest_operation_result = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/user_fragment.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/user_fragment.py new file mode 100644 index 000000000000..93ceed68d4b8 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/user_fragment.py @@ -0,0 +1,57 @@ +# 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 UserFragment(Resource): + """The User registered to a lab. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserFragment, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.unique_identifier = kwargs.get('unique_identifier', None) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/user_fragment_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/user_fragment_py3.py new file mode 100644 index 000000000000..7e3693f6298e --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/user_fragment_py3.py @@ -0,0 +1,57 @@ +# 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 UserFragment(Resource): + """The User registered to a lab. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, provisioning_state: str=None, unique_identifier: str=None, **kwargs) -> None: + super(UserFragment, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.unique_identifier = unique_identifier diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/user_paged.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/user_paged.py new file mode 100644 index 000000000000..aa983f616850 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/user_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 UserPaged(Paged): + """ + A paging container for iterating over a list of :class:`User ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[User]'} + } + + def __init__(self, *args, **kwargs): + + super(UserPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/user_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/user_py3.py new file mode 100644 index 000000000000..2f33a78c0056 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/user_py3.py @@ -0,0 +1,93 @@ +# 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 User(Resource): + """The User registered to a lab. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The identifier of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: The location of the resource. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar email: The user email address, as it was specified during + registration. + :vartype email: str + :ivar family_name: The user family name, as it was specified during + registration. + :vartype family_name: str + :ivar given_name: The user given name, as it was specified during + registration. + :vartype given_name: str + :ivar tenant_id: The user tenant ID, as it was specified during + registration. + :vartype tenant_id: str + :ivar total_usage: How long the user has used his VMs in this lab + :vartype total_usage: timedelta + :param provisioning_state: The provisioning status of the resource. + :type provisioning_state: str + :param unique_identifier: The unique immutable identifier of a resource + (Guid). + :type unique_identifier: str + :ivar latest_operation_result: The details of the latest operation. ex: + status, error + :vartype latest_operation_result: + ~azure.mgmt.labservices.models.LatestOperationResult + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'email': {'readonly': True}, + 'family_name': {'readonly': True}, + 'given_name': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'total_usage': {'readonly': True}, + 'latest_operation_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + 'family_name': {'key': 'properties.familyName', 'type': 'str'}, + 'given_name': {'key': 'properties.givenName', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'total_usage': {'key': 'properties.totalUsage', 'type': 'duration'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'unique_identifier': {'key': 'properties.uniqueIdentifier', 'type': 'str'}, + 'latest_operation_result': {'key': 'properties.latestOperationResult', 'type': 'LatestOperationResult'}, + } + + def __init__(self, *, location: str=None, tags=None, provisioning_state: str=None, unique_identifier: str=None, **kwargs) -> None: + super(User, self).__init__(location=location, tags=tags, **kwargs) + self.email = None + self.family_name = None + self.given_name = None + self.tenant_id = None + self.total_usage = None + self.provisioning_state = provisioning_state + self.unique_identifier = unique_identifier + self.latest_operation_result = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/virtual_machine_details.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/virtual_machine_details.py new file mode 100644 index 000000000000..0088407b134c --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/virtual_machine_details.py @@ -0,0 +1,61 @@ +# 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 VirtualMachineDetails(Model): + """Details of the backing virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: Provisioning state of the Dtl VM + :vartype provisioning_state: str + :ivar rdp_authority: Connection information for Windows + :vartype rdp_authority: str + :ivar ssh_authority: Connection information for Linux + :vartype ssh_authority: str + :ivar private_ip_address: PrivateIp address of the compute VM + :vartype private_ip_address: str + :ivar user_name: Compute VM login user name + :vartype user_name: str + :ivar last_known_power_state: Last known compute power state captured in + DTL + :vartype last_known_power_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'rdp_authority': {'readonly': True}, + 'ssh_authority': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'user_name': {'readonly': True}, + 'last_known_power_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'rdp_authority': {'key': 'rdpAuthority', 'type': 'str'}, + 'ssh_authority': {'key': 'sshAuthority', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'last_known_power_state': {'key': 'lastKnownPowerState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineDetails, self).__init__(**kwargs) + self.provisioning_state = None + self.rdp_authority = None + self.ssh_authority = None + self.private_ip_address = None + self.user_name = None + self.last_known_power_state = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/virtual_machine_details_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/virtual_machine_details_py3.py new file mode 100644 index 000000000000..347bf47a0b30 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/virtual_machine_details_py3.py @@ -0,0 +1,61 @@ +# 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 VirtualMachineDetails(Model): + """Details of the backing virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: Provisioning state of the Dtl VM + :vartype provisioning_state: str + :ivar rdp_authority: Connection information for Windows + :vartype rdp_authority: str + :ivar ssh_authority: Connection information for Linux + :vartype ssh_authority: str + :ivar private_ip_address: PrivateIp address of the compute VM + :vartype private_ip_address: str + :ivar user_name: Compute VM login user name + :vartype user_name: str + :ivar last_known_power_state: Last known compute power state captured in + DTL + :vartype last_known_power_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'rdp_authority': {'readonly': True}, + 'ssh_authority': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'user_name': {'readonly': True}, + 'last_known_power_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'rdp_authority': {'key': 'rdpAuthority', 'type': 'str'}, + 'ssh_authority': {'key': 'sshAuthority', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'last_known_power_state': {'key': 'lastKnownPowerState', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachineDetails, self).__init__(**kwargs) + self.provisioning_state = None + self.rdp_authority = None + self.ssh_authority = None + self.private_ip_address = None + self.user_name = None + self.last_known_power_state = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/vm_state_details.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/vm_state_details.py new file mode 100644 index 000000000000..c67712bbb3e2 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/vm_state_details.py @@ -0,0 +1,54 @@ +# 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 VmStateDetails(Model): + """Details about the state of the reference virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar rdp_authority: The RdpAuthority property is a server DNS host name + or IP address followed by the service port number for RDP (Remote Desktop + Protocol). + :vartype rdp_authority: str + :ivar ssh_authority: The SshAuthority property is a server DNS host name + or IP address followed by the service port number for SSH. + :vartype ssh_authority: str + :ivar power_state: The power state of the reference virtual machine. + :vartype power_state: str + :ivar last_known_power_state: Last known compute power state captured in + DTL + :vartype last_known_power_state: str + """ + + _validation = { + 'rdp_authority': {'readonly': True}, + 'ssh_authority': {'readonly': True}, + 'power_state': {'readonly': True}, + 'last_known_power_state': {'readonly': True}, + } + + _attribute_map = { + 'rdp_authority': {'key': 'rdpAuthority', 'type': 'str'}, + 'ssh_authority': {'key': 'sshAuthority', 'type': 'str'}, + 'power_state': {'key': 'powerState', 'type': 'str'}, + 'last_known_power_state': {'key': 'lastKnownPowerState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VmStateDetails, self).__init__(**kwargs) + self.rdp_authority = None + self.ssh_authority = None + self.power_state = None + self.last_known_power_state = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/models/vm_state_details_py3.py b/azure-mgmt-labservices/azure/mgmt/labservices/models/vm_state_details_py3.py new file mode 100644 index 000000000000..b3bb68a6b155 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/models/vm_state_details_py3.py @@ -0,0 +1,54 @@ +# 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 VmStateDetails(Model): + """Details about the state of the reference virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar rdp_authority: The RdpAuthority property is a server DNS host name + or IP address followed by the service port number for RDP (Remote Desktop + Protocol). + :vartype rdp_authority: str + :ivar ssh_authority: The SshAuthority property is a server DNS host name + or IP address followed by the service port number for SSH. + :vartype ssh_authority: str + :ivar power_state: The power state of the reference virtual machine. + :vartype power_state: str + :ivar last_known_power_state: Last known compute power state captured in + DTL + :vartype last_known_power_state: str + """ + + _validation = { + 'rdp_authority': {'readonly': True}, + 'ssh_authority': {'readonly': True}, + 'power_state': {'readonly': True}, + 'last_known_power_state': {'readonly': True}, + } + + _attribute_map = { + 'rdp_authority': {'key': 'rdpAuthority', 'type': 'str'}, + 'ssh_authority': {'key': 'sshAuthority', 'type': 'str'}, + 'power_state': {'key': 'powerState', 'type': 'str'}, + 'last_known_power_state': {'key': 'lastKnownPowerState', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VmStateDetails, self).__init__(**kwargs) + self.rdp_authority = None + self.ssh_authority = None + self.power_state = None + self.last_known_power_state = None diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/operations/__init__.py b/azure-mgmt-labservices/azure/mgmt/labservices/operations/__init__.py new file mode 100644 index 000000000000..f3a3a8cd5ed6 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/operations/__init__.py @@ -0,0 +1,32 @@ +# 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 .provider_operations import ProviderOperations +from .global_users_operations import GlobalUsersOperations +from .lab_accounts_operations import LabAccountsOperations +from .operations import Operations +from .gallery_images_operations import GalleryImagesOperations +from .labs_operations import LabsOperations +from .environment_settings_operations import EnvironmentSettingsOperations +from .environments_operations import EnvironmentsOperations +from .users_operations import UsersOperations + +__all__ = [ + 'ProviderOperations', + 'GlobalUsersOperations', + 'LabAccountsOperations', + 'Operations', + 'GalleryImagesOperations', + 'LabsOperations', + 'EnvironmentSettingsOperations', + 'EnvironmentsOperations', + 'UsersOperations', +] diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/operations/environment_settings_operations.py b/azure-mgmt-labservices/azure/mgmt/labservices/operations/environment_settings_operations.py new file mode 100644 index 000000000000..2b06fd3922fe --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/operations/environment_settings_operations.py @@ -0,0 +1,786 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class EnvironmentSettingsOperations(object): + """EnvironmentSettingsOperations 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: "2018-10-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-10-15" + + self.config = config + + def list( + self, resource_group_name, lab_account_name, lab_name, expand=None, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): + """List environment setting in a given lab. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param expand: Specify the $expand query. Example: + 'properties($select=publishingState)' + :type expand: str + :param filter: The filter to apply to the operation. + :type filter: str + :param top: The maximum number of resources to return from the + operation. + :type top: int + :param orderby: The ordering expression for the results, using OData + notation. + :type orderby: 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 EnvironmentSetting + :rtype: + ~azure.mgmt.labservices.models.EnvironmentSettingPaged[~azure.mgmt.labservices.models.EnvironmentSetting] + :raises: :class:`CloudError` + """ + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EnvironmentSettingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EnvironmentSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings'} + + def get( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get environment setting. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_name: str + :param expand: Specify the $expand query. Example: + 'properties($select=publishingState)' + :type expand: 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: EnvironmentSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.EnvironmentSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EnvironmentSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}'} + + + def _create_or_update_initial( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(environment_setting, 'EnvironmentSetting') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EnvironmentSetting', response) + if response.status_code == 201: + deserialized = self._deserialize('EnvironmentSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or replace an existing Environment Setting. This operation can + take a while to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_name: str + :param environment_setting: Represents settings of an environment, + from which environment instances would be created + :type environment_setting: + ~azure.mgmt.labservices.models.EnvironmentSetting + :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 EnvironmentSetting or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.labservices.models.EnvironmentSetting] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.labservices.models.EnvironmentSetting]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + lab_account_name=lab_account_name, + lab_name=lab_name, + environment_setting_name=environment_setting_name, + environment_setting=environment_setting, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('EnvironmentSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}'} + + + def _delete_initial( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers=None, raw=False, **operation_config): + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete environment setting. This operation can take a while to + complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_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:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + lab_account_name=lab_account_name, + lab_name=lab_name, + environment_setting_name=environment_setting_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}'} + + def update( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers=None, raw=False, **operation_config): + """Modify properties of environment setting. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_name: str + :param environment_setting: Represents settings of an environment, + from which environment instances would be created + :type environment_setting: + ~azure.mgmt.labservices.models.EnvironmentSettingFragment + :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: EnvironmentSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.EnvironmentSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(environment_setting, 'EnvironmentSettingFragment') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EnvironmentSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}'} + + def claim_any( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers=None, raw=False, **operation_config): + """Claims a random environment for a user in an environment settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_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:`CloudError` + """ + # Construct URL + url = self.claim_any.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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + claim_any.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/claimAny'} + + def publish( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, use_existing_image=None, custom_headers=None, raw=False, **operation_config): + """Provisions/deprovisions required resources for an environment setting + based on current state of the lab/environment setting. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_name: str + :param use_existing_image: Whether to use existing VM custom image + when publishing. + :type use_existing_image: bool + :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:`CloudError` + """ + publish_payload = models.PublishPayload(use_existing_image=use_existing_image) + + # Construct URL + url = self.publish.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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(publish_payload, 'PublishPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + publish.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/publish'} + + + def _start_initial( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start.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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def start( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Starts a template by starting all resources inside the template. This + operation can take a while to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_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:`CloudError` + """ + raw_result = self._start_initial( + resource_group_name=resource_group_name, + lab_account_name=lab_account_name, + lab_name=lab_name, + environment_setting_name=environment_setting_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) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/start'} + + + def _stop_initial( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.stop.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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def stop( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Starts a template by starting all resources inside the template. This + operation can take a while to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_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:`CloudError` + """ + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + lab_account_name=lab_account_name, + lab_name=lab_name, + environment_setting_name=environment_setting_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) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/stop'} diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/operations/environments_operations.py b/azure-mgmt-labservices/azure/mgmt/labservices/operations/environments_operations.py new file mode 100644 index 000000000000..68f7fcaf8ae0 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/operations/environments_operations.py @@ -0,0 +1,805 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class EnvironmentsOperations(object): + """EnvironmentsOperations 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: "2018-10-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-10-15" + + self.config = config + + def list( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, expand=None, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): + """List environments in a given environment setting. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_name: str + :param expand: Specify the $expand query. Example: + 'properties($expand=networkInterface)' + :type expand: str + :param filter: The filter to apply to the operation. + :type filter: str + :param top: The maximum number of resources to return from the + operation. + :type top: int + :param orderby: The ordering expression for the results, using OData + notation. + :type orderby: 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 Environment + :rtype: + ~azure.mgmt.labservices.models.EnvironmentPaged[~azure.mgmt.labservices.models.Environment] + :raises: :class:`CloudError` + """ + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EnvironmentPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EnvironmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments'} + + def get( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get environment. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_name: str + :param environment_name: The name of the environment. + :type environment_name: str + :param expand: Specify the $expand query. Example: + 'properties($expand=networkInterface)' + :type expand: 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: Environment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.Environment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Environment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}'} + + def create_or_update( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers=None, raw=False, **operation_config): + """Create or replace an existing Environment. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_name: str + :param environment_name: The name of the environment. + :type environment_name: str + :param environment: Represents an environment instance + :type environment: ~azure.mgmt.labservices.models.Environment + :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: Environment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.Environment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(environment, 'Environment') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Environment', response) + if response.status_code == 201: + deserialized = self._deserialize('Environment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}'} + + + def _delete_initial( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers=None, raw=False, **operation_config): + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete environment. This operation can take a while to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_name: str + :param environment_name: The name of the environment. + :type environment_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:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + lab_account_name=lab_account_name, + lab_name=lab_name, + environment_setting_name=environment_setting_name, + environment_name=environment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}'} + + def update( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers=None, raw=False, **operation_config): + """Modify properties of environments. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_name: str + :param environment_name: The name of the environment. + :type environment_name: str + :param environment: Represents an environment instance + :type environment: ~azure.mgmt.labservices.models.EnvironmentFragment + :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: Environment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.Environment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(environment, 'EnvironmentFragment') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Environment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}'} + + def claim( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers=None, raw=False, **operation_config): + """Claims the environment and assigns it to the user. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_name: str + :param environment_name: The name of the environment. + :type environment_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:`CloudError` + """ + # Construct URL + url = self.claim.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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + claim.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/claim'} + + + def _reset_password_initial( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.reset_password.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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(reset_password_payload, 'ResetPasswordPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def reset_password( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers=None, raw=False, polling=True, **operation_config): + """Resets the user password on an environment This operation can take a + while to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_name: str + :param environment_name: The name of the environment. + :type environment_name: str + :param reset_password_payload: Represents the payload for resetting + passwords. + :type reset_password_payload: + ~azure.mgmt.labservices.models.ResetPasswordPayload + :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:`CloudError` + """ + raw_result = self._reset_password_initial( + resource_group_name=resource_group_name, + lab_account_name=lab_account_name, + lab_name=lab_name, + environment_setting_name=environment_setting_name, + environment_name=environment_name, + reset_password_payload=reset_password_payload, + 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) + reset_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/resetPassword'} + + + def _start_initial( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start.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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def start( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Starts an environment by starting all resources inside the environment. + This operation can take a while to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_name: str + :param environment_name: The name of the environment. + :type environment_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:`CloudError` + """ + raw_result = self._start_initial( + resource_group_name=resource_group_name, + lab_account_name=lab_account_name, + lab_name=lab_name, + environment_setting_name=environment_setting_name, + environment_name=environment_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) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/start'} + + + def _stop_initial( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.stop.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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'environmentSettingName': self._serialize.url("environment_setting_name", environment_setting_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def stop( + self, resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Stops an environment by stopping all resources inside the environment + This operation can take a while to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param environment_setting_name: The name of the environment Setting. + :type environment_setting_name: str + :param environment_name: The name of the environment. + :type environment_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:`CloudError` + """ + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + lab_account_name=lab_account_name, + lab_name=lab_name, + environment_setting_name=environment_setting_name, + environment_name=environment_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) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/stop'} diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/operations/gallery_images_operations.py b/azure-mgmt-labservices/azure/mgmt/labservices/operations/gallery_images_operations.py new file mode 100644 index 000000000000..5b510899cc6a --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/operations/gallery_images_operations.py @@ -0,0 +1,398 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class GalleryImagesOperations(object): + """GalleryImagesOperations 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: "2018-10-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-10-15" + + self.config = config + + def list( + self, resource_group_name, lab_account_name, expand=None, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): + """List gallery images in a given lab account. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param expand: Specify the $expand query. Example: + 'properties($select=author)' + :type expand: str + :param filter: The filter to apply to the operation. + :type filter: str + :param top: The maximum number of resources to return from the + operation. + :type top: int + :param orderby: The ordering expression for the results, using OData + notation. + :type orderby: 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 GalleryImage + :rtype: + ~azure.mgmt.labservices.models.GalleryImagePaged[~azure.mgmt.labservices.models.GalleryImage] + :raises: :class:`CloudError` + """ + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.GalleryImagePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.GalleryImagePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages'} + + def get( + self, resource_group_name, lab_account_name, gallery_image_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get gallery image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param gallery_image_name: The name of the gallery Image. + :type gallery_image_name: str + :param expand: Specify the $expand query. Example: + 'properties($select=author)' + :type expand: 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: GalleryImage or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.GalleryImage or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GalleryImage', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}'} + + def create_or_update( + self, resource_group_name, lab_account_name, gallery_image_name, gallery_image, custom_headers=None, raw=False, **operation_config): + """Create or replace an existing Gallery Image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param gallery_image_name: The name of the gallery Image. + :type gallery_image_name: str + :param gallery_image: Represents an image from the Azure Marketplace + :type gallery_image: ~azure.mgmt.labservices.models.GalleryImage + :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: GalleryImage or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.GalleryImage or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(gallery_image, 'GalleryImage') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GalleryImage', response) + if response.status_code == 201: + deserialized = self._deserialize('GalleryImage', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}'} + + def delete( + self, resource_group_name, lab_account_name, gallery_image_name, custom_headers=None, raw=False, **operation_config): + """Delete gallery image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param gallery_image_name: The name of the gallery Image. + :type gallery_image_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:`CloudError` + """ + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}'} + + def update( + self, resource_group_name, lab_account_name, gallery_image_name, gallery_image, custom_headers=None, raw=False, **operation_config): + """Modify properties of gallery images. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param gallery_image_name: The name of the gallery Image. + :type gallery_image_name: str + :param gallery_image: Represents an image from the Azure Marketplace + :type gallery_image: + ~azure.mgmt.labservices.models.GalleryImageFragment + :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: GalleryImage or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.GalleryImage or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(gallery_image, 'GalleryImageFragment') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GalleryImage', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}'} diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/operations/global_users_operations.py b/azure-mgmt-labservices/azure/mgmt/labservices/operations/global_users_operations.py new file mode 100644 index 000000000000..6fc4113e4bc6 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/operations/global_users_operations.py @@ -0,0 +1,743 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class GlobalUsersOperations(object): + """GlobalUsersOperations 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: "2018-10-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-10-15" + + self.config = config + + def get_environment( + self, user_name, environment_id, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the virtual machine details. + + :param user_name: The name of the user. + :type user_name: str + :param environment_id: The resourceId of the environment + :type environment_id: str + :param expand: Specify the $expand query. Example: + 'properties($expand=environment)' + :type expand: 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: GetEnvironmentResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.GetEnvironmentResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + environment_operations_payload = models.EnvironmentOperationsPayload(environment_id=environment_id) + + # Construct URL + url = self.get_environment.metadata['url'] + path_format_arguments = { + 'userName': self._serialize.url("user_name", user_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(environment_operations_payload, 'EnvironmentOperationsPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GetEnvironmentResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_environment.metadata = {'url': '/providers/Microsoft.LabServices/users/{userName}/getEnvironment'} + + def get_operation_batch_status( + self, user_name, urls, custom_headers=None, raw=False, **operation_config): + """Get batch operation status. + + :param user_name: The name of the user. + :type user_name: str + :param urls: The operation url of long running operation + :type urls: list[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: OperationBatchStatusResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.OperationBatchStatusResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + operation_batch_status_payload = models.OperationBatchStatusPayload(urls=urls) + + # Construct URL + url = self.get_operation_batch_status.metadata['url'] + path_format_arguments = { + 'userName': self._serialize.url("user_name", user_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(operation_batch_status_payload, 'OperationBatchStatusPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationBatchStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_operation_batch_status.metadata = {'url': '/providers/Microsoft.LabServices/users/{userName}/getOperationBatchStatus'} + + def get_operation_status( + self, user_name, operation_url, custom_headers=None, raw=False, **operation_config): + """Gets the status of long running operation. + + :param user_name: The name of the user. + :type user_name: str + :param operation_url: The operation url of long running operation + :type operation_url: 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: OperationStatusResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.OperationStatusResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + operation_status_payload = models.OperationStatusPayload(operation_url=operation_url) + + # Construct URL + url = self.get_operation_status.metadata['url'] + path_format_arguments = { + 'userName': self._serialize.url("user_name", user_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(operation_status_payload, 'OperationStatusPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_operation_status.metadata = {'url': '/providers/Microsoft.LabServices/users/{userName}/getOperationStatus'} + + def get_personal_preferences( + self, user_name, personal_perferences_operations_payload, custom_headers=None, raw=False, **operation_config): + """Get personal preferences for a user. + + :param user_name: The name of the user. + :type user_name: str + :param personal_perferences_operations_payload: Represents payload for + any Environment operations like get, start, stop, connect + :type personal_perferences_operations_payload: + ~azure.mgmt.labservices.models.PersonalPerferencesOperationsPayload + :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: GetPersonalPreferencesResponse or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.labservices.models.GetPersonalPreferencesResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_personal_preferences.metadata['url'] + path_format_arguments = { + 'userName': self._serialize.url("user_name", user_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(personal_perferences_operations_payload, 'PersonalPerferencesOperationsPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GetPersonalPreferencesResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_personal_preferences.metadata = {'url': '/providers/Microsoft.LabServices/users/{userName}/getPersonalPreferences'} + + def list_environments( + self, user_name, lab_id=None, custom_headers=None, raw=False, **operation_config): + """List Environments for the user. + + :param user_name: The name of the user. + :type user_name: str + :param lab_id: The resource Id of the lab + :type lab_id: 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: ListEnvironmentsResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.ListEnvironmentsResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + list_environments_payload = models.ListEnvironmentsPayload(lab_id=lab_id) + + # Construct URL + url = self.list_environments.metadata['url'] + path_format_arguments = { + 'userName': self._serialize.url("user_name", user_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(list_environments_payload, 'ListEnvironmentsPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ListEnvironmentsResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_environments.metadata = {'url': '/providers/Microsoft.LabServices/users/{userName}/listEnvironments'} + + def list_labs( + self, user_name, custom_headers=None, raw=False, **operation_config): + """List labs for the user. + + :param user_name: The name of the user. + :type user_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: ListLabsResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.ListLabsResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_labs.metadata['url'] + path_format_arguments = { + 'userName': self._serialize.url("user_name", user_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ListLabsResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_labs.metadata = {'url': '/providers/Microsoft.LabServices/users/{userName}/listLabs'} + + def register( + self, user_name, registration_code=None, custom_headers=None, raw=False, **operation_config): + """Register a user to a managed lab. + + :param user_name: The name of the user. + :type user_name: str + :param registration_code: The registration code of the lab. + :type registration_code: 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:`CloudError` + """ + register_payload = models.RegisterPayload(registration_code=registration_code) + + # Construct URL + url = self.register.metadata['url'] + path_format_arguments = { + 'userName': self._serialize.url("user_name", user_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(register_payload, 'RegisterPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + register.metadata = {'url': '/providers/Microsoft.LabServices/users/{userName}/register'} + + + def _reset_password_initial( + self, user_name, reset_password_payload, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.reset_password.metadata['url'] + path_format_arguments = { + 'userName': self._serialize.url("user_name", user_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(reset_password_payload, 'ResetPasswordPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def reset_password( + self, user_name, reset_password_payload, custom_headers=None, raw=False, polling=True, **operation_config): + """Resets the user password on an environment This operation can take a + while to complete. + + :param user_name: The name of the user. + :type user_name: str + :param reset_password_payload: Represents the payload for resetting + passwords. + :type reset_password_payload: + ~azure.mgmt.labservices.models.ResetPasswordPayload + :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:`CloudError` + """ + raw_result = self._reset_password_initial( + user_name=user_name, + reset_password_payload=reset_password_payload, + 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) + reset_password.metadata = {'url': '/providers/Microsoft.LabServices/users/{userName}/resetPassword'} + + + def _start_environment_initial( + self, user_name, environment_id, custom_headers=None, raw=False, **operation_config): + environment_operations_payload = models.EnvironmentOperationsPayload(environment_id=environment_id) + + # Construct URL + url = self.start_environment.metadata['url'] + path_format_arguments = { + 'userName': self._serialize.url("user_name", user_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(environment_operations_payload, 'EnvironmentOperationsPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def start_environment( + self, user_name, environment_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Starts an environment by starting all resources inside the environment. + This operation can take a while to complete. + + :param user_name: The name of the user. + :type user_name: str + :param environment_id: The resourceId of the environment + :type environment_id: 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:`CloudError` + """ + raw_result = self._start_environment_initial( + user_name=user_name, + environment_id=environment_id, + 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) + start_environment.metadata = {'url': '/providers/Microsoft.LabServices/users/{userName}/startEnvironment'} + + + def _stop_environment_initial( + self, user_name, environment_id, custom_headers=None, raw=False, **operation_config): + environment_operations_payload = models.EnvironmentOperationsPayload(environment_id=environment_id) + + # Construct URL + url = self.stop_environment.metadata['url'] + path_format_arguments = { + 'userName': self._serialize.url("user_name", user_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(environment_operations_payload, 'EnvironmentOperationsPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def stop_environment( + self, user_name, environment_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Stops an environment by stopping all resources inside the environment + This operation can take a while to complete. + + :param user_name: The name of the user. + :type user_name: str + :param environment_id: The resourceId of the environment + :type environment_id: 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:`CloudError` + """ + raw_result = self._stop_environment_initial( + user_name=user_name, + environment_id=environment_id, + 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) + stop_environment.metadata = {'url': '/providers/Microsoft.LabServices/users/{userName}/stopEnvironment'} diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/operations/lab_accounts_operations.py b/azure-mgmt-labservices/azure/mgmt/labservices/operations/lab_accounts_operations.py new file mode 100644 index 000000000000..d5f8911b7ea3 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/operations/lab_accounts_operations.py @@ -0,0 +1,618 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class LabAccountsOperations(object): + """LabAccountsOperations 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: "2018-10-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-10-15" + + self.config = config + + def list_by_subscription( + self, expand=None, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): + """List lab accounts in a subscription. + + :param expand: Specify the $expand query. Example: + 'properties($expand=sizeConfiguration)' + :type expand: str + :param filter: The filter to apply to the operation. + :type filter: str + :param top: The maximum number of resources to return from the + operation. + :type top: int + :param orderby: The ordering expression for the results, using OData + notation. + :type orderby: 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 LabAccount + :rtype: + ~azure.mgmt.labservices.models.LabAccountPaged[~azure.mgmt.labservices.models.LabAccount] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.LabAccountPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LabAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/labaccounts'} + + def list_by_resource_group( + self, resource_group_name, expand=None, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): + """List lab accounts in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param expand: Specify the $expand query. Example: + 'properties($expand=sizeConfiguration)' + :type expand: str + :param filter: The filter to apply to the operation. + :type filter: str + :param top: The maximum number of resources to return from the + operation. + :type top: int + :param orderby: The ordering expression for the results, using OData + notation. + :type orderby: 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 LabAccount + :rtype: + ~azure.mgmt.labservices.models.LabAccountPaged[~azure.mgmt.labservices.models.LabAccount] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.LabAccountPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LabAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts'} + + def get( + self, resource_group_name, lab_account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get lab account. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param expand: Specify the $expand query. Example: + 'properties($expand=sizeConfiguration)' + :type expand: 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: LabAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.LabAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LabAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}'} + + def create_or_update( + self, resource_group_name, lab_account_name, lab_account, custom_headers=None, raw=False, **operation_config): + """Create or replace an existing Lab Account. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_account: Represents a lab account. + :type lab_account: ~azure.mgmt.labservices.models.LabAccount + :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: LabAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.LabAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(lab_account, 'LabAccount') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LabAccount', response) + if response.status_code == 201: + deserialized = self._deserialize('LabAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}'} + + + def _delete_initial( + self, resource_group_name, lab_account_name, custom_headers=None, raw=False, **operation_config): + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, lab_account_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete lab account. This operation can take a while to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + lab_account_name=lab_account_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}'} + + def update( + self, resource_group_name, lab_account_name, lab_account, custom_headers=None, raw=False, **operation_config): + """Modify properties of lab accounts. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_account: Represents a lab account. + :type lab_account: ~azure.mgmt.labservices.models.LabAccountFragment + :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: LabAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.LabAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(lab_account, 'LabAccountFragment') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LabAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}'} + + def create_lab( + self, resource_group_name, lab_account_name, create_lab_properties, custom_headers=None, raw=False, **operation_config): + """Create a lab in a lab account. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param create_lab_properties: Properties for creating a managed lab + and a default environment setting + :type create_lab_properties: + ~azure.mgmt.labservices.models.CreateLabProperties + :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:`CloudError` + """ + # Construct URL + url = self.create_lab.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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(create_lab_properties, 'CreateLabProperties') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + create_lab.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/createLab'} + + def get_regional_availability( + self, resource_group_name, lab_account_name, custom_headers=None, raw=False, **operation_config): + """Get regional availability information for each size category configured + under a lab account. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_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: GetRegionalAvailabilityResponse or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.labservices.models.GetRegionalAvailabilityResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_regional_availability.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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GetRegionalAvailabilityResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_regional_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/getRegionalAvailability'} diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/operations/labs_operations.py b/azure-mgmt-labservices/azure/mgmt/labservices/operations/labs_operations.py new file mode 100644 index 000000000000..9fddd0ffaf88 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/operations/labs_operations.py @@ -0,0 +1,547 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class LabsOperations(object): + """LabsOperations 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: "2018-10-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-10-15" + + self.config = config + + def list( + self, resource_group_name, lab_account_name, expand=None, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): + """List labs in a given lab account. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param expand: Specify the $expand query. Example: + 'properties($select=maxUsersInLab)' + :type expand: str + :param filter: The filter to apply to the operation. + :type filter: str + :param top: The maximum number of resources to return from the + operation. + :type top: int + :param orderby: The ordering expression for the results, using OData + notation. + :type orderby: 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 Lab + :rtype: + ~azure.mgmt.labservices.models.LabPaged[~azure.mgmt.labservices.models.Lab] + :raises: :class:`CloudError` + """ + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.LabPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LabPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs'} + + def get( + self, resource_group_name, lab_account_name, lab_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get lab. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param expand: Specify the $expand query. Example: + 'properties($select=maxUsersInLab)' + :type expand: 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: Lab or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.Lab or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Lab', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}'} + + def create_or_update( + self, resource_group_name, lab_account_name, lab_name, lab, custom_headers=None, raw=False, **operation_config): + """Create or replace an existing Lab. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param lab: Represents a lab. + :type lab: ~azure.mgmt.labservices.models.Lab + :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: Lab or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.Lab or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(lab, 'Lab') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Lab', response) + if response.status_code == 201: + deserialized = self._deserialize('Lab', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}'} + + + def _delete_initial( + self, resource_group_name, lab_account_name, lab_name, custom_headers=None, raw=False, **operation_config): + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, lab_account_name, lab_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete lab. This operation can take a while to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_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:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + lab_account_name=lab_account_name, + lab_name=lab_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}'} + + def update( + self, resource_group_name, lab_account_name, lab_name, lab, custom_headers=None, raw=False, **operation_config): + """Modify properties of labs. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param lab: Represents a lab. + :type lab: ~azure.mgmt.labservices.models.LabFragment + :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: Lab or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.Lab or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(lab, 'LabFragment') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Lab', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}'} + + def add_users( + self, resource_group_name, lab_account_name, lab_name, email_addresses, custom_headers=None, raw=False, **operation_config): + """Add users to a lab. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param email_addresses: List of user emails addresses to add to the + lab. + :type email_addresses: list[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:`CloudError` + """ + add_users_payload = models.AddUsersPayload(email_addresses=email_addresses) + + # Construct URL + url = self.add_users.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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(add_users_payload, 'AddUsersPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + add_users.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/addUsers'} + + def register( + self, resource_group_name, lab_account_name, lab_name, custom_headers=None, raw=False, **operation_config): + """Register to managed lab. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_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:`CloudError` + """ + # Construct URL + url = self.register.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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + register.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/register'} diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/operations/operations.py b/azure-mgmt-labservices/azure/mgmt/labservices/operations/operations.py new file mode 100644 index 000000000000..123ec3fb10cc --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/operations/operations.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations 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: "2018-10-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-10-15" + + self.config = config + + def get( + self, location_name, operation_name, custom_headers=None, raw=False, **operation_config): + """Get operation. + + :param location_name: The name of the location. + :type location_name: str + :param operation_name: The name of the operation. + :type operation_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: OperationResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.OperationResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'operationName': self._serialize.url("operation_name", operation_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/locations/{locationName}/operations/{operationName}'} diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/operations/provider_operations.py b/azure-mgmt-labservices/azure/mgmt/labservices/operations/provider_operations.py new file mode 100644 index 000000000000..81e2d910bc52 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/operations/provider_operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ProviderOperations(object): + """ProviderOperations 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: "2018-10-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-10-15" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Result of the request to list REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of OperationMetadata + :rtype: + ~azure.mgmt.labservices.models.OperationMetadataPaged[~azure.mgmt.labservices.models.OperationMetadata] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationMetadataPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationMetadataPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.LabServices/operations'} diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/operations/users_operations.py b/azure-mgmt-labservices/azure/mgmt/labservices/operations/users_operations.py new file mode 100644 index 000000000000..d3ee8bc1b955 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/operations/users_operations.py @@ -0,0 +1,442 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class UsersOperations(object): + """UsersOperations 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: "2018-10-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-10-15" + + self.config = config + + def list( + self, resource_group_name, lab_account_name, lab_name, expand=None, filter=None, top=None, orderby=None, custom_headers=None, raw=False, **operation_config): + """List users in a given lab. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param expand: Specify the $expand query. Example: + 'properties($select=email)' + :type expand: str + :param filter: The filter to apply to the operation. + :type filter: str + :param top: The maximum number of resources to return from the + operation. + :type top: int + :param orderby: The ordering expression for the results, using OData + notation. + :type orderby: 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 User + :rtype: + ~azure.mgmt.labservices.models.UserPaged[~azure.mgmt.labservices.models.User] + :raises: :class:`CloudError` + """ + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.UserPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.UserPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users'} + + def get( + self, resource_group_name, lab_account_name, lab_name, user_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get user. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param user_name: The name of the user. + :type user_name: str + :param expand: Specify the $expand query. Example: + 'properties($select=email)' + :type expand: 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: User or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.User or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('User', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}'} + + def create_or_update( + self, resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers=None, raw=False, **operation_config): + """Create or replace an existing User. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param user_name: The name of the user. + :type user_name: str + :param user: The User registered to a lab + :type user: ~azure.mgmt.labservices.models.User + :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: User or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.User or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(user, 'User') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('User', response) + if response.status_code == 201: + deserialized = self._deserialize('User', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}'} + + + def _delete_initial( + self, resource_group_name, lab_account_name, lab_name, user_name, custom_headers=None, raw=False, **operation_config): + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, lab_account_name, lab_name, user_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete user. This operation can take a while to complete. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param user_name: The name of the user. + :type user_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:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + lab_account_name=lab_account_name, + lab_name=lab_name, + user_name=user_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}'} + + def update( + self, resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers=None, raw=False, **operation_config): + """Modify properties of users. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param lab_account_name: The name of the lab Account. + :type lab_account_name: str + :param lab_name: The name of the lab. + :type lab_name: str + :param user_name: The name of the user. + :type user_name: str + :param user: The User registered to a lab + :type user: ~azure.mgmt.labservices.models.UserFragment + :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: User or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.labservices.models.User or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'labAccountName': self._serialize.url("lab_account_name", lab_account_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(user, 'UserFragment') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('User', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}'} diff --git a/azure-mgmt-labservices/azure/mgmt/labservices/version.py b/azure-mgmt-labservices/azure/mgmt/labservices/version.py new file mode 100644 index 000000000000..bc54914c2cd2 --- /dev/null +++ b/azure-mgmt-labservices/azure/mgmt/labservices/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 = "2018-10-15" + diff --git a/azure-mgmt-labservices/sdk_packaging.toml b/azure-mgmt-labservices/sdk_packaging.toml new file mode 100644 index 000000000000..0dd15bf0d06e --- /dev/null +++ b/azure-mgmt-labservices/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-labservices" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/azure-mgmt-labservices/setup.cfg b/azure-mgmt-labservices/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-mgmt-labservices/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-mgmt-labservices/setup.py b/azure-mgmt-labservices/setup.py new file mode 100644 index 000000000000..cd5778d06860 --- /dev/null +++ b/azure-mgmt-labservices/setup.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-labservices" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)