diff --git a/azure-mgmt-containerinstance/HISTORY.rst b/azure-mgmt-containerinstance/HISTORY.rst index 3dc7e1e3cc22..bafeacfd7c49 100644 --- a/azure-mgmt-containerinstance/HISTORY.rst +++ b/azure-mgmt-containerinstance/HISTORY.rst @@ -3,6 +3,18 @@ Release History =============== +1.2.0 (2018-10-08) +++++++++++++++++++ + +**Features** + +- Model ContainerGroup has a new parameter identity (MSI support) +- Added operation group ServiceAssociationLinkOperations + +**Note** + +- azure-mgmt-nspkg is not installed anymore on Python 3 (PEP420-based namespace package) + 1.1.0 (2018-09-06) ++++++++++++++++++ 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 5c9d34847435..63040e0a0149 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/container_instance_management_client.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/container_instance_management_client.py @@ -17,6 +17,7 @@ from .operations.operations import Operations from .operations.container_group_usage_operations import ContainerGroupUsageOperations from .operations.container_operations import ContainerOperations +from .operations.service_association_link_operations import ServiceAssociationLinkOperations from . import models @@ -68,6 +69,8 @@ class ContainerInstanceManagementClient(SDKClient): :vartype container_group_usage: azure.mgmt.containerinstance.operations.ContainerGroupUsageOperations :ivar container: Container operations :vartype container: azure.mgmt.containerinstance.operations.ContainerOperations + :ivar service_association_link: ServiceAssociationLink operations + :vartype service_association_link: azure.mgmt.containerinstance.operations.ServiceAssociationLinkOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -86,7 +89,7 @@ def __init__( super(ContainerInstanceManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-09-01' + self.api_version = '2018-10-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -98,3 +101,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.container = ContainerOperations( self._client, self.config, self._serialize, self._deserialize) + self.service_association_link = ServiceAssociationLinkOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py index 497cd6a01d8f..58553cbce4f9 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py @@ -26,6 +26,8 @@ from .azure_file_volume_py3 import AzureFileVolume from .git_repo_volume_py3 import GitRepoVolume from .volume_py3 import Volume + from .container_group_identity_user_assigned_identities_value_py3 import ContainerGroupIdentityUserAssignedIdentitiesValue + from .container_group_identity_py3 import ContainerGroupIdentity from .image_registry_credential_py3 import ImageRegistryCredential from .port_py3 import Port from .ip_address_py3 import IpAddress @@ -62,6 +64,8 @@ from .azure_file_volume import AzureFileVolume from .git_repo_volume import GitRepoVolume from .volume import Volume + from .container_group_identity_user_assigned_identities_value import ContainerGroupIdentityUserAssignedIdentitiesValue + from .container_group_identity import ContainerGroupIdentity from .image_registry_credential import ImageRegistryCredential from .port import Port from .ip_address import IpAddress @@ -84,6 +88,7 @@ from .container_group_paged import ContainerGroupPaged from .container_instance_management_client_enums import ( ContainerNetworkProtocol, + ResourceIdentityType, ContainerGroupRestartPolicy, ContainerGroupNetworkProtocol, ContainerGroupIpAddressType, @@ -109,6 +114,8 @@ 'AzureFileVolume', 'GitRepoVolume', 'Volume', + 'ContainerGroupIdentityUserAssignedIdentitiesValue', + 'ContainerGroupIdentity', 'ImageRegistryCredential', 'Port', 'IpAddress', @@ -130,6 +137,7 @@ 'Resource', 'ContainerGroupPaged', 'ContainerNetworkProtocol', + 'ResourceIdentityType', 'ContainerGroupRestartPolicy', 'ContainerGroupNetworkProtocol', 'ContainerGroupIpAddressType', 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 47260a4a39ac..517e4ac6e1c3 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group.py @@ -30,6 +30,9 @@ class ContainerGroup(Resource): :type location: str :param tags: The resource tags. :type tags: dict[str, str] + :param identity: The identity of the container group, if configured. + :type identity: + ~azure.mgmt.containerinstance.models.ContainerGroupIdentity :ivar provisioning_state: The provisioning state of the container group. This only appears in the response. :vartype provisioning_state: str @@ -86,6 +89,7 @@ class ContainerGroup(Resource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ContainerGroupIdentity'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'containers': {'key': 'properties.containers', 'type': '[Container]'}, 'image_registry_credentials': {'key': 'properties.imageRegistryCredentials', 'type': '[ImageRegistryCredential]'}, @@ -100,6 +104,7 @@ class ContainerGroup(Resource): def __init__(self, **kwargs): super(ContainerGroup, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) self.provisioning_state = None self.containers = kwargs.get('containers', None) self.image_registry_credentials = kwargs.get('image_registry_credentials', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_identity.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_identity.py new file mode 100644 index 000000000000..3669c19aa62a --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_identity.py @@ -0,0 +1,59 @@ +# 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 ContainerGroupIdentity(Model): + """Identity for the container group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of the container group identity. This + property will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the container group. This + property will only be provided for a system assigned identity. + :vartype tenant_id: str + :param type: The type of identity used for the container group. The type + 'SystemAssigned, UserAssigned' includes both an implicitly created + identity and a set of user assigned identities. The type 'None' will + remove any identities from the container group. Possible values include: + 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + :type type: str or + ~azure.mgmt.containerinstance.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated + with the container group. The user identity dictionary key references will + be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.containerinstance.models.ContainerGroupIdentityUserAssignedIdentitiesValue] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ContainerGroupIdentityUserAssignedIdentitiesValue}'}, + } + + def __init__(self, **kwargs): + super(ContainerGroupIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_identity_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_identity_py3.py new file mode 100644 index 000000000000..53ca40da721e --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_identity_py3.py @@ -0,0 +1,59 @@ +# 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 ContainerGroupIdentity(Model): + """Identity for the container group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of the container group identity. This + property will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the container group. This + property will only be provided for a system assigned identity. + :vartype tenant_id: str + :param type: The type of identity used for the container group. The type + 'SystemAssigned, UserAssigned' includes both an implicitly created + identity and a set of user assigned identities. The type 'None' will + remove any identities from the container group. Possible values include: + 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + :type type: str or + ~azure.mgmt.containerinstance.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated + with the container group. The user identity dictionary key references will + be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.containerinstance.models.ContainerGroupIdentityUserAssignedIdentitiesValue] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ContainerGroupIdentityUserAssignedIdentitiesValue}'}, + } + + def __init__(self, *, type=None, user_assigned_identities=None, **kwargs) -> None: + super(ContainerGroupIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_identity_user_assigned_identities_value.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_identity_user_assigned_identities_value.py new file mode 100644 index 000000000000..7e1d1b9f4282 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_identity_user_assigned_identities_value.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 ContainerGroupIdentityUserAssignedIdentitiesValue(Model): + """ContainerGroupIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContainerGroupIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_identity_user_assigned_identities_value_py3.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_identity_user_assigned_identities_value_py3.py new file mode 100644 index 000000000000..24cf7baa0e45 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_identity_user_assigned_identities_value_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 ContainerGroupIdentityUserAssignedIdentitiesValue(Model): + """ContainerGroupIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ContainerGroupIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = 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 index c50598dbd643..4b0781493e32 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_py3.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_py3.py @@ -30,6 +30,9 @@ class ContainerGroup(Resource): :type location: str :param tags: The resource tags. :type tags: dict[str, str] + :param identity: The identity of the container group, if configured. + :type identity: + ~azure.mgmt.containerinstance.models.ContainerGroupIdentity :ivar provisioning_state: The provisioning state of the container group. This only appears in the response. :vartype provisioning_state: str @@ -86,6 +89,7 @@ class ContainerGroup(Resource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ContainerGroupIdentity'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'containers': {'key': 'properties.containers', 'type': '[Container]'}, 'image_registry_credentials': {'key': 'properties.imageRegistryCredentials', 'type': '[ImageRegistryCredential]'}, @@ -98,8 +102,9 @@ class ContainerGroup(Resource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerGroupNetworkProfile'}, } - def __init__(self, *, containers, os_type, location: str=None, tags=None, image_registry_credentials=None, restart_policy=None, ip_address=None, volumes=None, diagnostics=None, network_profile=None, **kwargs) -> None: + def __init__(self, *, containers, os_type, location: str=None, tags=None, identity=None, image_registry_credentials=None, restart_policy=None, ip_address=None, volumes=None, diagnostics=None, network_profile=None, **kwargs) -> None: super(ContainerGroup, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity self.provisioning_state = None self.containers = containers self.image_registry_credentials = image_registry_credentials 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 773b5b98d246..ada6501a1dd9 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 @@ -18,6 +18,14 @@ class ContainerNetworkProtocol(str, Enum): udp = "UDP" +class ResourceIdentityType(str, Enum): + + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + system_assigned_user_assigned = "SystemAssigned, UserAssigned" + none = "None" + + class ContainerGroupRestartPolicy(str, Enum): always = "Always" 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 44737b213cc8..e8a8be371071 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address.py @@ -23,7 +23,7 @@ class IpAddress(Model): :param ports: Required. The list of ports exposed on the container group. :type ports: list[~azure.mgmt.containerinstance.models.Port] :param type: Required. Specifies if the IP is exposed to the public - internet. Possible values include: 'Public', 'Private' + internet or private VNET. Possible values include: 'Public', 'Private' :type type: str or ~azure.mgmt.containerinstance.models.ContainerGroupIpAddressType :param ip: The IP exposed to the public internet. 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 index 6b7f214facaa..cc21d6cedcc8 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address_py3.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address_py3.py @@ -23,7 +23,7 @@ class IpAddress(Model): :param ports: Required. The list of ports exposed on the container group. :type ports: list[~azure.mgmt.containerinstance.models.Port] :param type: Required. Specifies if the IP is exposed to the public - internet. Possible values include: 'Public', 'Private' + internet or private VNET. Possible values include: 'Public', 'Private' :type type: str or ~azure.mgmt.containerinstance.models.ContainerGroupIpAddressType :param ip: The IP exposed to the public internet. diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py index 53b4a7945cca..2ddda1c9f4a9 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py @@ -13,10 +13,12 @@ from .operations import Operations from .container_group_usage_operations import ContainerGroupUsageOperations from .container_operations import ContainerOperations +from .service_association_link_operations import ServiceAssociationLinkOperations __all__ = [ 'ContainerGroupsOperations', 'Operations', 'ContainerGroupUsageOperations', 'ContainerOperations', + 'ServiceAssociationLinkOperations', ] 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 faa702e28f5a..eb2e67c1af7b 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-09-01". + :ivar api_version: Client API version. Constant value: "2018-10-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-09-01" + self.api_version = "2018-10-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 5e42762bc234..ac232f6e2d82 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 @@ -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-09-01". + :ivar api_version: Client API version. Constant value: "2018-10-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-09-01" + self.api_version = "2018-10-01" self.config = config diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_operations.py index 67df85731647..13b83c2053e6 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_operations.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_operations.py @@ -23,7 +23,7 @@ class ContainerOperations(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-09-01". + :ivar api_version: Client API version. Constant value: "2018-10-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-09-01" + self.api_version = "2018-10-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 d80cbac84d72..2b6806d3a7b7 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-09-01". + :ivar api_version: Client API version. Constant value: "2018-10-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-09-01" + self.api_version = "2018-10-01" self.config = config diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/service_association_link_operations.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/service_association_link_operations.py new file mode 100644 index 000000000000..89c383a6eeb3 --- /dev/null +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/service_association_link_operations.py @@ -0,0 +1,97 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ServiceAssociationLinkOperations(object): + """ServiceAssociationLinkOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-10-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-10-01" + + self.config = config + + def delete( + self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): + """Delete the container instance service association link for the subnet. + + Delete the container instance service association link for the subnet. + This operation unblocks user from deleting subnet. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/providers/Microsoft.ContainerInstance/serviceAssociationLinks/default'} diff --git a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/version.py b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/version.py index 24b9de3384da..9c644827672b 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/containerinstance/version.py +++ b/azure-mgmt-containerinstance/azure/mgmt/containerinstance/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.1.0" +VERSION = "1.2.0" diff --git a/azure-mgmt-containerinstance/tests/recordings/test_mgmt_containerinstance.test_container_instance.yaml b/azure-mgmt-containerinstance/tests/recordings/test_mgmt_containerinstance.test_container_instance.yaml index 378c3bc23262..2f969c89b297 100644 --- a/azure-mgmt-containerinstance/tests/recordings/test_mgmt_containerinstance.test_container_instance.yaml +++ b/azure-mgmt-containerinstance/tests/recordings/test_mgmt_containerinstance.test_container_instance.yaml @@ -1,37 +1,37 @@ interactions: - request: - body: '{"location": "westus", "properties": {"containers": [{"name": "pycontainer26441510", - "properties": {"image": "alpine:latest", "resources": {"requests": {"memoryInGB": - 1.0, "cpu": 1.0}}, "volumeMounts": [{"name": "empty-volume", "mountPath": "/mnt/mydir"}], - "livenessProbe": {"exec": {"command": ["cat/tmp/healthy"]}, "periodSeconds": - 5}}}], "restartPolicy": "OnFailure", "osType": "Linux", "volumes": [{"name": - "empty-volume", "emptyDir": {}}], "diagnostics": {"logAnalytics": {"workspaceId": - "workspaceId", "workspaceKey": "workspaceKey"}}}}' + body: '{"location": "westus", "identity": {"type": "SystemAssigned"}, "properties": + {"containers": [{"name": "pycontainer26441510", "properties": {"image": "alpine:latest", + "resources": {"requests": {"memoryInGB": 1.0, "cpu": 1.0}}, "volumeMounts": + [{"name": "empty-volume", "mountPath": "/mnt/mydir"}], "livenessProbe": {"exec": + {"command": ["cat/tmp/healthy"]}, "periodSeconds": 5}}}], "restartPolicy": "OnFailure", + "osType": "Linux", "volumes": [{"name": "empty-volume", "emptyDir": {}}], "diagnostics": + {"logAnalytics": {"workspaceId": "workspaceId", "workspaceKey": "workspaceKey"}}}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Length: ['542'] + Content-Length: ['582'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.17134-SP0) requests/2.18.4 msrest/0.5.4 + User-Agent: [python/3.6.2 (Windows-10-10.0.17763-SP0) requests/2.18.4 msrest/0.5.4 msrest_azure/0.4.34 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510?api-version=2018-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510?api-version=2018-10-01 response: - body: {string: '{"properties":{"provisioningState":"Pending","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}],"livenessProbe":{"exec":{"command":["cat/tmp/healthy"]},"periodSeconds":5}}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"state":"Pending"},"diagnostics":{"logAnalytics":{"workspaceId":"workspaceId"}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}'} + body: {string: '{"properties":{"provisioningState":"Pending","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}],"livenessProbe":{"exec":{"command":["cat/tmp/healthy"]},"periodSeconds":5}}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"state":"Pending"},"diagnostics":{"logAnalytics":{"workspaceId":"workspaceId"}}},"identity":{"principalId":"5b9c7825-cea3-438c-9d39-67e7284a4c46","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}'} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/westus/operations/0358f7db-0bd3-4096-91f1-8576ea65d12e?api-version=2018-06-01'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/westus/operations/badf1f90-0b6a-4f30-bee0-21083e0f91df?api-version=2018-06-01'] cache-control: [no-cache] - content-length: ['864'] + content-length: ['1004'] content-type: [application/json; charset=utf-8] - date: ['Thu, 06 Sep 2018 18:02:53 GMT'] + date: ['Mon, 08 Oct 2018 16:46:22 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-resource-requests-pt1h: ['95'] - x-ms-ratelimit-remaining-subscription-resource-requests-pt5m: ['98'] + x-ms-ratelimit-remaining-subscription-resource-requests-pt1h: ['96'] + x-ms-ratelimit-remaining-subscription-resource-requests-pt5m: ['99'] x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 201, message: Created} - request: @@ -40,21 +40,21 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - User-Agent: [python/3.6.2 (Windows-10-10.0.17134-SP0) requests/2.18.4 msrest/0.5.4 + User-Agent: [python/3.6.2 (Windows-10-10.0.17763-SP0) requests/2.18.4 msrest/0.5.4 msrest_azure/0.4.34 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/westus/operations/0358f7db-0bd3-4096-91f1-8576ea65d12e?api-version=2018-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/westus/operations/badf1f90-0b6a-4f30-bee0-21083e0f91df?api-version=2018-06-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","status":"Succeeded","startTime":"2018-09-06T18:02:53.7066979Z","properties":{"events":[{"count":1,"firstTimestamp":"2018-09-06T18:03:11Z","lastTimestamp":"2018-09-06T18:03:11Z","name":"Pulling","message":"pulling - image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:13Z","lastTimestamp":"2018-09-06T18:03:13Z","name":"Pulled","message":"Successfully - pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:13Z","lastTimestamp":"2018-09-06T18:03:13Z","name":"Created","message":"Created - container with id 41b7e27558992017cd679361313de8157a2b35a3dc76ac79a6d4235dc9835e67","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:13Z","lastTimestamp":"2018-09-06T18:03:13Z","name":"Started","message":"Started - container with id 41b7e27558992017cd679361313de8157a2b35a3dc76ac79a6d4235dc9835e67","type":"Normal"}]}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","status":"Succeeded","startTime":"2018-10-08T16:46:22.8846678Z","properties":{"events":[{"count":1,"firstTimestamp":"2018-10-08T16:46:25Z","lastTimestamp":"2018-10-08T16:46:25Z","name":"Pulling","message":"pulling + image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-10-08T16:46:29Z","lastTimestamp":"2018-10-08T16:46:29Z","name":"Pulled","message":"Successfully + pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-10-08T16:46:29Z","lastTimestamp":"2018-10-08T16:46:29Z","name":"Created","message":"Created + container with id 0b19efa0986f5d279fab6c12dde2c658251be7cb4ef7bb693711c43055f6637b","type":"Normal"},{"count":1,"firstTimestamp":"2018-10-08T16:46:30Z","lastTimestamp":"2018-10-08T16:46:30Z","name":"Started","message":"Started + container with id 0b19efa0986f5d279fab6c12dde2c658251be7cb4ef7bb693711c43055f6637b","type":"Normal"}]}}'} headers: cache-control: [no-cache] content-length: ['1100'] content-type: [application/json; charset=utf-8] - date: ['Thu, 06 Sep 2018 18:03:24 GMT'] + date: ['Mon, 08 Oct 2018 16:46:54 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -68,21 +68,21 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - User-Agent: [python/3.6.2 (Windows-10-10.0.17134-SP0) requests/2.18.4 msrest/0.5.4 + User-Agent: [python/3.6.2 (Windows-10-10.0.17763-SP0) requests/2.18.4 msrest/0.5.4 msrest_azure/0.4.34 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510?api-version=2018-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510?api-version=2018-10-01 response: - body: {string: '{"properties":{"provisioningState":"Succeeded","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"instanceView":{"restartCount":0,"currentState":{"state":"Terminated","startTime":"2018-09-06T18:03:13Z","exitCode":0,"finishTime":"2018-09-06T18:03:13Z","detailStatus":"Completed"},"events":[{"count":1,"firstTimestamp":"2018-09-06T18:03:11Z","lastTimestamp":"2018-09-06T18:03:11Z","name":"Pulling","message":"pulling - image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:13Z","lastTimestamp":"2018-09-06T18:03:13Z","name":"Pulled","message":"Successfully - pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:13Z","lastTimestamp":"2018-09-06T18:03:13Z","name":"Created","message":"Created - container with id 41b7e27558992017cd679361313de8157a2b35a3dc76ac79a6d4235dc9835e67","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:13Z","lastTimestamp":"2018-09-06T18:03:13Z","name":"Started","message":"Started - container with id 41b7e27558992017cd679361313de8157a2b35a3dc76ac79a6d4235dc9835e67","type":"Normal"}]},"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}],"livenessProbe":{"exec":{"command":["cat/tmp/healthy"]},"periodSeconds":5}}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"events":[],"state":"Succeeded"},"diagnostics":{"logAnalytics":{"workspaceId":"workspaceId"}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}'} + body: {string: '{"properties":{"provisioningState":"Succeeded","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"instanceView":{"restartCount":0,"currentState":{"state":"Terminated","startTime":"2018-10-08T16:46:30Z","exitCode":0,"finishTime":"2018-10-08T16:46:30Z","detailStatus":"Completed"},"events":[{"count":1,"firstTimestamp":"2018-10-08T16:46:25Z","lastTimestamp":"2018-10-08T16:46:25Z","name":"Pulling","message":"pulling + image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-10-08T16:46:29Z","lastTimestamp":"2018-10-08T16:46:29Z","name":"Pulled","message":"Successfully + pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-10-08T16:46:29Z","lastTimestamp":"2018-10-08T16:46:29Z","name":"Created","message":"Created + container with id 0b19efa0986f5d279fab6c12dde2c658251be7cb4ef7bb693711c43055f6637b","type":"Normal"},{"count":1,"firstTimestamp":"2018-10-08T16:46:30Z","lastTimestamp":"2018-10-08T16:46:30Z","name":"Started","message":"Started + container with id 0b19efa0986f5d279fab6c12dde2c658251be7cb4ef7bb693711c43055f6637b","type":"Normal"}]},"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}],"livenessProbe":{"exec":{"command":["cat/tmp/healthy"]},"periodSeconds":5}}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"events":[],"state":"Succeeded"},"diagnostics":{"logAnalytics":{"workspaceId":"workspaceId"}}},"identity":{"principalId":"5b9c7825-cea3-438c-9d39-67e7284a4c46","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}'} headers: cache-control: [no-cache] - content-length: ['1875'] + content-length: ['2015'] content-type: [application/json; charset=utf-8] - date: ['Thu, 06 Sep 2018 18:03:25 GMT'] + date: ['Mon, 08 Oct 2018 16:46:54 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -96,22 +96,22 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - User-Agent: [python/3.6.2 (Windows-10-10.0.17134-SP0) requests/2.18.4 msrest/0.5.4 + User-Agent: [python/3.6.2 (Windows-10-10.0.17763-SP0) requests/2.18.4 msrest/0.5.4 msrest_azure/0.4.34 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510?api-version=2018-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510?api-version=2018-10-01 response: - body: {string: '{"properties":{"provisioningState":"Succeeded","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"instanceView":{"restartCount":0,"currentState":{"state":"Terminated","startTime":"2018-09-06T18:03:13Z","exitCode":0,"finishTime":"2018-09-06T18:03:13Z","detailStatus":"Completed"},"events":[{"count":1,"firstTimestamp":"2018-09-06T18:03:11Z","lastTimestamp":"2018-09-06T18:03:11Z","name":"Pulling","message":"pulling - image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:13Z","lastTimestamp":"2018-09-06T18:03:13Z","name":"Pulled","message":"Successfully - pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:13Z","lastTimestamp":"2018-09-06T18:03:13Z","name":"Created","message":"Created - container with id 41b7e27558992017cd679361313de8157a2b35a3dc76ac79a6d4235dc9835e67","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:13Z","lastTimestamp":"2018-09-06T18:03:13Z","name":"Started","message":"Started - container with id 41b7e27558992017cd679361313de8157a2b35a3dc76ac79a6d4235dc9835e67","type":"Normal"}]},"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}],"livenessProbe":{"exec":{"command":["cat/tmp/healthy"]},"periodSeconds":5}}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"events":[],"state":"Succeeded"},"diagnostics":{"logAnalytics":{"workspaceId":"workspaceId"}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}'} + body: {string: '{"properties":{"provisioningState":"Succeeded","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"instanceView":{"restartCount":0,"currentState":{"state":"Terminated","startTime":"2018-10-08T16:46:30Z","exitCode":0,"finishTime":"2018-10-08T16:46:30Z","detailStatus":"Completed"},"events":[{"count":1,"firstTimestamp":"2018-10-08T16:46:25Z","lastTimestamp":"2018-10-08T16:46:25Z","name":"Pulling","message":"pulling + image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-10-08T16:46:29Z","lastTimestamp":"2018-10-08T16:46:29Z","name":"Pulled","message":"Successfully + pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-10-08T16:46:29Z","lastTimestamp":"2018-10-08T16:46:29Z","name":"Created","message":"Created + container with id 0b19efa0986f5d279fab6c12dde2c658251be7cb4ef7bb693711c43055f6637b","type":"Normal"},{"count":1,"firstTimestamp":"2018-10-08T16:46:30Z","lastTimestamp":"2018-10-08T16:46:30Z","name":"Started","message":"Started + container with id 0b19efa0986f5d279fab6c12dde2c658251be7cb4ef7bb693711c43055f6637b","type":"Normal"}]},"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}],"livenessProbe":{"exec":{"command":["cat/tmp/healthy"]},"periodSeconds":5}}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"events":[],"state":"Succeeded"},"diagnostics":{"logAnalytics":{"workspaceId":"workspaceId"}}},"identity":{"principalId":"5b9c7825-cea3-438c-9d39-67e7284a4c46","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}'} headers: cache-control: [no-cache] - content-length: ['1875'] + content-length: ['2015'] content-type: [application/json; charset=utf-8] - date: ['Thu, 06 Sep 2018 18:03:33 GMT'] + date: ['Mon, 08 Oct 2018 16:46:55 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -125,18 +125,18 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - User-Agent: [python/3.6.2 (Windows-10-10.0.17134-SP0) requests/2.18.4 msrest/0.5.4 + User-Agent: [python/3.6.2 (Windows-10-10.0.17763-SP0) requests/2.18.4 msrest/0.5.4 msrest_azure/0.4.34 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups?api-version=2018-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups?api-version=2018-10-01 response: - body: {string: '{"value":[{"properties":{"provisioningState":"Succeeded","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}],"livenessProbe":{"exec":{"command":["cat/tmp/healthy"]},"periodSeconds":5}}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"diagnostics":{"logAnalytics":{"workspaceId":"workspaceId"}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}]}'} + body: {string: '{"value":[{"properties":{"provisioningState":"Succeeded","containers":[{"name":"pycontainer26441510","properties":{"image":"alpine:latest","ports":[],"environmentVariables":[],"resources":{"requests":{"memoryInGB":1.0,"cpu":1.0}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}],"livenessProbe":{"exec":{"command":["cat/tmp/healthy"]},"periodSeconds":5}}}],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"diagnostics":{"logAnalytics":{"workspaceId":"workspaceId"}}},"identity":{"principalId":"5b9c7825-cea3-438c-9d39-67e7284a4c46","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","name":"pycontainer26441510","type":"Microsoft.ContainerInstance/containerGroups","location":"westus"}]}'} headers: cache-control: [no-cache] - content-length: ['843'] + content-length: ['983'] content-type: [application/json; charset=utf-8] - date: ['Thu, 06 Sep 2018 18:03:34 GMT'] + date: ['Mon, 08 Oct 2018 16:46:56 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -152,18 +152,18 @@ interactions: Connection: [keep-alive] Content-Length: ['66'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.17134-SP0) requests/2.18.4 msrest/0.5.4 + User-Agent: [python/3.6.2 (Windows-10-10.0.17763-SP0) requests/2.18.4 msrest/0.5.4 msrest_azure/0.4.34 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] accept-language: [en-US] method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510/containers/pycontainer26441510/exec?api-version=2018-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510/containers/pycontainer26441510/exec?api-version=2018-10-01 response: - body: {string: '{"webSocketUri":"wss://bridge-linux-06.westus.management.azurecontainer.io/exec/caas-1a7f1ac282c843118cc3881a7b0603dd/bridge-9658fa886f0ac586?rows=24&cols=80&api-version=2018-02-01-preview","password":"6eru_Q14EzljWA3MP2ANPkDmQ-JXnAE8LtFPJ03Lxew[[EOM]]"}'} + body: {string: '{"webSocketUri":"wss://bridge-linux-04.westus.management.azurecontainer.io/exec/caas-15dc6bc1d2404ce9bfb7e9e16ac1e70d/bridge-9658fa886f0ac586?rows=24&cols=80&api-version=2018-02-01-preview","password":"Zv3AhfxiTlsEKCIbm8YrLUlwb1Uco2zXllZOsVpJbTE[[EOM]]"}'} headers: cache-control: [no-cache] content-length: ['254'] content-type: [application/json; charset=utf-8] - date: ['Thu, 06 Sep 2018 18:03:37 GMT'] + date: ['Mon, 08 Oct 2018 16:46:57 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -178,18 +178,18 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - User-Agent: [python/3.6.2 (Windows-10-10.0.17134-SP0) requests/2.18.4 msrest/0.5.4 + User-Agent: [python/3.6.2 (Windows-10-10.0.17763-SP0) requests/2.18.4 msrest/0.5.4 msrest_azure/0.4.34 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510/containers/pycontainer26441510/logs?api-version=2018-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510/containers/pycontainer26441510/logs?api-version=2018-10-01 response: body: {string: '{"content":""}'} headers: cache-control: [no-cache] content-length: ['14'] content-type: [application/json; charset=utf-8] - date: ['Thu, 06 Sep 2018 18:03:38 GMT'] + date: ['Mon, 08 Oct 2018 16:46:58 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -204,17 +204,17 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Length: ['0'] - User-Agent: [python/3.6.2 (Windows-10-10.0.17134-SP0) requests/2.18.4 msrest/0.5.4 + User-Agent: [python/3.6.2 (Windows-10-10.0.17763-SP0) requests/2.18.4 msrest/0.5.4 msrest_azure/0.4.34 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] accept-language: [en-US] method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510/restart?api-version=2018-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510/restart?api-version=2018-10-01 response: body: {string: ''} headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/westus/operations/efbaa5a1-81a3-460e-b750-26909e01ce03?api-version=2018-06-01'] + azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/westus/operations/5dd8ccdd-4f3e-47a9-a3da-05c76ef89bb2?api-version=2018-06-01'] cache-control: [no-cache] - date: ['Thu, 06 Sep 2018 18:03:40 GMT'] + date: ['Mon, 08 Oct 2018 16:46:59 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -227,25 +227,21 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - User-Agent: [python/3.6.2 (Windows-10-10.0.17134-SP0) requests/2.18.4 msrest/0.5.4 + User-Agent: [python/3.6.2 (Windows-10-10.0.17763-SP0) requests/2.18.4 msrest/0.5.4 msrest_azure/0.4.34 azure-mgmt-containerinstance/1.0.0 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/westus/operations/efbaa5a1-81a3-460e-b750-26909e01ce03?api-version=2018-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/westus/operations/5dd8ccdd-4f3e-47a9-a3da-05c76ef89bb2?api-version=2018-06-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","status":"Succeeded","startTime":"2018-09-06T18:03:41.2568351Z","properties":{"events":[{"count":1,"firstTimestamp":"2018-09-06T18:03:11Z","lastTimestamp":"2018-09-06T18:03:11Z","name":"Pulling","message":"pulling - image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:13Z","lastTimestamp":"2018-09-06T18:03:13Z","name":"Pulled","message":"Successfully - pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:13Z","lastTimestamp":"2018-09-06T18:03:13Z","name":"Created","message":"Created - container with id 41b7e27558992017cd679361313de8157a2b35a3dc76ac79a6d4235dc9835e67","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:13Z","lastTimestamp":"2018-09-06T18:03:13Z","name":"Started","message":"Started - container with id 41b7e27558992017cd679361313de8157a2b35a3dc76ac79a6d4235dc9835e67","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:42Z","lastTimestamp":"2018-09-06T18:03:42Z","name":"Pulling","message":"pulling - image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:44Z","lastTimestamp":"2018-09-06T18:03:44Z","name":"Pulled","message":"Successfully - pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:44Z","lastTimestamp":"2018-09-06T18:03:44Z","name":"Created","message":"Created - container with id c907e51308f23452c10ecd041e7fcb59fff8d96527ce687315320c125dbfba73","type":"Normal"},{"count":1,"firstTimestamp":"2018-09-06T18:03:44Z","lastTimestamp":"2018-09-06T18:03:44Z","name":"Started","message":"Started - container with id c907e51308f23452c10ecd041e7fcb59fff8d96527ce687315320c125dbfba73","type":"Normal"}]}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_containerinstance_test_container_instance26441510/providers/Microsoft.ContainerInstance/containerGroups/pycontainer26441510","status":"Succeeded","startTime":"2018-10-08T16:46:59.7788433Z","properties":{"events":[{"count":1,"firstTimestamp":"2018-10-08T16:46:25Z","lastTimestamp":"2018-10-08T16:46:25Z","name":"Pulling","message":"pulling + image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-10-08T16:46:29Z","lastTimestamp":"2018-10-08T16:46:29Z","name":"Pulled","message":"Successfully + pulled image \"alpine:latest\"","type":"Normal"},{"count":1,"firstTimestamp":"2018-10-08T16:46:29Z","lastTimestamp":"2018-10-08T16:46:29Z","name":"Created","message":"Created + container with id 0b19efa0986f5d279fab6c12dde2c658251be7cb4ef7bb693711c43055f6637b","type":"Normal"},{"count":1,"firstTimestamp":"2018-10-08T16:46:30Z","lastTimestamp":"2018-10-08T16:46:30Z","name":"Started","message":"Started + container with id 0b19efa0986f5d279fab6c12dde2c658251be7cb4ef7bb693711c43055f6637b","type":"Normal"}]}}'} headers: cache-control: [no-cache] - content-length: ['1901'] + content-length: ['1100'] content-type: [application/json; charset=utf-8] - date: ['Thu, 06 Sep 2018 18:04:10 GMT'] + date: ['Mon, 08 Oct 2018 16:47:30 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] diff --git a/azure-mgmt-containerinstance/tests/test_mgmt_containerinstance.py b/azure-mgmt-containerinstance/tests/test_mgmt_containerinstance.py index 0d2fa0387549..c93e48cc6bc5 100644 --- a/azure-mgmt-containerinstance/tests/test_mgmt_containerinstance.py +++ b/azure-mgmt-containerinstance/tests/test_mgmt_containerinstance.py @@ -32,6 +32,7 @@ def test_container_instance(self, resource_group, location): livenessprob_period_seconds = 5 log_analytics_workspace_id = 'workspaceId' log_analytics_workspace_key = 'workspaceKey' + identity_system_assigned = 'SystemAssigned' empty_volume = Volume(name='empty-volume', empty_dir={}) volume_mount = VolumeMount(name='empty-volume', mount_path='/mnt/mydir') @@ -40,6 +41,9 @@ def test_container_instance(self, resource_group, location): resource_group.name, container_group_name, { + 'identity': { + 'type': identity_system_assigned + }, 'location': location, 'containers': [{ 'name': container_group_name, @@ -76,6 +80,7 @@ def test_container_instance(self, resource_group, location): self.assertEqual(container_group.name, container_group_name) self.assertEqual(container_group.location, location) + self.assertEqual(container_group.identity.type, identity_system_assigned) self.assertEqual(container_group.os_type, os_type) self.assertEqual(container_group.restart_policy, restart_policy) self.assertEqual(container_group.diagnostics.log_analytics.workspace_id, log_analytics_workspace_id)