diff --git a/azure-mgmt-managedservices/HISTORY.rst b/azure-mgmt-managedservices/HISTORY.rst new file mode 100644 index 000000000000..d90b0730274d --- /dev/null +++ b/azure-mgmt-managedservices/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (2019-05-14) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-managedservices/MANIFEST.in b/azure-mgmt-managedservices/MANIFEST.in new file mode 100644 index 000000000000..e4884efef41b --- /dev/null +++ b/azure-mgmt-managedservices/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-managedservices/README.rst b/azure-mgmt-managedservices/README.rst new file mode 100644 index 000000000000..051d8a6473bb --- /dev/null +++ b/azure-mgmt-managedservices/README.rst @@ -0,0 +1,33 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure Managed Services 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, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Usage +===== + +For code examples, see `Managed Services +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-managedservices%2FREADME.png diff --git a/azure-mgmt-managedservices/azure/__init__.py b/azure-mgmt-managedservices/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-managedservices/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-managedservices/azure/mgmt/__init__.py b/azure-mgmt-managedservices/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/__init__.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/__init__.py new file mode 100644 index 000000000000..395333b4333e --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/__init__.py @@ -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_services_client import ManagedServicesClient +from .version import VERSION + +__all__ = ['ManagedServicesClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/managed_services_client.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/managed_services_client.py new file mode 100644 index 000000000000..f203c43a60f9 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/managed_services_client.py @@ -0,0 +1,84 @@ +# 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 SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.registration_definitions_operations import RegistrationDefinitionsOperations +from .operations.registration_assignments_operations import RegistrationAssignmentsOperations +from .operations.operations import Operations +from . import models + + +class ManagedServicesClientConfiguration(AzureConfiguration): + """Configuration for ManagedServicesClient + 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` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(ManagedServicesClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-managedservices/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + + +class ManagedServicesClient(SDKClient): + """Specification for ManagedServices. + + :ivar config: Configuration for client. + :vartype config: ManagedServicesClientConfiguration + + :ivar registration_definitions: RegistrationDefinitions operations + :vartype registration_definitions: azure.mgmt.managedservices.operations.RegistrationDefinitionsOperations + :ivar registration_assignments: RegistrationAssignments operations + :vartype registration_assignments: azure.mgmt.managedservices.operations.RegistrationAssignmentsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.managedservices.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + self.config = ManagedServicesClientConfiguration(credentials, base_url) + super(ManagedServicesClient, 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-06-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.registration_definitions = RegistrationDefinitionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.registration_assignments = RegistrationAssignmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/__init__.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/__init__.py new file mode 100644 index 000000000000..e5f57b0313ff --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/__init__.py @@ -0,0 +1,63 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from .authorization_py3 import Authorization + from .registration_definition_properties_py3 import RegistrationDefinitionProperties + from .plan_py3 import Plan + from .registration_definition_py3 import RegistrationDefinition + from .registration_assignment_properties_registration_definition_properties_py3 import RegistrationAssignmentPropertiesRegistrationDefinitionProperties + from .registration_assignment_properties_registration_definition_py3 import RegistrationAssignmentPropertiesRegistrationDefinition + from .registration_assignment_properties_py3 import RegistrationAssignmentProperties + from .registration_assignment_py3 import RegistrationAssignment + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .operation_list_py3 import OperationList + from .error_response_error_py3 import ErrorResponseError + from .error_response_py3 import ErrorResponse, ErrorResponseException +except (SyntaxError, ImportError): + from .authorization import Authorization + from .registration_definition_properties import RegistrationDefinitionProperties + from .plan import Plan + from .registration_definition import RegistrationDefinition + from .registration_assignment_properties_registration_definition_properties import RegistrationAssignmentPropertiesRegistrationDefinitionProperties + from .registration_assignment_properties_registration_definition import RegistrationAssignmentPropertiesRegistrationDefinition + from .registration_assignment_properties import RegistrationAssignmentProperties + from .registration_assignment import RegistrationAssignment + from .operation_display import OperationDisplay + from .operation import Operation + from .operation_list import OperationList + from .error_response_error import ErrorResponseError + from .error_response import ErrorResponse, ErrorResponseException +from .registration_definition_paged import RegistrationDefinitionPaged +from .registration_assignment_paged import RegistrationAssignmentPaged +from .managed_services_client_enums import ( + ProvisioningState, +) + +__all__ = [ + 'Authorization', + 'RegistrationDefinitionProperties', + 'Plan', + 'RegistrationDefinition', + 'RegistrationAssignmentPropertiesRegistrationDefinitionProperties', + 'RegistrationAssignmentPropertiesRegistrationDefinition', + 'RegistrationAssignmentProperties', + 'RegistrationAssignment', + 'OperationDisplay', + 'Operation', + 'OperationList', + 'ErrorResponseError', + 'ErrorResponse', 'ErrorResponseException', + 'RegistrationDefinitionPaged', + 'RegistrationAssignmentPaged', + 'ProvisioningState', +] diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/authorization.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/authorization.py new file mode 100644 index 000000000000..d44f2b851134 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/authorization.py @@ -0,0 +1,45 @@ +# 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 Authorization(Model): + """Authorization tuple containing principal Id (of user/service + principal/security group) and role definition id. + + All required parameters must be populated in order to send to Azure. + + :param principal_id: Required. Principal Id of the security group/service + principal/user that would be assigned permissions to the projected + subscription + :type principal_id: str + :param role_definition_id: Required. The role definition identifier. This + role will define all the permissions that the security group/service + principal/user must have on the projected subscription. This role cannot + be an owner role. + :type role_definition_id: str + """ + + _validation = { + 'principal_id': {'required': True}, + 'role_definition_id': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Authorization, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.role_definition_id = kwargs.get('role_definition_id', None) diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/authorization_py3.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/authorization_py3.py new file mode 100644 index 000000000000..dd5307748705 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/authorization_py3.py @@ -0,0 +1,45 @@ +# 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 Authorization(Model): + """Authorization tuple containing principal Id (of user/service + principal/security group) and role definition id. + + All required parameters must be populated in order to send to Azure. + + :param principal_id: Required. Principal Id of the security group/service + principal/user that would be assigned permissions to the projected + subscription + :type principal_id: str + :param role_definition_id: Required. The role definition identifier. This + role will define all the permissions that the security group/service + principal/user must have on the projected subscription. This role cannot + be an owner role. + :type role_definition_id: str + """ + + _validation = { + 'principal_id': {'required': True}, + 'role_definition_id': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str, role_definition_id: str, **kwargs) -> None: + super(Authorization, self).__init__(**kwargs) + self.principal_id = principal_id + self.role_definition_id = role_definition_id diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/error_response.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/error_response.py new file mode 100644 index 000000000000..0bb2ae53f561 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/error_response.py @@ -0,0 +1,50 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error: Error response indicates Azure Resource Manager is not able + to process the incoming request. The reason is provided in the error + message. + :vartype error: ~azure.mgmt.managedservices.models.ErrorResponseError + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/error_response_error.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/error_response_error.py new file mode 100644 index 000000000000..a22a3fe7daf9 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/error_response_error.py @@ -0,0 +1,41 @@ +# 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 ErrorResponseError(Model): + """Error response indicates Azure Resource Manager is not able to process the + incoming request. The reason is provided in the error message. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code. + :type code: str + :param message: Required. Error message indicating why the operation + failed. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponseError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/error_response_error_py3.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/error_response_error_py3.py new file mode 100644 index 000000000000..0407b0d4e106 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/error_response_error_py3.py @@ -0,0 +1,41 @@ +# 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 ErrorResponseError(Model): + """Error response indicates Azure Resource Manager is not able to process the + incoming request. The reason is provided in the error message. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code. + :type code: str + :param message: Required. Error message indicating why the operation + failed. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str, message: str, **kwargs) -> None: + super(ErrorResponseError, self).__init__(**kwargs) + self.code = code + self.message = message diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/error_response_py3.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/error_response_py3.py new file mode 100644 index 000000000000..65bd21421859 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/error_response_py3.py @@ -0,0 +1,50 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error: Error response indicates Azure Resource Manager is not able + to process the incoming request. The reason is provided in the error + message. + :vartype error: ~azure.mgmt.managedservices.models.ErrorResponseError + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/managed_services_client_enums.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/managed_services_client_enums.py new file mode 100644 index 000000000000..7c973162069e --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/managed_services_client_enums.py @@ -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 enum import Enum + + +class ProvisioningState(str, Enum): + + not_specified = "NotSpecified" + accepted = "Accepted" + running = "Running" + ready = "Ready" + creating = "Creating" + created = "Created" + deleting = "Deleting" + deleted = "Deleted" + canceled = "Canceled" + failed = "Failed" + succeeded = "Succeeded" + updating = "Updating" diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation.py new file mode 100644 index 000000000000..2b4fc63804f8 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation.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 Operation(Model): + """Object that describes a single Microsoft.ManagedServices operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation} + :vartype name: str + :ivar display: The object that represents the operation. + :vartype display: ~azure.mgmt.managedservices.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_display.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_display.py new file mode 100644 index 000000000000..ff3c7d57b1bf --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_display.py @@ -0,0 +1,41 @@ +# 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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.ManagedServices + :type provider: str + :param resource: Resource on which the operation is performed: + Registration definition, registration assignment etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_display_py3.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_display_py3.py new file mode 100644 index 000000000000..f6d0e99a0718 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_display_py3.py @@ -0,0 +1,41 @@ +# 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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.ManagedServices + :type provider: str + :param resource: Resource on which the operation is performed: + Registration definition, registration assignment etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_list.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_list.py new file mode 100644 index 000000000000..b3f2e806af4e --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_list.py @@ -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 OperationList(Model): + """List of the operations. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of Microsoft.ManagedServices operations. + :vartype value: list[~azure.mgmt.managedservices.models.Operation] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__(self, **kwargs): + super(OperationList, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_list_py3.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_list_py3.py new file mode 100644 index 000000000000..aed3a8d3ce94 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_list_py3.py @@ -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 OperationList(Model): + """List of the operations. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of Microsoft.ManagedServices operations. + :vartype value: list[~azure.mgmt.managedservices.models.Operation] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationList, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_py3.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_py3.py new file mode 100644 index 000000000000..afbd7d244ce4 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/operation_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 Operation(Model): + """Object that describes a single Microsoft.ManagedServices operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation} + :vartype name: str + :ivar display: The object that represents the operation. + :vartype display: ~azure.mgmt.managedservices.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/plan.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/plan.py new file mode 100644 index 000000000000..96a1757eeab2 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/plan.py @@ -0,0 +1,49 @@ +# 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 Plan(Model): + """Plan details for the managed services. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The plan name. + :type name: str + :param publisher: Required. The publisher ID. + :type publisher: str + :param product: Required. The product code. + :type product: str + :param version: Required. The plan's version. + :type version: str + """ + + _validation = { + 'name': {'required': True}, + 'publisher': {'required': True}, + 'product': {'required': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/plan_py3.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/plan_py3.py new file mode 100644 index 000000000000..0c37b6b98ba7 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/plan_py3.py @@ -0,0 +1,49 @@ +# 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 Plan(Model): + """Plan details for the managed services. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The plan name. + :type name: str + :param publisher: Required. The publisher ID. + :type publisher: str + :param product: Required. The product code. + :type product: str + :param version: Required. The plan's version. + :type version: str + """ + + _validation = { + 'name': {'required': True}, + 'publisher': {'required': True}, + 'product': {'required': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, name: str, publisher: str, product: str, version: str, **kwargs) -> None: + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.version = version diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment.py new file mode 100644 index 000000000000..d92e0ddf3858 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment.py @@ -0,0 +1,50 @@ +# 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 RegistrationAssignment(Model): + """Registration assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param properties: Properties of a registration assignment. + :type properties: + ~azure.mgmt.managedservices.models.RegistrationAssignmentProperties + :ivar id: The fully qualified path of the registration assignment. + :vartype id: str + :ivar type: Type of the resource. + :vartype type: str + :ivar name: Name of the registration assignment. + :vartype name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'RegistrationAssignmentProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegistrationAssignment, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.id = None + self.type = None + self.name = None diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_paged.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_paged.py new file mode 100644 index 000000000000..21a68092ffb5 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_paged.py @@ -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 RegistrationAssignmentPaged(Paged): + """ + A paging container for iterating over a list of :class:`RegistrationAssignment ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RegistrationAssignment]'} + } + + def __init__(self, *args, **kwargs): + + super(RegistrationAssignmentPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties.py new file mode 100644 index 000000000000..8e4bab71b31c --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties.py @@ -0,0 +1,54 @@ +# 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 RegistrationAssignmentProperties(Model): + """Properties of a registration assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param registration_definition_id: Required. Fully qualified path of the + registration definition. + :type registration_definition_id: str + :ivar provisioning_state: Current state of the registration assignment. + Possible values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', + 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.managedservices.models.ProvisioningState + :ivar registration_definition: Registration definition inside registration + assignment. + :vartype registration_definition: + ~azure.mgmt.managedservices.models.RegistrationAssignmentPropertiesRegistrationDefinition + """ + + _validation = { + 'registration_definition_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'registration_definition': {'readonly': True}, + } + + _attribute_map = { + 'registration_definition_id': {'key': 'registrationDefinitionId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'ProvisioningState'}, + 'registration_definition': {'key': 'registrationDefinition', 'type': 'RegistrationAssignmentPropertiesRegistrationDefinition'}, + } + + def __init__(self, **kwargs): + super(RegistrationAssignmentProperties, self).__init__(**kwargs) + self.registration_definition_id = kwargs.get('registration_definition_id', None) + self.provisioning_state = None + self.registration_definition = None diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_py3.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_py3.py new file mode 100644 index 000000000000..1eb37689784d --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_py3.py @@ -0,0 +1,54 @@ +# 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 RegistrationAssignmentProperties(Model): + """Properties of a registration assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param registration_definition_id: Required. Fully qualified path of the + registration definition. + :type registration_definition_id: str + :ivar provisioning_state: Current state of the registration assignment. + Possible values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', + 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.managedservices.models.ProvisioningState + :ivar registration_definition: Registration definition inside registration + assignment. + :vartype registration_definition: + ~azure.mgmt.managedservices.models.RegistrationAssignmentPropertiesRegistrationDefinition + """ + + _validation = { + 'registration_definition_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'registration_definition': {'readonly': True}, + } + + _attribute_map = { + 'registration_definition_id': {'key': 'registrationDefinitionId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'ProvisioningState'}, + 'registration_definition': {'key': 'registrationDefinition', 'type': 'RegistrationAssignmentPropertiesRegistrationDefinition'}, + } + + def __init__(self, *, registration_definition_id: str, **kwargs) -> None: + super(RegistrationAssignmentProperties, self).__init__(**kwargs) + self.registration_definition_id = registration_definition_id + self.provisioning_state = None + self.registration_definition = None diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_registration_definition.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_registration_definition.py new file mode 100644 index 000000000000..024c1af8b5b3 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_registration_definition.py @@ -0,0 +1,56 @@ +# 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 RegistrationAssignmentPropertiesRegistrationDefinition(Model): + """Registration definition inside registration assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param properties: Properties of registration definition inside + registration assignment. + :type properties: + ~azure.mgmt.managedservices.models.RegistrationAssignmentPropertiesRegistrationDefinitionProperties + :param plan: Plan details for the managed services. + :type plan: ~azure.mgmt.managedservices.models.Plan + :ivar id: Fully qualified path of the registration definition. + :vartype id: str + :ivar type: Type of the resource + (Microsoft.ManagedServices/registrationDefinitions). + :vartype type: str + :ivar name: Name of the registration definition. + :vartype name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'RegistrationAssignmentPropertiesRegistrationDefinitionProperties'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegistrationAssignmentPropertiesRegistrationDefinition, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.plan = kwargs.get('plan', None) + self.id = None + self.type = None + self.name = None diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_registration_definition_properties.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_registration_definition_properties.py new file mode 100644 index 000000000000..c6c54637627c --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_registration_definition_properties.py @@ -0,0 +1,62 @@ +# 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 RegistrationAssignmentPropertiesRegistrationDefinitionProperties(Model): + """Properties of registration definition inside registration assignment. + + :param description: Description of the registration definition. + :type description: str + :param authorizations: Authorization tuple containing principal id of the + user/security group or service principal and id of the build-in role. + :type authorizations: + list[~azure.mgmt.managedservices.models.Authorization] + :param registration_definition_name: Name of the registration definition. + :type registration_definition_name: str + :param provisioning_state: Current state of the registration definition. + Possible values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', + 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + 'Succeeded', 'Updating' + :type provisioning_state: str or + ~azure.mgmt.managedservices.models.ProvisioningState + :param managee_tenant_id: Id of the home tenant. + :type managee_tenant_id: str + :param managee_tenant_name: Name of the home tenant. + :type managee_tenant_name: str + :param managed_by_tenant_id: Id of the managedBy tenant. + :type managed_by_tenant_id: str + :param managed_by_tenant_name: Name of the managedBy tenant. + :type managed_by_tenant_name: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'authorizations': {'key': 'authorizations', 'type': '[Authorization]'}, + 'registration_definition_name': {'key': 'registrationDefinitionName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'ProvisioningState'}, + 'managee_tenant_id': {'key': 'manageeTenantId', 'type': 'str'}, + 'managee_tenant_name': {'key': 'manageeTenantName', 'type': 'str'}, + 'managed_by_tenant_id': {'key': 'managedByTenantId', 'type': 'str'}, + 'managed_by_tenant_name': {'key': 'managedByTenantName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegistrationAssignmentPropertiesRegistrationDefinitionProperties, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.authorizations = kwargs.get('authorizations', None) + self.registration_definition_name = kwargs.get('registration_definition_name', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.managee_tenant_id = kwargs.get('managee_tenant_id', None) + self.managee_tenant_name = kwargs.get('managee_tenant_name', None) + self.managed_by_tenant_id = kwargs.get('managed_by_tenant_id', None) + self.managed_by_tenant_name = kwargs.get('managed_by_tenant_name', None) diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_registration_definition_properties_py3.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_registration_definition_properties_py3.py new file mode 100644 index 000000000000..c74e5cc908ee --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_registration_definition_properties_py3.py @@ -0,0 +1,62 @@ +# 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 RegistrationAssignmentPropertiesRegistrationDefinitionProperties(Model): + """Properties of registration definition inside registration assignment. + + :param description: Description of the registration definition. + :type description: str + :param authorizations: Authorization tuple containing principal id of the + user/security group or service principal and id of the build-in role. + :type authorizations: + list[~azure.mgmt.managedservices.models.Authorization] + :param registration_definition_name: Name of the registration definition. + :type registration_definition_name: str + :param provisioning_state: Current state of the registration definition. + Possible values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', + 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + 'Succeeded', 'Updating' + :type provisioning_state: str or + ~azure.mgmt.managedservices.models.ProvisioningState + :param managee_tenant_id: Id of the home tenant. + :type managee_tenant_id: str + :param managee_tenant_name: Name of the home tenant. + :type managee_tenant_name: str + :param managed_by_tenant_id: Id of the managedBy tenant. + :type managed_by_tenant_id: str + :param managed_by_tenant_name: Name of the managedBy tenant. + :type managed_by_tenant_name: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'authorizations': {'key': 'authorizations', 'type': '[Authorization]'}, + 'registration_definition_name': {'key': 'registrationDefinitionName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'ProvisioningState'}, + 'managee_tenant_id': {'key': 'manageeTenantId', 'type': 'str'}, + 'managee_tenant_name': {'key': 'manageeTenantName', 'type': 'str'}, + 'managed_by_tenant_id': {'key': 'managedByTenantId', 'type': 'str'}, + 'managed_by_tenant_name': {'key': 'managedByTenantName', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, authorizations=None, registration_definition_name: str=None, provisioning_state=None, managee_tenant_id: str=None, managee_tenant_name: str=None, managed_by_tenant_id: str=None, managed_by_tenant_name: str=None, **kwargs) -> None: + super(RegistrationAssignmentPropertiesRegistrationDefinitionProperties, self).__init__(**kwargs) + self.description = description + self.authorizations = authorizations + self.registration_definition_name = registration_definition_name + self.provisioning_state = provisioning_state + self.managee_tenant_id = managee_tenant_id + self.managee_tenant_name = managee_tenant_name + self.managed_by_tenant_id = managed_by_tenant_id + self.managed_by_tenant_name = managed_by_tenant_name diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_registration_definition_py3.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_registration_definition_py3.py new file mode 100644 index 000000000000..9a5ef972e44c --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_properties_registration_definition_py3.py @@ -0,0 +1,56 @@ +# 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 RegistrationAssignmentPropertiesRegistrationDefinition(Model): + """Registration definition inside registration assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param properties: Properties of registration definition inside + registration assignment. + :type properties: + ~azure.mgmt.managedservices.models.RegistrationAssignmentPropertiesRegistrationDefinitionProperties + :param plan: Plan details for the managed services. + :type plan: ~azure.mgmt.managedservices.models.Plan + :ivar id: Fully qualified path of the registration definition. + :vartype id: str + :ivar type: Type of the resource + (Microsoft.ManagedServices/registrationDefinitions). + :vartype type: str + :ivar name: Name of the registration definition. + :vartype name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'RegistrationAssignmentPropertiesRegistrationDefinitionProperties'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, properties=None, plan=None, **kwargs) -> None: + super(RegistrationAssignmentPropertiesRegistrationDefinition, self).__init__(**kwargs) + self.properties = properties + self.plan = plan + self.id = None + self.type = None + self.name = None diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_py3.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_py3.py new file mode 100644 index 000000000000..decb5b20b6c3 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_assignment_py3.py @@ -0,0 +1,50 @@ +# 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 RegistrationAssignment(Model): + """Registration assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param properties: Properties of a registration assignment. + :type properties: + ~azure.mgmt.managedservices.models.RegistrationAssignmentProperties + :ivar id: The fully qualified path of the registration assignment. + :vartype id: str + :ivar type: Type of the resource. + :vartype type: str + :ivar name: Name of the registration assignment. + :vartype name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'RegistrationAssignmentProperties'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(RegistrationAssignment, self).__init__(**kwargs) + self.properties = properties + self.id = None + self.type = None + self.name = None diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition.py new file mode 100644 index 000000000000..65c19f3f8daa --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition.py @@ -0,0 +1,54 @@ +# 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 RegistrationDefinition(Model): + """Registration definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param properties: Properties of a registration definition. + :type properties: + ~azure.mgmt.managedservices.models.RegistrationDefinitionProperties + :param plan: Plan details for the managed services. + :type plan: ~azure.mgmt.managedservices.models.Plan + :ivar id: Fully qualified path of the registration definition. + :vartype id: str + :ivar type: Type of the resource. + :vartype type: str + :ivar name: Name of the registration definition. + :vartype name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'RegistrationDefinitionProperties'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegistrationDefinition, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.plan = kwargs.get('plan', None) + self.id = None + self.type = None + self.name = None diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition_paged.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition_paged.py new file mode 100644 index 000000000000..9b51285427ae --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition_paged.py @@ -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 RegistrationDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`RegistrationDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RegistrationDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(RegistrationDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition_properties.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition_properties.py new file mode 100644 index 000000000000..7581c7921911 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition_properties.py @@ -0,0 +1,67 @@ +# 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 RegistrationDefinitionProperties(Model): + """Properties of a registration definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the registration definition. + :type description: str + :param authorizations: Required. Authorization tuple containing principal + id of the user/security group or service principal and id of the build-in + role. + :type authorizations: + list[~azure.mgmt.managedservices.models.Authorization] + :param registration_definition_name: Name of the registration definition. + :type registration_definition_name: str + :param managed_by_tenant_id: Required. Id of the managedBy tenant. + :type managed_by_tenant_id: str + :ivar provisioning_state: Current state of the registration definition. + Possible values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', + 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.managedservices.models.ProvisioningState + :ivar managed_by_tenant_name: Name of the managedBy tenant. + :vartype managed_by_tenant_name: str + """ + + _validation = { + 'authorizations': {'required': True}, + 'managed_by_tenant_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'managed_by_tenant_name': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'authorizations': {'key': 'authorizations', 'type': '[Authorization]'}, + 'registration_definition_name': {'key': 'registrationDefinitionName', 'type': 'str'}, + 'managed_by_tenant_id': {'key': 'managedByTenantId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'ProvisioningState'}, + 'managed_by_tenant_name': {'key': 'managedByTenantName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegistrationDefinitionProperties, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.authorizations = kwargs.get('authorizations', None) + self.registration_definition_name = kwargs.get('registration_definition_name', None) + self.managed_by_tenant_id = kwargs.get('managed_by_tenant_id', None) + self.provisioning_state = None + self.managed_by_tenant_name = None diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition_properties_py3.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition_properties_py3.py new file mode 100644 index 000000000000..c2f207bd5c21 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition_properties_py3.py @@ -0,0 +1,67 @@ +# 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 RegistrationDefinitionProperties(Model): + """Properties of a registration definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the registration definition. + :type description: str + :param authorizations: Required. Authorization tuple containing principal + id of the user/security group or service principal and id of the build-in + role. + :type authorizations: + list[~azure.mgmt.managedservices.models.Authorization] + :param registration_definition_name: Name of the registration definition. + :type registration_definition_name: str + :param managed_by_tenant_id: Required. Id of the managedBy tenant. + :type managed_by_tenant_id: str + :ivar provisioning_state: Current state of the registration definition. + Possible values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', + 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.managedservices.models.ProvisioningState + :ivar managed_by_tenant_name: Name of the managedBy tenant. + :vartype managed_by_tenant_name: str + """ + + _validation = { + 'authorizations': {'required': True}, + 'managed_by_tenant_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'managed_by_tenant_name': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'authorizations': {'key': 'authorizations', 'type': '[Authorization]'}, + 'registration_definition_name': {'key': 'registrationDefinitionName', 'type': 'str'}, + 'managed_by_tenant_id': {'key': 'managedByTenantId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'ProvisioningState'}, + 'managed_by_tenant_name': {'key': 'managedByTenantName', 'type': 'str'}, + } + + def __init__(self, *, authorizations, managed_by_tenant_id: str, description: str=None, registration_definition_name: str=None, **kwargs) -> None: + super(RegistrationDefinitionProperties, self).__init__(**kwargs) + self.description = description + self.authorizations = authorizations + self.registration_definition_name = registration_definition_name + self.managed_by_tenant_id = managed_by_tenant_id + self.provisioning_state = None + self.managed_by_tenant_name = None diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition_py3.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition_py3.py new file mode 100644 index 000000000000..f570181a2764 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/models/registration_definition_py3.py @@ -0,0 +1,54 @@ +# 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 RegistrationDefinition(Model): + """Registration definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param properties: Properties of a registration definition. + :type properties: + ~azure.mgmt.managedservices.models.RegistrationDefinitionProperties + :param plan: Plan details for the managed services. + :type plan: ~azure.mgmt.managedservices.models.Plan + :ivar id: Fully qualified path of the registration definition. + :vartype id: str + :ivar type: Type of the resource. + :vartype type: str + :ivar name: Name of the registration definition. + :vartype name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'RegistrationDefinitionProperties'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, properties=None, plan=None, **kwargs) -> None: + super(RegistrationDefinition, self).__init__(**kwargs) + self.properties = properties + self.plan = plan + self.id = None + self.type = None + self.name = None diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/operations/__init__.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/operations/__init__.py new file mode 100644 index 000000000000..f51ba517d417 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/operations/__init__.py @@ -0,0 +1,20 @@ +# 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 .registration_definitions_operations import RegistrationDefinitionsOperations +from .registration_assignments_operations import RegistrationAssignmentsOperations +from .operations import Operations + +__all__ = [ + 'RegistrationDefinitionsOperations', + 'RegistrationAssignmentsOperations', + 'Operations', +] diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/operations/operations.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/operations/operations.py new file mode 100644 index 000000000000..85d385fc7869 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/operations/operations.py @@ -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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations 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. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def list( + self, api_version, custom_headers=None, raw=False, **operation_config): + """Gets a list of the operations. + + :param api_version: The API version to use for this operation. + :type api_version: 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: OperationList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.managedservices.models.OperationList or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.ManagedServices/operations'} diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/operations/registration_assignments_operations.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/operations/registration_assignments_operations.py new file mode 100644 index 000000000000..325b9bec7e99 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/operations/registration_assignments_operations.py @@ -0,0 +1,314 @@ +# 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 .. import models + + +class RegistrationAssignmentsOperations(object): + """RegistrationAssignmentsOperations 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. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def get( + self, scope, registration_assignment_id, api_version, expand_registration_definition=None, custom_headers=None, raw=False, **operation_config): + """Gets the details of specified registration assignment. + + :param scope: Scope of the resource. + :type scope: str + :param registration_assignment_id: Guid of the registration + assignment. + :type registration_assignment_id: str + :param api_version: The API version to use for this operation. + :type api_version: str + :param expand_registration_definition: Tells whether to return + registration definition details also along with registration + assignment details. + :type expand_registration_definition: bool + :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: RegistrationAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.managedservices.models.RegistrationAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'registrationAssignmentId': self._serialize.url("registration_assignment_id", registration_assignment_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand_registration_definition is not None: + query_parameters['$expandRegistrationDefinition'] = self._serialize.query("expand_registration_definition", expand_registration_definition, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RegistrationAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}'} + + def delete( + self, scope, registration_assignment_id, api_version, custom_headers=None, raw=False, **operation_config): + """Deletes the specified registration assignment. + + :param scope: Scope of the resource. + :type scope: str + :param registration_assignment_id: Guid of the registration + assignment. + :type registration_assignment_id: str + :param api_version: The API version to use for this operation. + :type api_version: 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: RegistrationAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.managedservices.models.RegistrationAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'registrationAssignmentId': self._serialize.url("registration_assignment_id", registration_assignment_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RegistrationAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}'} + + def create_or_update( + self, scope, registration_assignment_id, api_version, properties=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates a registration assignment. + + :param scope: Scope of the resource. + :type scope: str + :param registration_assignment_id: Guid of the registration + assignment. + :type registration_assignment_id: str + :param api_version: The API version to use for this operation. + :type api_version: str + :param properties: Properties of a registration assignment. + :type properties: + ~azure.mgmt.managedservices.models.RegistrationAssignmentProperties + :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: RegistrationAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.managedservices.models.RegistrationAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + request_body = models.RegistrationAssignment(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'registrationAssignmentId': self._serialize.url("registration_assignment_id", registration_assignment_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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 body + body_content = self._serialize.body(request_body, 'RegistrationAssignment') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RegistrationAssignment', response) + if response.status_code == 201: + deserialized = self._deserialize('RegistrationAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}'} + + def list( + self, scope, api_version, expand_registration_definition=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of the registration assignments. + + :param scope: Scope of the resource. + :type scope: str + :param api_version: The API version to use for this operation. + :type api_version: str + :param expand_registration_definition: Tells whether to return + registration definition details also along with registration + assignment details. + :type expand_registration_definition: bool + :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: An iterator like instance of RegistrationAssignment + :rtype: + ~azure.mgmt.managedservices.models.RegistrationAssignmentPaged[~azure.mgmt.managedservices.models.RegistrationAssignment] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand_registration_definition is not None: + query_parameters['$expandRegistrationDefinition'] = self._serialize.query("expand_registration_definition", expand_registration_definition, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.RegistrationAssignmentPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RegistrationAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.ManagedServices/registrationAssignments'} diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/operations/registration_definitions_operations.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/operations/registration_definitions_operations.py new file mode 100644 index 000000000000..2d349517f994 --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/operations/registration_definitions_operations.py @@ -0,0 +1,304 @@ +# 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 .. import models + + +class RegistrationDefinitionsOperations(object): + """RegistrationDefinitionsOperations 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. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def get( + self, scope, registration_definition_id, api_version, custom_headers=None, raw=False, **operation_config): + """Gets the registration definition details. + + :param scope: Scope of the resource. + :type scope: str + :param registration_definition_id: Guid of the registration + definition. + :type registration_definition_id: str + :param api_version: The API version to use for this operation. + :type api_version: 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: RegistrationDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.managedservices.models.RegistrationDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'registrationDefinitionId': self._serialize.url("registration_definition_id", registration_definition_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RegistrationDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}'} + + def delete( + self, registration_definition_id, api_version, scope, custom_headers=None, raw=False, **operation_config): + """Deletes the registration definition. + + :param registration_definition_id: Guid of the registration + definition. + :type registration_definition_id: str + :param api_version: The API version to use for this operation. + :type api_version: str + :param scope: Scope of the resource. + :type scope: 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: RegistrationDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.managedservices.models.RegistrationDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'registrationDefinitionId': self._serialize.url("registration_definition_id", registration_definition_id, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RegistrationDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}'} + + def create_or_update( + self, registration_definition_id, api_version, scope, properties=None, plan=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates a registration definition. + + :param registration_definition_id: Guid of the registration + definition. + :type registration_definition_id: str + :param api_version: The API version to use for this operation. + :type api_version: str + :param scope: Scope of the resource. + :type scope: str + :param properties: Properties of a registration definition. + :type properties: + ~azure.mgmt.managedservices.models.RegistrationDefinitionProperties + :param plan: Plan details for the managed services. + :type plan: ~azure.mgmt.managedservices.models.Plan + :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: RegistrationDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.managedservices.models.RegistrationDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + request_body = models.RegistrationDefinition(properties=properties, plan=plan) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'registrationDefinitionId': self._serialize.url("registration_definition_id", registration_definition_id, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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 body + body_content = self._serialize.body(request_body, 'RegistrationDefinition') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RegistrationDefinition', response) + if response.status_code == 201: + deserialized = self._deserialize('RegistrationDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}'} + + def list( + self, scope, api_version, custom_headers=None, raw=False, **operation_config): + """Gets a list of the registration definitions. + + :param scope: Scope of the resource. + :type scope: str + :param api_version: The API version to use for this operation. + :type api_version: 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: An iterator like instance of RegistrationDefinition + :rtype: + ~azure.mgmt.managedservices.models.RegistrationDefinitionPaged[~azure.mgmt.managedservices.models.RegistrationDefinition] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.RegistrationDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RegistrationDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions'} diff --git a/azure-mgmt-managedservices/azure/mgmt/managedservices/version.py b/azure-mgmt-managedservices/azure/mgmt/managedservices/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-mgmt-managedservices/azure/mgmt/managedservices/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + diff --git a/azure-mgmt-managedservices/sdk_packaging.toml b/azure-mgmt-managedservices/sdk_packaging.toml new file mode 100644 index 000000000000..311dc8ac0dc7 --- /dev/null +++ b/azure-mgmt-managedservices/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-managedservices" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Managed Services" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/azure-mgmt-managedservices/setup.cfg b/azure-mgmt-managedservices/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-mgmt-managedservices/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-mgmt-managedservices/setup.py b/azure-mgmt-managedservices/setup.py new file mode 100644 index 000000000000..e93fc571425d --- /dev/null +++ b/azure-mgmt-managedservices/setup.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-managedservices" +PACKAGE_PPRINT_NAME = "Managed Services" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +) diff --git a/azure-mgmt-managedservices/tests/recordings/test_mgmt_managedservices.test_managedservices_crud.yaml b/azure-mgmt-managedservices/tests/recordings/test_mgmt_managedservices.test_managedservices_crud.yaml new file mode 100644 index 000000000000..70b9d7d1629a --- /dev/null +++ b/azure-mgmt-managedservices/tests/recordings/test_mgmt_managedservices.test_managedservices_crud.yaml @@ -0,0 +1,290 @@ +interactions: +- request: + body: '{"properties": {"description": "dpp", "authorizations": [{"principalId": + "d6f6c88a-5b7a-455e-ba40-ce146d4d3671", "roleDefinitionId": "acdd72a7-3385-48ef-bd42-f606fba81ae7"}], + "registrationDefinitionName": "Registration Test", "managedByTenantId": "bab3375b-6197-4a15-a44b-16c41faa91d7"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '287' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - python/3.7.3 (Windows-10-10.0.17763-SP0) msrest/0.6.6 msrest_azure/0.4.34 + azure-mgmt-managedservices/0.1.0 Azure-SDK-For-Python + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/1cf1704a-f8a8-4082-a8be-457d3f68e812?api-version=2018-06-01-preview + + response: + body: + string: '{"properties":{"registrationDefinitionName":"Registration Test","description":"dpp","managedByTenantId":"bab3375b-6197-4a15-a44b-16c41faa91d7","authorizations":[{"principalId":"d6f6c88a-5b7a-455e-ba40-ce146d4d3671","roleDefinitionId":"acdd72a7-3385-48ef-bd42-f606fba81ae7"}],"provisioningState":"Succeeded","managedByTenantName":"Default + Directory"},"id":"/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/1cf1704a-f8a8-4082-a8be-457d3f68e812","type":"Microsoft.ManagedServices/registrationDefinitions","name":"1cf1704a-f8a8-4082-a8be-457d3f68e812"}' + + headers: + cache-control: + - no-cache + content-length: + - '611' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 10 May 2019 21:19:30 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: 'b''{"properties": {"registrationDefinitionId": "/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/1cf1704a-f8a8-4082-a8be-457d3f68e812"}}''' + + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '196' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - python/3.7.3 (Windows-10-10.0.17763-SP0) msrest/0.6.6 msrest_azure/0.4.34 + azure-mgmt-managedservices/0.1.0 Azure-SDK-For-Python + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationAssignments/367257d7-b69a-4b76-9c18-6dd3e9ae33ce?api-version=2018-06-01-preview + + response: + body: + string: '{"properties":{"registrationDefinitionId":"/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/1cf1704a-f8a8-4082-a8be-457d3f68e812","provisioningState":"Succeeded"},"id":"/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationAssignments/367257d7-b69a-4b76-9c18-6dd3e9ae33ce","type":"Microsoft.ManagedServices/registrationAssignments","name":"367257d7-b69a-4b76-9c18-6dd3e9ae33ce"}' + + headers: + cache-control: + - no-cache + content-length: + - '487' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 10 May 2019 21:19:35 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.3 (Windows-10-10.0.17763-SP0) msrest/0.6.6 msrest_azure/0.4.34 + azure-mgmt-managedservices/0.1.0 Azure-SDK-For-Python + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/1cf1704a-f8a8-4082-a8be-457d3f68e812?api-version=2018-06-01-preview + + response: + body: + string: '{"properties":{"registrationDefinitionName":"Registration Test","description":"dpp","managedByTenantId":"bab3375b-6197-4a15-a44b-16c41faa91d7","authorizations":[{"principalId":"d6f6c88a-5b7a-455e-ba40-ce146d4d3671","roleDefinitionId":"acdd72a7-3385-48ef-bd42-f606fba81ae7"}],"provisioningState":"Succeeded","managedByTenantName":"Default + Directory"},"id":"/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/1cf1704a-f8a8-4082-a8be-457d3f68e812","type":"Microsoft.ManagedServices/registrationDefinitions","name":"1cf1704a-f8a8-4082-a8be-457d3f68e812"}' + + headers: + cache-control: + - no-cache + content-length: + - '611' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 10 May 2019 21:19:35 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.3 (Windows-10-10.0.17763-SP0) msrest/0.6.6 msrest_azure/0.4.34 + azure-mgmt-managedservices/0.1.0 Azure-SDK-For-Python + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationAssignments/367257d7-b69a-4b76-9c18-6dd3e9ae33ce?api-version=2018-06-01-preview + + response: + body: + string: '{"properties":{"registrationDefinitionId":"/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/1cf1704a-f8a8-4082-a8be-457d3f68e812","provisioningState":"Succeeded"},"id":"/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationAssignments/367257d7-b69a-4b76-9c18-6dd3e9ae33ce","type":"Microsoft.ManagedServices/registrationAssignments","name":"367257d7-b69a-4b76-9c18-6dd3e9ae33ce"}' + + headers: + cache-control: + - no-cache + content-length: + - '487' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 10 May 2019 21:19:35 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python/3.7.3 (Windows-10-10.0.17763-SP0) msrest/0.6.6 msrest_azure/0.4.34 + azure-mgmt-managedservices/0.1.0 Azure-SDK-For-Python + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationAssignments/367257d7-b69a-4b76-9c18-6dd3e9ae33ce?api-version=2018-06-01-preview + + response: + body: + string: '{"properties":{"registrationDefinitionId":"/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/1cf1704a-f8a8-4082-a8be-457d3f68e812","provisioningState":"Deleted"},"id":"/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationAssignments/367257d7-b69a-4b76-9c18-6dd3e9ae33ce","type":"Microsoft.ManagedServices/registrationAssignments","name":"367257d7-b69a-4b76-9c18-6dd3e9ae33ce"}' + + headers: + cache-control: + - no-cache + content-length: + - '485' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 10 May 2019 21:19:38 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python/3.7.3 (Windows-10-10.0.17763-SP0) msrest/0.6.6 msrest_azure/0.4.34 + azure-mgmt-managedservices/0.1.0 Azure-SDK-For-Python + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/1cf1704a-f8a8-4082-a8be-457d3f68e812?api-version=2018-06-01-preview + + response: + body: + string: '{"properties":{"registrationDefinitionName":"Registration Test","description":"dpp","managedByTenantId":"bab3375b-6197-4a15-a44b-16c41faa91d7","authorizations":[{"principalId":"d6f6c88a-5b7a-455e-ba40-ce146d4d3671","roleDefinitionId":"acdd72a7-3385-48ef-bd42-f606fba81ae7"}],"provisioningState":"Deleted","managedByTenantName":"Default + Directory"},"id":"/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/1cf1704a-f8a8-4082-a8be-457d3f68e812","type":"Microsoft.ManagedServices/registrationDefinitions","name":"1cf1704a-f8a8-4082-a8be-457d3f68e812"}' + + headers: + cache-control: + - no-cache + content-length: + - '609' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 10 May 2019 21:19:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/azure-mgmt-managedservices/tests/test_mgmt_managedservices.py b/azure-mgmt-managedservices/tests/test_mgmt_managedservices.py new file mode 100644 index 000000000000..94756d9b2e91 --- /dev/null +++ b/azure-mgmt-managedservices/tests/test_mgmt_managedservices.py @@ -0,0 +1,68 @@ +# 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. +#-------------------------------------------------------------------------- +import unittest +import json +import uuid +from devtools_testutils import AzureMgmtTestCase +from azure.mgmt.managedservices import ManagedServicesClient + + +class MgmtManagedServicesTest(AzureMgmtTestCase): + def setUp(self): + super(MgmtManagedServicesTest, self).setUp() + self.client = self.create_basic_client(ManagedServicesClient) + + def test_managedservices_crud(self): + scope = 'subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15' + assignmentid = '367257d7-b69a-4b76-9c18-6dd3e9ae33ce' + api_version = '2018-06-01-preview' + definitionid = '1cf1704a-f8a8-4082-a8be-457d3f68e812' + regdef_string='{"registrationDefinitionName":"Registration Test","description":"dpp","managedByTenantId":"bab3375b-6197-4a15-a44b-16c41faa91d7","authorizations":[{"principalId":"d6f6c88a-5b7a-455e-ba40-ce146d4d3671","roleDefinitionId":"acdd72a7-3385-48ef-bd42-f606fba81ae7"}]}' + properties = json.loads((regdef_string)) + + #create definition + defresponse = self.client.registration_definitions.create_or_update( + definitionid, api_version, scope, properties) + definitionresourceid = defresponse.id + self.assertIsNotNone(defresponse) + self.assertEqual(definitionid, defresponse.name) + + #create assignment + assignmentproperties ={"registrationDefinitionId":definitionresourceid} + assignmentresponse = self.client.registration_assignments.create_or_update( + scope, assignmentid, api_version,assignmentproperties) + self.assertIsNotNone(assignmentresponse) + self.assertEqual(assignmentid, assignmentresponse.name) + + #get definition + getdefresponse = self.client.registration_definitions.get( + scope,definitionid,api_version) + self.assertIsNotNone(getdefresponse) + self.assertEqual(definitionid, getdefresponse.name) + + #get assingment + getassignmentresponse = self.client.registration_assignments.get( + scope, assignmentid, api_version) + + self.assertIsNotNone(getassignmentresponse) + self.assertEqual(assignmentid, getassignmentresponse.name) + + #remove assignment + removeassignmentresponse = self.client.registration_assignments.delete( + scope, assignmentid, api_version) + self.assertIsNotNone(removeassignmentresponse) + self.assertEqual(assignmentid, removeassignmentresponse.name) + + #remove definition + removedefinitionresponse = self.client.registration_definitions.delete( + definitionid, api_version, scope) + self.assertIsNotNone(removedefinitionresponse) + self.assertEqual(definitionid, removedefinitionresponse.name) + +if __name__ == '__main__': + unittest.main()