Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR devspaces/resource-manager] Adding 2019-04-01 API version for Microsoft.DevSpaces RP #4912

Merged
merged 2 commits into from
Apr 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions azure-mgmt-devspaces/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
recursive-include tests *.py *.yaml
include *.rst
include azure/__init__.py
include azure/mgmt/__init__.py
Expand Down
22 changes: 3 additions & 19 deletions azure-mgmt-devspaces/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see
For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/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
=====

Expand All @@ -47,3 +28,6 @@ Provide Feedback
If you encounter any bugs or have suggestions, please file an issue in the
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__
section of the project.


.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-devspaces%2FREADME.png
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ 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 = '2019-01-01-preview'
self.api_version = '2019-04-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
3 changes: 3 additions & 0 deletions azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .sku_py3 import Sku
from .controller_py3 import Controller
from .controller_update_parameters_py3 import ControllerUpdateParameters
from .list_connection_details_parameters_py3 import ListConnectionDetailsParameters
from .orchestrator_specific_connection_details_py3 import OrchestratorSpecificConnectionDetails
from .controller_connection_details_py3 import ControllerConnectionDetails
from .controller_connection_details_list_py3 import ControllerConnectionDetailsList
Expand All @@ -32,6 +33,7 @@
from .sku import Sku
from .controller import Controller
from .controller_update_parameters import ControllerUpdateParameters
from .list_connection_details_parameters import ListConnectionDetailsParameters
from .orchestrator_specific_connection_details import OrchestratorSpecificConnectionDetails
from .controller_connection_details import ControllerConnectionDetails
from .controller_connection_details_list import ControllerConnectionDetailsList
Expand All @@ -54,6 +56,7 @@
'Sku',
'Controller',
'ControllerUpdateParameters',
'ListConnectionDetailsParameters',
'OrchestratorSpecificConnectionDetails',
'ControllerConnectionDetails',
'ControllerConnectionDetailsList',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,15 @@
class ControllerConnectionDetails(Model):
"""ControllerConnectionDetails.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar auth_key: Authentication key for communicating with services.
:vartype auth_key: str
:param orchestrator_specific_connection_details:
:type orchestrator_specific_connection_details:
~azure.mgmt.devspaces.models.OrchestratorSpecificConnectionDetails
"""

_validation = {
'auth_key': {'readonly': True},
}

_attribute_map = {
'auth_key': {'key': 'authKey', 'type': 'str'},
'orchestrator_specific_connection_details': {'key': 'orchestratorSpecificConnectionDetails', 'type': 'OrchestratorSpecificConnectionDetails'},
}

def __init__(self, **kwargs):
super(ControllerConnectionDetails, self).__init__(**kwargs)
self.auth_key = None
self.orchestrator_specific_connection_details = kwargs.get('orchestrator_specific_connection_details', None)
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,15 @@
class ControllerConnectionDetails(Model):
"""ControllerConnectionDetails.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar auth_key: Authentication key for communicating with services.
:vartype auth_key: str
:param orchestrator_specific_connection_details:
:type orchestrator_specific_connection_details:
~azure.mgmt.devspaces.models.OrchestratorSpecificConnectionDetails
"""

_validation = {
'auth_key': {'readonly': True},
}

