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..63d72f9bcaf9 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 @@ -89,7 +89,7 @@ def __init__( self._client = ServiceClient(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-04-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py index 4d7d387d8a68..bf283a05231f 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py @@ -9,35 +9,66 @@ # 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_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 .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 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 from .container_group_paged import ContainerGroupPaged from .container_instance_management_client_enums import ( ContainerNetworkProtocol, 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..c1669d5148c3 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,7 +38,8 @@ 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. @@ -61,13 +65,13 @@ class Container(Model): 'volume_mounts': {'key': 'properties.volumeMounts', 'type': '[VolumeMount]'}, } - 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) 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..8e3f186c7865 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 @@ -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..3e5529322e6c --- /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 start container exec request. + + :param command: The command to be executed. + :type command: str + :param terminal_size: The size of the terminal. + :type terminal_size: + ~azure.mgmt.containerinstance.models.ContainerExecRequestTerminalSize + """ + + _attribute_map = { + 'command': {'key': 'command', 'type': 'str'}, + 'terminal_size': {'key': 'terminalSize', 'type': 'ContainerExecRequestTerminalSize'}, + } + + def __init__(self, *, command: 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..2bd04a7316d1 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 @@ -15,18 +15,18 @@ 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 + :param row: The row size of the terminal + :type row: int + :param column: The column size of the terminal + :type column: int """ _attribute_map = { - 'rows': {'key': 'rows', 'type': 'int'}, - 'cols': {'key': 'cols', 'type': 'int'}, + 'row': {'key': 'row', 'type': 'int'}, + 'column': {'key': 'column', '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.row = kwargs.get('row', None) + self.column = kwargs.get('column', 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..363142b51b42 --- /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 row: The row size of the terminal + :type row: int + :param column: The column size of the terminal + :type column: int + """ + + _attribute_map = { + 'row': {'key': 'row', 'type': 'int'}, + 'column': {'key': 'column', 'type': 'int'}, + } + + def __init__(self, *, row: int=None, column: int=None, **kwargs) -> None: + super(ContainerExecRequestTerminalSize, self).__init__(**kwargs) + self.row = row + self.column = column diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_response.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_response.py index 33e3557041a5..62af20771c0b 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 @@ -15,18 +15,26 @@ 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 + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar web_socket_uri: The uri for the exec websocket. + :vartype web_socket_uri: str + :ivar password: The password to start the exec command. + :vartype password: str """ + _validation = { + 'web_socket_uri': {'readonly': True}, + 'password': {'readonly': True}, + } + _attribute_map = { 'web_socket_uri': {'key': 'webSocketUri', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, } - def __init__(self, web_socket_uri=None, password=None): - super(ContainerExecResponse, self).__init__() - self.web_socket_uri = web_socket_uri - self.password = password + def __init__(self, **kwargs): + super(ContainerExecResponse, self).__init__(**kwargs) + self.web_socket_uri = None + self.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..599f5ad654c6 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_exec_response_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 ContainerExecResponse(Model): + """The information for the container exec command. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar web_socket_uri: The uri for the exec websocket. + :vartype web_socket_uri: str + :ivar password: The password to start the exec command. + :vartype password: str + """ + + _validation = { + 'web_socket_uri': {'readonly': True}, + 'password': {'readonly': True}, + } + + _attribute_map = { + 'web_socket_uri': {'key': 'webSocketUri', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ContainerExecResponse, self).__init__(**kwargs) + self.web_socket_uri = None + self.password = None 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..b2ff8579927e 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 @@ -86,13 +89,13 @@ class ContainerGroup(Resource): 'instance_view': {'key': 'properties.instanceView', 'type': 'ContainerGroupPropertiesInstanceView'}, } - 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 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..921e92c2d7e3 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_py3.py @@ -0,0 +1,101 @@ +# 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 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 + """ + + _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'}, + } + + def __init__(self, *, containers, os_type, location: str=None, tags=None, image_registry_credentials=None, restart_policy=None, ip_address=None, volumes=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 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_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..54f0b8a2bd0f --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_py3.py @@ -0,0 +1,77 @@ +# 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] + """ + + _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]'}, + } + + def __init__(self, *, name: str, image: str, resources, command=None, ports=None, environment_variables=None, volume_mounts=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 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..1f29eb566eaa 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_state.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_state.py @@ -15,22 +15,32 @@ 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 + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar state: The state of the container instance. + :vartype state: str + :ivar start_time: The date-time when the container instance state started. + :vartype start_time: datetime + :ivar 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 + :vartype exit_code: int + :ivar 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 + :vartype finish_time: datetime + :ivar detail_status: The human-readable status of the container instance state. - :type detail_status: str + :vartype detail_status: str """ + _validation = { + 'state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'exit_code': {'readonly': True}, + 'finish_time': {'readonly': True}, + 'detail_status': {'readonly': True}, + } + _attribute_map = { 'state': {'key': 'state', 'type': 'str'}, 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, @@ -39,10 +49,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 = None + self.start_time = None + self.exit_code = None + self.finish_time = None + self.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..433a0483c9a8 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_state_py3.py @@ -0,0 +1,58 @@ +# 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. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar state: The state of the container instance. + :vartype state: str + :ivar start_time: The date-time when the container instance state started. + :vartype start_time: datetime + :ivar exit_code: The container instance exit codes correspond to those + from the `docker run` command. + :vartype exit_code: int + :ivar finish_time: The date-time when the container instance state + finished. + :vartype finish_time: datetime + :ivar detail_status: The human-readable status of the container instance + state. + :vartype detail_status: str + """ + + _validation = { + 'state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'exit_code': {'readonly': True}, + 'finish_time': {'readonly': True}, + 'detail_status': {'readonly': True}, + } + + _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, **kwargs) -> None: + super(ContainerState, self).__init__(**kwargs) + self.state = None + self.start_time = None + self.exit_code = None + self.finish_time = None + self.detail_status = None 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..1f279361192a 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/environment_variable.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/environment_variable.py @@ -15,9 +15,11 @@ 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. + :param value: Required. The value of the environment variable. :type value: str """ @@ -31,7 +33,7 @@ class EnvironmentVariable(Model): 'value': {'key': 'value', '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) 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..790db3327d03 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/environment_variable_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 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: Required. The value of the environment variable. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str, value: str, **kwargs) -> None: + super(EnvironmentVariable, self).__init__(**kwargs) + self.name = name + self.value = 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..f8daff9cedb6 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/event.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/event.py @@ -15,20 +15,32 @@ 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 + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar count: The count of the event. + :vartype count: int + :ivar first_timestamp: The date-time of the earliest logged event. + :vartype first_timestamp: datetime + :ivar last_timestamp: The date-time of the latest logged event. + :vartype last_timestamp: datetime + :ivar name: The event name. + :vartype name: str + :ivar message: The event message. + :vartype message: str + :ivar type: The event type. + :vartype type: str """ + _validation = { + 'count': {'readonly': True}, + 'first_timestamp': {'readonly': True}, + 'last_timestamp': {'readonly': True}, + 'name': {'readonly': True}, + 'message': {'readonly': True}, + 'type': {'readonly': True}, + } + _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'first_timestamp': {'key': 'firstTimestamp', 'type': 'iso-8601'}, @@ -38,11 +50,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 = None + self.first_timestamp = None + self.last_timestamp = None + self.name = None + self.message = None + self.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..ba3b1deeee4f --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/event_py3.py @@ -0,0 +1,60 @@ +# 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. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar count: The count of the event. + :vartype count: int + :ivar first_timestamp: The date-time of the earliest logged event. + :vartype first_timestamp: datetime + :ivar last_timestamp: The date-time of the latest logged event. + :vartype last_timestamp: datetime + :ivar name: The event name. + :vartype name: str + :ivar message: The event message. + :vartype message: str + :ivar type: The event type. + :vartype type: str + """ + + _validation = { + 'count': {'readonly': True}, + 'first_timestamp': {'readonly': True}, + 'last_timestamp': {'readonly': True}, + 'name': {'readonly': True}, + 'message': {'readonly': True}, + 'type': {'readonly': True}, + } + + _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, **kwargs) -> None: + super(Event, self).__init__(**kwargs) + self.count = None + self.first_timestamp = None + self.last_timestamp = None + self.name = None + self.message = None + self.type = None 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/logs.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/logs.py index ebf445b6180a..5575e908d8ec 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/logs.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/logs.py @@ -15,14 +15,21 @@ class Logs(Model): """The logs. - :param content: The content of the log. - :type content: str + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar content: The content of the log. + :vartype content: str """ + _validation = { + 'content': {'readonly': True}, + } + _attribute_map = { '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 = 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..b801c11ff202 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/logs_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 Logs(Model): + """The logs. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar content: The content of the log. + :vartype content: str + """ + + _validation = { + 'content': {'readonly': True}, + } + + _attribute_map = { + 'content': {'key': 'content', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Logs, self).__init__(**kwargs) + self.content = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation.py index c2bde99d5d41..537572376e28 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation.py @@ -15,19 +15,22 @@ class Operation(Model): """An operation for Azure Container Instance service. - :param name: The name of the operation. - :type name: str + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation. + :vartype name: str :param display: The display information of the operation. :type display: ~azure.mgmt.containerinstance.models.OperationDisplay - :param origin: The intended executor of the operation. Possible values + :ivar origin: The intended executor of the operation. Possible values include: 'User', 'System' - :type origin: str or + :vartype origin: str or ~azure.mgmt.containerinstance.models.ContainerInstanceOperationsOrigin """ _validation = { - 'name': {'required': True}, - 'display': {'required': True}, + 'name': {'readonly': True}, + 'origin': {'readonly': True}, } _attribute_map = { @@ -36,8 +39,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 = None + self.display = kwargs.get('display', None) + self.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..a21c8853724b 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_display.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_display.py @@ -15,16 +15,26 @@ 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 + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The name of the provider of the operation. + :vartype provider: str + :ivar resource: The name of the resource type of the operation. + :vartype resource: str + :ivar operation: The friendly name of the operation. + :vartype operation: str + :ivar description: The description of the operation. + :vartype description: str """ + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, @@ -32,9 +42,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 = None + self.resource = None + self.operation = None + self.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..ad7dd6f153aa --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_display_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 OperationDisplay(Model): + """The display information of the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The name of the provider of the operation. + :vartype provider: str + :ivar resource: The name of the resource type of the operation. + :vartype resource: str + :ivar operation: The friendly name of the operation. + :vartype operation: str + :ivar description: The description of the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _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, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None 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..2547ea4acc1d --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/operation_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 Operation(Model): + """An operation for Azure Container Instance service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation. + :vartype name: str + :param display: The display information of the operation. + :type display: ~azure.mgmt.containerinstance.models.OperationDisplay + :ivar origin: The intended executor of the operation. Possible values + include: 'User', 'System' + :vartype origin: str or + ~azure.mgmt.containerinstance.models.ContainerInstanceOperationsOrigin + """ + + _validation = { + 'name': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display + self.origin = None 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/container_group_usage_operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_group_usage_operations.py index 7417d09bd637..4239d0d25065 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-04-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-04-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..422190a20fc3 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-04-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-04-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 index 72513725100e..aee663de18a2 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_logs_operations.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_logs_operations.py @@ -23,7 +23,7 @@ class ContainerLogsOperations(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-04-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-04-01" self.config = config diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/operations.py index 77b53408cd2f..fdc3d1f5baf2 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-04-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-04-01" self.config = config diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py index e3387a6c2586..bc5aa41493e1 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py @@ -23,7 +23,7 @@ class StartContainerOperations(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-04-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-04-01" self.config = config