Skip to content

Commit 3f636c3

Browse files
AutorestCIlmazuel
authored andcommitted
[AutoPR] containerinstance/resource-manager (#3489)
* Generated from 9a5541421e8815773449ba570834099b97025183 (#3484) Moving MSI Identity object to correct properties * adding test for msi identity in container groups * Update version.py * ACI changelog
1 parent a8b56b3 commit 3f636c3

21 files changed

+425
-84
lines changed

azure-mgmt-containerinstance/HISTORY.rst

+12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
Release History
44
===============
55

6+
1.2.0 (2018-10-08)
7+
++++++++++++++++++
8+
9+
**Features**
10+
11+
- Model ContainerGroup has a new parameter identity (MSI support)
12+
- Added operation group ServiceAssociationLinkOperations
13+
14+
**Note**
15+
16+
- azure-mgmt-nspkg is not installed anymore on Python 3 (PEP420-based namespace package)
17+
618
1.1.0 (2018-09-06)
719
++++++++++++++++++
820

azure-mgmt-containerinstance/azure/mgmt/containerinstance/container_instance_management_client.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from .operations.operations import Operations
1818
from .operations.container_group_usage_operations import ContainerGroupUsageOperations
1919
from .operations.container_operations import ContainerOperations
20+
from .operations.service_association_link_operations import ServiceAssociationLinkOperations
2021
from . import models
2122

2223

@@ -68,6 +69,8 @@ class ContainerInstanceManagementClient(SDKClient):
6869
:vartype container_group_usage: azure.mgmt.containerinstance.operations.ContainerGroupUsageOperations
6970
:ivar container: Container operations
7071
:vartype container: azure.mgmt.containerinstance.operations.ContainerOperations
72+
:ivar service_association_link: ServiceAssociationLink operations
73+
:vartype service_association_link: azure.mgmt.containerinstance.operations.ServiceAssociationLinkOperations
7174
7275
:param credentials: Credentials needed for the client to connect to Azure.
7376
:type credentials: :mod:`A msrestazure Credentials
@@ -86,7 +89,7 @@ def __init__(
8689
super(ContainerInstanceManagementClient, self).__init__(self.config.credentials, self.config)
8790

8891
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
89-
self.api_version = '2018-09-01'
92+
self.api_version = '2018-10-01'
9093
self._serialize = Serializer(client_models)
9194
self._deserialize = Deserializer(client_models)
9295

@@ -98,3 +101,5 @@ def __init__(
98101
self._client, self.config, self._serialize, self._deserialize)
99102
self.container = ContainerOperations(
100103
self._client, self.config, self._serialize, self._deserialize)
104+
self.service_association_link = ServiceAssociationLinkOperations(
105+
self._client, self.config, self._serialize, self._deserialize)

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
from .azure_file_volume_py3 import AzureFileVolume
2727
from .git_repo_volume_py3 import GitRepoVolume
2828
from .volume_py3 import Volume
29+
from .container_group_identity_user_assigned_identities_value_py3 import ContainerGroupIdentityUserAssignedIdentitiesValue
30+
from .container_group_identity_py3 import ContainerGroupIdentity
2931
from .image_registry_credential_py3 import ImageRegistryCredential
3032
from .port_py3 import Port
3133
from .ip_address_py3 import IpAddress
@@ -62,6 +64,8 @@
6264
from .azure_file_volume import AzureFileVolume
6365
from .git_repo_volume import GitRepoVolume
6466
from .volume import Volume
67+
from .container_group_identity_user_assigned_identities_value import ContainerGroupIdentityUserAssignedIdentitiesValue
68+
from .container_group_identity import ContainerGroupIdentity
6569
from .image_registry_credential import ImageRegistryCredential
6670
from .port import Port
6771
from .ip_address import IpAddress
@@ -84,6 +88,7 @@
8488
from .container_group_paged import ContainerGroupPaged
8589
from .container_instance_management_client_enums import (
8690
ContainerNetworkProtocol,
91+
ResourceIdentityType,
8792
ContainerGroupRestartPolicy,
8893
ContainerGroupNetworkProtocol,
8994
ContainerGroupIpAddressType,
@@ -109,6 +114,8 @@
109114
'AzureFileVolume',
110115
'GitRepoVolume',
111116
'Volume',
117+
'ContainerGroupIdentityUserAssignedIdentitiesValue',
118+
'ContainerGroupIdentity',
112119
'ImageRegistryCredential',
113120
'Port',
114121
'IpAddress',
@@ -130,6 +137,7 @@
130137
'Resource',
131138
'ContainerGroupPaged',
132139
'ContainerNetworkProtocol',
140+
'ResourceIdentityType',
133141
'ContainerGroupRestartPolicy',
134142
'ContainerGroupNetworkProtocol',
135143
'ContainerGroupIpAddressType',

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group.py

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class ContainerGroup(Resource):
3030
:type location: str
3131
:param tags: The resource tags.
3232
:type tags: dict[str, str]
33+
:param identity: The identity of the container group, if configured.
34+
:type identity:
35+
~azure.mgmt.containerinstance.models.ContainerGroupIdentity
3336
:ivar provisioning_state: The provisioning state of the container group.
3437
This only appears in the response.
3538
:vartype provisioning_state: str
@@ -86,6 +89,7 @@ class ContainerGroup(Resource):
8689
'type': {'key': 'type', 'type': 'str'},
8790
'location': {'key': 'location', 'type': 'str'},
8891
'tags': {'key': 'tags', 'type': '{str}'},
92+
'identity': {'key': 'identity', 'type': 'ContainerGroupIdentity'},
8993
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
9094
'containers': {'key': 'properties.containers', 'type': '[Container]'},
9195
'image_registry_credentials': {'key': 'properties.imageRegistryCredentials', 'type': '[ImageRegistryCredential]'},
@@ -100,6 +104,7 @@ class ContainerGroup(Resource):
100104

101105
def __init__(self, **kwargs):
102106
super(ContainerGroup, self).__init__(**kwargs)
107+
self.identity = kwargs.get('identity', None)
103108
self.provisioning_state = None
104109
self.containers = kwargs.get('containers', None)
105110
self.image_registry_credentials = kwargs.get('image_registry_credentials', None)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class ContainerGroupIdentity(Model):
16+
"""Identity for the container group.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
:ivar principal_id: The principal id of the container group identity. This
22+
property will only be provided for a system assigned identity.
23+
:vartype principal_id: str
24+
:ivar tenant_id: The tenant id associated with the container group. This
25+
property will only be provided for a system assigned identity.
26+
:vartype tenant_id: str
27+
:param type: The type of identity used for the container group. The type
28+
'SystemAssigned, UserAssigned' includes both an implicitly created
29+
identity and a set of user assigned identities. The type 'None' will
30+
remove any identities from the container group. Possible values include:
31+
'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
32+
:type type: str or
33+
~azure.mgmt.containerinstance.models.ResourceIdentityType
34+
:param user_assigned_identities: The list of user identities associated
35+
with the container group. The user identity dictionary key references will
36+
be ARM resource ids in the form:
37+
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
38+
:type user_assigned_identities: dict[str,
39+
~azure.mgmt.containerinstance.models.ContainerGroupIdentityUserAssignedIdentitiesValue]
40+
"""
41+
42+
_validation = {
43+
'principal_id': {'readonly': True},
44+
'tenant_id': {'readonly': True},
45+
}
46+
47+
_attribute_map = {
48+
'principal_id': {'key': 'principalId', 'type': 'str'},
49+
'tenant_id': {'key': 'tenantId', 'type': 'str'},
50+
'type': {'key': 'type', 'type': 'ResourceIdentityType'},
51+
'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ContainerGroupIdentityUserAssignedIdentitiesValue}'},
52+
}
53+
54+
def __init__(self, **kwargs):
55+
super(ContainerGroupIdentity, self).__init__(**kwargs)
56+
self.principal_id = None
57+
self.tenant_id = None
58+
self.type = kwargs.get('type', None)
59+
self.user_assigned_identities = kwargs.get('user_assigned_identities', None)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class ContainerGroupIdentity(Model):
16+
"""Identity for the container group.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
:ivar principal_id: The principal id of the container group identity. This
22+
property will only be provided for a system assigned identity.
23+
:vartype principal_id: str
24+
:ivar tenant_id: The tenant id associated with the container group. This
25+
property will only be provided for a system assigned identity.
26+
:vartype tenant_id: str
27+
:param type: The type of identity used for the container group. The type
28+
'SystemAssigned, UserAssigned' includes both an implicitly created
29+
identity and a set of user assigned identities. The type 'None' will
30+
remove any identities from the container group. Possible values include:
31+
'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
32+
:type type: str or
33+
~azure.mgmt.containerinstance.models.ResourceIdentityType
34+
:param user_assigned_identities: The list of user identities associated
35+
with the container group. The user identity dictionary key references will
36+
be ARM resource ids in the form:
37+
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
38+
:type user_assigned_identities: dict[str,
39+
~azure.mgmt.containerinstance.models.ContainerGroupIdentityUserAssignedIdentitiesValue]
40+
"""
41+
42+
_validation = {
43+
'principal_id': {'readonly': True},
44+
'tenant_id': {'readonly': True},
45+
}
46+
47+
_attribute_map = {
48+
'principal_id': {'key': 'principalId', 'type': 'str'},
49+
'tenant_id': {'key': 'tenantId', 'type': 'str'},
50+
'type': {'key': 'type', 'type': 'ResourceIdentityType'},
51+
'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ContainerGroupIdentityUserAssignedIdentitiesValue}'},
52+
}
53+
54+
def __init__(self, *, type=None, user_assigned_identities=None, **kwargs) -> None:
55+
super(ContainerGroupIdentity, self).__init__(**kwargs)
56+
self.principal_id = None
57+
self.tenant_id = None
58+
self.type = type
59+
self.user_assigned_identities = user_assigned_identities
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class ContainerGroupIdentityUserAssignedIdentitiesValue(Model):
16+
"""ContainerGroupIdentityUserAssignedIdentitiesValue.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
:ivar principal_id: The principal id of user assigned identity.
22+
:vartype principal_id: str
23+
:ivar client_id: The client id of user assigned identity.
24+
:vartype client_id: str
25+
"""
26+
27+
_validation = {
28+
'principal_id': {'readonly': True},
29+
'client_id': {'readonly': True},
30+
}
31+
32+
_attribute_map = {
33+
'principal_id': {'key': 'principalId', 'type': 'str'},
34+
'client_id': {'key': 'clientId', 'type': 'str'},
35+
}
36+
37+
def __init__(self, **kwargs):
38+
super(ContainerGroupIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs)
39+
self.principal_id = None
40+
self.client_id = None
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class ContainerGroupIdentityUserAssignedIdentitiesValue(Model):
16+
"""ContainerGroupIdentityUserAssignedIdentitiesValue.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
:ivar principal_id: The principal id of user assigned identity.
22+
:vartype principal_id: str
23+
:ivar client_id: The client id of user assigned identity.
24+
:vartype client_id: str
25+
"""
26+
27+
_validation = {
28+
'principal_id': {'readonly': True},
29+
'client_id': {'readonly': True},
30+
}
31+
32+
_attribute_map = {
33+
'principal_id': {'key': 'principalId', 'type': 'str'},
34+
'client_id': {'key': 'clientId', 'type': 'str'},
35+
}
36+
37+
def __init__(self, **kwargs) -> None:
38+
super(ContainerGroupIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs)
39+
self.principal_id = None
40+
self.client_id = None

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_py3.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class ContainerGroup(Resource):
3030
:type location: str
3131
:param tags: The resource tags.
3232
:type tags: dict[str, str]
33+
:param identity: The identity of the container group, if configured.
34+
:type identity:
35+
~azure.mgmt.containerinstance.models.ContainerGroupIdentity
3336
:ivar provisioning_state: The provisioning state of the container group.
3437
This only appears in the response.
3538
:vartype provisioning_state: str
@@ -86,6 +89,7 @@ class ContainerGroup(Resource):
8689
'type': {'key': 'type', 'type': 'str'},
8790
'location': {'key': 'location', 'type': 'str'},
8891
'tags': {'key': 'tags', 'type': '{str}'},
92+
'identity': {'key': 'identity', 'type': 'ContainerGroupIdentity'},
8993
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
9094
'containers': {'key': 'properties.containers', 'type': '[Container]'},
9195
'image_registry_credentials': {'key': 'properties.imageRegistryCredentials', 'type': '[ImageRegistryCredential]'},
@@ -98,8 +102,9 @@ class ContainerGroup(Resource):
98102
'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerGroupNetworkProfile'},
99103
}
100104

101-
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:
105+
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:
102106
super(ContainerGroup, self).__init__(location=location, tags=tags, **kwargs)
107+
self.identity = identity
103108
self.provisioning_state = None
104109
self.containers = containers
105110
self.image_registry_credentials = image_registry_credentials

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_instance_management_client_enums.py

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ class ContainerNetworkProtocol(str, Enum):
1818
udp = "UDP"
1919

2020

21+
class ResourceIdentityType(str, Enum):
22+
23+
system_assigned = "SystemAssigned"
24+
user_assigned = "UserAssigned"
25+
system_assigned_user_assigned = "SystemAssigned, UserAssigned"
26+
none = "None"
27+
28+
2129
class ContainerGroupRestartPolicy(str, Enum):
2230

2331
always = "Always"

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class IpAddress(Model):
2323
:param ports: Required. The list of ports exposed on the container group.
2424
:type ports: list[~azure.mgmt.containerinstance.models.Port]
2525
:param type: Required. Specifies if the IP is exposed to the public
26-
internet. Possible values include: 'Public', 'Private'
26+
internet or private VNET. Possible values include: 'Public', 'Private'
2727
:type type: str or
2828
~azure.mgmt.containerinstance.models.ContainerGroupIpAddressType
2929
:param ip: The IP exposed to the public internet.

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address_py3.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class IpAddress(Model):
2323
:param ports: Required. The list of ports exposed on the container group.
2424
:type ports: list[~azure.mgmt.containerinstance.models.Port]
2525
:param type: Required. Specifies if the IP is exposed to the public
26-
internet. Possible values include: 'Public', 'Private'
26+
internet or private VNET. Possible values include: 'Public', 'Private'
2727
:type type: str or
2828
~azure.mgmt.containerinstance.models.ContainerGroupIpAddressType
2929
:param ip: The IP exposed to the public internet.

azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
from .operations import Operations
1414
from .container_group_usage_operations import ContainerGroupUsageOperations
1515
from .container_operations import ContainerOperations
16+
from .service_association_link_operations import ServiceAssociationLinkOperations
1617

1718
__all__ = [
1819
'ContainerGroupsOperations',
1920
'Operations',
2021
'ContainerGroupUsageOperations',
2122
'ContainerOperations',
23+
'ServiceAssociationLinkOperations',
2224
]

0 commit comments

Comments
 (0)