From 7d0cd355fb91e55e4aad25639542ccefc03441a7 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 7 Mar 2018 00:52:36 +0000 Subject: [PATCH 1/5] Generated from a60b503fd362577f4fab95a5e2518b553ec284e9 fixing small syntax error --- .../container_instance_management_client.py | 10 ++ .../mgmt/containerinstance/models/__init__.py | 12 ++ .../models/async_operation.py | 55 ++++++++ .../models/async_operation_properties.py | 35 ++++++ .../azure_resource_extended_error_info.py | 41 ++++++ .../models/container_exec_request.py | 33 +++++ .../container_exec_request_terminal_size.py | 32 +++++ .../models/container_exec_response.py | 32 +++++ .../containerinstance/operations/__init__.py | 4 + ...nc_container_group_operation_operations.py | 100 +++++++++++++++ .../container_group_usage_operations.py | 5 +- .../operations/container_groups_operations.py | 37 +++--- .../operations/container_logs_operations.py | 5 +- .../operations/operations.py | 5 +- .../operations/start_container_operations.py | 117 ++++++++++++++++++ .../azure/mgmt/containerinstance/version.py | 2 +- 16 files changed, 504 insertions(+), 21 deletions(-) create mode 100644 azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation.py create mode 100644 azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation_properties.py create mode 100644 azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_resource_extended_error_info.py create mode 100644 azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request.py create mode 100644 azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request_terminal_size.py create mode 100644 azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_response.py create mode 100644 azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/async_container_group_operation_operations.py create mode 100644 azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py 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..f9083d726442 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 @@ -16,7 +16,9 @@ from .operations.container_groups_operations import ContainerGroupsOperations from .operations.operations import Operations from .operations.container_group_usage_operations import ContainerGroupUsageOperations +from .operations.async_container_group_operation_operations import AsyncContainerGroupOperationOperations from .operations.container_logs_operations import ContainerLogsOperations +from .operations.start_container_operations import StartContainerOperations from . import models @@ -66,8 +68,12 @@ class ContainerInstanceManagementClient(object): :vartype operations: azure.mgmt.containerinstance.operations.Operations :ivar container_group_usage: ContainerGroupUsage operations :vartype container_group_usage: azure.mgmt.containerinstance.operations.ContainerGroupUsageOperations + :ivar async_container_group_operation: AsyncContainerGroupOperation operations + :vartype async_container_group_operation: azure.mgmt.containerinstance.operations.AsyncContainerGroupOperationOperations :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 @@ -96,5 +102,9 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.container_group_usage = ContainerGroupUsageOperations( self._client, self.config, self._serialize, self._deserialize) + self.async_container_group_operation = AsyncContainerGroupOperationOperations( + 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..1aa033d14126 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py @@ -33,7 +33,13 @@ from .usage_name import UsageName from .usage import Usage from .usage_list_result import UsageListResult +from .async_operation_properties import AsyncOperationProperties +from .azure_resource_extended_error_info import AzureResourceExtendedErrorInfo +from .async_operation import AsyncOperation 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 ( @@ -69,7 +75,13 @@ 'UsageName', 'Usage', 'UsageListResult', + 'AsyncOperationProperties', + 'AzureResourceExtendedErrorInfo', + 'AsyncOperation', 'Logs', + 'ContainerExecRequestTerminalSize', + 'ContainerExecRequest', + 'ContainerExecResponse', 'Resource', 'ContainerGroupPaged', 'ContainerNetworkProtocol', diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation.py new file mode 100644 index 000000000000..433cc10eed25 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation.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 AsyncOperation(Model): + """Azure async operation status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Async operation id. + :type id: str + :param status: Async operation status. + :type status: str + :ivar start_time: The date time that the async operation started. + :vartype start_time: datetime + :param properties: this structure contains the detailed properties of the + operation. + :type properties: + ~azure.mgmt.containerinstance.models.AsyncOperationProperties + :param error: If the async operation fails, this structure contains the + error details. + :type error: + ~azure.mgmt.containerinstance.models.AzureResourceExtendedErrorInfo + """ + + _validation = { + 'start_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'properties': {'key': 'properties', 'type': 'AsyncOperationProperties'}, + 'error': {'key': 'error', 'type': 'AzureResourceExtendedErrorInfo'}, + } + + def __init__(self, id=None, status=None, properties=None, error=None): + super(AsyncOperation, self).__init__() + self.id = id + self.status = status + self.start_time = None + self.properties = properties + self.error = error diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation_properties.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation_properties.py new file mode 100644 index 000000000000..6368530491ee --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation_properties.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 AsyncOperationProperties(Model): + """The properties of the async operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar events: The events of the async operation. + :vartype events: list[~azure.mgmt.containerinstance.models.Event] + """ + + _validation = { + 'events': {'readonly': True}, + } + + _attribute_map = { + 'events': {'key': 'events', 'type': '[Event]'}, + } + + def __init__(self): + super(AsyncOperationProperties, self).__init__() + self.events = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_resource_extended_error_info.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_resource_extended_error_info.py new file mode 100644 index 000000000000..90a8ddb0a4e0 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_resource_extended_error_info.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 AzureResourceExtendedErrorInfo(Model): + """The error detail information for async operation. + + :param code: The error code. + :type code: str + :param target: The error target. + :type target: str + :param message: The error message. + :type message: str + :param details: An array containing error information. + :type details: + list[~azure.mgmt.containerinstance.models.AzureResourceExtendedErrorInfo] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[AzureResourceExtendedErrorInfo]'}, + } + + def __init__(self, code=None, target=None, message=None, details=None): + super(AzureResourceExtendedErrorInfo, self).__init__() + self.code = code + self.target = target + self.message = message + self.details = details 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..0ab581b27964 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py @@ -12,11 +12,15 @@ from .container_groups_operations import ContainerGroupsOperations from .operations import Operations from .container_group_usage_operations import ContainerGroupUsageOperations +from .async_container_group_operation_operations import AsyncContainerGroupOperationOperations from .container_logs_operations import ContainerLogsOperations +from .start_container_operations import StartContainerOperations __all__ = [ 'ContainerGroupsOperations', 'Operations', 'ContainerGroupUsageOperations', + 'AsyncContainerGroupOperationOperations', 'ContainerLogsOperations', + 'StartContainerOperations', ] diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/async_container_group_operation_operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/async_container_group_operation_operations.py new file mode 100644 index 000000000000..38d9b4c1759b --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/async_container_group_operation_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 AsyncContainerGroupOperationOperations(object): + """AsyncContainerGroupOperationOperations 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 get( + self, location, operation_id, custom_headers=None, raw=False, **operation_config): + """Get the usage for a subscription. + + :param location: The identifier for the physical azure location. + :type location: str + :param operation_id: The operation Id. + :type operation_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: AsyncOperation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerinstance.models.AsyncOperation 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'), + 'location': self._serialize.url("location", location, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + 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('AsyncOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/operations/{operationId}'} 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..8e9a00abba62 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 @@ -22,7 +22,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 +60,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 +105,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 +133,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 +179,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 +206,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,6 +247,7 @@ 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): @@ -271,7 +274,7 @@ def create_or_update( :raises: :class:`CloudError` """ # 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'), @@ -307,17 +310,26 @@ def create_or_update( raise exp deserialized = None + header_dict = {} if response.status_code == 200: deserialized = self._deserialize('ContainerGroup', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } if response.status_code == 201: deserialized = self._deserialize('ContainerGroup', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } if raw: client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response return deserialized + 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): @@ -343,12 +355,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 +381,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 +403,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 +428,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 +469,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..34be7ff555fa --- /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 exec_method( + 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.exec_method.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 + exec_method.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..9bd1dfac7ecb 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.2.0" From 66b74411d2cdde1ef7f7bbbd464ecdd3c30914e7 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 7 Mar 2018 18:31:57 +0000 Subject: [PATCH 2/5] Generated from 1ec1e3fd40e63a08d3262affca1203988f7407ef Updating correct examples for async operation --- .../operations/async_container_group_operation_operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/async_container_group_operation_operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/async_container_group_operation_operations.py index 38d9b4c1759b..94e206e70a06 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/async_container_group_operation_operations.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/async_container_group_operation_operations.py @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): def get( self, location, operation_id, custom_headers=None, raw=False, **operation_config): - """Get the usage for a subscription. + """Get the container group async operation status. :param location: The identifier for the physical azure location. :type location: str From b9eabed42b9c71ff4139541808da31489a1da35c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 7 Mar 2018 21:27:47 +0000 Subject: [PATCH 3/5] Generated from 24d60116617096cd26598e974ac7e1fa00ec8169 fixing ARM header field --- .../operations/container_groups_operations.py | 106 +++++++++++++----- 1 file changed, 75 insertions(+), 31 deletions(-) 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 8e9a00abba62..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 @@ -249,30 +251,9 @@ def get( 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 = self.create_or_update.metadata['url'] path_format_arguments = { @@ -310,25 +291,88 @@ def create_or_update( raise exp deserialized = None - header_dict = {} if response.status_code == 200: deserialized = self._deserialize('ContainerGroup', response) - header_dict = { - 'Azure-AsyncOperation': 'str', - } if response.status_code == 201: deserialized = self._deserialize('ContainerGroup', response) - header_dict = { - 'Azure-AsyncOperation': 'str', - } if raw: client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) return client_raw_response 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( From 40bae0c86031fae06e8ab88da234cb4624724bad Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 12 Mar 2018 18:12:21 +0000 Subject: [PATCH 4/5] Generated from 9fecbb9feb0b8ea3cbba6a02e84973b2bdf11378 remvoing extra async operations --- .../container_instance_management_client.py | 5 - .../mgmt/containerinstance/models/__init__.py | 6 -- .../models/async_operation.py | 55 ---------- .../models/async_operation_properties.py | 35 ------ .../azure_resource_extended_error_info.py | 41 ------- .../containerinstance/operations/__init__.py | 2 - ...nc_container_group_operation_operations.py | 100 ------------------ .../operations/start_container_operations.py | 6 +- 8 files changed, 3 insertions(+), 247 deletions(-) delete mode 100644 azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation.py delete mode 100644 azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation_properties.py delete mode 100644 azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_resource_extended_error_info.py delete mode 100644 azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/async_container_group_operation_operations.py 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 f9083d726442..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 @@ -16,7 +16,6 @@ from .operations.container_groups_operations import ContainerGroupsOperations from .operations.operations import Operations from .operations.container_group_usage_operations import ContainerGroupUsageOperations -from .operations.async_container_group_operation_operations import AsyncContainerGroupOperationOperations from .operations.container_logs_operations import ContainerLogsOperations from .operations.start_container_operations import StartContainerOperations from . import models @@ -68,8 +67,6 @@ class ContainerInstanceManagementClient(object): :vartype operations: azure.mgmt.containerinstance.operations.Operations :ivar container_group_usage: ContainerGroupUsage operations :vartype container_group_usage: azure.mgmt.containerinstance.operations.ContainerGroupUsageOperations - :ivar async_container_group_operation: AsyncContainerGroupOperation operations - :vartype async_container_group_operation: azure.mgmt.containerinstance.operations.AsyncContainerGroupOperationOperations :ivar container_logs: ContainerLogs operations :vartype container_logs: azure.mgmt.containerinstance.operations.ContainerLogsOperations :ivar start_container: StartContainer operations @@ -102,8 +99,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.container_group_usage = ContainerGroupUsageOperations( self._client, self.config, self._serialize, self._deserialize) - self.async_container_group_operation = AsyncContainerGroupOperationOperations( - self._client, self.config, self._serialize, self._deserialize) self.container_logs = ContainerLogsOperations( self._client, self.config, self._serialize, self._deserialize) self.start_container = StartContainerOperations( diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py index 1aa033d14126..4d7d387d8a68 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py @@ -33,9 +33,6 @@ from .usage_name import UsageName from .usage import Usage from .usage_list_result import UsageListResult -from .async_operation_properties import AsyncOperationProperties -from .azure_resource_extended_error_info import AzureResourceExtendedErrorInfo -from .async_operation import AsyncOperation from .logs import Logs from .container_exec_request_terminal_size import ContainerExecRequestTerminalSize from .container_exec_request import ContainerExecRequest @@ -75,9 +72,6 @@ 'UsageName', 'Usage', 'UsageListResult', - 'AsyncOperationProperties', - 'AzureResourceExtendedErrorInfo', - 'AsyncOperation', 'Logs', 'ContainerExecRequestTerminalSize', 'ContainerExecRequest', diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation.py deleted file mode 100644 index 433cc10eed25..000000000000 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 AsyncOperation(Model): - """Azure async operation status. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param id: Async operation id. - :type id: str - :param status: Async operation status. - :type status: str - :ivar start_time: The date time that the async operation started. - :vartype start_time: datetime - :param properties: this structure contains the detailed properties of the - operation. - :type properties: - ~azure.mgmt.containerinstance.models.AsyncOperationProperties - :param error: If the async operation fails, this structure contains the - error details. - :type error: - ~azure.mgmt.containerinstance.models.AzureResourceExtendedErrorInfo - """ - - _validation = { - 'start_time': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'properties': {'key': 'properties', 'type': 'AsyncOperationProperties'}, - 'error': {'key': 'error', 'type': 'AzureResourceExtendedErrorInfo'}, - } - - def __init__(self, id=None, status=None, properties=None, error=None): - super(AsyncOperation, self).__init__() - self.id = id - self.status = status - self.start_time = None - self.properties = properties - self.error = error diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation_properties.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation_properties.py deleted file mode 100644 index 6368530491ee..000000000000 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/async_operation_properties.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 AsyncOperationProperties(Model): - """The properties of the async operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar events: The events of the async operation. - :vartype events: list[~azure.mgmt.containerinstance.models.Event] - """ - - _validation = { - 'events': {'readonly': True}, - } - - _attribute_map = { - 'events': {'key': 'events', 'type': '[Event]'}, - } - - def __init__(self): - super(AsyncOperationProperties, self).__init__() - self.events = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_resource_extended_error_info.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_resource_extended_error_info.py deleted file mode 100644 index 90a8ddb0a4e0..000000000000 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_resource_extended_error_info.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 AzureResourceExtendedErrorInfo(Model): - """The error detail information for async operation. - - :param code: The error code. - :type code: str - :param target: The error target. - :type target: str - :param message: The error message. - :type message: str - :param details: An array containing error information. - :type details: - list[~azure.mgmt.containerinstance.models.AzureResourceExtendedErrorInfo] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[AzureResourceExtendedErrorInfo]'}, - } - - def __init__(self, code=None, target=None, message=None, details=None): - super(AzureResourceExtendedErrorInfo, self).__init__() - self.code = code - self.target = target - self.message = message - self.details = details diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py index 0ab581b27964..1729a0ebb8cb 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py @@ -12,7 +12,6 @@ from .container_groups_operations import ContainerGroupsOperations from .operations import Operations from .container_group_usage_operations import ContainerGroupUsageOperations -from .async_container_group_operation_operations import AsyncContainerGroupOperationOperations from .container_logs_operations import ContainerLogsOperations from .start_container_operations import StartContainerOperations @@ -20,7 +19,6 @@ 'ContainerGroupsOperations', 'Operations', 'ContainerGroupUsageOperations', - 'AsyncContainerGroupOperationOperations', 'ContainerLogsOperations', 'StartContainerOperations', ] diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/async_container_group_operation_operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/async_container_group_operation_operations.py deleted file mode 100644 index 94e206e70a06..000000000000 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/async_container_group_operation_operations.py +++ /dev/null @@ -1,100 +0,0 @@ -# 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 AsyncContainerGroupOperationOperations(object): - """AsyncContainerGroupOperationOperations 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 get( - self, location, operation_id, custom_headers=None, raw=False, **operation_config): - """Get the container group async operation status. - - :param location: The identifier for the physical azure location. - :type location: str - :param operation_id: The operation Id. - :type operation_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: AsyncOperation or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerinstance.models.AsyncOperation 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'), - 'location': self._serialize.url("location", location, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - 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('AsyncOperation', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/operations/{operationId}'} 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 index 34be7ff555fa..e3387a6c2586 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def exec_method( + 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. @@ -68,7 +68,7 @@ def exec_method( container_exec_request = models.ContainerExecRequest(command=command, terminal_size=terminal_size) # Construct URL - url = self.exec_method.metadata['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'), @@ -114,4 +114,4 @@ def exec_method( return client_raw_response return deserialized - exec_method.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec'} + launch_exec.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec'} From 1aa698a6065b5d313c68cdda226665589ce67808 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 12 Mar 2018 20:21:37 +0000 Subject: [PATCH 5/5] Generated from 338812373b418f43cc56c9cf152a99475fbe12e1 Update Python version --- .../azure/mgmt/containerinstance/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/version.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/version.py index 9bd1dfac7ecb..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.2.0" +VERSION = "0.4.0"