diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/container_instance_management_client.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/container_instance_management_client.py index 0744af2e4898..6ec5aba00eb2 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/container_instance_management_client.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/container_instance_management_client.py @@ -17,6 +17,7 @@ from .operations.operations import Operations from .operations.container_group_usage_operations import ContainerGroupUsageOperations from .operations.container_logs_operations import ContainerLogsOperations +from .operations.start_container_operations import StartContainerOperations from . import models @@ -68,6 +69,8 @@ class ContainerInstanceManagementClient(object): :vartype container_group_usage: azure.mgmt.containerinstance.operations.ContainerGroupUsageOperations :ivar container_logs: ContainerLogs operations :vartype container_logs: azure.mgmt.containerinstance.operations.ContainerLogsOperations + :ivar start_container: StartContainer operations + :vartype start_container: azure.mgmt.containerinstance.operations.StartContainerOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -98,3 +101,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.container_logs = ContainerLogsOperations( self._client, self.config, self._serialize, self._deserialize) + self.start_container = StartContainerOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py index 0ae2d1e064b4..4d7d387d8a68 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py @@ -34,6 +34,9 @@ from .usage import Usage from .usage_list_result import UsageListResult from .logs import Logs +from .container_exec_request_terminal_size import ContainerExecRequestTerminalSize +from .container_exec_request import ContainerExecRequest +from .container_exec_response import ContainerExecResponse from .resource import Resource from .container_group_paged import ContainerGroupPaged from .container_instance_management_client_enums import ( @@ -70,6 +73,9 @@ 'Usage', 'UsageListResult', 'Logs', + 'ContainerExecRequestTerminalSize', + 'ContainerExecRequest', + 'ContainerExecResponse', 'Resource', 'ContainerGroupPaged', 'ContainerNetworkProtocol', diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request.py new file mode 100644 index 000000000000..06a3757ef84d --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request.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 ContainerExecRequest(Model): + """The start container exec request. + + :param command: The command to be executed. + :type command: str + :param terminal_size: The size of the terminal. + :type terminal_size: + ~azure.mgmt.containerinstance.models.ContainerExecRequestTerminalSize + """ + + _attribute_map = { + 'command': {'key': 'command', 'type': 'str'}, + 'terminal_size': {'key': 'terminalSize', 'type': 'ContainerExecRequestTerminalSize'}, + } + + def __init__(self, command=None, terminal_size=None): + super(ContainerExecRequest, self).__init__() + self.command = command + self.terminal_size = terminal_size diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request_terminal_size.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request_terminal_size.py new file mode 100644 index 000000000000..38467deb4134 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request_terminal_size.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 ContainerExecRequestTerminalSize(Model): + """The size of the terminal. + + :param row: The row size of the terminal + :type row: int + :param column: The column size of the terminal + :type column: int + """ + + _attribute_map = { + 'row': {'key': 'row', 'type': 'int'}, + 'column': {'key': 'column', 'type': 'int'}, + } + + def __init__(self, row=None, column=None): + super(ContainerExecRequestTerminalSize, self).__init__() + self.row = row + self.column = column diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_response.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_response.py new file mode 100644 index 000000000000..33e3557041a5 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_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 ContainerExecResponse(Model): + """The information for the container exec command. + + :param web_socket_uri: The uri for the exec websocket. + :type web_socket_uri: str + :param password: The password to start the exec command. + :type password: str + """ + + _attribute_map = { + 'web_socket_uri': {'key': 'webSocketUri', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, web_socket_uri=None, password=None): + super(ContainerExecResponse, self).__init__() + self.web_socket_uri = web_socket_uri + self.password = password diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py index 710e1db45020..1729a0ebb8cb 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py @@ -13,10 +13,12 @@ from .operations import Operations from .container_group_usage_operations import ContainerGroupUsageOperations from .container_logs_operations import ContainerLogsOperations +from .start_container_operations import StartContainerOperations __all__ = [ 'ContainerGroupsOperations', 'Operations', 'ContainerGroupUsageOperations', 'ContainerLogsOperations', + 'StartContainerOperations', ] diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_group_usage_operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_group_usage_operations.py index 41fe07da49fe..7417d09bd637 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_group_usage_operations.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_group_usage_operations.py @@ -22,7 +22,7 @@ class ContainerGroupUsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2018-02-01-preview". """ @@ -54,7 +54,7 @@ def list( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'location': self._serialize.url("location", location, 'str') @@ -94,3 +94,4 @@ def list( return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages'} diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_groups_operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_groups_operations.py index 2dcacd71fa0f..0f405fa3ebf7 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_groups_operations.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_groups_operations.py @@ -12,6 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError +from msrestazure.azure_operation import AzureOperationPoller from .. import models @@ -22,7 +24,7 @@ class ContainerGroupsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2018-02-01-preview". """ @@ -60,7 +62,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -105,6 +107,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -132,7 +135,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups' + 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') @@ -178,6 +181,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups'} def get( self, resource_group_name, container_group_name, custom_headers=None, raw=False, **operation_config): @@ -204,7 +208,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + 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'), @@ -245,33 +249,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}'} - def create_or_update( - self, resource_group_name, container_group_name, container_group, custom_headers=None, raw=False, **operation_config): - """Create or update container groups. - - Create or update container groups with specified configurations. - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param container_group_name: The name of the container group. - :type container_group_name: str - :param container_group: The properties of the container group to be - created or updated. - :type container_group: - ~azure.mgmt.containerinstance.models.ContainerGroup - :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: ContainerGroup or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerinstance.models.ContainerGroup or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_or_update_initial( + self, resource_group_name, container_group_name, container_group, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + 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'), @@ -319,6 +303,78 @@ def create_or_update( return deserialized + def create_or_update( + self, resource_group_name, container_group_name, container_group, custom_headers=None, raw=False, **operation_config): + """Create or update container groups. + + Create or update container groups with specified configurations. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param container_group_name: The name of the container group. + :type container_group_name: str + :param container_group: The properties of the container group to be + created or updated. + :type container_group: + ~azure.mgmt.containerinstance.models.ContainerGroup + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns + ContainerGroup or ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerinstance.models.ContainerGroup] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + container_group_name=container_group_name, + container_group=container_group, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._deserialize('ContainerGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}'} + def update( self, resource_group_name, container_group_name, location=None, tags=None, custom_headers=None, raw=False, **operation_config): """Update container groups. @@ -343,12 +399,10 @@ def update( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - resource = None - if location is not None or tags is not None: - resource = models.Resource(location=location, tags=tags) + resource = models.Resource(location=location, tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + 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'), @@ -371,10 +425,7 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if resource is not None: - body_content = self._serialize.body(resource, 'Resource') - else: - body_content = None + body_content = self._serialize.body(resource, 'Resource') # Construct and send request request = self._client.patch(url, query_parameters) @@ -396,6 +447,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}'} def delete( self, resource_group_name, container_group_name, custom_headers=None, raw=False, **operation_config): @@ -420,7 +472,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + 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'), @@ -461,3 +513,4 @@ def delete( return client_raw_response return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}'} diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_logs_operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_logs_operations.py index e5871c4fa945..72513725100e 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_logs_operations.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_logs_operations.py @@ -22,7 +22,7 @@ class ContainerLogsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2018-02-01-preview". """ @@ -65,7 +65,7 @@ def list( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs' + 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'), @@ -109,3 +109,4 @@ def list( return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs'} diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/operations.py index d1c85ca0a159..77b53408cd2f 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/operations.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2018-02-01-preview". """ @@ -52,7 +52,7 @@ def list( :raises: :class:`CloudError` """ # Construct URL - url = '/providers/Microsoft.ContainerInstance/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -87,3 +87,4 @@ def list( return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.ContainerInstance/operations'} diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py new file mode 100644 index 000000000000..e3387a6c2586 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py @@ -0,0 +1,117 @@ +# 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 StartContainerOperations(object): + """StartContainerOperations 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-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01-preview" + + self.config = config + + def launch_exec( + self, resource_group_name, container_group_name, container_name, command=None, terminal_size=None, custom_headers=None, raw=False, **operation_config): + """Starts the exec command for a specific container instance. + + Starts the exec command for a specified container instance in a + specified resource group and container group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param container_group_name: The name of the container group. + :type container_group_name: str + :param container_name: The name of the container instance. + :type container_name: str + :param command: The command to be executed. + :type command: str + :param terminal_size: The size of the terminal. + :type terminal_size: + ~azure.mgmt.containerinstance.models.ContainerExecRequestTerminalSize + :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: ContainerExecResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerinstance.models.ContainerExecResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + container_exec_request = models.ContainerExecRequest(command=command, terminal_size=terminal_size) + + # Construct URL + url = self.launch_exec.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'), + 'containerGroupName': self._serialize.url("container_group_name", container_group_name, 'str'), + 'containerName': self._serialize.url("container_name", container_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(container_exec_request, 'ContainerExecRequest') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + 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('ContainerExecResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + launch_exec.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec'} diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/version.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/version.py index 54fdd938c10a..85da2c00c1a6 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/version.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.3.1" +VERSION = "0.4.0"