_attribute_map = {
'auth_key': {'key': 'authKey', '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.orchestrator_specific_connection_details = orchestrator_specific_connection_details
Original file line number Diff line number Diff line change
@@ -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 ListConnectionDetailsParameters(Model):
"""Parameters for listing connection details of an Azure Dev Spaces
Controller.

All required parameters must be populated in order to send to Azure.

:param target_container_host_resource_id: Required. Resource ID of the
target container host mapped to the Azure Dev Spaces Controller.
:type target_container_host_resource_id: str
"""

_validation = {
'target_container_host_resource_id': {'required': True},
}

_attribute_map = {
'target_container_host_resource_id': {'key': 'targetContainerHostResourceId', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ListConnectionDetailsParameters, self).__init__(**kwargs)
self.target_container_host_resource_id = kwargs.get('target_container_host_resource_id', None)
Original file line number Diff line number Diff line change
@@ -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 ListConnectionDetailsParameters(Model):
"""Parameters for listing connection details of an Azure Dev Spaces
Controller.

All required parameters must be populated in order to send to Azure.

:param target_container_host_resource_id: Required. Resource ID of the
target container host mapped to the Azure Dev Spaces Controller.
:type target_container_host_resource_id: str
"""

_validation = {
'target_container_host_resource_id': {'required': True},
}

_attribute_map = {
'target_container_host_resource_id': {'key': 'targetContainerHostResourceId', 'type': 'str'},
}

def __init__(self, *, target_container_host_resource_id: str, **kwargs) -> None:
super(ListConnectionDetailsParameters, self).__init__(**kwargs)
self.target_container_host_resource_id = target_container_host_resource_id
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError

from .. import models

Expand All @@ -23,7 +22,7 @@ class ContainerHostMappingsOperations(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: "2019-01-01-preview".
:ivar api_version: Client API version. Constant value: "2019-04-01".
"""

models = models
Expand All @@ -33,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-01-01-preview"
self.api_version = "2019-04-01"

self.config = config

Expand All @@ -55,9 +54,11 @@ def get_container_host_mapping(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: object or ClientRawResponse if raw=true
:rtype: object or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:return: ContainerHostMapping or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.devspaces.models.ContainerHostMapping or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.devspaces.models.ErrorResponseException>`
"""
container_host_mapping = models.ContainerHostMapping(container_host_resource_id=container_host_resource_id)

Expand Down Expand Up @@ -92,15 +93,13 @@ def get_container_host_mapping(
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 response.status_code not in [200, 204]:
raise models.ErrorResponseException(self._deserialize, response)

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('object', response)
deserialized = self._deserialize('ContainerHostMapping', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: "2019-01-01-preview".
:ivar api_version: Client API version. Constant value: "2019-04-01".
"""

models = models
Expand All @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-01-01-preview"
self.api_version = "2019-04-01"

self.config = config

Expand Down Expand Up @@ -498,7 +498,7 @@ def internal_paging(next_link=None, raw=False):
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers'}

def list_connection_details(
self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, name, target_container_host_resource_id, custom_headers=None, raw=False, **operation_config):
"""Lists connection details for an Azure Dev Spaces Controller.

Lists connection details for the underlying container resources of an
Expand All @@ -509,6 +509,9 @@ def list_connection_details(
:type resource_group_name: str
:param name: Name of the resource.
:type name: str
:param target_container_host_resource_id: Resource ID of the target
container host mapped to the Azure Dev Spaces Controller.
:type target_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
Expand All @@ -521,6 +524,8 @@ def list_connection_details(
:raises:
:class:`ErrorResponseException<azure.mgmt.devspaces.models.ErrorResponseException>`
"""
list_connection_details_parameters = models.ListConnectionDetailsParameters(target_container_host_resource_id=target_container_host_resource_id)

# Construct URL
url = self.list_connection_details.metadata['url']
path_format_arguments = {
Expand All @@ -537,15 +542,19 @@ def list_connection_details(
# 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_connection_details_parameters, 'ListConnectionDetailsParameters')

# Construct and send request
request = self._client.post(url, query_parameters, header_parameters)
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]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: "2019-01-01-preview".
:ivar api_version: Client API version. Constant value: "2019-04-01".
"""

models = models
Expand All @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-01-01-preview"
self.api_version = "2019-04-01"

self.config = config

Expand Down
1 change: 1 addition & 0 deletions azure-mgmt-devspaces/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
version=version,
description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME),
long_description=readme + '\n\n' + history,
long_description_content_type='text/x-rst',
license='MIT License',
author='Microsoft Corporation',
author_email='[email protected]',
Expand Down