Skip to content

Commit

Permalink
[AutoPR] containerinstance/resource-manager (#3489)
Browse files Browse the repository at this point in the history
* Generated from 9a5541421e8815773449ba570834099b97025183 (#3484)

Moving MSI Identity object to correct properties

* adding test for msi identity in container groups

* Update version.py

* ACI changelog
  • Loading branch information
AutorestCI authored and lmazuel committed Oct 8, 2018
1 parent a8b56b3 commit 3f636c3
Show file tree
Hide file tree
Showing 21 changed files with 425 additions and 84 deletions.
12 changes: 12 additions & 0 deletions azure-mgmt-containerinstance/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
++++++++++++++++++

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
Expand All @@ -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)

Expand All @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -84,6 +88,7 @@
from .container_group_paged import ContainerGroupPaged
from .container_instance_management_client_enums import (
ContainerNetworkProtocol,
ResourceIdentityType,
ContainerGroupRestartPolicy,
ContainerGroupNetworkProtocol,
ContainerGroupIpAddressType,
Expand All @@ -109,6 +114,8 @@
'AzureFileVolume',
'GitRepoVolume',
'Volume',
'ContainerGroupIdentityUserAssignedIdentitiesValue',
'ContainerGroupIdentity',
'ImageRegistryCredential',
'Port',
'IpAddress',
Expand All @@ -130,6 +137,7 @@
'Resource',
'ContainerGroupPaged',
'ContainerNetworkProtocol',
'ResourceIdentityType',
'ContainerGroupRestartPolicy',
'ContainerGroupNetworkProtocol',
'ContainerGroupIpAddressType',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]'},
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]'},
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]

0 comments on commit 3f636c3

Please sign in to comment.