Skip to content

Commit

Permalink
Initial version of MSI
Browse files Browse the repository at this point in the history
  • Loading branch information
lmazuel committed Dec 13, 2017
1 parent ad98951 commit 3a408ed
Show file tree
Hide file tree
Showing 23 changed files with 1,618 additions and 0 deletions.
9 changes: 9 additions & 0 deletions azure-mgmt-msi/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. :changelog:
Release History
===============

0.1.0 (2017-12-13)
++++++++++++++++++

* Initial Release
2 changes: 2 additions & 0 deletions azure-mgmt-msi/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include *.rst
include azure_bdist_wheel.py
49 changes: 49 additions & 0 deletions azure-mgmt-msi/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure MSI Management Client Library.

Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.

For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


Compatibility
=============

**IMPORTANT**: If you have an earlier version of the azure package
(version < 1.0), you should uninstall it before installing this package.

You can check the version using pip:

.. code:: shell
pip freeze
If you see azure==0.11.0 (or any version below 1.0), uninstall it first:

.. code:: shell
pip uninstall azure
Usage
=====

For code examples, see `MSI Management
<https://azure-sdk-for-python.readthedocs.org/en/latest/sample_azure-mgmt-msi.html>`__
on readthedocs.org.


Provide Feedback
================

If you encounter any bugs or have suggestions, please file an issue in the
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__
section of the project.
1 change: 1 addition & 0 deletions azure-mgmt-msi/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
1 change: 1 addition & 0 deletions azure-mgmt-msi/azure/mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
18 changes: 18 additions & 0 deletions azure-mgmt-msi/azure/mgmt/msi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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 .managed_service_identity_client import ManagedServiceIdentityClient
from .version import VERSION

__all__ = ['ManagedServiceIdentityClient']

__version__ = VERSION

88 changes: 88 additions & 0 deletions azure-mgmt-msi/azure/mgmt/msi/managed_service_identity_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# 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.service_client import ServiceClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.operations import Operations
from .operations.user_assigned_identities_operations import UserAssignedIdentitiesOperations
from . import models


class ManagedServiceIdentityClientConfiguration(AzureConfiguration):
"""Configuration for ManagedServiceIdentityClient
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The Id of the Subscription to which the identity
belongs.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(ManagedServiceIdentityClientConfiguration, self).__init__(base_url)

self.add_user_agent('azure-mgmt-msi/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id


class ManagedServiceIdentityClient(object):
"""The Managed Service Identity Client.
:ivar config: Configuration for client.
:vartype config: ManagedServiceIdentityClientConfiguration
:ivar operations: Operations operations
:vartype operations: azure.mgmt.msi.operations.Operations
:ivar user_assigned_identities: UserAssignedIdentities operations
:vartype user_assigned_identities: azure.mgmt.msi.operations.UserAssignedIdentitiesOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The Id of the Subscription to which the identity
belongs.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = ManagedServiceIdentityClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2015-08-31-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.user_assigned_identities = UserAssignedIdentitiesOperations(
self._client, self.config, self._serialize, self._deserialize)
28 changes: 28 additions & 0 deletions azure-mgmt-msi/azure/mgmt/msi/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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 .identity import Identity
from .operation_display import OperationDisplay
from .operation import Operation
from .operation_paged import OperationPaged
from .identity_paged import IdentityPaged
from .managed_service_identity_client_enums import (
UserAssignedIdentities,
)

__all__ = [
'Identity',
'OperationDisplay',
'Operation',
'OperationPaged',
'IdentityPaged',
'UserAssignedIdentities',
]
77 changes: 77 additions & 0 deletions azure-mgmt-msi/azure/mgmt/msi/models/identity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class Identity(Model):
"""Describes an identity resource.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: The id of the created identity.
:vartype id: str
:ivar name: The name of the created identity.
:vartype name: str
:param location: The Azure region where the identity lives.
:type location: str
:param tags: Resource tags
:type tags: dict[str, str]
:ivar tenant_id: The id of the tenant which the identity belongs to.
:vartype tenant_id: str
:ivar principal_id: The id of the service principal object associated with
the created identity.
:vartype principal_id: str
:ivar client_id: The id of the app associated with the identity. This is a
random generated UUID by MSI.
:vartype client_id: str
:ivar client_secret_url: The ManagedServiceIdentity DataPlane URL that
can be queried to obtain the identity credentials.
:vartype client_secret_url: str
:ivar type: The type of resource i.e.
Microsoft.ManagedIdentity/userAssignedIdentities. Possible values include:
'Microsoft.ManagedIdentity/userAssignedIdentities'
:vartype type: str or ~azure.mgmt.msi.models.UserAssignedIdentities
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'tenant_id': {'readonly': True},
'principal_id': {'readonly': True},
'client_id': {'readonly': True},
'client_secret_url': {'readonly': True},
'type': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'tenant_id': {'key': 'properties.tenantId', 'type': 'str'},
'principal_id': {'key': 'properties.principalId', 'type': 'str'},
'client_id': {'key': 'properties.clientId', 'type': 'str'},
'client_secret_url': {'key': 'properties.clientSecretUrl', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}

def __init__(self, location=None, tags=None):
self.id = None
self.name = None
self.location = location
self.tags = tags
self.tenant_id = None
self.principal_id = None
self.client_id = None
self.client_secret_url = None
self.type = None
27 changes: 27 additions & 0 deletions azure-mgmt-msi/azure/mgmt/msi/models/identity_paged.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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.paging import Paged


class IdentityPaged(Paged):
"""
A paging container for iterating over a list of :class:`Identity <azure.mgmt.msi.models.Identity>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[Identity]'}
}

def __init__(self, *args, **kwargs):

super(IdentityPaged, self).__init__(*args, **kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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 enum import Enum


class UserAssignedIdentities(Enum):

microsoft_managed_identityuser_assigned_identities = "Microsoft.ManagedIdentity/userAssignedIdentities"
35 changes: 35 additions & 0 deletions azure-mgmt-msi/azure/mgmt/msi/models/operation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class Operation(Model):
"""Microsoft.ManagedIdentity Operation.
Operation supported by the Microsoft.ManagedIdentity REST API.
:param name: Operation Name. The name of the REST Operation. This is of
the format {provider}/{resource}/{operation}.
:type name: str
:param display: Operation Display. The object that describes the
operation.
:type display: ~azure.mgmt.msi.models.OperationDisplay
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display': {'key': 'display', 'type': 'OperationDisplay'},
}

def __init__(self, name=None, display=None):
self.name = name
self.display = display
Loading

0 comments on commit 3a408ed

Please sign in to comment.