diff --git a/azure-mgmt-devspaces/MANIFEST.in b/azure-mgmt-devspaces/MANIFEST.in index bb37a2723dae..6ceb27f7a96e 100644 --- a/azure-mgmt-devspaces/MANIFEST.in +++ b/azure-mgmt-devspaces/MANIFEST.in @@ -1 +1,4 @@ include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/dev_spaces_management_client.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/dev_spaces_management_client.py index 15bca069693d..1bcdf2000675 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/dev_spaces_management_client.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/dev_spaces_management_client.py @@ -13,8 +13,9 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION -from .operations.controllers_operations import ControllersOperations +from .operations.container_host_mappings_operations import ContainerHostMappingsOperations from .operations.operations import Operations +from .operations.controllers_operations import ControllersOperations from . import models @@ -56,10 +57,12 @@ class DevSpacesManagementClient(SDKClient): :ivar config: Configuration for client. :vartype config: DevSpacesManagementClientConfiguration - :ivar controllers: Controllers operations - :vartype controllers: azure.mgmt.devspaces.operations.ControllersOperations + :ivar container_host_mappings: ContainerHostMappings operations + :vartype container_host_mappings: azure.mgmt.devspaces.operations.ContainerHostMappingsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.devspaces.operations.Operations + :ivar controllers: Controllers operations + :vartype controllers: azure.mgmt.devspaces.operations.ControllersOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -76,11 +79,13 @@ def __init__( super(DevSpacesManagementClient, 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-06-01-preview' + self.api_version = '2019-01-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.controllers = ControllersOperations( + self.container_host_mappings = ContainerHostMappingsOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + self.controllers = ControllersOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py index b23c697b8c05..29ebb50efec5 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py @@ -10,56 +10,59 @@ # -------------------------------------------------------------------------- try: + from .container_host_mapping_py3 import ContainerHostMapping + from .tracked_resource_py3 import TrackedResource + from .resource_provider_operation_display_py3 import ResourceProviderOperationDisplay + from .resource_provider_operation_definition_py3 import ResourceProviderOperationDefinition from .sku_py3 import Sku from .controller_py3 import Controller from .controller_update_parameters_py3 import ControllerUpdateParameters from .orchestrator_specific_connection_details_py3 import OrchestratorSpecificConnectionDetails from .controller_connection_details_py3 import ControllerConnectionDetails from .controller_connection_details_list_py3 import ControllerConnectionDetailsList - from .tracked_resource_py3 import TrackedResource - from .resource_provider_operation_display_py3 import ResourceProviderOperationDisplay - from .resource_provider_operation_definition_py3 import ResourceProviderOperationDefinition from .resource_py3 import Resource from .kubernetes_connection_details_py3 import KubernetesConnectionDetails from .error_details_py3 import ErrorDetails from .error_response_py3 import ErrorResponse, ErrorResponseException except (SyntaxError, ImportError): + from .container_host_mapping import ContainerHostMapping + from .tracked_resource import TrackedResource + from .resource_provider_operation_display import ResourceProviderOperationDisplay + from .resource_provider_operation_definition import ResourceProviderOperationDefinition from .sku import Sku from .controller import Controller from .controller_update_parameters import ControllerUpdateParameters from .orchestrator_specific_connection_details import OrchestratorSpecificConnectionDetails from .controller_connection_details import ControllerConnectionDetails from .controller_connection_details_list import ControllerConnectionDetailsList - from .tracked_resource import TrackedResource - from .resource_provider_operation_display import ResourceProviderOperationDisplay - from .resource_provider_operation_definition import ResourceProviderOperationDefinition from .resource import Resource from .kubernetes_connection_details import KubernetesConnectionDetails from .error_details import ErrorDetails from .error_response import ErrorResponse, ErrorResponseException -from .controller_paged import ControllerPaged from .resource_provider_operation_definition_paged import ResourceProviderOperationDefinitionPaged +from .controller_paged import ControllerPaged from .dev_spaces_management_client_enums import ( ProvisioningState, SkuTier, ) __all__ = [ + 'ContainerHostMapping', + 'TrackedResource', + 'ResourceProviderOperationDisplay', + 'ResourceProviderOperationDefinition', 'Sku', 'Controller', 'ControllerUpdateParameters', 'OrchestratorSpecificConnectionDetails', 'ControllerConnectionDetails', 'ControllerConnectionDetailsList', - 'TrackedResource', - 'ResourceProviderOperationDisplay', - 'ResourceProviderOperationDefinition', 'Resource', 'KubernetesConnectionDetails', 'ErrorDetails', 'ErrorResponse', 'ErrorResponseException', - 'ControllerPaged', 'ResourceProviderOperationDefinitionPaged', + 'ControllerPaged', 'ProvisioningState', 'SkuTier', ] diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/container_host_mapping.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/container_host_mapping.py new file mode 100644 index 000000000000..893bc7f395cb --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/container_host_mapping.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 ContainerHostMapping(Model): + """Container host mapping object specifying the Container host resource ID and + its associated Controller resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param container_host_resource_id: ARM ID of the Container Host resource + :type container_host_resource_id: str + :ivar mapped_controller_resource_id: ARM ID of the mapped Controller + resource + :vartype mapped_controller_resource_id: str + """ + + _validation = { + 'mapped_controller_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'container_host_resource_id': {'key': 'containerHostResourceId', 'type': 'str'}, + 'mapped_controller_resource_id': {'key': 'mappedControllerResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContainerHostMapping, self).__init__(**kwargs) + self.container_host_resource_id = kwargs.get('container_host_resource_id', None) + self.mapped_controller_resource_id = None diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/container_host_mapping_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/container_host_mapping_py3.py new file mode 100644 index 000000000000..d3dd56a2e029 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/container_host_mapping_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 ContainerHostMapping(Model): + """Container host mapping object specifying the Container host resource ID and + its associated Controller resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param container_host_resource_id: ARM ID of the Container Host resource + :type container_host_resource_id: str + :ivar mapped_controller_resource_id: ARM ID of the mapped Controller + resource + :vartype mapped_controller_resource_id: str + """ + + _validation = { + 'mapped_controller_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'container_host_resource_id': {'key': 'containerHostResourceId', 'type': 'str'}, + 'mapped_controller_resource_id': {'key': 'mappedControllerResourceId', 'type': 'str'}, + } + + def __init__(self, *, container_host_resource_id: str=None, **kwargs) -> None: + super(ContainerHostMapping, self).__init__(**kwargs) + self.container_host_resource_id = container_host_resource_id + self.mapped_controller_resource_id = None diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller.py index 6066bd15af2a..87580d5b1d7e 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller.py @@ -32,12 +32,12 @@ class Controller(TrackedResource): :type location: str :ivar provisioning_state: Provisioning state of the Azure Dev Spaces Controller. Possible values include: 'Succeeded', 'Failed', 'Canceled', - 'Updating', 'Creating', 'Deleting' + 'Updating', 'Creating', 'Deleting', 'Deleted' :vartype provisioning_state: str or ~azure.mgmt.devspaces.models.ProvisioningState - :param host_suffix: Required. DNS suffix for public endpoints running in - the Azure Dev Spaces Controller. - :type host_suffix: str + :ivar host_suffix: DNS suffix for public endpoints running in the Azure + Dev Spaces Controller. + :vartype host_suffix: str :ivar data_plane_fqdn: DNS name for accessing DataPlane services :vartype data_plane_fqdn: str :param target_container_host_resource_id: Required. Resource ID of the @@ -55,7 +55,7 @@ class Controller(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, - 'host_suffix': {'required': True}, + 'host_suffix': {'readonly': True}, 'data_plane_fqdn': {'readonly': True}, 'target_container_host_resource_id': {'required': True}, 'target_container_host_credentials_base64': {'required': True}, @@ -79,7 +79,7 @@ class Controller(TrackedResource): def __init__(self, **kwargs): super(Controller, self).__init__(**kwargs) self.provisioning_state = None - self.host_suffix = kwargs.get('host_suffix', None) + self.host_suffix = None self.data_plane_fqdn = None self.target_container_host_resource_id = kwargs.get('target_container_host_resource_id', None) self.target_container_host_credentials_base64 = kwargs.get('target_container_host_credentials_base64', None) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details.py index 3701e8a363b8..f4b047bdb8c1 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details.py @@ -20,10 +20,6 @@ class ControllerConnectionDetails(Model): :ivar auth_key: Authentication key for communicating with services. :vartype auth_key: str - :ivar workspace_storage_account_name: Workspace storage account name. - :vartype workspace_storage_account_name: str - :ivar workspace_storage_sas_token: Workspace storage account SAS token. - :vartype workspace_storage_sas_token: str :param orchestrator_specific_connection_details: :type orchestrator_specific_connection_details: ~azure.mgmt.devspaces.models.OrchestratorSpecificConnectionDetails @@ -31,20 +27,14 @@ class ControllerConnectionDetails(Model): _validation = { 'auth_key': {'readonly': True}, - 'workspace_storage_account_name': {'readonly': True}, - 'workspace_storage_sas_token': {'readonly': True}, } _attribute_map = { 'auth_key': {'key': 'authKey', 'type': 'str'}, - 'workspace_storage_account_name': {'key': 'workspaceStorageAccountName', 'type': 'str'}, - 'workspace_storage_sas_token': {'key': 'workspaceStorageSasToken', 'type': 'str'}, 'orchestrator_specific_connection_details': {'key': 'orchestratorSpecificConnectionDetails', 'type': 'OrchestratorSpecificConnectionDetails'}, } def __init__(self, **kwargs): super(ControllerConnectionDetails, self).__init__(**kwargs) self.auth_key = None - self.workspace_storage_account_name = None - self.workspace_storage_sas_token = None self.orchestrator_specific_connection_details = kwargs.get('orchestrator_specific_connection_details', None) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_py3.py index fef49a40f947..0142e5ca18a2 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_py3.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_py3.py @@ -20,10 +20,6 @@ class ControllerConnectionDetails(Model): :ivar auth_key: Authentication key for communicating with services. :vartype auth_key: str - :ivar workspace_storage_account_name: Workspace storage account name. - :vartype workspace_storage_account_name: str - :ivar workspace_storage_sas_token: Workspace storage account SAS token. - :vartype workspace_storage_sas_token: str :param orchestrator_specific_connection_details: :type orchestrator_specific_connection_details: ~azure.mgmt.devspaces.models.OrchestratorSpecificConnectionDetails @@ -31,20 +27,14 @@ class ControllerConnectionDetails(Model): _validation = { 'auth_key': {'readonly': True}, - 'workspace_storage_account_name': {'readonly': True}, - 'workspace_storage_sas_token': {'readonly': True}, } _attribute_map = { 'auth_key': {'key': 'authKey', 'type': 'str'}, - 'workspace_storage_account_name': {'key': 'workspaceStorageAccountName', 'type': 'str'}, - 'workspace_storage_sas_token': {'key': 'workspaceStorageSasToken', 'type': 'str'}, 'orchestrator_specific_connection_details': {'key': 'orchestratorSpecificConnectionDetails', 'type': 'OrchestratorSpecificConnectionDetails'}, } def __init__(self, *, orchestrator_specific_connection_details=None, **kwargs) -> None: super(ControllerConnectionDetails, self).__init__(**kwargs) self.auth_key = None - self.workspace_storage_account_name = None - self.workspace_storage_sas_token = None self.orchestrator_specific_connection_details = orchestrator_specific_connection_details diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_py3.py index c24d70754737..a24c6a8042dd 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_py3.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_py3.py @@ -32,12 +32,12 @@ class Controller(TrackedResource): :type location: str :ivar provisioning_state: Provisioning state of the Azure Dev Spaces Controller. Possible values include: 'Succeeded', 'Failed', 'Canceled', - 'Updating', 'Creating', 'Deleting' + 'Updating', 'Creating', 'Deleting', 'Deleted' :vartype provisioning_state: str or ~azure.mgmt.devspaces.models.ProvisioningState - :param host_suffix: Required. DNS suffix for public endpoints running in - the Azure Dev Spaces Controller. - :type host_suffix: str + :ivar host_suffix: DNS suffix for public endpoints running in the Azure + Dev Spaces Controller. + :vartype host_suffix: str :ivar data_plane_fqdn: DNS name for accessing DataPlane services :vartype data_plane_fqdn: str :param target_container_host_resource_id: Required. Resource ID of the @@ -55,7 +55,7 @@ class Controller(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, - 'host_suffix': {'required': True}, + 'host_suffix': {'readonly': True}, 'data_plane_fqdn': {'readonly': True}, 'target_container_host_resource_id': {'required': True}, 'target_container_host_credentials_base64': {'required': True}, @@ -76,10 +76,10 @@ class Controller(TrackedResource): 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, *, host_suffix: str, target_container_host_resource_id: str, target_container_host_credentials_base64: str, sku, tags=None, location: str=None, **kwargs) -> None: + def __init__(self, *, target_container_host_resource_id: str, target_container_host_credentials_base64: str, sku, tags=None, location: str=None, **kwargs) -> None: super(Controller, self).__init__(tags=tags, location=location, **kwargs) self.provisioning_state = None - self.host_suffix = host_suffix + self.host_suffix = None self.data_plane_fqdn = None self.target_container_host_resource_id = target_container_host_resource_id self.target_container_host_credentials_base64 = target_container_host_credentials_base64 diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/dev_spaces_management_client_enums.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/dev_spaces_management_client_enums.py index b94e6f8aeb98..fba06f9ddbcf 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/dev_spaces_management_client_enums.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/dev_spaces_management_client_enums.py @@ -20,6 +20,7 @@ class ProvisioningState(str, Enum): updating = "Updating" creating = "Creating" deleting = "Deleting" + deleted = "Deleted" class SkuTier(str, Enum): diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/kubernetes_connection_details.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/kubernetes_connection_details.py index 822de6ef48fb..e7175c8c1ab3 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/kubernetes_connection_details.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/kubernetes_connection_details.py @@ -13,7 +13,7 @@ class KubernetesConnectionDetails(OrchestratorSpecificConnectionDetails): - """KubernetesConnectionDetails. + """Contains information used to connect to a Kubernetes cluster. All required parameters must be populated in order to send to Azure. diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/kubernetes_connection_details_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/kubernetes_connection_details_py3.py index 537bce3ae461..143bb5a98963 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/kubernetes_connection_details_py3.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/kubernetes_connection_details_py3.py @@ -13,7 +13,7 @@ class KubernetesConnectionDetails(OrchestratorSpecificConnectionDetails): - """KubernetesConnectionDetails. + """Contains information used to connect to a Kubernetes cluster. All required parameters must be populated in order to send to Azure. diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/orchestrator_specific_connection_details.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/orchestrator_specific_connection_details.py index f81894f7749c..cde860d75d2a 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/orchestrator_specific_connection_details.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/orchestrator_specific_connection_details.py @@ -13,7 +13,8 @@ class OrchestratorSpecificConnectionDetails(Model): - """OrchestratorSpecificConnectionDetails. + """Base class for types that supply values used to connect to container + orchestrators. You probably want to use the sub-classes and not this class directly. Known sub-classes are: KubernetesConnectionDetails diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/orchestrator_specific_connection_details_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/orchestrator_specific_connection_details_py3.py index c361a2b46837..c5a97af6956f 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/orchestrator_specific_connection_details_py3.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/orchestrator_specific_connection_details_py3.py @@ -13,7 +13,8 @@ class OrchestratorSpecificConnectionDetails(Model): - """OrchestratorSpecificConnectionDetails. + """Base class for types that supply values used to connect to container + orchestrators. You probably want to use the sub-classes and not this class directly. Known sub-classes are: KubernetesConnectionDetails diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/__init__.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/__init__.py index e2a90c21eba8..166c97cda17e 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/__init__.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/__init__.py @@ -9,10 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- -from .controllers_operations import ControllersOperations +from .container_host_mappings_operations import ContainerHostMappingsOperations from .operations import Operations +from .controllers_operations import ControllersOperations __all__ = [ - 'ControllersOperations', + 'ContainerHostMappingsOperations', 'Operations', + 'ControllersOperations', ] diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/container_host_mappings_operations.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/container_host_mappings_operations.py new file mode 100644 index 000000000000..9b028219786f --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/container_host_mappings_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ContainerHostMappingsOperations(object): + """ContainerHostMappingsOperations 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: "2019-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01-preview" + + self.config = config + + def get_container_host_mapping( + self, resource_group_name, location, container_host_resource_id=None, custom_headers=None, raw=False, **operation_config): + """Returns container host mapping object for a container host resource ID + if an associated controller exists. + + :param resource_group_name: Resource group to which the resource + belongs. + :type resource_group_name: str + :param location: Location of the container host. + :type location: str + :param container_host_resource_id: ARM ID of the Container Host + resource + :type container_host_resource_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: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + container_host_mapping = models.ContainerHostMapping(container_host_resource_id=container_host_resource_id) + + # Construct URL + url = self.get_container_host_mapping.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', max_length=90, min_length=1), + 'location': self._serialize.url("location", location, '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(container_host_mapping, 'ContainerHostMapping') + + # 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('object', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_container_host_mapping.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/locations/{location}/checkContainerHostMapping'} diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/controllers_operations.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/controllers_operations.py index d68c6285c616..69932a6afc72 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/controllers_operations.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/controllers_operations.py @@ -24,7 +24,7 @@ class ControllersOperations(object): :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-06-01-preview". + :ivar api_version: Client API version. Constant value: "2019-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-06-01-preview" + self.api_version = "2019-01-01-preview" self.config = config @@ -75,7 +75,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -84,8 +84,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -120,6 +120,7 @@ def _create_initial( # 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()) @@ -132,9 +133,8 @@ def _create_initial( body_content = self._serialize.body(controller, 'Controller') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: raise models.ErrorResponseException(self._deserialize, response) @@ -225,7 +225,6 @@ def _delete_initial( # 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: @@ -234,8 +233,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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, 202, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -331,6 +330,7 @@ def update( # 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()) @@ -343,9 +343,8 @@ def update( body_content = self._serialize.body(controller_update_parameters, 'ControllerUpdateParameters') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: raise models.ErrorResponseException(self._deserialize, response) @@ -404,7 +403,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -413,9 +412,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -471,7 +469,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -480,9 +478,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -539,7 +536,7 @@ def list_connection_details( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -548,8 +545,8 @@ def list_connection_details( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/operations.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/operations.py index 9b1e28b996fb..58f75ea20ce0 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/operations.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/operations.py @@ -23,7 +23,7 @@ class Operations(object): :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-06-01-preview". + :ivar api_version: Client API version. Constant value: "2019-01-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-06-01-preview" + self.api_version = "2019-01-01-preview" self.config = config @@ -71,7 +71,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -80,9 +80,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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)