diff --git a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/_azure_stack_management_client.py b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/_azure_stack_management_client.py index 46dcad8f1bcc..f893cb20a0c7 100644 --- a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/_azure_stack_management_client.py +++ b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/_azure_stack_management_client.py @@ -14,9 +14,11 @@ from ._configuration import AzureStackManagementClientConfiguration from .operations import Operations +from .operations import CloudManifestFileOperations +from .operations import CustomerSubscriptionsOperations from .operations import ProductsOperations from .operations import RegistrationsOperations -from .operations import CustomerSubscriptionsOperations +from .operations import LinkedSubscriptionsOperations from . import models @@ -28,12 +30,16 @@ class AzureStackManagementClient(SDKClient): :ivar operations: Operations operations :vartype operations: azure.mgmt.azurestack.operations.Operations + :ivar cloud_manifest_file: CloudManifestFile operations + :vartype cloud_manifest_file: azure.mgmt.azurestack.operations.CloudManifestFileOperations + :ivar customer_subscriptions: CustomerSubscriptions operations + :vartype customer_subscriptions: azure.mgmt.azurestack.operations.CustomerSubscriptionsOperations :ivar products: Products operations :vartype products: azure.mgmt.azurestack.operations.ProductsOperations :ivar registrations: Registrations operations :vartype registrations: azure.mgmt.azurestack.operations.RegistrationsOperations - :ivar customer_subscriptions: CustomerSubscriptions operations - :vartype customer_subscriptions: azure.mgmt.azurestack.operations.CustomerSubscriptionsOperations + :ivar linked_subscriptions: LinkedSubscriptions operations + :vartype linked_subscriptions: azure.mgmt.azurestack.operations.LinkedSubscriptionsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -52,15 +58,19 @@ def __init__( super(AzureStackManagementClient, 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 = '2017-06-01' + self.api_version = '2020-06-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + self.cloud_manifest_file = CloudManifestFileOperations( + self._client, self.config, self._serialize, self._deserialize) + self.customer_subscriptions = CustomerSubscriptionsOperations( + self._client, self.config, self._serialize, self._deserialize) self.products = ProductsOperations( self._client, self.config, self._serialize, self._deserialize) self.registrations = RegistrationsOperations( self._client, self.config, self._serialize, self._deserialize) - self.customer_subscriptions = CustomerSubscriptionsOperations( + self.linked_subscriptions = LinkedSubscriptionsOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/__init__.py b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/__init__.py index 5aba3e6d7eec..1baa74a22c22 100644 --- a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/__init__.py +++ b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/__init__.py @@ -11,6 +11,9 @@ try: from ._models_py3 import ActivationKeyResult + from ._models_py3 import CloudManifestFileDeploymentData + from ._models_py3 import CloudManifestFileProperties + from ._models_py3 import CloudManifestFileResponse from ._models_py3 import Compatibility from ._models_py3 import CustomerSubscription from ._models_py3 import DataDiskImage @@ -20,6 +23,8 @@ from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import ExtendedProduct from ._models_py3 import IconUris + from ._models_py3 import LinkedSubscription + from ._models_py3 import LinkedSubscriptionParameter from ._models_py3 import MarketplaceProductLogUpdate from ._models_py3 import Operation from ._models_py3 import OsDiskImage @@ -31,11 +36,15 @@ from ._models_py3 import Registration from ._models_py3 import RegistrationParameter from ._models_py3 import Resource + from ._models_py3 import SystemData from ._models_py3 import TrackedResource from ._models_py3 import VirtualMachineExtensionProductProperties from ._models_py3 import VirtualMachineProductProperties except (SyntaxError, ImportError): from ._models import ActivationKeyResult + from ._models import CloudManifestFileDeploymentData + from ._models import CloudManifestFileProperties + from ._models import CloudManifestFileResponse from ._models import Compatibility from ._models import CustomerSubscription from ._models import DataDiskImage @@ -45,6 +54,8 @@ from ._models import ErrorResponse, ErrorResponseException from ._models import ExtendedProduct from ._models import IconUris + from ._models import LinkedSubscription + from ._models import LinkedSubscriptionParameter from ._models import MarketplaceProductLogUpdate from ._models import Operation from ._models import OsDiskImage @@ -56,24 +67,29 @@ from ._models import Registration from ._models import RegistrationParameter from ._models import Resource + from ._models import SystemData from ._models import TrackedResource from ._models import VirtualMachineExtensionProductProperties from ._models import VirtualMachineProductProperties from ._paged_models import CustomerSubscriptionPaged +from ._paged_models import LinkedSubscriptionPaged from ._paged_models import OperationPaged from ._paged_models import ProductPaged from ._paged_models import RegistrationPaged from ._azure_stack_management_client_enums import ( + CreatedByType, ProvisioningState, ComputeRole, OperatingSystem, CompatibilityIssue, Category, - Location, ) __all__ = [ 'ActivationKeyResult', + 'CloudManifestFileDeploymentData', + 'CloudManifestFileProperties', + 'CloudManifestFileResponse', 'Compatibility', 'CustomerSubscription', 'DataDiskImage', @@ -83,6 +99,8 @@ 'ErrorResponse', 'ErrorResponseException', 'ExtendedProduct', 'IconUris', + 'LinkedSubscription', + 'LinkedSubscriptionParameter', 'MarketplaceProductLogUpdate', 'Operation', 'OsDiskImage', @@ -94,17 +112,19 @@ 'Registration', 'RegistrationParameter', 'Resource', + 'SystemData', 'TrackedResource', 'VirtualMachineExtensionProductProperties', 'VirtualMachineProductProperties', 'OperationPaged', + 'CustomerSubscriptionPaged', 'ProductPaged', 'RegistrationPaged', - 'CustomerSubscriptionPaged', + 'LinkedSubscriptionPaged', + 'CreatedByType', 'ProvisioningState', 'ComputeRole', 'OperatingSystem', 'CompatibilityIssue', 'Category', - 'Location', ] diff --git a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_azure_stack_management_client_enums.py b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_azure_stack_management_client_enums.py index d819ad990f80..27cdf59d9b49 100644 --- a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_azure_stack_management_client_enums.py +++ b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_azure_stack_management_client_enums.py @@ -12,6 +12,14 @@ from enum import Enum +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + class ProvisioningState(str, Enum): creating = "Creating" @@ -52,8 +60,3 @@ class Category(str, Enum): azure_ad = "AzureAD" adfs = "ADFS" - - -class Location(str, Enum): - - global_enum = "global" diff --git a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_models.py b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_models.py index 1b1788792552..87993d0f8316 100644 --- a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_models.py +++ b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_models.py @@ -37,34 +37,53 @@ class CloudError(Model): } -class Compatibility(Model): - """Product compatibility. +class CloudManifestFileDeploymentData(Model): + """Cloud specific manifest data for AzureStack deployment. + + :param external_dsms_certificates: Dsms external certificates. + :type external_dsms_certificates: str + :param custom_cloud_verification_key: Signing verification public key. + :type custom_cloud_verification_key: str + :param custom_cloud_arm_endpoint: ARM endpoint. + :type custom_cloud_arm_endpoint: str + :param external_dsms_endpoint: Dsms endpoint. + :type external_dsms_endpoint: str + """ - :param is_compatible: Tells if product is compatible with current device - :type is_compatible: bool - :param message: Short error message if any compatibility issues are found - :type message: str - :param description: Full error message if any compatibility issues are - found - :type description: str - :param issues: List of all issues found - :type issues: list[str or - ~azure.mgmt.azurestack.models.CompatibilityIssue] + _attribute_map = { + 'external_dsms_certificates': {'key': 'externalDsmsCertificates', 'type': 'str'}, + 'custom_cloud_verification_key': {'key': 'customCloudVerificationKey', 'type': 'str'}, + 'custom_cloud_arm_endpoint': {'key': 'customEnvironmentEndpoints.customCloudArmEndpoint', 'type': 'str'}, + 'external_dsms_endpoint': {'key': 'customEnvironmentEndpoints.externalDsmsEndpoint', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CloudManifestFileDeploymentData, self).__init__(**kwargs) + self.external_dsms_certificates = kwargs.get('external_dsms_certificates', None) + self.custom_cloud_verification_key = kwargs.get('custom_cloud_verification_key', None) + self.custom_cloud_arm_endpoint = kwargs.get('custom_cloud_arm_endpoint', None) + self.external_dsms_endpoint = kwargs.get('external_dsms_endpoint', None) + + +class CloudManifestFileProperties(Model): + """Cloud specific manifest JSON properties. + + :param deployment_data: Cloud specific manifest data. + :type deployment_data: + ~azure.mgmt.azurestack.models.CloudManifestFileDeploymentData + :param signature: Signature of the cloud specific manifest data. + :type signature: str """ _attribute_map = { - 'is_compatible': {'key': 'isCompatible', 'type': 'bool'}, - 'message': {'key': 'message', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'issues': {'key': 'issues', 'type': '[str]'}, + 'deployment_data': {'key': 'deploymentData', 'type': 'CloudManifestFileDeploymentData'}, + 'signature': {'key': 'signature', 'type': 'str'}, } def __init__(self, **kwargs): - super(Compatibility, self).__init__(**kwargs) - self.is_compatible = kwargs.get('is_compatible', None) - self.message = kwargs.get('message', None) - self.description = kwargs.get('description', None) - self.issues = kwargs.get('issues', None) + super(CloudManifestFileProperties, self).__init__(**kwargs) + self.deployment_data = kwargs.get('deployment_data', None) + self.signature = kwargs.get('signature', None) class Resource(Model): @@ -105,6 +124,75 @@ def __init__(self, **kwargs): self.etag = kwargs.get('etag', None) +class CloudManifestFileResponse(Resource): + """Cloud specific manifest GET response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: ID of the resource. + :vartype id: str + :ivar name: Name of the resource. + :vartype name: str + :ivar type: Type of Resource. + :vartype type: str + :param etag: The entity tag used for optimistic concurrency when modifying + the resource. + :type etag: str + :param properties: Cloud specific manifest data. + :type properties: + ~azure.mgmt.azurestack.models.CloudManifestFileProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CloudManifestFileProperties'}, + } + + def __init__(self, **kwargs): + super(CloudManifestFileResponse, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class Compatibility(Model): + """Product compatibility. + + :param is_compatible: Tells if product is compatible with current device + :type is_compatible: bool + :param message: Short error message if any compatibility issues are found + :type message: str + :param description: Full error message if any compatibility issues are + found + :type description: str + :param issues: List of all issues found + :type issues: list[str or + ~azure.mgmt.azurestack.models.CompatibilityIssue] + """ + + _attribute_map = { + 'is_compatible': {'key': 'isCompatible', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'issues': {'key': 'issues', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(Compatibility, self).__init__(**kwargs) + self.is_compatible = kwargs.get('is_compatible', None) + self.message = kwargs.get('message', None) + self.description = kwargs.get('description', None) + self.issues = kwargs.get('issues', None) + + class CustomerSubscription(Resource): """Customer subscription. @@ -122,6 +210,8 @@ class CustomerSubscription(Resource): :type etag: str :param tenant_id: Tenant Id. :type tenant_id: str + :param system_data: + :type system_data: ~azure.mgmt.azurestack.models.SystemData """ _validation = { @@ -136,11 +226,13 @@ class CustomerSubscription(Resource): 'type': {'key': 'type', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__(self, **kwargs): super(CustomerSubscription, self).__init__(**kwargs) self.tenant_id = kwargs.get('tenant_id', None) + self.system_data = kwargs.get('system_data', None) class DataDiskImage(Model): @@ -411,6 +503,195 @@ def __init__(self, **kwargs): self.hero = kwargs.get('hero', None) +class TrackedResource(Model): + """Base resource object. + + 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. + + :ivar id: ID of the resource. + :vartype id: str + :ivar name: Name of the resource. + :vartype name: str + :ivar type: Type of Resource. + :vartype type: str + :ivar kind: The kind of the resource. + :vartype kind: str + :param system_data: + :type system_data: ~azure.mgmt.azurestack.models.SystemData + :ivar location: Required. Location of the resource. Default value: + "global" . + :vartype location: str + :param tags: Custom tags for the resource. + :type tags: dict[str, str] + :param etag: The entity tag used for optimistic concurrency when modifying + the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'location': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + location = "global" + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = None + self.system_data = kwargs.get('system_data', None) + self.tags = kwargs.get('tags', None) + self.etag = kwargs.get('etag', None) + + +class LinkedSubscription(TrackedResource): + """Linked Subscription information. + + 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. + + :ivar id: ID of the resource. + :vartype id: str + :ivar name: Name of the resource. + :vartype name: str + :ivar type: Type of Resource. + :vartype type: str + :ivar kind: The kind of the resource. + :vartype kind: str + :param system_data: + :type system_data: ~azure.mgmt.azurestack.models.SystemData + :ivar location: Required. Location of the resource. Default value: + "global" . + :vartype location: str + :param tags: Custom tags for the resource. + :type tags: dict[str, str] + :param etag: The entity tag used for optimistic concurrency when modifying + the resource. + :type etag: str + :param linked_subscription_id: The identifier associated with the device + subscription. + :type linked_subscription_id: str + :param registration_resource_id: The identifier associated with the device + registration. + :type registration_resource_id: str + :ivar device_id: The identifier of the Azure Stack device for remote + management. + :vartype device_id: str + :ivar device_object_id: The object identifier associated with the Azure + Stack device connecting to Azure. + :vartype device_object_id: str + :ivar device_link_state: The connection state of the Azure Stack device. + :vartype device_link_state: str + :ivar last_connected_time: The last remote management connection time for + the Azure Stack device connected to the linked subscription resource. + :vartype last_connected_time: str + :ivar device_connection_status: The status of the remote management + connection of the Azure Stack device. + :vartype device_connection_status: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'location': {'required': True, 'constant': True}, + 'device_id': {'readonly': True}, + 'device_object_id': {'readonly': True}, + 'device_link_state': {'readonly': True}, + 'last_connected_time': {'readonly': True}, + 'device_connection_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'linked_subscription_id': {'key': 'properties.linkedSubscriptionId', 'type': 'str'}, + 'registration_resource_id': {'key': 'properties.registrationResourceId', 'type': 'str'}, + 'device_id': {'key': 'properties.deviceId', 'type': 'str'}, + 'device_object_id': {'key': 'properties.deviceObjectId', 'type': 'str'}, + 'device_link_state': {'key': 'properties.deviceLinkState', 'type': 'str'}, + 'last_connected_time': {'key': 'properties.lastConnectedTime', 'type': 'str'}, + 'device_connection_status': {'key': 'properties.deviceConnectionStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LinkedSubscription, self).__init__(**kwargs) + self.linked_subscription_id = kwargs.get('linked_subscription_id', None) + self.registration_resource_id = kwargs.get('registration_resource_id', None) + self.device_id = None + self.device_object_id = None + self.device_link_state = None + self.last_connected_time = None + self.device_connection_status = None + + +class LinkedSubscriptionParameter(Model): + """Linked Subscription resource. + + 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 linked_subscription_id: Required. The identifier associated with + the device subscription. + :type linked_subscription_id: str + :param registration_resource_id: Required. The identifier associated with + the device registration. + :type registration_resource_id: str + :ivar location: Required. Location of the resource. Default value: + "global" . + :vartype location: str + """ + + _validation = { + 'linked_subscription_id': {'required': True}, + 'registration_resource_id': {'required': True}, + 'location': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'linked_subscription_id': {'key': 'properties.linkedSubscriptionId', 'type': 'str'}, + 'registration_resource_id': {'key': 'properties.registrationResourceId', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + location = "global" + + def __init__(self, **kwargs): + super(LinkedSubscriptionParameter, self).__init__(**kwargs) + self.linked_subscription_id = kwargs.get('linked_subscription_id', None) + self.registration_resource_id = kwargs.get('registration_resource_id', None) + + class MarketplaceProductLogUpdate(Model): """Update details for product log. @@ -559,6 +840,8 @@ class Product(Resource): :type product_properties: ~azure.mgmt.azurestack.models.ProductProperties :param compatibility: Product compatibility with current device. :type compatibility: ~azure.mgmt.azurestack.models.Compatibility + :param system_data: + :type system_data: ~azure.mgmt.azurestack.models.SystemData """ _validation = { @@ -590,6 +873,7 @@ class Product(Resource): 'product_kind': {'key': 'properties.productKind', 'type': 'str'}, 'product_properties': {'key': 'properties.productProperties', 'type': 'ProductProperties'}, 'compatibility': {'key': 'properties.compatibility', 'type': 'Compatibility'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__(self, **kwargs): @@ -612,6 +896,7 @@ def __init__(self, **kwargs): self.product_kind = kwargs.get('product_kind', None) self.product_properties = kwargs.get('product_properties', None) self.compatibility = kwargs.get('compatibility', None) + self.system_data = kwargs.get('system_data', None) class ProductLink(Model): @@ -743,57 +1028,6 @@ def __init__(self, **kwargs): self.version = kwargs.get('version', None) -class TrackedResource(Model): - """Base resource object. - - 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. - - :ivar id: ID of the resource. - :vartype id: str - :ivar name: Name of the resource. - :vartype name: str - :ivar type: Type of Resource. - :vartype type: str - :ivar location: Required. Location of the resource. Default value: - "global" . - :vartype location: str - :param tags: Custom tags for the resource. - :type tags: dict[str, str] - :param etag: The entity tag used for optimistic concurrency when modifying - the resource. - :type etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - location = "global" - - def __init__(self, **kwargs): - super(TrackedResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.tags = kwargs.get('tags', None) - self.etag = kwargs.get('etag', None) - - class Registration(TrackedResource): """Registration information. @@ -808,6 +1042,10 @@ class Registration(TrackedResource): :vartype name: str :ivar type: Type of Resource. :vartype type: str + :ivar kind: The kind of the resource. + :vartype kind: str + :param system_data: + :type system_data: ~azure.mgmt.azurestack.models.SystemData :ivar location: Required. Location of the resource. Default value: "global" . :vartype location: str @@ -830,6 +1068,7 @@ class Registration(TrackedResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'kind': {'readonly': True}, 'location': {'required': True, 'constant': True}, } @@ -837,6 +1076,8 @@ class Registration(TrackedResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, @@ -855,18 +1096,22 @@ def __init__(self, **kwargs): class RegistrationParameter(Model): """Registration resource. + 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_token: Required. The token identifying registered Azure Stack :type registration_token: str - :param location: Location of the resource. Possible values include: - 'global' - :type location: str or ~azure.mgmt.azurestack.models.Location + :ivar location: Required. Location of the resource. Default value: + "global" . + :vartype location: str """ _validation = { 'registration_token': {'required': True}, + 'location': {'required': True, 'constant': True}, } _attribute_map = { @@ -874,10 +1119,52 @@ class RegistrationParameter(Model): 'location': {'key': 'location', 'type': 'str'}, } + location = "global" + def __init__(self, **kwargs): super(RegistrationParameter, self).__init__(**kwargs) self.registration_token = kwargs.get('registration_token', None) - self.location = kwargs.get('location', None) + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or ~azure.mgmt.azurestack.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.azurestack.models.CreatedByType + :param last_modified_at: The type of identity that last modified the + resource. + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) class VirtualMachineExtensionProductProperties(Model): diff --git a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_models_py3.py b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_models_py3.py index 322590fdb8bc..bf3fea8c9b73 100644 --- a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_models_py3.py +++ b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_models_py3.py @@ -37,34 +37,53 @@ class CloudError(Model): } -class Compatibility(Model): - """Product compatibility. +class CloudManifestFileDeploymentData(Model): + """Cloud specific manifest data for AzureStack deployment. + + :param external_dsms_certificates: Dsms external certificates. + :type external_dsms_certificates: str + :param custom_cloud_verification_key: Signing verification public key. + :type custom_cloud_verification_key: str + :param custom_cloud_arm_endpoint: ARM endpoint. + :type custom_cloud_arm_endpoint: str + :param external_dsms_endpoint: Dsms endpoint. + :type external_dsms_endpoint: str + """ - :param is_compatible: Tells if product is compatible with current device - :type is_compatible: bool - :param message: Short error message if any compatibility issues are found - :type message: str - :param description: Full error message if any compatibility issues are - found - :type description: str - :param issues: List of all issues found - :type issues: list[str or - ~azure.mgmt.azurestack.models.CompatibilityIssue] + _attribute_map = { + 'external_dsms_certificates': {'key': 'externalDsmsCertificates', 'type': 'str'}, + 'custom_cloud_verification_key': {'key': 'customCloudVerificationKey', 'type': 'str'}, + 'custom_cloud_arm_endpoint': {'key': 'customEnvironmentEndpoints.customCloudArmEndpoint', 'type': 'str'}, + 'external_dsms_endpoint': {'key': 'customEnvironmentEndpoints.externalDsmsEndpoint', 'type': 'str'}, + } + + def __init__(self, *, external_dsms_certificates: str=None, custom_cloud_verification_key: str=None, custom_cloud_arm_endpoint: str=None, external_dsms_endpoint: str=None, **kwargs) -> None: + super(CloudManifestFileDeploymentData, self).__init__(**kwargs) + self.external_dsms_certificates = external_dsms_certificates + self.custom_cloud_verification_key = custom_cloud_verification_key + self.custom_cloud_arm_endpoint = custom_cloud_arm_endpoint + self.external_dsms_endpoint = external_dsms_endpoint + + +class CloudManifestFileProperties(Model): + """Cloud specific manifest JSON properties. + + :param deployment_data: Cloud specific manifest data. + :type deployment_data: + ~azure.mgmt.azurestack.models.CloudManifestFileDeploymentData + :param signature: Signature of the cloud specific manifest data. + :type signature: str """ _attribute_map = { - 'is_compatible': {'key': 'isCompatible', 'type': 'bool'}, - 'message': {'key': 'message', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'issues': {'key': 'issues', 'type': '[str]'}, + 'deployment_data': {'key': 'deploymentData', 'type': 'CloudManifestFileDeploymentData'}, + 'signature': {'key': 'signature', 'type': 'str'}, } - def __init__(self, *, is_compatible: bool=None, message: str=None, description: str=None, issues=None, **kwargs) -> None: - super(Compatibility, self).__init__(**kwargs) - self.is_compatible = is_compatible - self.message = message - self.description = description - self.issues = issues + def __init__(self, *, deployment_data=None, signature: str=None, **kwargs) -> None: + super(CloudManifestFileProperties, self).__init__(**kwargs) + self.deployment_data = deployment_data + self.signature = signature class Resource(Model): @@ -105,6 +124,75 @@ def __init__(self, *, etag: str=None, **kwargs) -> None: self.etag = etag +class CloudManifestFileResponse(Resource): + """Cloud specific manifest GET response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: ID of the resource. + :vartype id: str + :ivar name: Name of the resource. + :vartype name: str + :ivar type: Type of Resource. + :vartype type: str + :param etag: The entity tag used for optimistic concurrency when modifying + the resource. + :type etag: str + :param properties: Cloud specific manifest data. + :type properties: + ~azure.mgmt.azurestack.models.CloudManifestFileProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CloudManifestFileProperties'}, + } + + def __init__(self, *, etag: str=None, properties=None, **kwargs) -> None: + super(CloudManifestFileResponse, self).__init__(etag=etag, **kwargs) + self.properties = properties + + +class Compatibility(Model): + """Product compatibility. + + :param is_compatible: Tells if product is compatible with current device + :type is_compatible: bool + :param message: Short error message if any compatibility issues are found + :type message: str + :param description: Full error message if any compatibility issues are + found + :type description: str + :param issues: List of all issues found + :type issues: list[str or + ~azure.mgmt.azurestack.models.CompatibilityIssue] + """ + + _attribute_map = { + 'is_compatible': {'key': 'isCompatible', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'issues': {'key': 'issues', 'type': '[str]'}, + } + + def __init__(self, *, is_compatible: bool=None, message: str=None, description: str=None, issues=None, **kwargs) -> None: + super(Compatibility, self).__init__(**kwargs) + self.is_compatible = is_compatible + self.message = message + self.description = description + self.issues = issues + + class CustomerSubscription(Resource): """Customer subscription. @@ -122,6 +210,8 @@ class CustomerSubscription(Resource): :type etag: str :param tenant_id: Tenant Id. :type tenant_id: str + :param system_data: + :type system_data: ~azure.mgmt.azurestack.models.SystemData """ _validation = { @@ -136,11 +226,13 @@ class CustomerSubscription(Resource): 'type': {'key': 'type', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - def __init__(self, *, etag: str=None, tenant_id: str=None, **kwargs) -> None: + def __init__(self, *, etag: str=None, tenant_id: str=None, system_data=None, **kwargs) -> None: super(CustomerSubscription, self).__init__(etag=etag, **kwargs) self.tenant_id = tenant_id + self.system_data = system_data class DataDiskImage(Model): @@ -411,6 +503,195 @@ def __init__(self, *, large: str=None, wide: str=None, medium: str=None, small: self.hero = hero +class TrackedResource(Model): + """Base resource object. + + 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. + + :ivar id: ID of the resource. + :vartype id: str + :ivar name: Name of the resource. + :vartype name: str + :ivar type: Type of Resource. + :vartype type: str + :ivar kind: The kind of the resource. + :vartype kind: str + :param system_data: + :type system_data: ~azure.mgmt.azurestack.models.SystemData + :ivar location: Required. Location of the resource. Default value: + "global" . + :vartype location: str + :param tags: Custom tags for the resource. + :type tags: dict[str, str] + :param etag: The entity tag used for optimistic concurrency when modifying + the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'location': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + location = "global" + + def __init__(self, *, system_data=None, tags=None, etag: str=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = None + self.system_data = system_data + self.tags = tags + self.etag = etag + + +class LinkedSubscription(TrackedResource): + """Linked Subscription information. + + 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. + + :ivar id: ID of the resource. + :vartype id: str + :ivar name: Name of the resource. + :vartype name: str + :ivar type: Type of Resource. + :vartype type: str + :ivar kind: The kind of the resource. + :vartype kind: str + :param system_data: + :type system_data: ~azure.mgmt.azurestack.models.SystemData + :ivar location: Required. Location of the resource. Default value: + "global" . + :vartype location: str + :param tags: Custom tags for the resource. + :type tags: dict[str, str] + :param etag: The entity tag used for optimistic concurrency when modifying + the resource. + :type etag: str + :param linked_subscription_id: The identifier associated with the device + subscription. + :type linked_subscription_id: str + :param registration_resource_id: The identifier associated with the device + registration. + :type registration_resource_id: str + :ivar device_id: The identifier of the Azure Stack device for remote + management. + :vartype device_id: str + :ivar device_object_id: The object identifier associated with the Azure + Stack device connecting to Azure. + :vartype device_object_id: str + :ivar device_link_state: The connection state of the Azure Stack device. + :vartype device_link_state: str + :ivar last_connected_time: The last remote management connection time for + the Azure Stack device connected to the linked subscription resource. + :vartype last_connected_time: str + :ivar device_connection_status: The status of the remote management + connection of the Azure Stack device. + :vartype device_connection_status: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'location': {'required': True, 'constant': True}, + 'device_id': {'readonly': True}, + 'device_object_id': {'readonly': True}, + 'device_link_state': {'readonly': True}, + 'last_connected_time': {'readonly': True}, + 'device_connection_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'linked_subscription_id': {'key': 'properties.linkedSubscriptionId', 'type': 'str'}, + 'registration_resource_id': {'key': 'properties.registrationResourceId', 'type': 'str'}, + 'device_id': {'key': 'properties.deviceId', 'type': 'str'}, + 'device_object_id': {'key': 'properties.deviceObjectId', 'type': 'str'}, + 'device_link_state': {'key': 'properties.deviceLinkState', 'type': 'str'}, + 'last_connected_time': {'key': 'properties.lastConnectedTime', 'type': 'str'}, + 'device_connection_status': {'key': 'properties.deviceConnectionStatus', 'type': 'str'}, + } + + def __init__(self, *, system_data=None, tags=None, etag: str=None, linked_subscription_id: str=None, registration_resource_id: str=None, **kwargs) -> None: + super(LinkedSubscription, self).__init__(system_data=system_data, tags=tags, etag=etag, **kwargs) + self.linked_subscription_id = linked_subscription_id + self.registration_resource_id = registration_resource_id + self.device_id = None + self.device_object_id = None + self.device_link_state = None + self.last_connected_time = None + self.device_connection_status = None + + +class LinkedSubscriptionParameter(Model): + """Linked Subscription resource. + + 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 linked_subscription_id: Required. The identifier associated with + the device subscription. + :type linked_subscription_id: str + :param registration_resource_id: Required. The identifier associated with + the device registration. + :type registration_resource_id: str + :ivar location: Required. Location of the resource. Default value: + "global" . + :vartype location: str + """ + + _validation = { + 'linked_subscription_id': {'required': True}, + 'registration_resource_id': {'required': True}, + 'location': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'linked_subscription_id': {'key': 'properties.linkedSubscriptionId', 'type': 'str'}, + 'registration_resource_id': {'key': 'properties.registrationResourceId', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + location = "global" + + def __init__(self, *, linked_subscription_id: str, registration_resource_id: str, **kwargs) -> None: + super(LinkedSubscriptionParameter, self).__init__(**kwargs) + self.linked_subscription_id = linked_subscription_id + self.registration_resource_id = registration_resource_id + + class MarketplaceProductLogUpdate(Model): """Update details for product log. @@ -559,6 +840,8 @@ class Product(Resource): :type product_properties: ~azure.mgmt.azurestack.models.ProductProperties :param compatibility: Product compatibility with current device. :type compatibility: ~azure.mgmt.azurestack.models.Compatibility + :param system_data: + :type system_data: ~azure.mgmt.azurestack.models.SystemData """ _validation = { @@ -590,9 +873,10 @@ class Product(Resource): 'product_kind': {'key': 'properties.productKind', 'type': 'str'}, 'product_properties': {'key': 'properties.productProperties', 'type': 'ProductProperties'}, 'compatibility': {'key': 'properties.compatibility', 'type': 'Compatibility'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - def __init__(self, *, etag: str=None, display_name: str=None, description: str=None, publisher_display_name: str=None, publisher_identifier: str=None, offer: str=None, offer_version: str=None, sku: str=None, billing_part_number: str=None, vm_extension_type: str=None, gallery_item_identity: str=None, icon_uris=None, links=None, legal_terms: str=None, privacy_policy: str=None, payload_length: int=None, product_kind: str=None, product_properties=None, compatibility=None, **kwargs) -> None: + def __init__(self, *, etag: str=None, display_name: str=None, description: str=None, publisher_display_name: str=None, publisher_identifier: str=None, offer: str=None, offer_version: str=None, sku: str=None, billing_part_number: str=None, vm_extension_type: str=None, gallery_item_identity: str=None, icon_uris=None, links=None, legal_terms: str=None, privacy_policy: str=None, payload_length: int=None, product_kind: str=None, product_properties=None, compatibility=None, system_data=None, **kwargs) -> None: super(Product, self).__init__(etag=etag, **kwargs) self.display_name = display_name self.description = description @@ -612,6 +896,7 @@ def __init__(self, *, etag: str=None, display_name: str=None, description: str=N self.product_kind = product_kind self.product_properties = product_properties self.compatibility = compatibility + self.system_data = system_data class ProductLink(Model): @@ -743,57 +1028,6 @@ def __init__(self, *, version: str=None, **kwargs) -> None: self.version = version -class TrackedResource(Model): - """Base resource object. - - 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. - - :ivar id: ID of the resource. - :vartype id: str - :ivar name: Name of the resource. - :vartype name: str - :ivar type: Type of Resource. - :vartype type: str - :ivar location: Required. Location of the resource. Default value: - "global" . - :vartype location: str - :param tags: Custom tags for the resource. - :type tags: dict[str, str] - :param etag: The entity tag used for optimistic concurrency when modifying - the resource. - :type etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - location = "global" - - def __init__(self, *, tags=None, etag: str=None, **kwargs) -> None: - super(TrackedResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.tags = tags - self.etag = etag - - class Registration(TrackedResource): """Registration information. @@ -808,6 +1042,10 @@ class Registration(TrackedResource): :vartype name: str :ivar type: Type of Resource. :vartype type: str + :ivar kind: The kind of the resource. + :vartype kind: str + :param system_data: + :type system_data: ~azure.mgmt.azurestack.models.SystemData :ivar location: Required. Location of the resource. Default value: "global" . :vartype location: str @@ -830,6 +1068,7 @@ class Registration(TrackedResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'kind': {'readonly': True}, 'location': {'required': True, 'constant': True}, } @@ -837,6 +1076,8 @@ class Registration(TrackedResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, @@ -845,8 +1086,8 @@ class Registration(TrackedResource): 'billing_model': {'key': 'properties.billingModel', 'type': 'str'}, } - def __init__(self, *, tags=None, etag: str=None, object_id: str=None, cloud_id: str=None, billing_model: str=None, **kwargs) -> None: - super(Registration, self).__init__(tags=tags, etag=etag, **kwargs) + def __init__(self, *, system_data=None, tags=None, etag: str=None, object_id: str=None, cloud_id: str=None, billing_model: str=None, **kwargs) -> None: + super(Registration, self).__init__(system_data=system_data, tags=tags, etag=etag, **kwargs) self.object_id = object_id self.cloud_id = cloud_id self.billing_model = billing_model @@ -855,18 +1096,22 @@ def __init__(self, *, tags=None, etag: str=None, object_id: str=None, cloud_id: class RegistrationParameter(Model): """Registration resource. + 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_token: Required. The token identifying registered Azure Stack :type registration_token: str - :param location: Location of the resource. Possible values include: - 'global' - :type location: str or ~azure.mgmt.azurestack.models.Location + :ivar location: Required. Location of the resource. Default value: + "global" . + :vartype location: str """ _validation = { 'registration_token': {'required': True}, + 'location': {'required': True, 'constant': True}, } _attribute_map = { @@ -874,10 +1119,52 @@ class RegistrationParameter(Model): 'location': {'key': 'location', 'type': 'str'}, } - def __init__(self, *, registration_token: str, location=None, **kwargs) -> None: + location = "global" + + def __init__(self, *, registration_token: str, **kwargs) -> None: super(RegistrationParameter, self).__init__(**kwargs) self.registration_token = registration_token - self.location = location + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or ~azure.mgmt.azurestack.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.azurestack.models.CreatedByType + :param last_modified_at: The type of identity that last modified the + resource. + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at class VirtualMachineExtensionProductProperties(Model): diff --git a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_paged_models.py b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_paged_models.py index f16bf38204a4..2503072f6bcb 100644 --- a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_paged_models.py +++ b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/models/_paged_models.py @@ -25,6 +25,19 @@ class OperationPaged(Paged): def __init__(self, *args, **kwargs): super(OperationPaged, self).__init__(*args, **kwargs) +class CustomerSubscriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`CustomerSubscription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CustomerSubscription]'} + } + + def __init__(self, *args, **kwargs): + + super(CustomerSubscriptionPaged, self).__init__(*args, **kwargs) class ProductPaged(Paged): """ A paging container for iterating over a list of :class:`Product ` object @@ -51,16 +64,16 @@ class RegistrationPaged(Paged): def __init__(self, *args, **kwargs): super(RegistrationPaged, self).__init__(*args, **kwargs) -class CustomerSubscriptionPaged(Paged): +class LinkedSubscriptionPaged(Paged): """ - A paging container for iterating over a list of :class:`CustomerSubscription ` object + A paging container for iterating over a list of :class:`LinkedSubscription ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[CustomerSubscription]'} + 'current_page': {'key': 'value', 'type': '[LinkedSubscription]'} } def __init__(self, *args, **kwargs): - super(CustomerSubscriptionPaged, self).__init__(*args, **kwargs) + super(LinkedSubscriptionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/__init__.py b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/__init__.py index c19768fd4c6b..a15715de88de 100644 --- a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/__init__.py +++ b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/__init__.py @@ -10,13 +10,17 @@ # -------------------------------------------------------------------------- from ._operations import Operations +from ._cloud_manifest_file_operations import CloudManifestFileOperations +from ._customer_subscriptions_operations import CustomerSubscriptionsOperations from ._products_operations import ProductsOperations from ._registrations_operations import RegistrationsOperations -from ._customer_subscriptions_operations import CustomerSubscriptionsOperations +from ._linked_subscriptions_operations import LinkedSubscriptionsOperations __all__ = [ 'Operations', + 'CloudManifestFileOperations', + 'CustomerSubscriptionsOperations', 'ProductsOperations', 'RegistrationsOperations', - 'CustomerSubscriptionsOperations', + 'LinkedSubscriptionsOperations', ] diff --git a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_cloud_manifest_file_operations.py b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_cloud_manifest_file_operations.py new file mode 100644 index 000000000000..5cfbc17bf402 --- /dev/null +++ b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_cloud_manifest_file_operations.py @@ -0,0 +1,150 @@ +# 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 CloudManifestFileOperations(object): + """CloudManifestFileOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API Version. Constant value: "2020-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Returns a cloud specific manifest JSON file with latest version. + + :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: CloudManifestFileResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestack.models.CloudManifestFileResponse 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("self.api_version", self.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('CloudManifestFileResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.AzureStack/cloudManifestFiles'} + + def get( + self, verification_version, version_creation_date=None, custom_headers=None, raw=False, **operation_config): + """Returns a cloud specific manifest JSON file. + + :param verification_version: Signing verification key version. + :type verification_version: str + :param version_creation_date: Signing verification key version + creation date. + :type version_creation_date: 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: CloudManifestFileResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestack.models.CloudManifestFileResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'verificationVersion': self._serialize.url("verification_version", verification_version, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if version_creation_date is not None: + query_parameters['versionCreationDate'] = self._serialize.query("version_creation_date", version_creation_date, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.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('CloudManifestFileResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.AzureStack/cloudManifestFiles/{verificationVersion}'} diff --git a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_customer_subscriptions_operations.py b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_customer_subscriptions_operations.py index ae9c17565a78..7eb040ccf822 100644 --- a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_customer_subscriptions_operations.py +++ b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_customer_subscriptions_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -25,7 +24,7 @@ class CustomerSubscriptionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API Version. Constant value: "2017-06-01". + :ivar api_version: Client API Version. Constant value: "2020-06-01-preview". """ models = models @@ -35,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-06-01" + self.api_version = "2020-06-01-preview" self.config = config @@ -190,7 +189,8 @@ def delete( overrides`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -220,9 +220,7 @@ def delete( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -230,7 +228,7 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/customerSubscriptions/{customerSubscriptionName}'} def create( - self, resource_group, registration_name, customer_subscription_name, etag=None, tenant_id=None, custom_headers=None, raw=False, **operation_config): + self, resource_group, registration_name, customer_subscription_name, customer_creation_parameters, custom_headers=None, raw=False, **operation_config): """Creates a new customer subscription under a registration. :param resource_group: Name of the resource group. @@ -239,11 +237,10 @@ def create( :type registration_name: str :param customer_subscription_name: Name of the product. :type customer_subscription_name: str - :param etag: The entity tag used for optimistic concurrency when - modifying the resource. - :type etag: str - :param tenant_id: Tenant Id. - :type tenant_id: str + :param customer_creation_parameters: Parameters use to create a + customer subscription. + :type customer_creation_parameters: + ~azure.mgmt.azurestack.models.CustomerSubscription :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -252,10 +249,9 @@ def create( :return: CustomerSubscription or ClientRawResponse if raw=true :rtype: ~azure.mgmt.azurestack.models.CustomerSubscription or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ - customer_creation_parameters = models.CustomerSubscription(etag=etag, tenant_id=tenant_id) - # Construct URL url = self.create.metadata['url'] path_format_arguments = { @@ -289,9 +285,7 @@ def create( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: diff --git a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_linked_subscriptions_operations.py b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_linked_subscriptions_operations.py new file mode 100644 index 000000000000..169dc4c19b69 --- /dev/null +++ b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_linked_subscriptions_operations.py @@ -0,0 +1,435 @@ +# 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 LinkedSubscriptionsOperations(object): + """LinkedSubscriptionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API Version. Constant value: "2020-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-01-preview" + + self.config = config + + def list_by_resource_group( + self, resource_group, custom_headers=None, raw=False, **operation_config): + """Returns a list of all linked subscriptions under current resource + group. + + :param resource_group: Name of the resource group. + :type resource_group: 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 LinkedSubscription + :rtype: + ~azure.mgmt.azurestack.models.LinkedSubscriptionPaged[~azure.mgmt.azurestack.models.LinkedSubscription] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.LinkedSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Returns a list of all linked subscriptions under current subscription. + + :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 LinkedSubscription + :rtype: + ~azure.mgmt.azurestack.models.LinkedSubscriptionPaged[~azure.mgmt.azurestack.models.LinkedSubscription] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.LinkedSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStack/linkedSubscriptions'} + + def get( + self, resource_group, linked_subscription_name, custom_headers=None, raw=False, **operation_config): + """Returns the properties of a Linked Subscription resource. + + :param resource_group: Name of the resource group. + :type resource_group: str + :param linked_subscription_name: Name of the Linked Subscription + resource. + :type linked_subscription_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LinkedSubscription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestack.models.LinkedSubscription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'linkedSubscriptionName': self._serialize.url("linked_subscription_name", linked_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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('LinkedSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions/{linkedSubscriptionName}'} + + def delete( + self, resource_group, linked_subscription_name, custom_headers=None, raw=False, **operation_config): + """Delete the requested Linked Subscription resource. + + :param resource_group: Name of the resource group. + :type resource_group: str + :param linked_subscription_name: Name of the Linked Subscription + resource. + :type linked_subscription_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'linkedSubscriptionName': self._serialize.url("linked_subscription_name", linked_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions/{linkedSubscriptionName}'} + + def create_or_update( + self, resource_group, linked_subscription_name, linked_subscription_id, registration_resource_id, custom_headers=None, raw=False, **operation_config): + """Create or update a linked subscription resource. + + :param resource_group: Name of the resource group. + :type resource_group: str + :param linked_subscription_name: Name of the Linked Subscription + resource. + :type linked_subscription_name: str + :param linked_subscription_id: The identifier associated with the + device subscription. + :type linked_subscription_id: str + :param registration_resource_id: The identifier associated with the + device registration. + :type registration_resource_id: 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: LinkedSubscription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestack.models.LinkedSubscription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + resource = models.LinkedSubscriptionParameter(linked_subscription_id=linked_subscription_id, registration_resource_id=registration_resource_id) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'linkedSubscriptionName': self._serialize.url("linked_subscription_name", linked_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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(resource, 'LinkedSubscriptionParameter') + + # 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('LinkedSubscription', response) + if response.status_code == 201: + deserialized = self._deserialize('LinkedSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions/{linkedSubscriptionName}'} + + def update( + self, resource_group, linked_subscription_name, linked_subscription_id, registration_resource_id, custom_headers=None, raw=False, **operation_config): + """Patch a Linked Subscription resource. + + :param resource_group: Name of the resource group. + :type resource_group: str + :param linked_subscription_name: Name of the Linked Subscription + resource. + :type linked_subscription_name: str + :param linked_subscription_id: The identifier associated with the + device subscription. + :type linked_subscription_id: str + :param registration_resource_id: The identifier associated with the + device registration. + :type registration_resource_id: 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: LinkedSubscription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.azurestack.models.LinkedSubscription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + resource = models.LinkedSubscriptionParameter(linked_subscription_id=linked_subscription_id, registration_resource_id=registration_resource_id) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'linkedSubscriptionName': self._serialize.url("linked_subscription_name", linked_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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(resource, 'LinkedSubscriptionParameter') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + 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('LinkedSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions/{linkedSubscriptionName}'} diff --git a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_operations.py b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_operations.py index 30448f634809..f21a70810c47 100644 --- a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_operations.py +++ b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -25,7 +24,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API Version. Constant value: "2017-06-01". + :ivar api_version: Client API Version. Constant value: "2020-06-01-preview". """ models = models @@ -35,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-06-01" + self.api_version = "2020-06-01-preview" self.config = config @@ -51,7 +50,8 @@ def list( :return: An iterator like instance of Operation :rtype: ~azure.mgmt.azurestack.models.OperationPaged[~azure.mgmt.azurestack.models.Operation] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -86,9 +86,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response diff --git a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_products_operations.py b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_products_operations.py index 4407fc0cf1a5..86c9c7d5d2a7 100644 --- a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_products_operations.py +++ b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_products_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -25,7 +24,7 @@ class ProductsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API Version. Constant value: "2017-06-01". + :ivar api_version: Client API Version. Constant value: "2020-06-01-preview". """ models = models @@ -35,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-06-01" + self.api_version = "2020-06-01-preview" self.config = config @@ -191,7 +190,8 @@ def list_details( :return: ExtendedProduct or ClientRawResponse if raw=true :rtype: ~azure.mgmt.azurestack.models.ExtendedProduct or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.list_details.metadata['url'] @@ -222,9 +222,7 @@ def list_details( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -238,13 +236,15 @@ def list_details( list_details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/{productName}/listDetails'} def get_products( - self, resource_group, registration_name, custom_headers=None, raw=False, **operation_config): + self, resource_group, registration_name, product_name, custom_headers=None, raw=False, **operation_config): """Returns a list of products. :param resource_group: Name of the resource group. :type resource_group: str :param registration_name: Name of the Azure Stack registration. :type registration_name: str + :param product_name: Name of the product. + :type product_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -263,7 +263,8 @@ def get_products( path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), - 'registrationName': self._serialize.url("registration_name", registration_name, 'str') + 'registrationName': self._serialize.url("registration_name", registration_name, 'str'), + 'productName': self._serialize.url("product_name", product_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -304,7 +305,7 @@ def get_products( return client_raw_response return deserialized - get_products.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/_all/GetProducts'} + get_products.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/{productName}/getProducts'} def get_product( self, resource_group, registration_name, product_name, custom_headers=None, raw=False, **operation_config): @@ -376,7 +377,7 @@ def get_product( return client_raw_response return deserialized - get_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/{productName}/GetProduct'} + get_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/{productName}/getProduct'} def upload_log( self, resource_group, registration_name, product_name, custom_headers=None, raw=False, **operation_config): diff --git a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_registrations_operations.py b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_registrations_operations.py index c9a69428b993..e7eb3105ef5c 100644 --- a/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_registrations_operations.py +++ b/sdk/azurestack/azure-mgmt-azurestack/azure/mgmt/azurestack/operations/_registrations_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -25,7 +24,7 @@ class RegistrationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API Version. Constant value: "2017-06-01". + :ivar api_version: Client API Version. Constant value: "2020-06-01-preview". """ models = models @@ -35,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-06-01" + self.api_version = "2020-06-01-preview" self.config = config @@ -220,7 +219,7 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}'} def create_or_update( - self, resource_group, registration_name, registration_token, location=None, custom_headers=None, raw=False, **operation_config): + self, resource_group, registration_name, registration_token, custom_headers=None, raw=False, **operation_config): """Create or update an Azure Stack registration. :param resource_group: Name of the resource group. @@ -230,9 +229,6 @@ def create_or_update( :param registration_token: The token identifying registered Azure Stack :type registration_token: str - :param location: Location of the resource. Possible values include: - 'global' - :type location: str or ~azure.mgmt.azurestack.models.Location :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -241,9 +237,10 @@ def create_or_update( :return: Registration or ClientRawResponse if raw=true :rtype: ~azure.mgmt.azurestack.models.Registration or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ - token = models.RegistrationParameter(registration_token=registration_token, location=location) + token = models.RegistrationParameter(registration_token=registration_token) # Construct URL url = self.create_or_update.metadata['url'] @@ -277,9 +274,7 @@ def create_or_update( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -295,7 +290,7 @@ def create_or_update( create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}'} def update( - self, resource_group, registration_name, registration_token, location=None, custom_headers=None, raw=False, **operation_config): + self, resource_group, registration_name, registration_token, custom_headers=None, raw=False, **operation_config): """Patch an Azure Stack registration. :param resource_group: Name of the resource group. @@ -305,9 +300,6 @@ def update( :param registration_token: The token identifying registered Azure Stack :type registration_token: str - :param location: Location of the resource. Possible values include: - 'global' - :type location: str or ~azure.mgmt.azurestack.models.Location :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -319,7 +311,7 @@ def update( :raises: :class:`ErrorResponseException` """ - token = models.RegistrationParameter(registration_token=registration_token, location=location) + token = models.RegistrationParameter(registration_token=registration_token) # Construct URL url = self.update.metadata['url'] @@ -382,7 +374,8 @@ def get_activation_key( :return: ActivationKeyResult or ClientRawResponse if raw=true :rtype: ~azure.mgmt.azurestack.models.ActivationKeyResult or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_activation_key.metadata['url'] @@ -412,9 +405,7 @@ def get_activation_key( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -426,3 +417,55 @@ def get_activation_key( return deserialized get_activation_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/getactivationkey'} + + def enable_remote_management( + self, resource_group, registration_name, custom_headers=None, raw=False, **operation_config): + """Enables remote management for device under the Azure Stack + registration. + + :param resource_group: Name of the resource group. + :type resource_group: str + :param registration_name: Name of the Azure Stack registration. + :type registration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.enable_remote_management.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'registrationName': self._serialize.url("registration_name", registration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(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) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + enable_remote_management.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/enableRemoteManagement'}