diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/_meta.json b/sdk/containerinstance/azure-mgmt-containerinstance/_meta.json index 9cc101495ebc..fd3989a28d0d 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/_meta.json +++ b/sdk/containerinstance/azure-mgmt-containerinstance/_meta.json @@ -4,7 +4,7 @@ "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "09d35de8dd3318687eee441d7ddc54a33bf1a9fa", + "commit": "bed3616742c023bb0f1649baa0b1a4514238b004", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/containerinstance/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/containerinstance/resource-manager/readme.md" diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_configuration.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_configuration.py index c642e925cf62..119f1c01be53 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_configuration.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-03-01" + self.api_version = "2021-07-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-containerinstance/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_metadata.json b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_metadata.json index 9cdc3dc38bbd..7e8dd90914de 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_metadata.json +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2021-03-01", - "total_api_version_list": ["2021-03-01"], + "chosen_version": "2021-07-01", + "total_api_version_list": ["2021-07-01"], "client": { "name": "ContainerInstanceManagementClient", "filename": "_container_instance_management_client", diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_version.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_version.py index 142a0420b39b..e5754a47ce68 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_version.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "8.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_configuration.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_configuration.py index c7ca7065d7fc..7bfbcf375d98 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_configuration.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-03-01" + self.api_version = "2021-07-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-containerinstance/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_groups_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_groups_operations.py index 7916c2e1c15f..ba41f3486682 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_groups_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_groups_operations.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -63,7 +63,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -136,7 +136,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -213,7 +213,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -261,7 +261,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -406,7 +406,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -458,7 +458,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -577,7 +577,7 @@ async def _restart_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -702,7 +702,7 @@ async def stop( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -746,7 +746,7 @@ async def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -845,3 +845,64 @@ def get_long_running_output(pipeline_response): else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/start'} # type: ignore + + async def get_outbound_network_dependencies_endpoints( + self, + resource_group_name: str, + container_group_name: str, + **kwargs: Any + ) -> List[str]: + """Get all network dependencies for container group. + + Gets all the network dependencies for this container group to allow complete control of network + setting and configuration. For container groups, this will always be an empty list. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param container_group_name: The name of the container group. + :type container_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_outbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'containerGroupName': self._serialize.url("container_group_name", container_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/outboundNetworkDependenciesEndpoints'} # type: ignore diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_containers_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_containers_operations.py index ab2659ece42d..a8bb63a815a1 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_containers_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_containers_operations.py @@ -76,7 +76,7 @@ async def list_logs( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -148,7 +148,7 @@ async def execute_command( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -218,7 +218,7 @@ async def attach( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -253,4 +253,4 @@ async def attach( return cls(pipeline_response, deserialized, {}) return deserialized - attach.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/attach'} # type: ignore + attach.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/attach'} # type: ignore diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_location_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_location_operations.py index 38498aa5991b..cc910a26b4ae 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_location_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_location_operations.py @@ -60,7 +60,7 @@ def list_usage( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -132,7 +132,7 @@ def list_cached_images( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -204,7 +204,7 @@ def list_capabilities( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_operations.py index f626eefc3e2b..6d3da620a489 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_operations.py @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py index 3b15358fd76b..557f8bf362dd 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py @@ -25,8 +25,8 @@ from ._models_py3 import ContainerGroupDiagnostics from ._models_py3 import ContainerGroupIdentity from ._models_py3 import ContainerGroupListResult - from ._models_py3 import ContainerGroupNetworkProfile from ._models_py3 import ContainerGroupPropertiesInstanceView + from ._models_py3 import ContainerGroupSubnetId from ._models_py3 import ContainerHttpGet from ._models_py3 import ContainerPort from ._models_py3 import ContainerProbe @@ -38,7 +38,7 @@ from ._models_py3 import Event from ._models_py3 import GitRepoVolume from ._models_py3 import GpuResource - from ._models_py3 import HttpHeaders + from ._models_py3 import HttpHeader from ._models_py3 import ImageRegistryCredential from ._models_py3 import InitContainerDefinition from ._models_py3 import InitContainerPropertiesDefinitionInstanceView @@ -77,8 +77,8 @@ from ._models import ContainerGroupDiagnostics # type: ignore from ._models import ContainerGroupIdentity # type: ignore from ._models import ContainerGroupListResult # type: ignore - from ._models import ContainerGroupNetworkProfile # type: ignore from ._models import ContainerGroupPropertiesInstanceView # type: ignore + from ._models import ContainerGroupSubnetId # type: ignore from ._models import ContainerHttpGet # type: ignore from ._models import ContainerPort # type: ignore from ._models import ContainerProbe # type: ignore @@ -90,7 +90,7 @@ from ._models import Event # type: ignore from ._models import GitRepoVolume # type: ignore from ._models import GpuResource # type: ignore - from ._models import HttpHeaders # type: ignore + from ._models import HttpHeader # type: ignore from ._models import ImageRegistryCredential # type: ignore from ._models import InitContainerDefinition # type: ignore from ._models import InitContainerPropertiesDefinitionInstanceView # type: ignore @@ -144,8 +144,8 @@ 'ContainerGroupDiagnostics', 'ContainerGroupIdentity', 'ContainerGroupListResult', - 'ContainerGroupNetworkProfile', 'ContainerGroupPropertiesInstanceView', + 'ContainerGroupSubnetId', 'ContainerHttpGet', 'ContainerPort', 'ContainerProbe', @@ -157,7 +157,7 @@ 'Event', 'GitRepoVolume', 'GpuResource', - 'HttpHeaders', + 'HttpHeader', 'ImageRegistryCredential', 'InitContainerDefinition', 'InitContainerPropertiesDefinitionInstanceView', diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models.py index eea10ab2cfb1..3d7bbab29430 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models.py @@ -542,8 +542,8 @@ class ContainerGroup(Resource): ~azure.mgmt.containerinstance.models.ContainerGroupPropertiesInstanceView :param diagnostics: The diagnostic information for a container group. :type diagnostics: ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics - :param network_profile: The network profile information for a container group. - :type network_profile: ~azure.mgmt.containerinstance.models.ContainerGroupNetworkProfile + :param subnet_ids: The subnet resource IDs for a container group. + :type subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId] :param dns_config: The DNS config information for a container group. :type dns_config: ~azure.mgmt.containerinstance.models.DnsConfiguration :param sku: The SKU for a container group. Possible values include: "Standard", "Dedicated". @@ -580,7 +580,7 @@ class ContainerGroup(Resource): 'volumes': {'key': 'properties.volumes', 'type': '[Volume]'}, 'instance_view': {'key': 'properties.instanceView', 'type': 'ContainerGroupPropertiesInstanceView'}, 'diagnostics': {'key': 'properties.diagnostics', 'type': 'ContainerGroupDiagnostics'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerGroupNetworkProfile'}, + 'subnet_ids': {'key': 'properties.subnetIds', 'type': '[ContainerGroupSubnetId]'}, 'dns_config': {'key': 'properties.dnsConfig', 'type': 'DnsConfiguration'}, 'sku': {'key': 'properties.sku', 'type': 'str'}, 'encryption_properties': {'key': 'properties.encryptionProperties', 'type': 'EncryptionProperties'}, @@ -602,7 +602,7 @@ def __init__( self.volumes = kwargs.get('volumes', None) self.instance_view = None self.diagnostics = kwargs.get('diagnostics', None) - self.network_profile = kwargs.get('network_profile', None) + self.subnet_ids = kwargs.get('subnet_ids', None) self.dns_config = kwargs.get('dns_config', None) self.sku = kwargs.get('sku', None) self.encryption_properties = kwargs.get('encryption_properties', None) @@ -697,59 +697,63 @@ def __init__( self.next_link = kwargs.get('next_link', None) -class ContainerGroupNetworkProfile(msrest.serialization.Model): - """Container group network profile information. +class ContainerGroupPropertiesInstanceView(msrest.serialization.Model): + """The instance view of the container group. Only valid in response. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param id: Required. The identifier for a network profile. - :type id: str + :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 = { - 'id': {'required': True}, + 'events': {'readonly': True}, + 'state': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'events': {'key': 'events', 'type': '[Event]'}, + 'state': {'key': 'state', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ContainerGroupNetworkProfile, self).__init__(**kwargs) - self.id = kwargs['id'] + super(ContainerGroupPropertiesInstanceView, self).__init__(**kwargs) + self.events = None + self.state = None -class ContainerGroupPropertiesInstanceView(msrest.serialization.Model): - """The instance view of the container group. Only valid in response. +class ContainerGroupSubnetId(msrest.serialization.Model): + """Container group subnet information. - 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 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 + :param id: Required. Resource ID of virtual network and subnet. + :type id: str + :param name: Friendly name for the subnet. + :type name: str """ _validation = { - 'events': {'readonly': True}, - 'state': {'readonly': True}, + 'id': {'required': True}, } _attribute_map = { - 'events': {'key': 'events', 'type': '[Event]'}, - 'state': {'key': 'state', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ContainerGroupPropertiesInstanceView, self).__init__(**kwargs) - self.events = None - self.state = None + super(ContainerGroupSubnetId, self).__init__(**kwargs) + self.id = kwargs['id'] + self.name = kwargs.get('name', None) class ContainerHttpGet(msrest.serialization.Model): @@ -764,7 +768,7 @@ class ContainerHttpGet(msrest.serialization.Model): :param scheme: The scheme. Possible values include: "http", "https". :type scheme: str or ~azure.mgmt.containerinstance.models.Scheme :param http_headers: The HTTP headers. - :type http_headers: ~azure.mgmt.containerinstance.models.HttpHeaders + :type http_headers: list[~azure.mgmt.containerinstance.models.HttpHeader] """ _validation = { @@ -775,7 +779,7 @@ class ContainerHttpGet(msrest.serialization.Model): 'path': {'key': 'path', 'type': 'str'}, 'port': {'key': 'port', 'type': 'int'}, 'scheme': {'key': 'scheme', 'type': 'str'}, - 'http_headers': {'key': 'httpHeaders', 'type': 'HttpHeaders'}, + 'http_headers': {'key': 'httpHeaders', 'type': '[HttpHeader]'}, } def __init__( @@ -1164,8 +1168,8 @@ def __init__( self.sku = kwargs['sku'] -class HttpHeaders(msrest.serialization.Model): - """The HTTP headers. +class HttpHeader(msrest.serialization.Model): + """The HTTP header. :param name: The header name. :type name: str @@ -1182,7 +1186,7 @@ def __init__( self, **kwargs ): - super(HttpHeaders, self).__init__(**kwargs) + super(HttpHeader, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.value = kwargs.get('value', None) @@ -1199,6 +1203,10 @@ class ImageRegistryCredential(msrest.serialization.Model): :type username: str :param password: The password for the private registry. :type password: str + :param identity: The identity for the private registry. + :type identity: str + :param identity_url: The identity URL for the private registry. + :type identity_url: str """ _validation = { @@ -1210,6 +1218,8 @@ class ImageRegistryCredential(msrest.serialization.Model): 'server': {'key': 'server', 'type': 'str'}, 'username': {'key': 'username', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'identity_url': {'key': 'identityUrl', 'type': 'str'}, } def __init__( @@ -1220,6 +1230,8 @@ def __init__( self.server = kwargs['server'] self.username = kwargs['username'] self.password = kwargs.get('password', None) + self.identity = kwargs.get('identity', None) + self.identity_url = kwargs.get('identity_url', None) class InitContainerDefinition(msrest.serialization.Model): @@ -1372,7 +1384,7 @@ class LogAnalytics(msrest.serialization.Model): :param metadata: Metadata for log analytics. :type metadata: dict[str, str] :param workspace_resource_id: The workspace resource id for log analytics. - :type workspace_resource_id: dict[str, str] + :type workspace_resource_id: str """ _validation = { @@ -1385,7 +1397,7 @@ class LogAnalytics(msrest.serialization.Model): 'workspace_key': {'key': 'workspaceKey', 'type': 'str'}, 'log_type': {'key': 'logType', 'type': 'str'}, 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': '{str}'}, + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, } def __init__( diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models_py3.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models_py3.py index e8d132d5eba6..50b966093726 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models_py3.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models_py3.py @@ -592,8 +592,8 @@ class ContainerGroup(Resource): ~azure.mgmt.containerinstance.models.ContainerGroupPropertiesInstanceView :param diagnostics: The diagnostic information for a container group. :type diagnostics: ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics - :param network_profile: The network profile information for a container group. - :type network_profile: ~azure.mgmt.containerinstance.models.ContainerGroupNetworkProfile + :param subnet_ids: The subnet resource IDs for a container group. + :type subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId] :param dns_config: The DNS config information for a container group. :type dns_config: ~azure.mgmt.containerinstance.models.DnsConfiguration :param sku: The SKU for a container group. Possible values include: "Standard", "Dedicated". @@ -630,7 +630,7 @@ class ContainerGroup(Resource): 'volumes': {'key': 'properties.volumes', 'type': '[Volume]'}, 'instance_view': {'key': 'properties.instanceView', 'type': 'ContainerGroupPropertiesInstanceView'}, 'diagnostics': {'key': 'properties.diagnostics', 'type': 'ContainerGroupDiagnostics'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerGroupNetworkProfile'}, + 'subnet_ids': {'key': 'properties.subnetIds', 'type': '[ContainerGroupSubnetId]'}, 'dns_config': {'key': 'properties.dnsConfig', 'type': 'DnsConfiguration'}, 'sku': {'key': 'properties.sku', 'type': 'str'}, 'encryption_properties': {'key': 'properties.encryptionProperties', 'type': 'EncryptionProperties'}, @@ -650,7 +650,7 @@ def __init__( ip_address: Optional["IpAddress"] = None, volumes: Optional[List["Volume"]] = None, diagnostics: Optional["ContainerGroupDiagnostics"] = None, - network_profile: Optional["ContainerGroupNetworkProfile"] = None, + subnet_ids: Optional[List["ContainerGroupSubnetId"]] = None, dns_config: Optional["DnsConfiguration"] = None, sku: Optional[Union[str, "ContainerGroupSku"]] = None, encryption_properties: Optional["EncryptionProperties"] = None, @@ -668,7 +668,7 @@ def __init__( self.volumes = volumes self.instance_view = None self.diagnostics = diagnostics - self.network_profile = network_profile + self.subnet_ids = subnet_ids self.dns_config = dns_config self.sku = sku self.encryption_properties = encryption_properties @@ -771,61 +771,66 @@ def __init__( self.next_link = next_link -class ContainerGroupNetworkProfile(msrest.serialization.Model): - """Container group network profile information. +class ContainerGroupPropertiesInstanceView(msrest.serialization.Model): + """The instance view of the container group. Only valid in response. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param id: Required. The identifier for a network profile. - :type id: str + :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 = { - 'id': {'required': True}, + 'events': {'readonly': True}, + 'state': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'events': {'key': 'events', 'type': '[Event]'}, + 'state': {'key': 'state', 'type': 'str'}, } def __init__( self, - *, - id: str, **kwargs ): - super(ContainerGroupNetworkProfile, self).__init__(**kwargs) - self.id = id + super(ContainerGroupPropertiesInstanceView, self).__init__(**kwargs) + self.events = None + self.state = None -class ContainerGroupPropertiesInstanceView(msrest.serialization.Model): - """The instance view of the container group. Only valid in response. +class ContainerGroupSubnetId(msrest.serialization.Model): + """Container group subnet information. - 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 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 + :param id: Required. Resource ID of virtual network and subnet. + :type id: str + :param name: Friendly name for the subnet. + :type name: str """ _validation = { - 'events': {'readonly': True}, - 'state': {'readonly': True}, + 'id': {'required': True}, } _attribute_map = { - 'events': {'key': 'events', 'type': '[Event]'}, - 'state': {'key': 'state', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, } def __init__( self, + *, + id: str, + name: Optional[str] = None, **kwargs ): - super(ContainerGroupPropertiesInstanceView, self).__init__(**kwargs) - self.events = None - self.state = None + super(ContainerGroupSubnetId, self).__init__(**kwargs) + self.id = id + self.name = name class ContainerHttpGet(msrest.serialization.Model): @@ -840,7 +845,7 @@ class ContainerHttpGet(msrest.serialization.Model): :param scheme: The scheme. Possible values include: "http", "https". :type scheme: str or ~azure.mgmt.containerinstance.models.Scheme :param http_headers: The HTTP headers. - :type http_headers: ~azure.mgmt.containerinstance.models.HttpHeaders + :type http_headers: list[~azure.mgmt.containerinstance.models.HttpHeader] """ _validation = { @@ -851,7 +856,7 @@ class ContainerHttpGet(msrest.serialization.Model): 'path': {'key': 'path', 'type': 'str'}, 'port': {'key': 'port', 'type': 'int'}, 'scheme': {'key': 'scheme', 'type': 'str'}, - 'http_headers': {'key': 'httpHeaders', 'type': 'HttpHeaders'}, + 'http_headers': {'key': 'httpHeaders', 'type': '[HttpHeader]'}, } def __init__( @@ -860,7 +865,7 @@ def __init__( port: int, path: Optional[str] = None, scheme: Optional[Union[str, "Scheme"]] = None, - http_headers: Optional["HttpHeaders"] = None, + http_headers: Optional[List["HttpHeader"]] = None, **kwargs ): super(ContainerHttpGet, self).__init__(**kwargs) @@ -1275,8 +1280,8 @@ def __init__( self.sku = sku -class HttpHeaders(msrest.serialization.Model): - """The HTTP headers. +class HttpHeader(msrest.serialization.Model): + """The HTTP header. :param name: The header name. :type name: str @@ -1296,7 +1301,7 @@ def __init__( value: Optional[str] = None, **kwargs ): - super(HttpHeaders, self).__init__(**kwargs) + super(HttpHeader, self).__init__(**kwargs) self.name = name self.value = value @@ -1313,6 +1318,10 @@ class ImageRegistryCredential(msrest.serialization.Model): :type username: str :param password: The password for the private registry. :type password: str + :param identity: The identity for the private registry. + :type identity: str + :param identity_url: The identity URL for the private registry. + :type identity_url: str """ _validation = { @@ -1324,6 +1333,8 @@ class ImageRegistryCredential(msrest.serialization.Model): 'server': {'key': 'server', 'type': 'str'}, 'username': {'key': 'username', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'identity_url': {'key': 'identityUrl', 'type': 'str'}, } def __init__( @@ -1332,12 +1343,16 @@ def __init__( server: str, username: str, password: Optional[str] = None, + identity: Optional[str] = None, + identity_url: Optional[str] = None, **kwargs ): super(ImageRegistryCredential, self).__init__(**kwargs) self.server = server self.username = username self.password = password + self.identity = identity + self.identity_url = identity_url class InitContainerDefinition(msrest.serialization.Model): @@ -1501,7 +1516,7 @@ class LogAnalytics(msrest.serialization.Model): :param metadata: Metadata for log analytics. :type metadata: dict[str, str] :param workspace_resource_id: The workspace resource id for log analytics. - :type workspace_resource_id: dict[str, str] + :type workspace_resource_id: str """ _validation = { @@ -1514,7 +1529,7 @@ class LogAnalytics(msrest.serialization.Model): 'workspace_key': {'key': 'workspaceKey', 'type': 'str'}, 'log_type': {'key': 'logType', 'type': 'str'}, 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': '{str}'}, + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, } def __init__( @@ -1524,7 +1539,7 @@ def __init__( workspace_key: str, log_type: Optional[Union[str, "LogAnalyticsLogType"]] = None, metadata: Optional[Dict[str, str]] = None, - workspace_resource_id: Optional[Dict[str, str]] = None, + workspace_resource_id: Optional[str] = None, **kwargs ): super(LogAnalytics, self).__init__(**kwargs) diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_groups_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_groups_operations.py index 182f2be6964d..23746b18d8bd 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_groups_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_groups_operations.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +68,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -142,7 +142,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -220,7 +220,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -269,7 +269,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -416,7 +416,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -469,7 +469,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -590,7 +590,7 @@ def _restart_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -717,7 +717,7 @@ def stop( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -762,7 +762,7 @@ def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -862,3 +862,65 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/start'} # type: ignore + + def get_outbound_network_dependencies_endpoints( + self, + resource_group_name, # type: str + container_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List[str] + """Get all network dependencies for container group. + + Gets all the network dependencies for this container group to allow complete control of network + setting and configuration. For container groups, this will always be an empty list. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param container_group_name: The name of the container group. + :type container_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_outbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'containerGroupName': self._serialize.url("container_group_name", container_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/outboundNetworkDependenciesEndpoints'} # type: ignore diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_containers_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_containers_operations.py index 3384f34790e6..50219a9502dc 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_containers_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_containers_operations.py @@ -81,7 +81,7 @@ def list_logs( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -154,7 +154,7 @@ def execute_command( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -225,7 +225,7 @@ def attach( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -260,4 +260,4 @@ def attach( return cls(pipeline_response, deserialized, {}) return deserialized - attach.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/attach'} # type: ignore + attach.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/attach'} # type: ignore diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_location_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_location_operations.py index 0bb44178526c..ad7927695246 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_location_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_location_operations.py @@ -65,7 +65,7 @@ def list_usage( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -138,7 +138,7 @@ def list_cached_images( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -211,7 +211,7 @@ def list_capabilities( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_operations.py index c7069eeea575..a6956a93125c 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None):