diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c6860e8470fe..170aaf38f59a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -8,7 +8,7 @@ /azure-mgmt-batchai/ @AlexanderYukhanov /azure-mgmt-cdn/ @tjprescott /azure-mgmt-consumption/ @sandeepnl -/azure-mgmt-containerinstance/ @yolo3301 @xizhamsft +/azure-mgmt-containerinstance/ @samkreter @xizhamsft /azure-mgmt-containerregistry/ @djyou /azure-mgmt-cosmosdb/ @dmakwana /azure-mgmt-datafactory/ @hvermis diff --git a/azure-mgmt-containerinstance/HISTORY.rst b/azure-mgmt-containerinstance/HISTORY.rst index 28f543073f13..e1dd07392c15 100644 --- a/azure-mgmt-containerinstance/HISTORY.rst +++ b/azure-mgmt-containerinstance/HISTORY.rst @@ -3,6 +3,42 @@ Release History =============== +1.0.0 (2018-06-13) +++++++++++++++++++ + +**Features** + +- Model Container has a new parameter liveness_probe +- Model Container has a new parameter readiness_probe +- Model ContainerGroup has a new parameter diagnostics +- Model EnvironmentVariable has a new parameter secure_value +- Client class can be used as a context manager to keep the underlying HTTP session open for performance + +**General Breaking changes** + +This version uses a next-generation code generator that *might* introduce breaking changes. + +- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments. + To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments. +- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered. + While this is not a breaking change, the distinctions are important, and are documented here: + https://docs.python.org/3/library/enum.html#others + At a glance: + + - "is" should not be used at all. + - "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered. + +- New Long Running Operation: + + - Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same. + - Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used. + - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, + without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`. + - New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`, + the response of the initial call will be returned without polling. + - `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`. + - `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away. + 0.4.0 (2018-03-19) ++++++++++++++++++ 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 6ec5aba00eb2..a969d13ac371 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 @@ -9,15 +9,14 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION from .operations.container_groups_operations import ContainerGroupsOperations 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 .operations.container_operations import ContainerOperations from . import models @@ -55,7 +54,7 @@ def __init__( self.subscription_id = subscription_id -class ContainerInstanceManagementClient(object): +class ContainerInstanceManagementClient(SDKClient): """ContainerInstanceManagementClient :ivar config: Configuration for client. @@ -67,10 +66,8 @@ 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 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 + :ivar container: Container operations + :vartype container: azure.mgmt.containerinstance.operations.ContainerOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -86,10 +83,10 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = ContainerInstanceManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(ContainerInstanceManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-02-01-preview' + self.api_version = '2018-06-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -99,7 +96,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.container_group_usage = ContainerGroupUsageOperations( 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.container = ContainerOperations( 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 4d7d387d8a68..1ba2cf55de82 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py @@ -9,35 +9,76 @@ # regenerated. # -------------------------------------------------------------------------- -from .container_port import ContainerPort -from .environment_variable import EnvironmentVariable -from .container_state import ContainerState -from .event import Event -from .container_properties_instance_view import ContainerPropertiesInstanceView -from .resource_requests import ResourceRequests -from .resource_limits import ResourceLimits -from .resource_requirements import ResourceRequirements -from .volume_mount import VolumeMount -from .container import Container -from .azure_file_volume import AzureFileVolume -from .git_repo_volume import GitRepoVolume -from .volume import Volume -from .image_registry_credential import ImageRegistryCredential -from .port import Port -from .ip_address import IpAddress -from .container_group_properties_instance_view import ContainerGroupPropertiesInstanceView -from .container_group import ContainerGroup -from .operation_display import OperationDisplay -from .operation import Operation -from .operation_list_result import OperationListResult -from .usage_name import UsageName -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 +try: + from .container_port_py3 import ContainerPort + from .environment_variable_py3 import EnvironmentVariable + from .container_state_py3 import ContainerState + from .event_py3 import Event + from .container_properties_instance_view_py3 import ContainerPropertiesInstanceView + from .resource_requests_py3 import ResourceRequests + from .resource_limits_py3 import ResourceLimits + from .resource_requirements_py3 import ResourceRequirements + from .volume_mount_py3 import VolumeMount + from .container_exec_py3 import ContainerExec + from .container_http_get_py3 import ContainerHttpGet + from .container_probe_py3 import ContainerProbe + from .container_py3 import Container + from .azure_file_volume_py3 import AzureFileVolume + from .git_repo_volume_py3 import GitRepoVolume + from .volume_py3 import Volume + from .image_registry_credential_py3 import ImageRegistryCredential + from .port_py3 import Port + from .ip_address_py3 import IpAddress + from .container_group_properties_instance_view_py3 import ContainerGroupPropertiesInstanceView + from .log_analytics_py3 import LogAnalytics + from .container_group_diagnostics_py3 import ContainerGroupDiagnostics + from .container_group_py3 import ContainerGroup + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .operation_list_result_py3 import OperationListResult + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .usage_list_result_py3 import UsageListResult + from .logs_py3 import Logs + from .container_exec_request_terminal_size_py3 import ContainerExecRequestTerminalSize + from .container_exec_request_py3 import ContainerExecRequest + from .container_exec_response_py3 import ContainerExecResponse + from .resource_py3 import Resource +except (SyntaxError, ImportError): + from .container_port import ContainerPort + from .environment_variable import EnvironmentVariable + from .container_state import ContainerState + from .event import Event + from .container_properties_instance_view import ContainerPropertiesInstanceView + from .resource_requests import ResourceRequests + from .resource_limits import ResourceLimits + from .resource_requirements import ResourceRequirements + from .volume_mount import VolumeMount + from .container_exec import ContainerExec + from .container_http_get import ContainerHttpGet + from .container_probe import ContainerProbe + from .container import Container + from .azure_file_volume import AzureFileVolume + from .git_repo_volume import GitRepoVolume + from .volume import Volume + from .image_registry_credential import ImageRegistryCredential + from .port import Port + from .ip_address import IpAddress + from .container_group_properties_instance_view import ContainerGroupPropertiesInstanceView + from .log_analytics import LogAnalytics + from .container_group_diagnostics import ContainerGroupDiagnostics + from .container_group import ContainerGroup + from .operation_display import OperationDisplay + from .operation import Operation + from .operation_list_result import OperationListResult + from .usage_name import UsageName + 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 ( ContainerNetworkProtocol, @@ -57,6 +98,9 @@ 'ResourceLimits', 'ResourceRequirements', 'VolumeMount', + 'ContainerExec', + 'ContainerHttpGet', + 'ContainerProbe', 'Container', 'AzureFileVolume', 'GitRepoVolume', @@ -65,6 +109,8 @@ 'Port', 'IpAddress', 'ContainerGroupPropertiesInstanceView', + 'LogAnalytics', + 'ContainerGroupDiagnostics', 'ContainerGroup', 'OperationDisplay', 'Operation', diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_file_volume.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_file_volume.py index cf2ae6cd76ba..55b2b20e70b4 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_file_volume.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_file_volume.py @@ -16,14 +16,16 @@ class AzureFileVolume(Model): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - :param share_name: The name of the Azure File share to be mounted as a - volume. + All required parameters must be populated in order to send to Azure. + + :param share_name: Required. The name of the Azure File share to be + mounted as a volume. :type share_name: str :param read_only: The flag indicating whether the Azure File shared mounted as a volume is read-only. :type read_only: bool - :param storage_account_name: The name of the storage account that contains - the Azure File share. + :param storage_account_name: Required. The name of the storage account + that contains the Azure File share. :type storage_account_name: str :param storage_account_key: The storage account access key used to access the Azure File share. @@ -42,9 +44,9 @@ class AzureFileVolume(Model): 'storage_account_key': {'key': 'storageAccountKey', 'type': 'str'}, } - def __init__(self, share_name, storage_account_name, read_only=None, storage_account_key=None): - super(AzureFileVolume, self).__init__() - self.share_name = share_name - self.read_only = read_only - self.storage_account_name = storage_account_name - self.storage_account_key = storage_account_key + def __init__(self, **kwargs): + super(AzureFileVolume, self).__init__(**kwargs) + self.share_name = kwargs.get('share_name', None) + self.read_only = kwargs.get('read_only', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.storage_account_key = kwargs.get('storage_account_key', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_file_volume_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_file_volume_py3.py new file mode 100644 index 000000000000..7d1d6714f96a --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/azure_file_volume_py3.py @@ -0,0 +1,52 @@ +# 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 AzureFileVolume(Model): + """The properties of the Azure File volume. Azure File shares are mounted as + volumes. + + All required parameters must be populated in order to send to Azure. + + :param share_name: Required. The name of the Azure File share to be + mounted as a volume. + :type share_name: str + :param read_only: The flag indicating whether the Azure File shared + mounted as a volume is read-only. + :type read_only: bool + :param storage_account_name: Required. The name of the storage account + that contains the Azure File share. + :type storage_account_name: str + :param storage_account_key: The storage account access key used to access + the Azure File share. + :type storage_account_key: str + """ + + _validation = { + 'share_name': {'required': True}, + 'storage_account_name': {'required': True}, + } + + _attribute_map = { + 'share_name': {'key': 'shareName', 'type': 'str'}, + 'read_only': {'key': 'readOnly', 'type': 'bool'}, + 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, + 'storage_account_key': {'key': 'storageAccountKey', 'type': 'str'}, + } + + def __init__(self, *, share_name: str, storage_account_name: str, read_only: bool=None, storage_account_key: str=None, **kwargs) -> None: + super(AzureFileVolume, self).__init__(**kwargs) + self.share_name = share_name + self.read_only = read_only + self.storage_account_name = storage_account_name + self.storage_account_key = storage_account_key diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container.py index 2127894223ec..98768c78ed4d 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container.py @@ -18,9 +18,12 @@ class Container(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: The user-provided name of the container instance. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The user-provided name of the container instance. :type name: str - :param image: The name of the image used to create the container instance. + :param image: Required. The name of the image used to create the container + instance. :type image: str :param command: The commands to execute within the container instance in exec form. @@ -35,12 +38,17 @@ class Container(Model): valid in response. :vartype instance_view: ~azure.mgmt.containerinstance.models.ContainerPropertiesInstanceView - :param resources: The resource requirements of the container instance. + :param resources: Required. The resource requirements of the container + instance. :type resources: ~azure.mgmt.containerinstance.models.ResourceRequirements :param volume_mounts: The volume mounts available to the container instance. :type volume_mounts: list[~azure.mgmt.containerinstance.models.VolumeMount] + :param liveness_probe: The liveness probe. + :type liveness_probe: ~azure.mgmt.containerinstance.models.ContainerProbe + :param readiness_probe: The readiness probe. + :type readiness_probe: ~azure.mgmt.containerinstance.models.ContainerProbe """ _validation = { @@ -59,15 +67,19 @@ class Container(Model): 'instance_view': {'key': 'properties.instanceView', 'type': 'ContainerPropertiesInstanceView'}, 'resources': {'key': 'properties.resources', 'type': 'ResourceRequirements'}, 'volume_mounts': {'key': 'properties.volumeMounts', 'type': '[VolumeMount]'}, + 'liveness_probe': {'key': 'properties.livenessProbe', 'type': 'ContainerProbe'}, + 'readiness_probe': {'key': 'properties.readinessProbe', 'type': 'ContainerProbe'}, } - def __init__(self, name, image, resources, command=None, ports=None, environment_variables=None, volume_mounts=None): - super(Container, self).__init__() - self.name = name - self.image = image - self.command = command - self.ports = ports - self.environment_variables = environment_variables + def __init__(self, **kwargs): + super(Container, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.image = kwargs.get('image', None) + self.command = kwargs.get('command', None) + self.ports = kwargs.get('ports', None) + self.environment_variables = kwargs.get('environment_variables', None) self.instance_view = None - self.resources = resources - self.volume_mounts = volume_mounts + self.resources = kwargs.get('resources', None) + self.volume_mounts = kwargs.get('volume_mounts', None) + self.liveness_probe = kwargs.get('liveness_probe', None) + self.readiness_probe = kwargs.get('readiness_probe', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec.py new file mode 100644 index 000000000000..2fe3dabdd9d9 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ContainerExec(Model): + """The container execution command, for liveness or readiness probe. + + :param command: The commands to execute within the container. + :type command: list[str] + """ + + _attribute_map = { + 'command': {'key': 'command', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ContainerExec, self).__init__(**kwargs) + self.command = kwargs.get('command', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_py3.py new file mode 100644 index 000000000000..6e6d96e30374 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ContainerExec(Model): + """The container execution command, for liveness or readiness probe. + + :param command: The commands to execute within the container. + :type command: list[str] + """ + + _attribute_map = { + 'command': {'key': 'command', 'type': '[str]'}, + } + + def __init__(self, *, command=None, **kwargs) -> None: + super(ContainerExec, self).__init__(**kwargs) + self.command = command 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 index 06a3757ef84d..f9d7392bbfdc 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request.py @@ -13,7 +13,7 @@ class ContainerExecRequest(Model): - """The start container exec request. + """The container exec request. :param command: The command to be executed. :type command: str @@ -27,7 +27,7 @@ class ContainerExecRequest(Model): '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 + def __init__(self, **kwargs): + super(ContainerExecRequest, self).__init__(**kwargs) + self.command = kwargs.get('command', None) + self.terminal_size = kwargs.get('terminal_size', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request_py3.py new file mode 100644 index 000000000000..5b49de214131 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ContainerExecRequest(Model): + """The 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: str=None, terminal_size=None, **kwargs) -> None: + super(ContainerExecRequest, self).__init__(**kwargs) + 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 index 1b39f9247cc2..94acd92ba917 100644 --- 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 @@ -26,7 +26,7 @@ class ContainerExecRequestTerminalSize(Model): 'cols': {'key': 'cols', 'type': 'int'}, } - def __init__(self, rows=None, cols=None): - super(ContainerExecRequestTerminalSize, self).__init__() - self.rows = rows - self.cols = cols + def __init__(self, **kwargs): + super(ContainerExecRequestTerminalSize, self).__init__(**kwargs) + self.rows = kwargs.get('rows', None) + self.cols = kwargs.get('cols', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request_terminal_size_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request_terminal_size_py3.py new file mode 100644 index 000000000000..481fd4aaaaa5 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_request_terminal_size_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ContainerExecRequestTerminalSize(Model): + """The size of the terminal. + + :param rows: The row size of the terminal + :type rows: int + :param cols: The column size of the terminal + :type cols: int + """ + + _attribute_map = { + 'rows': {'key': 'rows', 'type': 'int'}, + 'cols': {'key': 'cols', 'type': 'int'}, + } + + def __init__(self, *, rows: int=None, cols: int=None, **kwargs) -> None: + super(ContainerExecRequestTerminalSize, self).__init__(**kwargs) + self.rows = rows + self.cols = cols 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 index 33e3557041a5..a894399a1d96 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_response.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_response.py @@ -26,7 +26,7 @@ class ContainerExecResponse(Model): '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 + def __init__(self, **kwargs): + super(ContainerExecResponse, self).__init__(**kwargs) + self.web_socket_uri = kwargs.get('web_socket_uri', None) + self.password = kwargs.get('password', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_response_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_response_py3.py new file mode 100644 index 000000000000..9318680514a4 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_response_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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: str=None, password: str=None, **kwargs) -> None: + super(ContainerExecResponse, self).__init__(**kwargs) + self.web_socket_uri = web_socket_uri + self.password = password diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group.py index 9fd8034300e0..fa4a94d911e0 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group.py @@ -18,6 +18,8 @@ class ContainerGroup(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The resource id. :vartype id: str :ivar name: The resource name. @@ -31,7 +33,7 @@ class ContainerGroup(Resource): :ivar provisioning_state: The provisioning state of the container group. This only appears in the response. :vartype provisioning_state: str - :param containers: The containers within the container group. + :param containers: Required. The containers within the container group. :type containers: list[~azure.mgmt.containerinstance.models.Container] :param image_registry_credentials: The image registry credentials by which the container group is created from. @@ -47,8 +49,9 @@ class ContainerGroup(Resource): ~azure.mgmt.containerinstance.models.ContainerGroupRestartPolicy :param ip_address: The IP address type of the container group. :type ip_address: ~azure.mgmt.containerinstance.models.IpAddress - :param os_type: The operating system type required by the containers in - the container group. Possible values include: 'Windows', 'Linux' + :param os_type: Required. The operating system type required by the + containers in the container group. Possible values include: 'Windows', + 'Linux' :type os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes :param volumes: The list of volumes that can be mounted by containers in @@ -58,6 +61,9 @@ class ContainerGroup(Resource): in response. :vartype instance_view: ~azure.mgmt.containerinstance.models.ContainerGroupPropertiesInstanceView + :param diagnostics: The diagnostic information for a container group. + :type diagnostics: + ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics """ _validation = { @@ -84,15 +90,17 @@ class ContainerGroup(Resource): 'os_type': {'key': 'properties.osType', 'type': 'str'}, 'volumes': {'key': 'properties.volumes', 'type': '[Volume]'}, 'instance_view': {'key': 'properties.instanceView', 'type': 'ContainerGroupPropertiesInstanceView'}, + 'diagnostics': {'key': 'properties.diagnostics', 'type': 'ContainerGroupDiagnostics'}, } - def __init__(self, containers, os_type, location=None, tags=None, image_registry_credentials=None, restart_policy=None, ip_address=None, volumes=None): - super(ContainerGroup, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(ContainerGroup, self).__init__(**kwargs) self.provisioning_state = None - self.containers = containers - self.image_registry_credentials = image_registry_credentials - self.restart_policy = restart_policy - self.ip_address = ip_address - self.os_type = os_type - self.volumes = volumes + self.containers = kwargs.get('containers', None) + self.image_registry_credentials = kwargs.get('image_registry_credentials', None) + self.restart_policy = kwargs.get('restart_policy', None) + self.ip_address = kwargs.get('ip_address', None) + self.os_type = kwargs.get('os_type', None) + self.volumes = kwargs.get('volumes', None) self.instance_view = None + self.diagnostics = kwargs.get('diagnostics', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_diagnostics.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_diagnostics.py new file mode 100644 index 000000000000..c393dde8f7b8 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_diagnostics.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ContainerGroupDiagnostics(Model): + """Container group diagnostic information. + + :param log_analytics: Container group log analytics information. + :type log_analytics: ~azure.mgmt.containerinstance.models.LogAnalytics + """ + + _attribute_map = { + 'log_analytics': {'key': 'logAnalytics', 'type': 'LogAnalytics'}, + } + + def __init__(self, **kwargs): + super(ContainerGroupDiagnostics, self).__init__(**kwargs) + self.log_analytics = kwargs.get('log_analytics', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_diagnostics_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_diagnostics_py3.py new file mode 100644 index 000000000000..fb5fee21a034 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_diagnostics_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ContainerGroupDiagnostics(Model): + """Container group diagnostic information. + + :param log_analytics: Container group log analytics information. + :type log_analytics: ~azure.mgmt.containerinstance.models.LogAnalytics + """ + + _attribute_map = { + 'log_analytics': {'key': 'logAnalytics', 'type': 'LogAnalytics'}, + } + + def __init__(self, *, log_analytics=None, **kwargs) -> None: + super(ContainerGroupDiagnostics, self).__init__(**kwargs) + self.log_analytics = log_analytics diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_properties_instance_view.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_properties_instance_view.py index 357337b836d2..1bdf0f7da3e9 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_properties_instance_view.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_properties_instance_view.py @@ -34,7 +34,7 @@ class ContainerGroupPropertiesInstanceView(Model): 'state': {'key': 'state', 'type': 'str'}, } - def __init__(self): - super(ContainerGroupPropertiesInstanceView, self).__init__() + def __init__(self, **kwargs): + super(ContainerGroupPropertiesInstanceView, self).__init__(**kwargs) self.events = None self.state = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_properties_instance_view_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_properties_instance_view_py3.py new file mode 100644 index 000000000000..69d83391e0b4 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_properties_instance_view_py3.py @@ -0,0 +1,40 @@ +# 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 ContainerGroupPropertiesInstanceView(Model): + """The instance view of the container group. Only valid in response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar events: The events of this container group. + :vartype events: list[~azure.mgmt.containerinstance.models.Event] + :ivar state: The state of the container group. Only valid in response. + :vartype state: str + """ + + _validation = { + 'events': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'events': {'key': 'events', 'type': '[Event]'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ContainerGroupPropertiesInstanceView, self).__init__(**kwargs) + self.events = None + self.state = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_py3.py new file mode 100644 index 000000000000..da93f1668143 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_py3.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class ContainerGroup(Resource): + """A container group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :ivar provisioning_state: The provisioning state of the container group. + This only appears in the response. + :vartype provisioning_state: str + :param containers: Required. The containers within the container group. + :type containers: list[~azure.mgmt.containerinstance.models.Container] + :param image_registry_credentials: The image registry credentials by which + the container group is created from. + :type image_registry_credentials: + list[~azure.mgmt.containerinstance.models.ImageRegistryCredential] + :param restart_policy: Restart policy for all containers within the + container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never' + :type restart_policy: str or + ~azure.mgmt.containerinstance.models.ContainerGroupRestartPolicy + :param ip_address: The IP address type of the container group. + :type ip_address: ~azure.mgmt.containerinstance.models.IpAddress + :param os_type: Required. The operating system type required by the + containers in the container group. Possible values include: 'Windows', + 'Linux' + :type os_type: str or + ~azure.mgmt.containerinstance.models.OperatingSystemTypes + :param volumes: The list of volumes that can be mounted by containers in + this container group. + :type volumes: list[~azure.mgmt.containerinstance.models.Volume] + :ivar instance_view: The instance view of the container group. Only valid + in response. + :vartype instance_view: + ~azure.mgmt.containerinstance.models.ContainerGroupPropertiesInstanceView + :param diagnostics: The diagnostic information for a container group. + :type diagnostics: + ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'containers': {'required': True}, + 'os_type': {'required': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'containers': {'key': 'properties.containers', 'type': '[Container]'}, + 'image_registry_credentials': {'key': 'properties.imageRegistryCredentials', 'type': '[ImageRegistryCredential]'}, + 'restart_policy': {'key': 'properties.restartPolicy', 'type': 'str'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'IpAddress'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'volumes': {'key': 'properties.volumes', 'type': '[Volume]'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'ContainerGroupPropertiesInstanceView'}, + 'diagnostics': {'key': 'properties.diagnostics', 'type': 'ContainerGroupDiagnostics'}, + } + + def __init__(self, *, containers, os_type, location: str=None, tags=None, image_registry_credentials=None, restart_policy=None, ip_address=None, volumes=None, diagnostics=None, **kwargs) -> None: + super(ContainerGroup, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.containers = containers + self.image_registry_credentials = image_registry_credentials + self.restart_policy = restart_policy + self.ip_address = ip_address + self.os_type = os_type + self.volumes = volumes + self.instance_view = None + self.diagnostics = diagnostics diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_http_get.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_http_get.py new file mode 100644 index 000000000000..1823b1a315fb --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_http_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ContainerHttpGet(Model): + """The container Http Get settings, for liveness or readiness probe. + + All required parameters must be populated in order to send to Azure. + + :param path: The path to probe. + :type path: str + :param port: Required. The port number to probe. + :type port: int + :param scheme: The scheme. Possible values include: 'http', 'https' + :type scheme: str or ~azure.mgmt.containerinstance.models.enum + """ + + _validation = { + 'port': {'required': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'scheme': {'key': 'scheme', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContainerHttpGet, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.port = kwargs.get('port', None) + self.scheme = kwargs.get('scheme', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_http_get_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_http_get_py3.py new file mode 100644 index 000000000000..d9ca73f63818 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_http_get_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ContainerHttpGet(Model): + """The container Http Get settings, for liveness or readiness probe. + + All required parameters must be populated in order to send to Azure. + + :param path: The path to probe. + :type path: str + :param port: Required. The port number to probe. + :type port: int + :param scheme: The scheme. Possible values include: 'http', 'https' + :type scheme: str or ~azure.mgmt.containerinstance.models.enum + """ + + _validation = { + 'port': {'required': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'scheme': {'key': 'scheme', 'type': 'str'}, + } + + def __init__(self, *, port: int, path: str=None, scheme=None, **kwargs) -> None: + super(ContainerHttpGet, self).__init__(**kwargs) + self.path = path + self.port = port + self.scheme = scheme diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_instance_management_client_enums.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_instance_management_client_enums.py index 88151cedb249..04280f098e01 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_instance_management_client_enums.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_instance_management_client_enums.py @@ -12,32 +12,32 @@ from enum import Enum -class ContainerNetworkProtocol(Enum): +class ContainerNetworkProtocol(str, Enum): tcp = "TCP" udp = "UDP" -class ContainerGroupRestartPolicy(Enum): +class ContainerGroupRestartPolicy(str, Enum): always = "Always" on_failure = "OnFailure" never = "Never" -class ContainerGroupNetworkProtocol(Enum): +class ContainerGroupNetworkProtocol(str, Enum): tcp = "TCP" udp = "UDP" -class OperatingSystemTypes(Enum): +class OperatingSystemTypes(str, Enum): windows = "Windows" linux = "Linux" -class ContainerInstanceOperationsOrigin(Enum): +class ContainerInstanceOperationsOrigin(str, Enum): user = "User" system = "System" diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_port.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_port.py index cae44d55caff..8920c7daaef0 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_port.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_port.py @@ -15,11 +15,13 @@ class ContainerPort(Model): """The port exposed on the container instance. + All required parameters must be populated in order to send to Azure. + :param protocol: The protocol associated with the port. Possible values include: 'TCP', 'UDP' :type protocol: str or ~azure.mgmt.containerinstance.models.ContainerNetworkProtocol - :param port: The port number exposed within the container group. + :param port: Required. The port number exposed within the container group. :type port: int """ @@ -32,7 +34,7 @@ class ContainerPort(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, port, protocol=None): - super(ContainerPort, self).__init__() - self.protocol = protocol - self.port = port + def __init__(self, **kwargs): + super(ContainerPort, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_port_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_port_py3.py new file mode 100644 index 000000000000..c5085347de4d --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_port_py3.py @@ -0,0 +1,40 @@ +# 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 ContainerPort(Model): + """The port exposed on the container instance. + + All required parameters must be populated in order to send to Azure. + + :param protocol: The protocol associated with the port. Possible values + include: 'TCP', 'UDP' + :type protocol: str or + ~azure.mgmt.containerinstance.models.ContainerNetworkProtocol + :param port: Required. The port number exposed within the container group. + :type port: int + """ + + _validation = { + 'port': {'required': True}, + } + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, port: int, protocol=None, **kwargs) -> None: + super(ContainerPort, self).__init__(**kwargs) + self.protocol = protocol + self.port = port diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_probe.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_probe.py new file mode 100644 index 000000000000..884447e44a81 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_probe.py @@ -0,0 +1,52 @@ +# 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 ContainerProbe(Model): + """The container probe, for liveness or readiness. + + :param exec_property: The execution command to probe + :type exec_property: ~azure.mgmt.containerinstance.models.ContainerExec + :param http_get: The Http Get settings to probe + :type http_get: ~azure.mgmt.containerinstance.models.ContainerHttpGet + :param initial_delay_seconds: The initial delay seconds. + :type initial_delay_seconds: int + :param period_seconds: The period seconds. + :type period_seconds: int + :param failure_threshold: The failure threshold. + :type failure_threshold: int + :param success_threshold: The success threshold. + :type success_threshold: int + :param timeout_seconds: The timeout seconds. + :type timeout_seconds: int + """ + + _attribute_map = { + 'exec_property': {'key': 'exec', 'type': 'ContainerExec'}, + 'http_get': {'key': 'httpGet', 'type': 'ContainerHttpGet'}, + 'initial_delay_seconds': {'key': 'initialDelaySeconds', 'type': 'int'}, + 'period_seconds': {'key': 'periodSeconds', 'type': 'int'}, + 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, + 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, + 'timeout_seconds': {'key': 'timeoutSeconds', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ContainerProbe, self).__init__(**kwargs) + self.exec_property = kwargs.get('exec_property', None) + self.http_get = kwargs.get('http_get', None) + self.initial_delay_seconds = kwargs.get('initial_delay_seconds', None) + self.period_seconds = kwargs.get('period_seconds', None) + self.failure_threshold = kwargs.get('failure_threshold', None) + self.success_threshold = kwargs.get('success_threshold', None) + self.timeout_seconds = kwargs.get('timeout_seconds', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_probe_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_probe_py3.py new file mode 100644 index 000000000000..67d0046da16f --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_probe_py3.py @@ -0,0 +1,52 @@ +# 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 ContainerProbe(Model): + """The container probe, for liveness or readiness. + + :param exec_property: The execution command to probe + :type exec_property: ~azure.mgmt.containerinstance.models.ContainerExec + :param http_get: The Http Get settings to probe + :type http_get: ~azure.mgmt.containerinstance.models.ContainerHttpGet + :param initial_delay_seconds: The initial delay seconds. + :type initial_delay_seconds: int + :param period_seconds: The period seconds. + :type period_seconds: int + :param failure_threshold: The failure threshold. + :type failure_threshold: int + :param success_threshold: The success threshold. + :type success_threshold: int + :param timeout_seconds: The timeout seconds. + :type timeout_seconds: int + """ + + _attribute_map = { + 'exec_property': {'key': 'exec', 'type': 'ContainerExec'}, + 'http_get': {'key': 'httpGet', 'type': 'ContainerHttpGet'}, + 'initial_delay_seconds': {'key': 'initialDelaySeconds', 'type': 'int'}, + 'period_seconds': {'key': 'periodSeconds', 'type': 'int'}, + 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, + 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, + 'timeout_seconds': {'key': 'timeoutSeconds', 'type': 'int'}, + } + + def __init__(self, *, exec_property=None, http_get=None, initial_delay_seconds: int=None, period_seconds: int=None, failure_threshold: int=None, success_threshold: int=None, timeout_seconds: int=None, **kwargs) -> None: + super(ContainerProbe, self).__init__(**kwargs) + self.exec_property = exec_property + self.http_get = http_get + self.initial_delay_seconds = initial_delay_seconds + self.period_seconds = period_seconds + self.failure_threshold = failure_threshold + self.success_threshold = success_threshold + self.timeout_seconds = timeout_seconds diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_properties_instance_view.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_properties_instance_view.py index 531dfa1550f3..0f15799863d1 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_properties_instance_view.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_properties_instance_view.py @@ -45,8 +45,8 @@ class ContainerPropertiesInstanceView(Model): 'events': {'key': 'events', 'type': '[Event]'}, } - def __init__(self): - super(ContainerPropertiesInstanceView, self).__init__() + def __init__(self, **kwargs): + super(ContainerPropertiesInstanceView, self).__init__(**kwargs) self.restart_count = None self.current_state = None self.previous_state = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_properties_instance_view_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_properties_instance_view_py3.py new file mode 100644 index 000000000000..a371bbb49f4a --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_properties_instance_view_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ContainerPropertiesInstanceView(Model): + """The instance view of the container instance. Only valid in response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar restart_count: The number of times that the container instance has + been restarted. + :vartype restart_count: int + :ivar current_state: Current container instance state. + :vartype current_state: + ~azure.mgmt.containerinstance.models.ContainerState + :ivar previous_state: Previous container instance state. + :vartype previous_state: + ~azure.mgmt.containerinstance.models.ContainerState + :ivar events: The events of the container instance. + :vartype events: list[~azure.mgmt.containerinstance.models.Event] + """ + + _validation = { + 'restart_count': {'readonly': True}, + 'current_state': {'readonly': True}, + 'previous_state': {'readonly': True}, + 'events': {'readonly': True}, + } + + _attribute_map = { + 'restart_count': {'key': 'restartCount', 'type': 'int'}, + 'current_state': {'key': 'currentState', 'type': 'ContainerState'}, + 'previous_state': {'key': 'previousState', 'type': 'ContainerState'}, + 'events': {'key': 'events', 'type': '[Event]'}, + } + + def __init__(self, **kwargs) -> None: + super(ContainerPropertiesInstanceView, self).__init__(**kwargs) + self.restart_count = None + self.current_state = None + self.previous_state = None + self.events = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_py3.py new file mode 100644 index 000000000000..cdcc92593f9b --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_py3.py @@ -0,0 +1,85 @@ +# 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 Container(Model): + """A container instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The user-provided name of the container instance. + :type name: str + :param image: Required. The name of the image used to create the container + instance. + :type image: str + :param command: The commands to execute within the container instance in + exec form. + :type command: list[str] + :param ports: The exposed ports on the container instance. + :type ports: list[~azure.mgmt.containerinstance.models.ContainerPort] + :param environment_variables: The environment variables to set in the + container instance. + :type environment_variables: + list[~azure.mgmt.containerinstance.models.EnvironmentVariable] + :ivar instance_view: The instance view of the container instance. Only + valid in response. + :vartype instance_view: + ~azure.mgmt.containerinstance.models.ContainerPropertiesInstanceView + :param resources: Required. The resource requirements of the container + instance. + :type resources: ~azure.mgmt.containerinstance.models.ResourceRequirements + :param volume_mounts: The volume mounts available to the container + instance. + :type volume_mounts: + list[~azure.mgmt.containerinstance.models.VolumeMount] + :param liveness_probe: The liveness probe. + :type liveness_probe: ~azure.mgmt.containerinstance.models.ContainerProbe + :param readiness_probe: The readiness probe. + :type readiness_probe: ~azure.mgmt.containerinstance.models.ContainerProbe + """ + + _validation = { + 'name': {'required': True}, + 'image': {'required': True}, + 'instance_view': {'readonly': True}, + 'resources': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'image': {'key': 'properties.image', 'type': 'str'}, + 'command': {'key': 'properties.command', 'type': '[str]'}, + 'ports': {'key': 'properties.ports', 'type': '[ContainerPort]'}, + 'environment_variables': {'key': 'properties.environmentVariables', 'type': '[EnvironmentVariable]'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'ContainerPropertiesInstanceView'}, + 'resources': {'key': 'properties.resources', 'type': 'ResourceRequirements'}, + 'volume_mounts': {'key': 'properties.volumeMounts', 'type': '[VolumeMount]'}, + 'liveness_probe': {'key': 'properties.livenessProbe', 'type': 'ContainerProbe'}, + 'readiness_probe': {'key': 'properties.readinessProbe', 'type': 'ContainerProbe'}, + } + + def __init__(self, *, name: str, image: str, resources, command=None, ports=None, environment_variables=None, volume_mounts=None, liveness_probe=None, readiness_probe=None, **kwargs) -> None: + super(Container, self).__init__(**kwargs) + self.name = name + self.image = image + self.command = command + self.ports = ports + self.environment_variables = environment_variables + self.instance_view = None + self.resources = resources + self.volume_mounts = volume_mounts + self.liveness_probe = liveness_probe + self.readiness_probe = readiness_probe diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_state.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_state.py index 8e21533f9679..8b70058cc3ad 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_state.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_state.py @@ -39,10 +39,10 @@ class ContainerState(Model): 'detail_status': {'key': 'detailStatus', 'type': 'str'}, } - def __init__(self, state=None, start_time=None, exit_code=None, finish_time=None, detail_status=None): - super(ContainerState, self).__init__() - self.state = state - self.start_time = start_time - self.exit_code = exit_code - self.finish_time = finish_time - self.detail_status = detail_status + def __init__(self, **kwargs): + super(ContainerState, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.start_time = kwargs.get('start_time', None) + self.exit_code = kwargs.get('exit_code', None) + self.finish_time = kwargs.get('finish_time', None) + self.detail_status = kwargs.get('detail_status', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_state_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_state_py3.py new file mode 100644 index 000000000000..34aa05a015d3 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_state_py3.py @@ -0,0 +1,48 @@ +# 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 ContainerState(Model): + """The container instance state. + + :param state: The state of the container instance. + :type state: str + :param start_time: The date-time when the container instance state + started. + :type start_time: datetime + :param exit_code: The container instance exit codes correspond to those + from the `docker run` command. + :type exit_code: int + :param finish_time: The date-time when the container instance state + finished. + :type finish_time: datetime + :param detail_status: The human-readable status of the container instance + state. + :type detail_status: str + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'exit_code': {'key': 'exitCode', 'type': 'int'}, + 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, + 'detail_status': {'key': 'detailStatus', 'type': 'str'}, + } + + def __init__(self, *, state: str=None, start_time=None, exit_code: int=None, finish_time=None, detail_status: str=None, **kwargs) -> None: + super(ContainerState, self).__init__(**kwargs) + self.state = state + self.start_time = start_time + self.exit_code = exit_code + self.finish_time = finish_time + self.detail_status = detail_status diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/environment_variable.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/environment_variable.py index 943109fcd2a6..d92e7d8bb730 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/environment_variable.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/environment_variable.py @@ -15,23 +15,28 @@ class EnvironmentVariable(Model): """The environment variable to set within the container instance. - :param name: The name of the environment variable. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the environment variable. :type name: str :param value: The value of the environment variable. :type value: str + :param secure_value: The value of the secure environment variable. + :type secure_value: str """ _validation = { 'name': {'required': True}, - 'value': {'required': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'}, + 'secure_value': {'key': 'secureValue', 'type': 'str'}, } - def __init__(self, name, value): - super(EnvironmentVariable, self).__init__() - self.name = name - self.value = value + def __init__(self, **kwargs): + super(EnvironmentVariable, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.secure_value = kwargs.get('secure_value', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/environment_variable_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/environment_variable_py3.py new file mode 100644 index 000000000000..49d6f145b134 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/environment_variable_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EnvironmentVariable(Model): + """The environment variable to set within the container instance. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the environment variable. + :type name: str + :param value: The value of the environment variable. + :type value: str + :param secure_value: The value of the secure environment variable. + :type secure_value: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'secure_value': {'key': 'secureValue', 'type': 'str'}, + } + + def __init__(self, *, name: str, value: str=None, secure_value: str=None, **kwargs) -> None: + super(EnvironmentVariable, self).__init__(**kwargs) + self.name = name + self.value = value + self.secure_value = secure_value diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/event.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/event.py index 30156452dc72..003d325e358a 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/event.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/event.py @@ -38,11 +38,11 @@ class Event(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, count=None, first_timestamp=None, last_timestamp=None, name=None, message=None, type=None): - super(Event, self).__init__() - self.count = count - self.first_timestamp = first_timestamp - self.last_timestamp = last_timestamp - self.name = name - self.message = message - self.type = type + def __init__(self, **kwargs): + super(Event, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.first_timestamp = kwargs.get('first_timestamp', None) + self.last_timestamp = kwargs.get('last_timestamp', None) + self.name = kwargs.get('name', None) + self.message = kwargs.get('message', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/event_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/event_py3.py new file mode 100644 index 000000000000..43aa706c89ca --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/event_py3.py @@ -0,0 +1,48 @@ +# 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 Event(Model): + """A container group or container instance event. + + :param count: The count of the event. + :type count: int + :param first_timestamp: The date-time of the earliest logged event. + :type first_timestamp: datetime + :param last_timestamp: The date-time of the latest logged event. + :type last_timestamp: datetime + :param name: The event name. + :type name: str + :param message: The event message. + :type message: str + :param type: The event type. + :type type: str + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'first_timestamp': {'key': 'firstTimestamp', 'type': 'iso-8601'}, + 'last_timestamp': {'key': 'lastTimestamp', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, count: int=None, first_timestamp=None, last_timestamp=None, name: str=None, message: str=None, type: str=None, **kwargs) -> None: + super(Event, self).__init__(**kwargs) + self.count = count + self.first_timestamp = first_timestamp + self.last_timestamp = last_timestamp + self.name = name + self.message = message + self.type = type diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/git_repo_volume.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/git_repo_volume.py index dd552deec1f2..f940ef6351e4 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/git_repo_volume.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/git_repo_volume.py @@ -16,12 +16,14 @@ class GitRepoVolume(Model): """Represents a volume that is populated with the contents of a git repository. + All required parameters must be populated in order to send to Azure. + :param directory: Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. :type directory: str - :param repository: Repository URL + :param repository: Required. Repository URL :type repository: str :param revision: Commit hash for the specified revision. :type revision: str @@ -37,8 +39,8 @@ class GitRepoVolume(Model): 'revision': {'key': 'revision', 'type': 'str'}, } - def __init__(self, repository, directory=None, revision=None): - super(GitRepoVolume, self).__init__() - self.directory = directory - self.repository = repository - self.revision = revision + def __init__(self, **kwargs): + super(GitRepoVolume, self).__init__(**kwargs) + self.directory = kwargs.get('directory', None) + self.repository = kwargs.get('repository', None) + self.revision = kwargs.get('revision', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/git_repo_volume_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/git_repo_volume_py3.py new file mode 100644 index 000000000000..c354e20e5384 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/git_repo_volume_py3.py @@ -0,0 +1,46 @@ +# 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 GitRepoVolume(Model): + """Represents a volume that is populated with the contents of a git + repository. + + All required parameters must be populated in order to send to Azure. + + :param directory: Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be the git + repository. Otherwise, if specified, the volume will contain the git + repository in the subdirectory with the given name. + :type directory: str + :param repository: Required. Repository URL + :type repository: str + :param revision: Commit hash for the specified revision. + :type revision: str + """ + + _validation = { + 'repository': {'required': True}, + } + + _attribute_map = { + 'directory': {'key': 'directory', 'type': 'str'}, + 'repository': {'key': 'repository', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'str'}, + } + + def __init__(self, *, repository: str, directory: str=None, revision: str=None, **kwargs) -> None: + super(GitRepoVolume, self).__init__(**kwargs) + self.directory = directory + self.repository = repository + self.revision = revision diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/image_registry_credential.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/image_registry_credential.py index b0a03de266f8..62989fe9d793 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/image_registry_credential.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/image_registry_credential.py @@ -15,10 +15,12 @@ class ImageRegistryCredential(Model): """Image registry credential. - :param server: The Docker image registry server without a protocol such as - "http" and "https". + All required parameters must be populated in order to send to Azure. + + :param server: Required. The Docker image registry server without a + protocol such as "http" and "https". :type server: str - :param username: The username for the private registry. + :param username: Required. The username for the private registry. :type username: str :param password: The password for the private registry. :type password: str @@ -35,8 +37,8 @@ class ImageRegistryCredential(Model): 'password': {'key': 'password', 'type': 'str'}, } - def __init__(self, server, username, password=None): - super(ImageRegistryCredential, self).__init__() - self.server = server - self.username = username - self.password = password + def __init__(self, **kwargs): + super(ImageRegistryCredential, self).__init__(**kwargs) + self.server = kwargs.get('server', None) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/image_registry_credential_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/image_registry_credential_py3.py new file mode 100644 index 000000000000..6af83932e2e5 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/image_registry_credential_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ImageRegistryCredential(Model): + """Image registry credential. + + All required parameters must be populated in order to send to Azure. + + :param server: Required. The Docker image registry server without a + protocol such as "http" and "https". + :type server: str + :param username: Required. The username for the private registry. + :type username: str + :param password: The password for the private registry. + :type password: str + """ + + _validation = { + 'server': {'required': True}, + 'username': {'required': True}, + } + + _attribute_map = { + 'server': {'key': 'server', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, server: str, username: str, password: str=None, **kwargs) -> None: + super(ImageRegistryCredential, self).__init__(**kwargs) + self.server = server + self.username = username + self.password = password diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address.py index df4ae1c2021d..07d02792b719 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address.py @@ -18,10 +18,12 @@ class IpAddress(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param ports: The list of ports exposed on the container group. + All required parameters must be populated in order to send to Azure. + + :param ports: Required. The list of ports exposed on the container group. :type ports: list[~azure.mgmt.containerinstance.models.Port] - :ivar type: Specifies if the IP is exposed to the public internet. Default - value: "Public" . + :ivar type: Required. Specifies if the IP is exposed to the public + internet. Default value: "Public" . :vartype type: str :param ip: The IP exposed to the public internet. :type ip: str @@ -47,9 +49,9 @@ class IpAddress(Model): type = "Public" - def __init__(self, ports, ip=None, dns_name_label=None): - super(IpAddress, self).__init__() - self.ports = ports - self.ip = ip - self.dns_name_label = dns_name_label + def __init__(self, **kwargs): + super(IpAddress, self).__init__(**kwargs) + self.ports = kwargs.get('ports', None) + self.ip = kwargs.get('ip', None) + self.dns_name_label = kwargs.get('dns_name_label', None) self.fqdn = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address_py3.py new file mode 100644 index 000000000000..752618b68479 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IpAddress(Model): + """IP address for the container group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param ports: Required. The list of ports exposed on the container group. + :type ports: list[~azure.mgmt.containerinstance.models.Port] + :ivar type: Required. Specifies if the IP is exposed to the public + internet. Default value: "Public" . + :vartype type: str + :param ip: The IP exposed to the public internet. + :type ip: str + :param dns_name_label: The Dns name label for the IP. + :type dns_name_label: str + :ivar fqdn: The FQDN for the IP. + :vartype fqdn: str + """ + + _validation = { + 'ports': {'required': True}, + 'type': {'required': True, 'constant': True}, + 'fqdn': {'readonly': True}, + } + + _attribute_map = { + 'ports': {'key': 'ports', 'type': '[Port]'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ip': {'key': 'ip', 'type': 'str'}, + 'dns_name_label': {'key': 'dnsNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + } + + type = "Public" + + def __init__(self, *, ports, ip: str=None, dns_name_label: str=None, **kwargs) -> None: + super(IpAddress, self).__init__(**kwargs) + self.ports = ports + self.ip = ip + self.dns_name_label = dns_name_label + self.fqdn = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/log_analytics.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/log_analytics.py new file mode 100644 index 000000000000..7179478dda9d --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/log_analytics.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LogAnalytics(Model): + """Container group log analytics information. + + All required parameters must be populated in order to send to Azure. + + :param workspace_id: Required. The workspace id for log analytics + :type workspace_id: str + :param workspace_key: Required. The workspace key for log analytics + :type workspace_key: str + """ + + _validation = { + 'workspace_id': {'required': True}, + 'workspace_key': {'required': True}, + } + + _attribute_map = { + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'workspace_key': {'key': 'workspaceKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LogAnalytics, self).__init__(**kwargs) + self.workspace_id = kwargs.get('workspace_id', None) + self.workspace_key = kwargs.get('workspace_key', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/log_analytics_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/log_analytics_py3.py new file mode 100644 index 000000000000..a628d09e0d45 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/log_analytics_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LogAnalytics(Model): + """Container group log analytics information. + + All required parameters must be populated in order to send to Azure. + + :param workspace_id: Required. The workspace id for log analytics + :type workspace_id: str + :param workspace_key: Required. The workspace key for log analytics + :type workspace_key: str + """ + + _validation = { + 'workspace_id': {'required': True}, + 'workspace_key': {'required': True}, + } + + _attribute_map = { + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'workspace_key': {'key': 'workspaceKey', 'type': 'str'}, + } + + def __init__(self, *, workspace_id: str, workspace_key: str, **kwargs) -> None: + super(LogAnalytics, self).__init__(**kwargs) + self.workspace_id = workspace_id + self.workspace_key = workspace_key diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/logs.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/logs.py index ebf445b6180a..5d39e27a2a7d 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/logs.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/logs.py @@ -23,6 +23,6 @@ class Logs(Model): 'content': {'key': 'content', 'type': 'str'}, } - def __init__(self, content=None): - super(Logs, self).__init__() - self.content = content + def __init__(self, **kwargs): + super(Logs, self).__init__(**kwargs) + self.content = kwargs.get('content', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/logs_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/logs_py3.py new file mode 100644 index 000000000000..02985d4324d7 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/logs_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Logs(Model): + """The logs. + + :param content: The content of the log. + :type content: str + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'str'}, + } + + def __init__(self, *, content: str=None, **kwargs) -> None: + super(Logs, self).__init__(**kwargs) + self.content = content diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation.py index c2bde99d5d41..80c154e22d77 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation.py @@ -15,9 +15,11 @@ class Operation(Model): """An operation for Azure Container Instance service. - :param name: The name of the operation. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the operation. :type name: str - :param display: The display information of the operation. + :param display: Required. The display information of the operation. :type display: ~azure.mgmt.containerinstance.models.OperationDisplay :param origin: The intended executor of the operation. Possible values include: 'User', 'System' @@ -36,8 +38,8 @@ class Operation(Model): 'origin': {'key': 'origin', 'type': 'str'}, } - def __init__(self, name, display, origin=None): - super(Operation, self).__init__() - self.name = name - self.display = display - self.origin = origin + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_display.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_display.py index 65ec8aed2b31..430c7517e8b1 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_display.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_display.py @@ -32,9 +32,9 @@ class OperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None, description=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_display_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_display_py3.py new file mode 100644 index 000000000000..7e7b32e54ecc --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# 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 OperationDisplay(Model): + """The display information of the operation. + + :param provider: The name of the provider of the operation. + :type provider: str + :param resource: The name of the resource type of the operation. + :type resource: str + :param operation: The friendly name of the operation. + :type operation: str + :param description: The description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_list_result.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_list_result.py index b87745f8448b..b2b84dd28e70 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_list_result.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_list_result.py @@ -27,7 +27,7 @@ class OperationListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(OperationListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(OperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_list_result_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_list_result_py3.py new file mode 100644 index 000000000000..3a24331abe72 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_list_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationListResult(Model): + """The operation list response that contains all operations for Azure + Container Instance service. + + :param value: The list of operations. + :type value: list[~azure.mgmt.containerinstance.models.Operation] + :param next_link: The URI to fetch the next page of operations. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(OperationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_py3.py new file mode 100644 index 000000000000..bf808f78f281 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_py3.py @@ -0,0 +1,45 @@ +# 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 Operation(Model): + """An operation for Azure Container Instance service. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the operation. + :type name: str + :param display: Required. The display information of the operation. + :type display: ~azure.mgmt.containerinstance.models.OperationDisplay + :param origin: The intended executor of the operation. Possible values + include: 'User', 'System' + :type origin: str or + ~azure.mgmt.containerinstance.models.ContainerInstanceOperationsOrigin + """ + + _validation = { + 'name': {'required': True}, + 'display': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, *, name: str, display, origin=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/port.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/port.py index 86dde3991fb4..5ac1a3993c24 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/port.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/port.py @@ -15,11 +15,13 @@ class Port(Model): """The port exposed on the container group. + All required parameters must be populated in order to send to Azure. + :param protocol: The protocol associated with the port. Possible values include: 'TCP', 'UDP' :type protocol: str or ~azure.mgmt.containerinstance.models.ContainerGroupNetworkProtocol - :param port: The port number. + :param port: Required. The port number. :type port: int """ @@ -32,7 +34,7 @@ class Port(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, port, protocol=None): - super(Port, self).__init__() - self.protocol = protocol - self.port = port + def __init__(self, **kwargs): + super(Port, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/port_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/port_py3.py new file mode 100644 index 000000000000..f3885ce3ab0a --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/port_py3.py @@ -0,0 +1,40 @@ +# 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 Port(Model): + """The port exposed on the container group. + + All required parameters must be populated in order to send to Azure. + + :param protocol: The protocol associated with the port. Possible values + include: 'TCP', 'UDP' + :type protocol: str or + ~azure.mgmt.containerinstance.models.ContainerGroupNetworkProtocol + :param port: Required. The port number. + :type port: int + """ + + _validation = { + 'port': {'required': True}, + } + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, port: int, protocol=None, **kwargs) -> None: + super(Port, self).__init__(**kwargs) + self.protocol = protocol + self.port = port diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource.py index abed0cc38091..ac9c1c8372a7 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource.py @@ -44,10 +44,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_limits.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_limits.py index 5791fe6c8109..b30fddc28856 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_limits.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_limits.py @@ -26,7 +26,7 @@ class ResourceLimits(Model): 'cpu': {'key': 'cpu', 'type': 'float'}, } - def __init__(self, memory_in_gb=None, cpu=None): - super(ResourceLimits, self).__init__() - self.memory_in_gb = memory_in_gb - self.cpu = cpu + def __init__(self, **kwargs): + super(ResourceLimits, self).__init__(**kwargs) + self.memory_in_gb = kwargs.get('memory_in_gb', None) + self.cpu = kwargs.get('cpu', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_limits_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_limits_py3.py new file mode 100644 index 000000000000..ec57b66a1458 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_limits_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceLimits(Model): + """The resource limits. + + :param memory_in_gb: The memory limit in GB of this container instance. + :type memory_in_gb: float + :param cpu: The CPU limit of this container instance. + :type cpu: float + """ + + _attribute_map = { + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'float'}, + 'cpu': {'key': 'cpu', 'type': 'float'}, + } + + def __init__(self, *, memory_in_gb: float=None, cpu: float=None, **kwargs) -> None: + super(ResourceLimits, self).__init__(**kwargs) + self.memory_in_gb = memory_in_gb + self.cpu = cpu diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_py3.py new file mode 100644 index 000000000000..1a3b80c5355c --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_requests.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_requests.py index 565b0fe24930..1ab6580d6eda 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_requests.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_requests.py @@ -15,9 +15,12 @@ class ResourceRequests(Model): """The resource requests. - :param memory_in_gb: The memory request in GB of this container instance. + All required parameters must be populated in order to send to Azure. + + :param memory_in_gb: Required. The memory request in GB of this container + instance. :type memory_in_gb: float - :param cpu: The CPU request of this container instance. + :param cpu: Required. The CPU request of this container instance. :type cpu: float """ @@ -31,7 +34,7 @@ class ResourceRequests(Model): 'cpu': {'key': 'cpu', 'type': 'float'}, } - def __init__(self, memory_in_gb, cpu): - super(ResourceRequests, self).__init__() - self.memory_in_gb = memory_in_gb - self.cpu = cpu + def __init__(self, **kwargs): + super(ResourceRequests, self).__init__(**kwargs) + self.memory_in_gb = kwargs.get('memory_in_gb', None) + self.cpu = kwargs.get('cpu', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_requests_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_requests_py3.py new file mode 100644 index 000000000000..a0c78fc84cd9 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_requests_py3.py @@ -0,0 +1,40 @@ +# 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 ResourceRequests(Model): + """The resource requests. + + All required parameters must be populated in order to send to Azure. + + :param memory_in_gb: Required. The memory request in GB of this container + instance. + :type memory_in_gb: float + :param cpu: Required. The CPU request of this container instance. + :type cpu: float + """ + + _validation = { + 'memory_in_gb': {'required': True}, + 'cpu': {'required': True}, + } + + _attribute_map = { + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'float'}, + 'cpu': {'key': 'cpu', 'type': 'float'}, + } + + def __init__(self, *, memory_in_gb: float, cpu: float, **kwargs) -> None: + super(ResourceRequests, self).__init__(**kwargs) + self.memory_in_gb = memory_in_gb + self.cpu = cpu diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_requirements.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_requirements.py index 77889f033791..db8de1b34121 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_requirements.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_requirements.py @@ -15,7 +15,10 @@ class ResourceRequirements(Model): """The resource requirements. - :param requests: The resource requests of this container instance. + All required parameters must be populated in order to send to Azure. + + :param requests: Required. The resource requests of this container + instance. :type requests: ~azure.mgmt.containerinstance.models.ResourceRequests :param limits: The resource limits of this container instance. :type limits: ~azure.mgmt.containerinstance.models.ResourceLimits @@ -30,7 +33,7 @@ class ResourceRequirements(Model): 'limits': {'key': 'limits', 'type': 'ResourceLimits'}, } - def __init__(self, requests, limits=None): - super(ResourceRequirements, self).__init__() - self.requests = requests - self.limits = limits + def __init__(self, **kwargs): + super(ResourceRequirements, self).__init__(**kwargs) + self.requests = kwargs.get('requests', None) + self.limits = kwargs.get('limits', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_requirements_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_requirements_py3.py new file mode 100644 index 000000000000..314c31c66b3b --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/resource_requirements_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceRequirements(Model): + """The resource requirements. + + All required parameters must be populated in order to send to Azure. + + :param requests: Required. The resource requests of this container + instance. + :type requests: ~azure.mgmt.containerinstance.models.ResourceRequests + :param limits: The resource limits of this container instance. + :type limits: ~azure.mgmt.containerinstance.models.ResourceLimits + """ + + _validation = { + 'requests': {'required': True}, + } + + _attribute_map = { + 'requests': {'key': 'requests', 'type': 'ResourceRequests'}, + 'limits': {'key': 'limits', 'type': 'ResourceLimits'}, + } + + def __init__(self, *, requests, limits=None, **kwargs) -> None: + super(ResourceRequirements, self).__init__(**kwargs) + self.requests = requests + self.limits = limits diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage.py index 3c93ff64a712..d86a21a03315 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage.py @@ -42,8 +42,8 @@ class Usage(Model): 'name': {'key': 'name', 'type': 'UsageName'}, } - def __init__(self): - super(Usage, self).__init__() + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) self.unit = None self.current_value = None self.limit = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_list_result.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_list_result.py index 58cd00f08724..4948bfa503ee 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_list_result.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_list_result.py @@ -30,6 +30,6 @@ class UsageListResult(Model): 'value': {'key': 'value', 'type': '[Usage]'}, } - def __init__(self): - super(UsageListResult, self).__init__() + def __init__(self, **kwargs): + super(UsageListResult, self).__init__(**kwargs) self.value = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_list_result_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_list_result_py3.py new file mode 100644 index 000000000000..ebecbf619150 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_list_result_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageListResult(Model): + """The response containing the usage data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: + :vartype value: list[~azure.mgmt.containerinstance.models.Usage] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_name.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_name.py index 9220c923a2ed..ab96bf2f6e2b 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_name.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_name.py @@ -34,7 +34,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self): - super(UsageName, self).__init__() + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_name_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_name_py3.py new file mode 100644 index 000000000000..2318a2cf5201 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_name_py3.py @@ -0,0 +1,40 @@ +# 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 UsageName(Model): + """The name object of the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The name of the resource + :vartype value: str + :ivar localized_value: The localized name of the resource + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_py3.py new file mode 100644 index 000000000000..68b2abbf614f --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """A single usage result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Unit of the usage result + :vartype unit: str + :ivar current_value: The current usage of the resource + :vartype current_value: int + :ivar limit: The maximum permitted usage of the resource. + :vartype limit: int + :ivar name: The name object of the resource + :vartype name: ~azure.mgmt.containerinstance.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/volume.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/volume.py index c70e3ac50875..0cb70af33ed4 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/volume.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/volume.py @@ -15,7 +15,9 @@ class Volume(Model): """The properties of the volume. - :param name: The name of the volume. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the volume. :type name: str :param azure_file: The Azure File volume. :type azure_file: ~azure.mgmt.containerinstance.models.AzureFileVolume @@ -39,10 +41,10 @@ class Volume(Model): 'git_repo': {'key': 'gitRepo', 'type': 'GitRepoVolume'}, } - def __init__(self, name, azure_file=None, empty_dir=None, secret=None, git_repo=None): - super(Volume, self).__init__() - self.name = name - self.azure_file = azure_file - self.empty_dir = empty_dir - self.secret = secret - self.git_repo = git_repo + def __init__(self, **kwargs): + super(Volume, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.azure_file = kwargs.get('azure_file', None) + self.empty_dir = kwargs.get('empty_dir', None) + self.secret = kwargs.get('secret', None) + self.git_repo = kwargs.get('git_repo', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/volume_mount.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/volume_mount.py index 96d9dbb1eb7b..7e5ec91b98bf 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/volume_mount.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/volume_mount.py @@ -15,10 +15,12 @@ class VolumeMount(Model): """The properties of the volume mount. - :param name: The name of the volume mount. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the volume mount. :type name: str - :param mount_path: The path within the container where the volume should - be mounted. Must not contain colon (:). + :param mount_path: Required. The path within the container where the + volume should be mounted. Must not contain colon (:). :type mount_path: str :param read_only: The flag indicating whether the volume mount is read-only. @@ -36,8 +38,8 @@ class VolumeMount(Model): 'read_only': {'key': 'readOnly', 'type': 'bool'}, } - def __init__(self, name, mount_path, read_only=None): - super(VolumeMount, self).__init__() - self.name = name - self.mount_path = mount_path - self.read_only = read_only + def __init__(self, **kwargs): + super(VolumeMount, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.mount_path = kwargs.get('mount_path', None) + self.read_only = kwargs.get('read_only', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/volume_mount_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/volume_mount_py3.py new file mode 100644 index 000000000000..9d4e7fdb1d05 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/volume_mount_py3.py @@ -0,0 +1,45 @@ +# 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 VolumeMount(Model): + """The properties of the volume mount. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the volume mount. + :type name: str + :param mount_path: Required. The path within the container where the + volume should be mounted. Must not contain colon (:). + :type mount_path: str + :param read_only: The flag indicating whether the volume mount is + read-only. + :type read_only: bool + """ + + _validation = { + 'name': {'required': True}, + 'mount_path': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + 'read_only': {'key': 'readOnly', 'type': 'bool'}, + } + + def __init__(self, *, name: str, mount_path: str, read_only: bool=None, **kwargs) -> None: + super(VolumeMount, self).__init__(**kwargs) + self.name = name + self.mount_path = mount_path + self.read_only = read_only diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/volume_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/volume_py3.py new file mode 100644 index 000000000000..cc8eaa03353e --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/volume_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Volume(Model): + """The properties of the volume. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the volume. + :type name: str + :param azure_file: The Azure File volume. + :type azure_file: ~azure.mgmt.containerinstance.models.AzureFileVolume + :param empty_dir: The empty directory volume. + :type empty_dir: object + :param secret: The secret volume. + :type secret: dict[str, str] + :param git_repo: The git repo volume. + :type git_repo: ~azure.mgmt.containerinstance.models.GitRepoVolume + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'azure_file': {'key': 'azureFile', 'type': 'AzureFileVolume'}, + 'empty_dir': {'key': 'emptyDir', 'type': 'object'}, + 'secret': {'key': 'secret', 'type': '{str}'}, + 'git_repo': {'key': 'gitRepo', 'type': 'GitRepoVolume'}, + } + + def __init__(self, *, name: str, azure_file=None, empty_dir=None, secret=None, git_repo=None, **kwargs) -> None: + super(Volume, self).__init__(**kwargs) + self.name = name + self.azure_file = azure_file + self.empty_dir = empty_dir + self.secret = secret + self.git_repo = git_repo diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py index 1729a0ebb8cb..53b4a7945cca 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py @@ -12,13 +12,11 @@ from .container_groups_operations import ContainerGroupsOperations from .operations import Operations from .container_group_usage_operations import ContainerGroupUsageOperations -from .container_logs_operations import ContainerLogsOperations -from .start_container_operations import StartContainerOperations +from .container_operations import ContainerOperations __all__ = [ 'ContainerGroupsOperations', 'Operations', 'ContainerGroupUsageOperations', - 'ContainerLogsOperations', - 'StartContainerOperations', + 'ContainerOperations', ] 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 7417d09bd637..42b2710e9d49 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 @@ -23,7 +23,7 @@ class ContainerGroupUsageOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2018-02-01-preview". + :ivar api_version: Client API version. Constant value: "2018-06-01". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-02-01-preview" + self.api_version = "2018-06-01" self.config = config 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 0f405fa3ebf7..2c5e3b6647f3 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,8 +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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -25,7 +25,7 @@ class ContainerGroupsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2018-02-01-preview". + :ivar api_version: Client API version. Constant value: "2018-06-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-02-01-preview" + self.api_version = "2018-06-01" self.config = config @@ -304,7 +304,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, container_group_name, container_group, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, container_group_name, container_group, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update container groups. Create or update container groups with specified configurations. @@ -318,13 +318,16 @@ def create_or_update( :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 + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ContainerGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerinstance.models.ContainerGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerinstance.models.ContainerGroup]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -335,30 +338,8 @@ def create_or_update( 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: @@ -367,12 +348,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = 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) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}'} def update( 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 deleted file mode 100644 index 72513725100e..000000000000 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_logs_operations.py +++ /dev/null @@ -1,112 +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 ContainerLogsOperations(object): - """ContainerLogsOperations 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 list( - self, resource_group_name, container_group_name, container_name, tail=None, custom_headers=None, raw=False, **operation_config): - """Get the logs for a specified container instance. - - Get the logs 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 tail: The number of lines to show from the tail of the - container instance log. If not provided, all available logs are shown - up to 4mb. - :type tail: int - :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: Logs or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerinstance.models.Logs or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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') - if tail is not None: - query_parameters['tail'] = self._serialize.query("tail", tail, 'int') - - # 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('Logs', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - 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/start_container_operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_operations.py similarity index 51% rename from azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py rename to azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_operations.py index e3387a6c2586..a6d9457580e7 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_operations.py @@ -16,14 +16,14 @@ from .. import models -class StartContainerOperations(object): - """StartContainerOperations operations. +class ContainerOperations(object): + """ContainerOperations 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". + :ivar api_version: Client API version. Constant value: "2018-06-01". """ models = models @@ -33,16 +33,90 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-02-01-preview" + self.api_version = "2018-06-01" self.config = config - def launch_exec( + def list_logs( + self, resource_group_name, container_group_name, container_name, tail=None, custom_headers=None, raw=False, **operation_config): + """Get the logs for a specified container instance. + + Get the logs 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 tail: The number of lines to show from the tail of the + container instance log. If not provided, all available logs are shown + up to 4mb. + :type tail: int + :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: Logs or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerinstance.models.Logs or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_logs.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') + if tail is not None: + query_parameters['tail'] = self._serialize.query("tail", tail, 'int') + + # 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('Logs', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs'} + + def execute_command( 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. + """Executes a command in a specific container instance. - Starts the exec command for a specified container instance in a - specified resource group and container group. + Executes a command for a specific 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 @@ -68,7 +142,7 @@ def launch_exec( container_exec_request = models.ContainerExecRequest(command=command, terminal_size=terminal_size) # Construct URL - url = self.launch_exec.metadata['url'] + url = self.execute_command.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 +188,4 @@ def launch_exec( return client_raw_response return deserialized - launch_exec.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec'} + execute_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec'} diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/operations.py index 77b53408cd2f..9de4177e731e 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/operations.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/operations.py @@ -23,7 +23,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2018-02-01-preview". + :ivar api_version: Client API version. Constant value: "2018-06-01". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-02-01-preview" + self.api_version = "2018-06-01" self.config = config diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/version.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/version.py index 85da2c00c1a6..a39916c162ce 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.4.0" +VERSION = "1.0.0" diff --git a/azure-mgmt-containerinstance/build.json b/azure-mgmt-containerinstance/build.json deleted file mode 100644 index 86aab9d5767f..000000000000 --- a/azure-mgmt-containerinstance/build.json +++ /dev/null @@ -1 +0,0 @@ -{"autorest": "1.2.2", "date": "2017-09-08T01:23:49Z", "version": ""} \ No newline at end of file diff --git a/azure-mgmt-containerinstance/sdk_packaging.toml b/azure-mgmt-containerinstance/sdk_packaging.toml new file mode 100644 index 000000000000..65ee5cd98283 --- /dev/null +++ b/azure-mgmt-containerinstance/sdk_packaging.toml @@ -0,0 +1,5 @@ +[packaging] +package_name = "azure-mgmt-containerinstance" +package_pprint_name = "Container Instance" +package_doc_id = "containerinstance" +is_stable = true diff --git a/azure-mgmt-containerinstance/setup.py b/azure-mgmt-containerinstance/setup.py index 3ae7b6b93ae5..1f016a4e02ef 100644 --- a/azure-mgmt-containerinstance/setup.py +++ b/azure-mgmt-containerinstance/setup.py @@ -64,7 +64,7 @@ author_email='azpysdkhelp@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', @@ -77,7 +77,7 @@ zip_safe=False, packages=find_packages(exclude=["tests"]), install_requires=[ - 'msrestazure>=0.4.20,<2.0.0', + 'msrestazure>=0.4.27,<2.0.0', 'azure-common~=1.1', ], cmdclass=cmdclass diff --git a/azure-mgmt-containerinstance/tests/recordings/test_mgmt_containerinstance.test_container_instance.yaml b/azure-mgmt-containerinstance/tests/recordings/test_mgmt_containerinstance.test_container_instance.yaml index 60d407dfa75e..5957bb309e7e 100644 --- a/azure-mgmt-containerinstance/tests/recordings/test_mgmt_containerinstance.test_container_instance.yaml +++ b/azure-mgmt-containerinstance/tests/recordings/test_mgmt_containerinstance.test_container_instance.yaml @@ -2,34 +2,36 @@ interactions: - request: body: '{"location": "westus", "properties": {"containers": [{"name": "pycontainer26441510", "properties": {"image": "alpine:latest", "resources": {"requests": {"memoryInGB": - 1.0, "cpu": 1.0}}, "volumeMounts": [{"name": "empty-volume", "mountPath": "/mnt/mydir"}]}}], - "restartPolicy": "OnFailure", "osType": "Linux", "volumes": [{"name": "empty-volume", - "emptyDir": {}}]}}' + 1.0, "cpu": 1.0}}, "volumeMounts": [{"name": "empty-volume", "mountPath": "/mnt/mydir"}], + "livenessProbe": {"exec": {"command": ["cat/tmp/healthy"]}, "periodSeconds": + 5}}}], "restartPolicy": "OnFailure", "osType": "Linux", "volumes": [{"name": + "empty-volume", "emptyDir": {}}], "diagnostics": {"logAnalytics": {"workspaceId": + "workspaceId", "workspaceKey": "workspaceKey"}}}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Length: ['364'] + Content-Length: ['542'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 - msrest_azure/0.4.22 azure-mgmt-containerinstance/0.4.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.5.0 + msrest_azure/0.4.31 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510?api-version=2018-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510?api-version=2018-06-01 response: - body: {string: '{"properties":{"provisioningState":"Creating","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}]}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"events":[],"state":"Pending"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}'} + body: {string: '{"properties":{"provisioningState":"Pending","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}],"livenessProbe":{"exec":{"command":["cat/tmp/healthy"]},"periodSeconds":5}}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"state":"Pending"},"diagnostics":{"logAnalytics":{"workspaceId":"workspaceId"}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}'} headers: azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/West - US/operations/5ec11603-ea02-40b4-822e-5856f6518cae?api-version=2018-02-01-preview'] + US/operations/38a57cb2-77ab-4dc6-bc1d-c9267e266050?api-version=2018-02-01-preview'] cache-control: [no-cache] - content-length: ['741'] + content-length: ['864'] content-type: [application/json; charset=utf-8] - date: ['Mon, 19 Mar 2018 23:36:24 GMT'] + date: ['Wed, 20 Jun 2018 17:04:01 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-resource-requests-pt1h: ['84'] + x-ms-ratelimit-remaining-subscription-resource-requests-pt1h: ['95'] x-ms-ratelimit-remaining-subscription-resource-requests-pt5m: ['98'] x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 201, message: Created} @@ -39,21 +41,21 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 - msrest_azure/0.4.22 azure-mgmt-containerinstance/0.4.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.5.0 + msrest_azure/0.4.31 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/West%20US/operations/5ec11603-ea02-40b4-822e-5856f6518cae?api-version=2018-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/West%20US/operations/38a57cb2-77ab-4dc6-bc1d-c9267e266050?api-version=2018-02-01-preview response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","status":"Succeeded","startTime":"2018-03-19T23:36:23.8597884Z","properties":{"events":[{"count":1,"firstTimestamp":"2018-03-19T23:36:32Z","lastTimestamp":"2018-03-19T23:36:32Z","name":"Pulling","message":"pulling - image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-03-19T23:36:34Z","lastTimestamp":"2018-03-19T23:36:34Z","name":"Pulled","message":"Successfully - pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-03-19T23:36:34Z","lastTimestamp":"2018-03-19T23:36:34Z","name":"Created","message":"Created - container with id 8b97d2d01d60e8505ee23d259c04f7193c2d6272f54ea9725f82cfcbfa189f06","type":"Normal"},{"count":1,"firstTimestamp":"2018-03-19T23:36:35Z","lastTimestamp":"2018-03-19T23:36:35Z","name":"Started","message":"Started - container with id 8b97d2d01d60e8505ee23d259c04f7193c2d6272f54ea9725f82cfcbfa189f06","type":"Normal"}]}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","status":"Succeeded","startTime":"2018-06-20T17:04:01.7830474Z","properties":{"events":[{"count":1,"firstTimestamp":"2018-06-20T17:04:06Z","lastTimestamp":"2018-06-20T17:04:06Z","name":"Pulling","message":"pulling + image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-06-20T17:04:08Z","lastTimestamp":"2018-06-20T17:04:08Z","name":"Pulled","message":"Successfully + pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-06-20T17:04:08Z","lastTimestamp":"2018-06-20T17:04:08Z","name":"Created","message":"Created + container with id d4c98fbf2fac00198db4b3c803f6a959fc9e3dac9b470f67ffe58ffa29f75f5f","type":"Normal"},{"count":1,"firstTimestamp":"2018-06-20T17:04:09Z","lastTimestamp":"2018-06-20T17:04:09Z","name":"Started","message":"Started + container with id d4c98fbf2fac00198db4b3c803f6a959fc9e3dac9b470f67ffe58ffa29f75f5f","type":"Normal"}]}}'} headers: cache-control: [no-cache] content-length: ['1100'] content-type: [application/json; charset=utf-8] - date: ['Mon, 19 Mar 2018 23:36:54 GMT'] + date: ['Wed, 20 Jun 2018 17:04:32 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -67,21 +69,21 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 - msrest_azure/0.4.22 azure-mgmt-containerinstance/0.4.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.5.0 + msrest_azure/0.4.31 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510?api-version=2018-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510?api-version=2018-06-01 response: - body: {string: '{"properties":{"provisioningState":"Succeeded","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"instanceView":{"restartCount":0,"currentState":{"state":"Terminated","startTime":"2018-03-19T23:36:35Z","exitCode":0,"finishTime":"2018-03-19T23:36:35Z","detailStatus":"Completed"},"events":[{"count":1,"firstTimestamp":"2018-03-19T23:36:32Z","lastTimestamp":"2018-03-19T23:36:32Z","name":"Pulling","message":"pulling - image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-03-19T23:36:34Z","lastTimestamp":"2018-03-19T23:36:34Z","name":"Pulled","message":"Successfully - pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-03-19T23:36:34Z","lastTimestamp":"2018-03-19T23:36:34Z","name":"Created","message":"Created - container with id 8b97d2d01d60e8505ee23d259c04f7193c2d6272f54ea9725f82cfcbfa189f06","type":"Normal"},{"count":1,"firstTimestamp":"2018-03-19T23:36:35Z","lastTimestamp":"2018-03-19T23:36:35Z","name":"Started","message":"Started - container with id 8b97d2d01d60e8505ee23d259c04f7193c2d6272f54ea9725f82cfcbfa189f06","type":"Normal"}]},"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}]}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"events":[],"state":"Succeeded"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}'} + body: {string: '{"properties":{"provisioningState":"Succeeded","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"instanceView":{"restartCount":0,"currentState":{"state":"Terminated","startTime":"2018-06-20T17:04:09Z","exitCode":0,"finishTime":"2018-06-20T17:04:09Z","detailStatus":"Completed"},"events":[{"count":1,"firstTimestamp":"2018-06-20T17:04:06Z","lastTimestamp":"2018-06-20T17:04:06Z","name":"Pulling","message":"pulling + image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-06-20T17:04:08Z","lastTimestamp":"2018-06-20T17:04:08Z","name":"Pulled","message":"Successfully + pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-06-20T17:04:08Z","lastTimestamp":"2018-06-20T17:04:08Z","name":"Created","message":"Created + container with id d4c98fbf2fac00198db4b3c803f6a959fc9e3dac9b470f67ffe58ffa29f75f5f","type":"Normal"},{"count":1,"firstTimestamp":"2018-06-20T17:04:09Z","lastTimestamp":"2018-06-20T17:04:09Z","name":"Started","message":"Started + container with id d4c98fbf2fac00198db4b3c803f6a959fc9e3dac9b470f67ffe58ffa29f75f5f","type":"Normal"}]},"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}],"livenessProbe":{"exec":{"command":["cat/tmp/healthy"]},"periodSeconds":5}}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"events":[],"state":"Succeeded"},"diagnostics":{"logAnalytics":{"workspaceId":"workspaceId"}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}'} headers: cache-control: [no-cache] - content-length: ['1739'] + content-length: ['1875'] content-type: [application/json; charset=utf-8] - date: ['Mon, 19 Mar 2018 23:36:55 GMT'] + date: ['Wed, 20 Jun 2018 17:04:33 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -96,22 +98,22 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 - msrest_azure/0.4.22 azure-mgmt-containerinstance/0.4.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.5.0 + msrest_azure/0.4.31 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510?api-version=2018-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510?api-version=2018-06-01 response: - body: {string: '{"properties":{"provisioningState":"Succeeded","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"instanceView":{"restartCount":0,"currentState":{"state":"Terminated","startTime":"2018-03-19T23:36:35Z","exitCode":0,"finishTime":"2018-03-19T23:36:35Z","detailStatus":"Completed"},"events":[{"count":1,"firstTimestamp":"2018-03-19T23:36:32Z","lastTimestamp":"2018-03-19T23:36:32Z","name":"Pulling","message":"pulling - image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-03-19T23:36:34Z","lastTimestamp":"2018-03-19T23:36:34Z","name":"Pulled","message":"Successfully - pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-03-19T23:36:34Z","lastTimestamp":"2018-03-19T23:36:34Z","name":"Created","message":"Created - container with id 8b97d2d01d60e8505ee23d259c04f7193c2d6272f54ea9725f82cfcbfa189f06","type":"Normal"},{"count":1,"firstTimestamp":"2018-03-19T23:36:35Z","lastTimestamp":"2018-03-19T23:36:35Z","name":"Started","message":"Started - container with id 8b97d2d01d60e8505ee23d259c04f7193c2d6272f54ea9725f82cfcbfa189f06","type":"Normal"}]},"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}]}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"events":[],"state":"Succeeded"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}'} + body: {string: '{"properties":{"provisioningState":"Succeeded","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"instanceView":{"restartCount":0,"currentState":{"state":"Terminated","startTime":"2018-06-20T17:04:09Z","exitCode":0,"finishTime":"2018-06-20T17:04:09Z","detailStatus":"Completed"},"events":[{"count":1,"firstTimestamp":"2018-06-20T17:04:06Z","lastTimestamp":"2018-06-20T17:04:06Z","name":"Pulling","message":"pulling + image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-06-20T17:04:08Z","lastTimestamp":"2018-06-20T17:04:08Z","name":"Pulled","message":"Successfully + pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-06-20T17:04:08Z","lastTimestamp":"2018-06-20T17:04:08Z","name":"Created","message":"Created + container with id d4c98fbf2fac00198db4b3c803f6a959fc9e3dac9b470f67ffe58ffa29f75f5f","type":"Normal"},{"count":1,"firstTimestamp":"2018-06-20T17:04:09Z","lastTimestamp":"2018-06-20T17:04:09Z","name":"Started","message":"Started + container with id d4c98fbf2fac00198db4b3c803f6a959fc9e3dac9b470f67ffe58ffa29f75f5f","type":"Normal"}]},"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}],"livenessProbe":{"exec":{"command":["cat/tmp/healthy"]},"periodSeconds":5}}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"events":[],"state":"Succeeded"},"diagnostics":{"logAnalytics":{"workspaceId":"workspaceId"}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}'} headers: cache-control: [no-cache] - content-length: ['1739'] + content-length: ['1875'] content-type: [application/json; charset=utf-8] - date: ['Mon, 19 Mar 2018 23:36:56 GMT'] + date: ['Wed, 20 Jun 2018 17:04:34 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -126,18 +128,18 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 - msrest_azure/0.4.22 azure-mgmt-containerinstance/0.4.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.5.0 + msrest_azure/0.4.31 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups?api-version=2018-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups?api-version=2018-06-01 response: - body: {string: '{"value":[{"properties":{"provisioningState":"Succeeded","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}]}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}]}'} + body: {string: '{"value":[{"properties":{"provisioningState":"Succeeded","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}],"livenessProbe":{"exec":{"command":["cat/tmp/healthy"]},"periodSeconds":5}}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"diagnostics":{"logAnalytics":{"workspaceId":"workspaceId"}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}]}'} headers: cache-control: [no-cache] - content-length: ['707'] + content-length: ['843'] content-type: [application/json; charset=utf-8] - date: ['Mon, 19 Mar 2018 23:36:56 GMT'] + date: ['Wed, 20 Jun 2018 17:04:34 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -153,24 +155,50 @@ interactions: Connection: [keep-alive] Content-Length: ['66'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 - msrest_azure/0.4.22 azure-mgmt-containerinstance/0.4.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.5.0 + msrest_azure/0.4.31 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] accept-language: [en-US] method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510/containers/pycontainer26441510/exec?api-version=2018-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510/containers/pycontainer26441510/exec?api-version=2018-06-01 response: - body: {string: '{"webSocketUri":"wss://bridge-linux-01.westus.management.azurecontainer.io/exec/caas-17444714c0f443b0b9a8e30467a3308d/bridge-b922f3e57bff7dd4?rows=24&cols=80&api-version=2018-02-01-preview","password":"IKcUC6zOXP68r8MbDrj7Rcbt6RwQHPrrFJA2SYdWAsI"}'} + body: {string: '{"webSocketUri":"wss://bridge-linux-17.westus.management.azurecontainer.io/exec/caas-b366c4d398d2446186000db440d682dd/bridge-9658fa886f0ac586?rows=24&cols=80&api-version=2018-02-01-preview","password":"ACurGmg7CGUu_utlaXMzgOBUkdalQU_3shgrdGzsV5A[[EOM]]"}'} headers: cache-control: [no-cache] - content-length: ['247'] + content-length: ['254'] content-type: [application/json; charset=utf-8] - date: ['Mon, 19 Mar 2018 23:36:57 GMT'] + date: ['Wed, 20 Jun 2018 17:04:35 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: ['Accept-Encoding,Accept-Encoding'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.5.0 + msrest_azure/0.4.31 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510/containers/pycontainer26441510/logs?api-version=2018-06-01 + response: + body: {string: '{"content":""}'} + headers: + cache-control: [no-cache] + content-length: ['14'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 20 Jun 2018 17:04:35 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: ['Accept-Encoding,Accept-Encoding'] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 200, message: OK} version: 1 diff --git a/azure-mgmt-containerinstance/tests/test_mgmt_containerinstance.py b/azure-mgmt-containerinstance/tests/test_mgmt_containerinstance.py index a0f2b8b14cb6..4b4d56439155 100644 --- a/azure-mgmt-containerinstance/tests/test_mgmt_containerinstance.py +++ b/azure-mgmt-containerinstance/tests/test_mgmt_containerinstance.py @@ -29,6 +29,9 @@ def test_container_instance(self, resource_group, location): cpu = 1 memory = 1 restart_policy = 'OnFailure' + livenessprob_period_seconds = 5 + log_analytics_workspace_id = 'workspaceId' + log_analytics_workspace_key = 'workspaceKey' empty_volume = Volume(name='empty-volume', empty_dir={}) volume_mount = VolumeMount(name='empty-volume', mount_path='/mnt/mydir') @@ -47,11 +50,26 @@ def test_container_instance(self, resource_group, location): 'cpu': cpu } }, - 'volume_mounts': [volume_mount] + 'volume_mounts': [volume_mount], + 'liveness_probe': { + 'exec': { + 'command': [ + 'cat' + '/tmp/healthy' + ] + }, + 'periodSeconds': livenessprob_period_seconds + } }], 'os_type': os_type, 'restart_policy': restart_policy, - 'volumes': [empty_volume] + 'diagnostics': { + 'log_analytics': { + 'workspace_id': log_analytics_workspace_id, + 'workspace_key': log_analytics_workspace_key + } + }, + 'volumes': [empty_volume], } ) container_group = poller.result() @@ -60,11 +78,13 @@ def test_container_instance(self, resource_group, location): self.assertEqual(container_group.location, location) self.assertEqual(container_group.os_type, os_type) self.assertEqual(container_group.restart_policy, restart_policy) + self.assertEqual(container_group.diagnostics.log_analytics.workspace_id, log_analytics_workspace_id) self.assertEqual(container_group.containers[0].name, container_group_name) self.assertEqual(container_group.containers[0].image, image) self.assertEqual(container_group.containers[0].resources.requests.memory_in_gb, memory) self.assertEqual(container_group.containers[0].resources.requests.cpu, cpu) self.assertEqual(container_group.volumes[0].name, empty_volume.name) + self.assertEqual(container_group.containers[0].liveness_probe.period_seconds, livenessprob_period_seconds) container_group = self.client.container_groups.get(resource_group.name, container_group_name) @@ -72,11 +92,13 @@ def test_container_instance(self, resource_group, location): self.assertEqual(container_group.location, location) self.assertEqual(container_group.os_type, os_type) self.assertEqual(container_group.restart_policy, restart_policy) + self.assertEqual(container_group.diagnostics.log_analytics.workspace_id, log_analytics_workspace_id) self.assertEqual(container_group.containers[0].name, container_group_name) self.assertEqual(container_group.containers[0].image, image) self.assertEqual(container_group.containers[0].resources.requests.memory_in_gb, memory) self.assertEqual(container_group.containers[0].resources.requests.cpu, cpu) self.assertEqual(container_group.volumes[0].name, empty_volume.name) + self.assertEqual(container_group.containers[0].liveness_probe.period_seconds, livenessprob_period_seconds) container_groups = list(self.client.container_groups.list_by_resource_group(resource_group.name)) self.assertEqual(len(container_groups), 1) @@ -84,21 +106,30 @@ def test_container_instance(self, resource_group, location): self.assertEqual(container_groups[0].location, location) self.assertEqual(container_groups[0].os_type, os_type) self.assertEqual(container_groups[0].restart_policy, restart_policy) + self.assertEqual(container_groups[0].diagnostics.log_analytics.workspace_id, log_analytics_workspace_id) self.assertEqual(container_groups[0].containers[0].name, container_group_name) self.assertEqual(container_groups[0].containers[0].image, image) self.assertEqual(container_groups[0].containers[0].resources.requests.memory_in_gb, memory) self.assertEqual(container_groups[0].containers[0].resources.requests.cpu, cpu) self.assertEqual(container_groups[0].volumes[0].name, empty_volume.name) + self.assertEqual(container_groups[0].containers[0].liveness_probe.period_seconds, livenessprob_period_seconds) + # Testing Container_Execute_Command terminal_size = { "rows": 24, "cols": 80 } command = "/bin/bash" - containerExecResponse = self.client.start_container.launch_exec(resource_group.name, container_group.name, container_group.containers[0].name, command, terminal_size) + containerExecResponse = self.client.container.execute_command(resource_group.name, container_group.name, container_group.containers[0].name, command, terminal_size) self.assertNotEqual(containerExecResponse.web_socket_uri, None) self.assertNotEqual(containerExecResponse.password, None) + # Testing Container_List_Logs + containerLogResponse = self.client.container.list_logs(resource_group.name, container_group.name, container_group.containers[0].name) + + + + #------------------------------------------------------------------------------ if __name__ == '__main__': unittest.main()