From 75c16fe0aa683b73e30cfe370fa850aafd8fdec7 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 6 Aug 2020 01:55:59 +0000 Subject: [PATCH] Generated from 4f9ba8537982d22652748cb6b386c8c0cc64ee61 fix space-tab inconsistency --- .../azure-mgmt-reservations/README.md | 28 +- .../reservations/_azure_reservation_api.py | 18 +- .../mgmt/reservations/models/__init__.py | 24 +- .../models/_azure_reservation_api_enums.py | 12 + .../azure/mgmt/reservations/models/_models.py | 361 ++++++----------- .../mgmt/reservations/models/_models_py3.py | 371 ++++++------------ .../mgmt/reservations/operations/__init__.py | 8 +- .../_auto_quota_increase_operations.py | 12 +- .../operations/_quota_operations.py | 338 +++++++++++++++- .../operations/_quota_request_operations.py | 295 -------------- ...py => _quota_request_status_operations.py} | 36 +- .../operations/_quotas_operations.py | 117 ------ .../azure-mgmt-reservations/setup.py | 4 +- 13 files changed, 636 insertions(+), 988 deletions(-) delete mode 100644 sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_request_operations.py rename sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/{_quota_requests_operations.py => _quota_request_status_operations.py} (86%) delete mode 100644 sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quotas_operations.py diff --git a/sdk/reservations/azure-mgmt-reservations/README.md b/sdk/reservations/azure-mgmt-reservations/README.md index b23c59d1166..b9cd38a88fe 100644 --- a/sdk/reservations/azure-mgmt-reservations/README.md +++ b/sdk/reservations/azure-mgmt-reservations/README.md @@ -1,29 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure Reservations Client Library. - -Azure Resource Manager (ARM) is the next generation of management APIs -that replace the old Azure Service Management (ASM). - This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) -For the older Azure Service Management (ASM) libraries, see -[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) -library. -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. +# Usage -## Usage +For code examples, see [Reservations](https://docs.microsoft.com/python/api/overview/azure/) +on docs.microsoft.com. -For code examples, see -[Reservations](https://docs.microsoft.com/python/api/overview/azure/) on -docs.microsoft.com. -## Provide Feedback +# Provide Feedback -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-reservations%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-reservations%2FREADME.png) diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_azure_reservation_api.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_azure_reservation_api.py index 59992cc2d87..174cb5eeba4 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_azure_reservation_api.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/_azure_reservation_api.py @@ -15,9 +15,7 @@ from ._configuration import AzureReservationAPIConfiguration from .operations import AzureReservationAPIOperationsMixin from .operations import QuotaOperations -from .operations import QuotaRequestOperations -from .operations import QuotasOperations -from .operations import QuotaRequestsOperations +from .operations import QuotaRequestStatusOperations from .operations import AutoQuotaIncreaseOperations from .operations import ReservationOperations from .operations import ReservationOrderOperations @@ -33,12 +31,8 @@ class AzureReservationAPI(AzureReservationAPIOperationsMixin, SDKClient): :ivar quota: Quota operations :vartype quota: azure.mgmt.reservations.operations.QuotaOperations - :ivar quota_request: QuotaRequest operations - :vartype quota_request: azure.mgmt.reservations.operations.QuotaRequestOperations - :ivar quotas: Quotas operations - :vartype quotas: azure.mgmt.reservations.operations.QuotasOperations - :ivar quota_requests: QuotaRequests operations - :vartype quota_requests: azure.mgmt.reservations.operations.QuotaRequestsOperations + :ivar quota_request_status: QuotaRequestStatus operations + :vartype quota_request_status: azure.mgmt.reservations.operations.QuotaRequestStatusOperations :ivar auto_quota_increase: AutoQuotaIncrease operations :vartype auto_quota_increase: azure.mgmt.reservations.operations.AutoQuotaIncreaseOperations :ivar reservation: Reservation operations @@ -66,11 +60,7 @@ def __init__( self.quota = QuotaOperations( self._client, self.config, self._serialize, self._deserialize) - self.quota_request = QuotaRequestOperations( - self._client, self.config, self._serialize, self._deserialize) - self.quotas = QuotasOperations( - self._client, self.config, self._serialize, self._deserialize) - self.quota_requests = QuotaRequestsOperations( + self.quota_request_status = QuotaRequestStatusOperations( self._client, self.config, self._serialize, self._deserialize) self.auto_quota_increase = AutoQuotaIncreaseOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py index e61506f3b93..c272e08f0df 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import Actions from ._models_py3 import AppliedReservationList from ._models_py3 import AppliedReservations from ._models_py3 import AqiSettings @@ -22,7 +23,6 @@ from ._models_py3 import CreateGenericQuotaRequestParameters from ._models_py3 import CurrentQuotaLimit from ._models_py3 import CurrentQuotaLimitBase - from ._models_py3 import CurrentQuotaLimitBaseName from ._models_py3 import EmailAction from ._models_py3 import EmailActions from ._models_py3 import Error, ErrorException @@ -30,9 +30,6 @@ from ._models_py3 import ExtendedErrorInfo from ._models_py3 import ExtendedStatusInfo from ._models_py3 import MergeRequest - from ._models_py3 import OnFailure - from ._models_py3 import OnFailureEmailActions - from ._models_py3 import OnFailurePhoneActions from ._models_py3 import OperationDisplay from ._models_py3 import OperationResponse from ._models_py3 import Patch @@ -44,6 +41,7 @@ from ._models_py3 import PurchaseRequest from ._models_py3 import PurchaseRequestPropertiesReservedResourceProperties from ._models_py3 import QuotaLimitsResponse + from ._models_py3 import QuotaProperties from ._models_py3 import QuotaRequestDetails from ._models_py3 import QuotaRequestOneResourceSubmitResponse from ._models_py3 import QuotaRequestProperties @@ -58,6 +56,7 @@ from ._models_py3 import ReservationProperties from ._models_py3 import ReservationResponse from ._models_py3 import ReservationSplitProperties + from ._models_py3 import ResourceName from ._models_py3 import ScopeProperties from ._models_py3 import ServiceError from ._models_py3 import ServiceErrorDetail @@ -66,10 +65,10 @@ from ._models_py3 import SkuRestriction from ._models_py3 import SplitRequest from ._models_py3 import SubRequest - from ._models_py3 import SubRequestName from ._models_py3 import SubscriptionScopeProperties from ._models_py3 import SupportRequestAction except (SyntaxError, ImportError): + from ._models import Actions from ._models import AppliedReservationList from ._models import AppliedReservations from ._models import AqiSettings @@ -82,7 +81,6 @@ from ._models import CreateGenericQuotaRequestParameters from ._models import CurrentQuotaLimit from ._models import CurrentQuotaLimitBase - from ._models import CurrentQuotaLimitBaseName from ._models import EmailAction from ._models import EmailActions from ._models import Error, ErrorException @@ -90,9 +88,6 @@ from ._models import ExtendedErrorInfo from ._models import ExtendedStatusInfo from ._models import MergeRequest - from ._models import OnFailure - from ._models import OnFailureEmailActions - from ._models import OnFailurePhoneActions from ._models import OperationDisplay from ._models import OperationResponse from ._models import Patch @@ -104,6 +99,7 @@ from ._models import PurchaseRequest from ._models import PurchaseRequestPropertiesReservedResourceProperties from ._models import QuotaLimitsResponse + from ._models import QuotaProperties from ._models import QuotaRequestDetails from ._models import QuotaRequestOneResourceSubmitResponse from ._models import QuotaRequestProperties @@ -118,6 +114,7 @@ from ._models import ReservationProperties from ._models import ReservationResponse from ._models import ReservationSplitProperties + from ._models import ResourceName from ._models import ScopeProperties from ._models import ServiceError from ._models import ServiceErrorDetail @@ -126,7 +123,6 @@ from ._models import SkuRestriction from ._models import SplitRequest from ._models import SubRequest - from ._models import SubRequestName from ._models import SubscriptionScopeProperties from ._models import SupportRequestAction from ._paged_models import CurrentQuotaLimitBasePaged @@ -146,6 +142,7 @@ ) __all__ = [ + 'Actions', 'AppliedReservationList', 'AppliedReservations', 'AqiSettings', @@ -158,7 +155,6 @@ 'CreateGenericQuotaRequestParameters', 'CurrentQuotaLimit', 'CurrentQuotaLimitBase', - 'CurrentQuotaLimitBaseName', 'EmailAction', 'EmailActions', 'Error', 'ErrorException', @@ -166,9 +162,6 @@ 'ExtendedErrorInfo', 'ExtendedStatusInfo', 'MergeRequest', - 'OnFailure', - 'OnFailureEmailActions', - 'OnFailurePhoneActions', 'OperationDisplay', 'OperationResponse', 'Patch', @@ -180,6 +173,7 @@ 'PurchaseRequest', 'PurchaseRequestPropertiesReservedResourceProperties', 'QuotaLimitsResponse', + 'QuotaProperties', 'QuotaRequestDetails', 'QuotaRequestOneResourceSubmitResponse', 'QuotaRequestProperties', @@ -194,6 +188,7 @@ 'ReservationProperties', 'ReservationResponse', 'ReservationSplitProperties', + 'ResourceName', 'ScopeProperties', 'ServiceError', 'ServiceErrorDetail', @@ -202,7 +197,6 @@ 'SkuRestriction', 'SplitRequest', 'SubRequest', - 'SubRequestName', 'SubscriptionScopeProperties', 'SupportRequestAction', 'CurrentQuotaLimitBasePaged', diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_azure_reservation_api_enums.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_azure_reservation_api_enums.py index 1f5afb6042f..99f064c808c 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_azure_reservation_api_enums.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_azure_reservation_api_enums.py @@ -114,6 +114,18 @@ class ReservedResourceType(str, Enum): sql_data_warehouse = "SqlDataWarehouse" vmware_cloud_simple = "VMwareCloudSimple" red_hat_osa = "RedHatOsa" + databricks = "Databricks" + app_service = "AppService" + managed_disk = "ManagedDisk" + block_blob = "BlockBlob" + redis_cache = "RedisCache" + azure_data_explorer = "AzureDataExplorer" + my_sql = "MySql" + maria_db = "MariaDb" + postgre_sql = "PostgreSql" + dedicated_host = "DedicatedHost" + sap_hana = "SapHana" + sql_azure_hybrid_benefit = "SqlAzureHybridBenefit" class InstanceFlexibility(str, Enum): diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models.py index d9d3611631e..f94dbebbfb0 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models.py @@ -13,6 +13,22 @@ from msrest.exceptions import HttpOperationError +class Actions(Model): + """The actions for auto quota increase. + + :param email_actions: The email actions for auto quota increase. + :type email_actions: ~azure.mgmt.reservations.models.EmailActions + """ + + _attribute_map = { + 'email_actions': {'key': 'emailActions', 'type': 'EmailActions'}, + } + + def __init__(self, **kwargs): + super(Actions, self).__init__(**kwargs) + self.email_actions = kwargs.get('email_actions', None) + + class AppliedReservationList(Model): """AppliedReservationList. @@ -103,9 +119,9 @@ class AutoQuotaIncreaseDetail(Model): :param settings: Settings for automatic quota increase. :type settings: ~azure.mgmt.reservations.models.AqiSettings :param on_failure: The on failure Actions. - :type on_failure: ~azure.mgmt.reservations.models.OnFailure + :type on_failure: ~azure.mgmt.reservations.models.Actions :param on_success: The on success Actions. - :type on_success: ~azure.mgmt.reservations.models.OnFailure + :type on_success: ~azure.mgmt.reservations.models.Actions :param support_ticket_action: The support ticket action. :type support_ticket_action: ~azure.mgmt.reservations.models.SupportRequestAction @@ -122,8 +138,8 @@ class AutoQuotaIncreaseDetail(Model): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'settings': {'key': 'properties.settings', 'type': 'AqiSettings'}, - 'on_failure': {'key': 'properties.onFailure', 'type': 'OnFailure'}, - 'on_success': {'key': 'properties.onSuccess', 'type': 'OnFailure'}, + 'on_failure': {'key': 'properties.onFailure', 'type': 'Actions'}, + 'on_success': {'key': 'properties.onSuccess', 'type': 'Actions'}, 'support_ticket_action': {'key': 'properties.supportTicketAction', 'type': 'SupportRequestAction'}, } @@ -329,26 +345,8 @@ class CurrentQuotaLimit(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param limit: The quota limit. - :type limit: int - :ivar current_value: The current resource usages information. - :vartype current_value: int - :param unit: The units of the limit, such as - Count, Bytes, etc. Use the - unit field provided in the Get quota response. - :type unit: str - :param name: Name of the resource provide by the resource Provider. Please - use this name property for quotaRequests. - :type name: ~azure.mgmt.reservations.models.CurrentQuotaLimitBaseName - :param resource_type: The Resource Type Name. - :type resource_type: object - :ivar quota_period: The quota period over which the usage values are - summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per - one second). This parameter is optional because, for some resources like - compute, the period doesn’t matter. - :vartype quota_period: str - :param properties: Additional properties for the specific resource - provider. - :type properties: object + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.models.QuotaProperties :ivar provisioning_state: The quota request status. :vartype provisioning_state: object :ivar message: A user friendly message. @@ -356,32 +354,18 @@ class CurrentQuotaLimit(Model): """ _validation = { - 'current_value': {'readonly': True}, - 'quota_period': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'message': {'readonly': True}, } _attribute_map = { - 'limit': {'key': 'quotaInformation.limit', 'type': 'int'}, - 'current_value': {'key': 'quotaInformation.currentValue', 'type': 'int'}, - 'unit': {'key': 'quotaInformation.unit', 'type': 'str'}, - 'name': {'key': 'quotaInformation.name', 'type': 'CurrentQuotaLimitBaseName'}, - 'resource_type': {'key': 'quotaInformation.resourceType', 'type': 'object'}, - 'quota_period': {'key': 'quotaInformation.quotaPeriod', 'type': 'str'}, - 'properties': {'key': 'quotaInformation.properties', 'type': 'object'}, + 'properties': {'key': 'quotaInformation.properties', 'type': 'QuotaProperties'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'object'}, 'message': {'key': 'properties.message', 'type': 'str'}, } def __init__(self, **kwargs): super(CurrentQuotaLimit, self).__init__(**kwargs) - self.limit = kwargs.get('limit', None) - self.current_value = None - self.unit = kwargs.get('unit', None) - self.name = kwargs.get('name', None) - self.resource_type = kwargs.get('resource_type', None) - self.quota_period = None self.properties = kwargs.get('properties', None) self.provisioning_state = None self.message = None @@ -390,85 +374,19 @@ def __init__(self, **kwargs): class CurrentQuotaLimitBase(Model): """Quota limits. - Variables are only populated by the server, and will be ignored when - sending a request. - - :param limit: The quota limit. - :type limit: int - :ivar current_value: The current resource usages information. - :vartype current_value: int - :param unit: The units of the limit, such as - Count, Bytes, etc. Use the - unit field provided in the Get quota response. - :type unit: str - :param name: Name of the resource provide by the resource Provider. Please - use this name property for quotaRequests. - :type name: ~azure.mgmt.reservations.models.CurrentQuotaLimitBaseName - :param resource_type: The Resource Type Name. - :type resource_type: object - :ivar quota_period: The quota period over which the usage values are - summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per - one second). This parameter is optional because, for some resources like - compute, the period doesn’t matter. - :vartype quota_period: str - :param properties: Additional properties for the specific resource - provider. - :type properties: object + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.models.QuotaProperties """ - _validation = { - 'current_value': {'readonly': True}, - 'quota_period': {'readonly': True}, - } - _attribute_map = { - 'limit': {'key': 'limit', 'type': 'int'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'CurrentQuotaLimitBaseName'}, - 'resource_type': {'key': 'resourceType', 'type': 'object'}, - 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'properties': {'key': 'properties', 'type': 'QuotaProperties'}, } def __init__(self, **kwargs): super(CurrentQuotaLimitBase, self).__init__(**kwargs) - self.limit = kwargs.get('limit', None) - self.current_value = None - self.unit = kwargs.get('unit', None) - self.name = kwargs.get('name', None) - self.resource_type = kwargs.get('resource_type', None) - self.quota_period = None self.properties = kwargs.get('properties', None) -class CurrentQuotaLimitBaseName(Model): - """Name of the resource provide by the resource Provider. Please use this name - property for quotaRequests. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param value: Resource name. - :type value: str - :ivar localized_value: Resource display name. - :vartype localized_value: str - """ - - _validation = { - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CurrentQuotaLimitBaseName, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.localized_value = None - - class EmailAction(Model): """Email Action. @@ -488,18 +406,17 @@ def __init__(self, **kwargs): class EmailActions(Model): """The email actions. - :param value: The list of actions based on the success or failure of - automatic quota increase action. - :type value: list[~azure.mgmt.reservations.models.EmailAction] + :param email_addresses: The list of email actions. + :type email_addresses: list[~azure.mgmt.reservations.models.EmailAction] """ _attribute_map = { - 'value': {'key': 'value', 'type': '[EmailAction]'}, + 'email_addresses': {'key': 'emailAddresses', 'type': '[EmailAction]'}, } def __init__(self, **kwargs): super(EmailActions, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.email_addresses = kwargs.get('email_addresses', None) class Error(Model): @@ -644,58 +561,6 @@ def __init__(self, **kwargs): self.sources = kwargs.get('sources', None) -class OnFailure(Model): - """The actions for auto quota increase. - - :param email_actions: The email actions for auto quota increase. - :type email_actions: ~azure.mgmt.reservations.models.OnFailureEmailActions - :param phone_actions: The phone actions for auto quota increase. - :type phone_actions: ~azure.mgmt.reservations.models.OnFailurePhoneActions - """ - - _attribute_map = { - 'email_actions': {'key': 'emailActions', 'type': 'OnFailureEmailActions'}, - 'phone_actions': {'key': 'phoneActions', 'type': 'OnFailurePhoneActions'}, - } - - def __init__(self, **kwargs): - super(OnFailure, self).__init__(**kwargs) - self.email_actions = kwargs.get('email_actions', None) - self.phone_actions = kwargs.get('phone_actions', None) - - -class OnFailureEmailActions(Model): - """The email actions for auto quota increase. - - :param value: The list of email actions. - :type value: list[~azure.mgmt.reservations.models.EmailAction] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[EmailAction]'}, - } - - def __init__(self, **kwargs): - super(OnFailureEmailActions, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class OnFailurePhoneActions(Model): - """The phone actions for auto quota increase. - - :param value: The list of phone actions. - :type value: list[~azure.mgmt.reservations.models.PhoneAction] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PhoneAction]'}, - } - - def __init__(self, **kwargs): - super(OnFailurePhoneActions, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - class OperationDisplay(Model): """OperationDisplay. @@ -916,7 +781,10 @@ class PurchaseRequest(Model): :type location: str :param reserved_resource_type: Possible values include: 'VirtualMachines', 'SqlDatabases', 'SuseLinux', 'CosmosDb', 'RedHat', 'SqlDataWarehouse', - 'VMwareCloudSimple', 'RedHatOsa' + 'VMwareCloudSimple', 'RedHatOsa', 'Databricks', 'AppService', + 'ManagedDisk', 'BlockBlob', 'RedisCache', 'AzureDataExplorer', 'MySql', + 'MariaDb', 'PostgreSql', 'DedicatedHost', 'SapHana', + 'SqlAzureHybridBenefit' :type reserved_resource_type: str or ~azure.mgmt.reservations.models.ReservedResourceType :param billing_scope_id: @@ -1013,6 +881,60 @@ def __init__(self, **kwargs): self.next_link = kwargs.get('next_link', None) +class QuotaProperties(Model): + """Quota properties for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param limit: The quota limit. + :type limit: int + :ivar current_value: The current resource usages information. + :vartype current_value: int + :param unit: The units of the limit, such as - Count, Bytes, etc. Use the + unit field provided in the Get quota response. + :type unit: str + :param name: Name of the resource provide by the resource Provider. Please + use this name property for quotaRequests. + :type name: ~azure.mgmt.reservations.models.ResourceName + :param resource_type: The Resource Type Name. + :type resource_type: object + :ivar quota_period: The quota period over which the usage values are + summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per + one second). This parameter is optional because, for some resources like + compute, the period doesn’t matter. + :vartype quota_period: str + :param properties: Additional properties for the specific resource + provider. + :type properties: object + """ + + _validation = { + 'current_value': {'readonly': True}, + 'quota_period': {'readonly': True}, + } + + _attribute_map = { + 'limit': {'key': 'limit', 'type': 'int'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, + 'resource_type': {'key': 'resourceType', 'type': 'object'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(QuotaProperties, self).__init__(**kwargs) + self.limit = kwargs.get('limit', None) + self.current_value = None + self.unit = kwargs.get('unit', None) + self.name = kwargs.get('name', None) + self.resource_type = kwargs.get('resource_type', None) + self.quota_period = None + self.properties = kwargs.get('properties', None) + + class QuotaRequestDetails(Model): """The details of the quota Request. @@ -1086,26 +1008,8 @@ class QuotaRequestOneResourceSubmitResponse(Model): conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. :vartype request_submit_time: datetime - :param limit: The quota limit. - :type limit: int - :ivar current_value: The current resource usages information. - :vartype current_value: int - :param unit: The units of the limit, such as - Count, Bytes, etc. Use the - unit field provided in the Get quota response. - :type unit: str - :param name1: Name of the resource provide by the resource Provider. - Please use this name property for quotaRequests. - :type name1: ~azure.mgmt.reservations.models.CurrentQuotaLimitBaseName - :param resource_type: The Resource Type Name. - :type resource_type: object - :ivar quota_period: The quota period over which the usage values are - summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per - one second). This parameter is optional because, for some resources like - compute, the period doesn’t matter. - :vartype quota_period: str - :param properties: Additional properties for the specific resource - provider. - :type properties: object + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.models.QuotaProperties """ _validation = { @@ -1115,8 +1019,6 @@ class QuotaRequestOneResourceSubmitResponse(Model): 'provisioning_state': {'readonly': True}, 'message': {'readonly': True}, 'request_submit_time': {'readonly': True}, - 'current_value': {'readonly': True}, - 'quota_period': {'readonly': True}, } _attribute_map = { @@ -1126,13 +1028,7 @@ class QuotaRequestOneResourceSubmitResponse(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'object'}, 'message': {'key': 'properties.message', 'type': 'str'}, 'request_submit_time': {'key': 'properties.requestSubmitTime', 'type': 'iso-8601'}, - 'limit': {'key': 'properties.properties.limit', 'type': 'int'}, - 'current_value': {'key': 'properties.properties.currentValue', 'type': 'int'}, - 'unit': {'key': 'properties.properties.unit', 'type': 'str'}, - 'name1': {'key': 'properties.properties.name', 'type': 'CurrentQuotaLimitBaseName'}, - 'resource_type': {'key': 'properties.properties.resourceType', 'type': 'object'}, - 'quota_period': {'key': 'properties.properties.quotaPeriod', 'type': 'str'}, - 'properties': {'key': 'properties.properties.properties', 'type': 'object'}, + 'properties': {'key': 'properties.properties.properties', 'type': 'QuotaProperties'}, } def __init__(self, **kwargs): @@ -1143,12 +1039,6 @@ def __init__(self, **kwargs): self.provisioning_state = None self.message = None self.request_submit_time = None - self.limit = kwargs.get('limit', None) - self.current_value = None - self.unit = kwargs.get('unit', None) - self.name1 = kwargs.get('name1', None) - self.resource_type = kwargs.get('resource_type', None) - self.quota_period = None self.properties = kwargs.get('properties', None) @@ -1489,7 +1379,10 @@ class ReservationProperties(Model): :param reserved_resource_type: Possible values include: 'VirtualMachines', 'SqlDatabases', 'SuseLinux', 'CosmosDb', 'RedHat', 'SqlDataWarehouse', - 'VMwareCloudSimple', 'RedHatOsa' + 'VMwareCloudSimple', 'RedHatOsa', 'Databricks', 'AppService', + 'ManagedDisk', 'BlockBlob', 'RedisCache', 'AzureDataExplorer', 'MySql', + 'MariaDb', 'PostgreSql', 'DedicatedHost', 'SapHana', + 'SqlAzureHybridBenefit' :type reserved_resource_type: str or ~azure.mgmt.reservations.models.ReservedResourceType :param instance_flexibility: Possible values include: 'On', 'Off' @@ -1676,6 +1569,34 @@ def __init__(self, **kwargs): self.split_source = kwargs.get('split_source', None) +class ResourceName(Model): + """Name of the resource provide by the resource Provider. Please use this name + property for quotaRequests. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: Resource name. + :type value: str + :ivar localized_value: Resource display name. + :vartype localized_value: str + """ + + _validation = { + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = None + + class ScopeProperties(Model): """ScopeProperties. @@ -1849,7 +1770,7 @@ class SubRequest(Model): :ivar limit: The Resource limit. :vartype limit: int :param name: The Resource name. - :type name: ~azure.mgmt.reservations.models.SubRequestName + :type name: ~azure.mgmt.reservations.models.ResourceName :ivar resource_type: Resource type for which the quota check was made. :vartype resource_type: str :param unit: The units of the limit, such as - Count, Bytes, etc. Use the @@ -1872,7 +1793,7 @@ class SubRequest(Model): _attribute_map = { 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'SubRequestName'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'unit': {'key': 'unit', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'object'}, @@ -1891,34 +1812,6 @@ def __init__(self, **kwargs): self.sub_request_id = None -class SubRequestName(Model): - """The Resource name. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar localized_value: Resource display name. - :vartype localized_value: str - :ivar value: Resource name. - :vartype value: str - """ - - _validation = { - 'localized_value': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SubRequestName, self).__init__(**kwargs) - self.localized_value = None - self.value = None - - class SubscriptionScopeProperties(Model): """SubscriptionScopeProperties. @@ -1938,8 +1831,6 @@ def __init__(self, **kwargs): class SupportRequestAction(Model): """The SupportRequest action. - :param auto_quota_increase_state: Is support request action enabled. - :type auto_quota_increase_state: object :param severity: The support request severity. :type severity: object :param first_name: The first name of the recipient. @@ -1963,7 +1854,6 @@ class SupportRequestAction(Model): """ _attribute_map = { - 'auto_quota_increase_state': {'key': 'autoQuotaIncreaseState', 'type': 'object'}, 'severity': {'key': 'severity', 'type': 'object'}, 'first_name': {'key': 'firstName', 'type': 'str'}, 'last_name': {'key': 'lastName', 'type': 'str'}, @@ -1977,7 +1867,6 @@ class SupportRequestAction(Model): def __init__(self, **kwargs): super(SupportRequestAction, self).__init__(**kwargs) - self.auto_quota_increase_state = kwargs.get('auto_quota_increase_state', None) self.severity = kwargs.get('severity', None) self.first_name = kwargs.get('first_name', None) self.last_name = kwargs.get('last_name', None) diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models_py3.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models_py3.py index 7a372ddea51..bcb0c049c4e 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models_py3.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models_py3.py @@ -13,6 +13,22 @@ from msrest.exceptions import HttpOperationError +class Actions(Model): + """The actions for auto quota increase. + + :param email_actions: The email actions for auto quota increase. + :type email_actions: ~azure.mgmt.reservations.models.EmailActions + """ + + _attribute_map = { + 'email_actions': {'key': 'emailActions', 'type': 'EmailActions'}, + } + + def __init__(self, *, email_actions=None, **kwargs) -> None: + super(Actions, self).__init__(**kwargs) + self.email_actions = email_actions + + class AppliedReservationList(Model): """AppliedReservationList. @@ -103,9 +119,9 @@ class AutoQuotaIncreaseDetail(Model): :param settings: Settings for automatic quota increase. :type settings: ~azure.mgmt.reservations.models.AqiSettings :param on_failure: The on failure Actions. - :type on_failure: ~azure.mgmt.reservations.models.OnFailure + :type on_failure: ~azure.mgmt.reservations.models.Actions :param on_success: The on success Actions. - :type on_success: ~azure.mgmt.reservations.models.OnFailure + :type on_success: ~azure.mgmt.reservations.models.Actions :param support_ticket_action: The support ticket action. :type support_ticket_action: ~azure.mgmt.reservations.models.SupportRequestAction @@ -122,8 +138,8 @@ class AutoQuotaIncreaseDetail(Model): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'settings': {'key': 'properties.settings', 'type': 'AqiSettings'}, - 'on_failure': {'key': 'properties.onFailure', 'type': 'OnFailure'}, - 'on_success': {'key': 'properties.onSuccess', 'type': 'OnFailure'}, + 'on_failure': {'key': 'properties.onFailure', 'type': 'Actions'}, + 'on_success': {'key': 'properties.onSuccess', 'type': 'Actions'}, 'support_ticket_action': {'key': 'properties.supportTicketAction', 'type': 'SupportRequestAction'}, } @@ -329,26 +345,8 @@ class CurrentQuotaLimit(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param limit: The quota limit. - :type limit: int - :ivar current_value: The current resource usages information. - :vartype current_value: int - :param unit: The units of the limit, such as - Count, Bytes, etc. Use the - unit field provided in the Get quota response. - :type unit: str - :param name: Name of the resource provide by the resource Provider. Please - use this name property for quotaRequests. - :type name: ~azure.mgmt.reservations.models.CurrentQuotaLimitBaseName - :param resource_type: The Resource Type Name. - :type resource_type: object - :ivar quota_period: The quota period over which the usage values are - summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per - one second). This parameter is optional because, for some resources like - compute, the period doesn’t matter. - :vartype quota_period: str - :param properties: Additional properties for the specific resource - provider. - :type properties: object + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.models.QuotaProperties :ivar provisioning_state: The quota request status. :vartype provisioning_state: object :ivar message: A user friendly message. @@ -356,32 +354,18 @@ class CurrentQuotaLimit(Model): """ _validation = { - 'current_value': {'readonly': True}, - 'quota_period': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'message': {'readonly': True}, } _attribute_map = { - 'limit': {'key': 'quotaInformation.limit', 'type': 'int'}, - 'current_value': {'key': 'quotaInformation.currentValue', 'type': 'int'}, - 'unit': {'key': 'quotaInformation.unit', 'type': 'str'}, - 'name': {'key': 'quotaInformation.name', 'type': 'CurrentQuotaLimitBaseName'}, - 'resource_type': {'key': 'quotaInformation.resourceType', 'type': 'object'}, - 'quota_period': {'key': 'quotaInformation.quotaPeriod', 'type': 'str'}, - 'properties': {'key': 'quotaInformation.properties', 'type': 'object'}, + 'properties': {'key': 'quotaInformation.properties', 'type': 'QuotaProperties'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'object'}, 'message': {'key': 'properties.message', 'type': 'str'}, } - def __init__(self, *, limit: int=None, unit: str=None, name=None, resource_type=None, properties=None, **kwargs) -> None: + def __init__(self, *, properties=None, **kwargs) -> None: super(CurrentQuotaLimit, self).__init__(**kwargs) - self.limit = limit - self.current_value = None - self.unit = unit - self.name = name - self.resource_type = resource_type - self.quota_period = None self.properties = properties self.provisioning_state = None self.message = None @@ -390,85 +374,19 @@ def __init__(self, *, limit: int=None, unit: str=None, name=None, resource_type= class CurrentQuotaLimitBase(Model): """Quota limits. - Variables are only populated by the server, and will be ignored when - sending a request. - - :param limit: The quota limit. - :type limit: int - :ivar current_value: The current resource usages information. - :vartype current_value: int - :param unit: The units of the limit, such as - Count, Bytes, etc. Use the - unit field provided in the Get quota response. - :type unit: str - :param name: Name of the resource provide by the resource Provider. Please - use this name property for quotaRequests. - :type name: ~azure.mgmt.reservations.models.CurrentQuotaLimitBaseName - :param resource_type: The Resource Type Name. - :type resource_type: object - :ivar quota_period: The quota period over which the usage values are - summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per - one second). This parameter is optional because, for some resources like - compute, the period doesn’t matter. - :vartype quota_period: str - :param properties: Additional properties for the specific resource - provider. - :type properties: object + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.models.QuotaProperties """ - _validation = { - 'current_value': {'readonly': True}, - 'quota_period': {'readonly': True}, - } - _attribute_map = { - 'limit': {'key': 'limit', 'type': 'int'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'CurrentQuotaLimitBaseName'}, - 'resource_type': {'key': 'resourceType', 'type': 'object'}, - 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'properties': {'key': 'properties', 'type': 'QuotaProperties'}, } - def __init__(self, *, limit: int=None, unit: str=None, name=None, resource_type=None, properties=None, **kwargs) -> None: + def __init__(self, *, properties=None, **kwargs) -> None: super(CurrentQuotaLimitBase, self).__init__(**kwargs) - self.limit = limit - self.current_value = None - self.unit = unit - self.name = name - self.resource_type = resource_type - self.quota_period = None self.properties = properties -class CurrentQuotaLimitBaseName(Model): - """Name of the resource provide by the resource Provider. Please use this name - property for quotaRequests. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param value: Resource name. - :type value: str - :ivar localized_value: Resource display name. - :vartype localized_value: str - """ - - _validation = { - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, *, value: str=None, **kwargs) -> None: - super(CurrentQuotaLimitBaseName, self).__init__(**kwargs) - self.value = value - self.localized_value = None - - class EmailAction(Model): """Email Action. @@ -488,18 +406,17 @@ def __init__(self, *, email_address: str=None, **kwargs) -> None: class EmailActions(Model): """The email actions. - :param value: The list of actions based on the success or failure of - automatic quota increase action. - :type value: list[~azure.mgmt.reservations.models.EmailAction] + :param email_addresses: The list of email actions. + :type email_addresses: list[~azure.mgmt.reservations.models.EmailAction] """ _attribute_map = { - 'value': {'key': 'value', 'type': '[EmailAction]'}, + 'email_addresses': {'key': 'emailAddresses', 'type': '[EmailAction]'}, } - def __init__(self, *, value=None, **kwargs) -> None: + def __init__(self, *, email_addresses=None, **kwargs) -> None: super(EmailActions, self).__init__(**kwargs) - self.value = value + self.email_addresses = email_addresses class Error(Model): @@ -644,58 +561,6 @@ def __init__(self, *, sources=None, **kwargs) -> None: self.sources = sources -class OnFailure(Model): - """The actions for auto quota increase. - - :param email_actions: The email actions for auto quota increase. - :type email_actions: ~azure.mgmt.reservations.models.OnFailureEmailActions - :param phone_actions: The phone actions for auto quota increase. - :type phone_actions: ~azure.mgmt.reservations.models.OnFailurePhoneActions - """ - - _attribute_map = { - 'email_actions': {'key': 'emailActions', 'type': 'OnFailureEmailActions'}, - 'phone_actions': {'key': 'phoneActions', 'type': 'OnFailurePhoneActions'}, - } - - def __init__(self, *, email_actions=None, phone_actions=None, **kwargs) -> None: - super(OnFailure, self).__init__(**kwargs) - self.email_actions = email_actions - self.phone_actions = phone_actions - - -class OnFailureEmailActions(Model): - """The email actions for auto quota increase. - - :param value: The list of email actions. - :type value: list[~azure.mgmt.reservations.models.EmailAction] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[EmailAction]'}, - } - - def __init__(self, *, value=None, **kwargs) -> None: - super(OnFailureEmailActions, self).__init__(**kwargs) - self.value = value - - -class OnFailurePhoneActions(Model): - """The phone actions for auto quota increase. - - :param value: The list of phone actions. - :type value: list[~azure.mgmt.reservations.models.PhoneAction] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PhoneAction]'}, - } - - def __init__(self, *, value=None, **kwargs) -> None: - super(OnFailurePhoneActions, self).__init__(**kwargs) - self.value = value - - class OperationDisplay(Model): """OperationDisplay. @@ -916,7 +781,10 @@ class PurchaseRequest(Model): :type location: str :param reserved_resource_type: Possible values include: 'VirtualMachines', 'SqlDatabases', 'SuseLinux', 'CosmosDb', 'RedHat', 'SqlDataWarehouse', - 'VMwareCloudSimple', 'RedHatOsa' + 'VMwareCloudSimple', 'RedHatOsa', 'Databricks', 'AppService', + 'ManagedDisk', 'BlockBlob', 'RedisCache', 'AzureDataExplorer', 'MySql', + 'MariaDb', 'PostgreSql', 'DedicatedHost', 'SapHana', + 'SqlAzureHybridBenefit' :type reserved_resource_type: str or ~azure.mgmt.reservations.models.ReservedResourceType :param billing_scope_id: @@ -1013,6 +881,60 @@ def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: self.next_link = next_link +class QuotaProperties(Model): + """Quota properties for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param limit: The quota limit. + :type limit: int + :ivar current_value: The current resource usages information. + :vartype current_value: int + :param unit: The units of the limit, such as - Count, Bytes, etc. Use the + unit field provided in the Get quota response. + :type unit: str + :param name: Name of the resource provide by the resource Provider. Please + use this name property for quotaRequests. + :type name: ~azure.mgmt.reservations.models.ResourceName + :param resource_type: The Resource Type Name. + :type resource_type: object + :ivar quota_period: The quota period over which the usage values are + summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per + one second). This parameter is optional because, for some resources like + compute, the period doesn’t matter. + :vartype quota_period: str + :param properties: Additional properties for the specific resource + provider. + :type properties: object + """ + + _validation = { + 'current_value': {'readonly': True}, + 'quota_period': {'readonly': True}, + } + + _attribute_map = { + 'limit': {'key': 'limit', 'type': 'int'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, + 'resource_type': {'key': 'resourceType', 'type': 'object'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, limit: int=None, unit: str=None, name=None, resource_type=None, properties=None, **kwargs) -> None: + super(QuotaProperties, self).__init__(**kwargs) + self.limit = limit + self.current_value = None + self.unit = unit + self.name = name + self.resource_type = resource_type + self.quota_period = None + self.properties = properties + + class QuotaRequestDetails(Model): """The details of the quota Request. @@ -1086,26 +1008,8 @@ class QuotaRequestOneResourceSubmitResponse(Model): conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. :vartype request_submit_time: datetime - :param limit: The quota limit. - :type limit: int - :ivar current_value: The current resource usages information. - :vartype current_value: int - :param unit: The units of the limit, such as - Count, Bytes, etc. Use the - unit field provided in the Get quota response. - :type unit: str - :param name1: Name of the resource provide by the resource Provider. - Please use this name property for quotaRequests. - :type name1: ~azure.mgmt.reservations.models.CurrentQuotaLimitBaseName - :param resource_type: The Resource Type Name. - :type resource_type: object - :ivar quota_period: The quota period over which the usage values are - summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per - one second). This parameter is optional because, for some resources like - compute, the period doesn’t matter. - :vartype quota_period: str - :param properties: Additional properties for the specific resource - provider. - :type properties: object + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.models.QuotaProperties """ _validation = { @@ -1115,8 +1019,6 @@ class QuotaRequestOneResourceSubmitResponse(Model): 'provisioning_state': {'readonly': True}, 'message': {'readonly': True}, 'request_submit_time': {'readonly': True}, - 'current_value': {'readonly': True}, - 'quota_period': {'readonly': True}, } _attribute_map = { @@ -1126,16 +1028,10 @@ class QuotaRequestOneResourceSubmitResponse(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'object'}, 'message': {'key': 'properties.message', 'type': 'str'}, 'request_submit_time': {'key': 'properties.requestSubmitTime', 'type': 'iso-8601'}, - 'limit': {'key': 'properties.properties.limit', 'type': 'int'}, - 'current_value': {'key': 'properties.properties.currentValue', 'type': 'int'}, - 'unit': {'key': 'properties.properties.unit', 'type': 'str'}, - 'name1': {'key': 'properties.properties.name', 'type': 'CurrentQuotaLimitBaseName'}, - 'resource_type': {'key': 'properties.properties.resourceType', 'type': 'object'}, - 'quota_period': {'key': 'properties.properties.quotaPeriod', 'type': 'str'}, - 'properties': {'key': 'properties.properties.properties', 'type': 'object'}, + 'properties': {'key': 'properties.properties.properties', 'type': 'QuotaProperties'}, } - def __init__(self, *, limit: int=None, unit: str=None, name1=None, resource_type=None, properties=None, **kwargs) -> None: + def __init__(self, *, properties=None, **kwargs) -> None: super(QuotaRequestOneResourceSubmitResponse, self).__init__(**kwargs) self.id = None self.name = None @@ -1143,12 +1039,6 @@ def __init__(self, *, limit: int=None, unit: str=None, name1=None, resource_type self.provisioning_state = None self.message = None self.request_submit_time = None - self.limit = limit - self.current_value = None - self.unit = unit - self.name1 = name1 - self.resource_type = resource_type - self.quota_period = None self.properties = properties @@ -1489,7 +1379,10 @@ class ReservationProperties(Model): :param reserved_resource_type: Possible values include: 'VirtualMachines', 'SqlDatabases', 'SuseLinux', 'CosmosDb', 'RedHat', 'SqlDataWarehouse', - 'VMwareCloudSimple', 'RedHatOsa' + 'VMwareCloudSimple', 'RedHatOsa', 'Databricks', 'AppService', + 'ManagedDisk', 'BlockBlob', 'RedisCache', 'AzureDataExplorer', 'MySql', + 'MariaDb', 'PostgreSql', 'DedicatedHost', 'SapHana', + 'SqlAzureHybridBenefit' :type reserved_resource_type: str or ~azure.mgmt.reservations.models.ReservedResourceType :param instance_flexibility: Possible values include: 'On', 'Off' @@ -1676,6 +1569,34 @@ def __init__(self, *, split_destinations=None, split_source: str=None, **kwargs) self.split_source = split_source +class ResourceName(Model): + """Name of the resource provide by the resource Provider. Please use this name + property for quotaRequests. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: Resource name. + :type value: str + :ivar localized_value: Resource display name. + :vartype localized_value: str + """ + + _validation = { + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, **kwargs) -> None: + super(ResourceName, self).__init__(**kwargs) + self.value = value + self.localized_value = None + + class ScopeProperties(Model): """ScopeProperties. @@ -1849,7 +1770,7 @@ class SubRequest(Model): :ivar limit: The Resource limit. :vartype limit: int :param name: The Resource name. - :type name: ~azure.mgmt.reservations.models.SubRequestName + :type name: ~azure.mgmt.reservations.models.ResourceName :ivar resource_type: Resource type for which the quota check was made. :vartype resource_type: str :param unit: The units of the limit, such as - Count, Bytes, etc. Use the @@ -1872,7 +1793,7 @@ class SubRequest(Model): _attribute_map = { 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'SubRequestName'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'unit': {'key': 'unit', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'object'}, @@ -1891,34 +1812,6 @@ def __init__(self, *, name=None, unit: str=None, provisioning_state=None, **kwar self.sub_request_id = None -class SubRequestName(Model): - """The Resource name. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar localized_value: Resource display name. - :vartype localized_value: str - :ivar value: Resource name. - :vartype value: str - """ - - _validation = { - 'localized_value': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(SubRequestName, self).__init__(**kwargs) - self.localized_value = None - self.value = None - - class SubscriptionScopeProperties(Model): """SubscriptionScopeProperties. @@ -1938,8 +1831,6 @@ def __init__(self, *, scopes=None, **kwargs) -> None: class SupportRequestAction(Model): """The SupportRequest action. - :param auto_quota_increase_state: Is support request action enabled. - :type auto_quota_increase_state: object :param severity: The support request severity. :type severity: object :param first_name: The first name of the recipient. @@ -1963,7 +1854,6 @@ class SupportRequestAction(Model): """ _attribute_map = { - 'auto_quota_increase_state': {'key': 'autoQuotaIncreaseState', 'type': 'object'}, 'severity': {'key': 'severity', 'type': 'object'}, 'first_name': {'key': 'firstName', 'type': 'str'}, 'last_name': {'key': 'lastName', 'type': 'str'}, @@ -1975,9 +1865,8 @@ class SupportRequestAction(Model): 'alternate_email_addresses': {'key': 'alternateEmailAddresses', 'type': '[str]'}, } - def __init__(self, *, auto_quota_increase_state=None, severity=None, first_name: str=None, last_name: str=None, country: str=None, phone_number: str=None, primary_email_address: str=None, support_language: str=None, preferred_contact_method=None, alternate_email_addresses=None, **kwargs) -> None: + def __init__(self, *, severity=None, first_name: str=None, last_name: str=None, country: str=None, phone_number: str=None, primary_email_address: str=None, support_language: str=None, preferred_contact_method=None, alternate_email_addresses=None, **kwargs) -> None: super(SupportRequestAction, self).__init__(**kwargs) - self.auto_quota_increase_state = auto_quota_increase_state self.severity = severity self.first_name = first_name self.last_name = last_name diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/__init__.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/__init__.py index 728b229d1cd..4d18278cf6d 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/__init__.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/__init__.py @@ -10,9 +10,7 @@ # -------------------------------------------------------------------------- from ._quota_operations import QuotaOperations -from ._quota_request_operations import QuotaRequestOperations -from ._quotas_operations import QuotasOperations -from ._quota_requests_operations import QuotaRequestsOperations +from ._quota_request_status_operations import QuotaRequestStatusOperations from ._auto_quota_increase_operations import AutoQuotaIncreaseOperations from ._reservation_operations import ReservationOperations from ._reservation_order_operations import ReservationOrderOperations @@ -21,9 +19,7 @@ __all__ = [ 'QuotaOperations', - 'QuotaRequestOperations', - 'QuotasOperations', - 'QuotaRequestsOperations', + 'QuotaRequestStatusOperations', 'AutoQuotaIncreaseOperations', 'ReservationOperations', 'ReservationOrderOperations', diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_auto_quota_increase_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_auto_quota_increase_operations.py index 5250285ec25..dfd888adf12 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_auto_quota_increase_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_auto_quota_increase_operations.py @@ -24,7 +24,7 @@ class AutoQuotaIncreaseOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Api version. Constant value: "2019-07-19-preview". + :ivar api_version: API version. Constant value: "2019-07-19-preview". """ models = models @@ -40,10 +40,7 @@ def __init__(self, client, config, serializer, deserializer): def get_properties( self, subscription_id, custom_headers=None, raw=False, **operation_config): - """For the specified subscription, gets the Auto Quota Increase enrollment - status. - - Gets the Auto Quota Increase enrollment details for the specified + """Gets the Auto Quota Increase enrollment details for the specified subscription. :param subscription_id: Azure subscription id. @@ -100,10 +97,7 @@ def get_properties( def create( self, subscription_id, auto_quota_increase_request, custom_headers=None, raw=False, **operation_config): - """For the specified subscription, sets the Auto Quota Increase enrollment - properties. - - Sets the Auto Quota Increase enrollment properties for the specified + """Sets the Auto Quota Increase enrollment properties for the specified subscription. :param subscription_id: Azure subscription id. diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_operations.py index c860871b52e..b00efa6723f 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_operations.py @@ -11,6 +11,8 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +26,7 @@ class QuotaOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Api version. Constant value: "2019-07-19-preview". + :ivar api_version: API version. Constant value: "2019-07-19-preview". """ models = models @@ -38,24 +40,20 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def list_status( + def get( self, subscription_id, provider_id, location, resource_name, custom_headers=None, raw=False, **operation_config): - """Gets the current quota limit and usages for the resource provider for - the specified location for the specific resource in the parameter. - - This API gets the current quota limit and usages for the specific - resource for resource provider for the specified location. This - response can be used to submit quotaRequests. + """Gets the current service limits (quotas) and usage of a resource. The + response from Get API can be leveraged to submit quota update requests. :param subscription_id: Azure subscription id. :type subscription_id: str - :param provider_id: Azure resource Provider id. + :param provider_id: Azure resource provider id. :type provider_id: str :param location: Azure region. :type location: str - :param resource_name: The Resource name for the specific resource - provider, such as SKU name for Microsoft.Compute, pool for - Microsoft.Batch. + :param resource_name: The resource name for a resource provider, such + as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for + Microsoft.MachineLearningServices :type resource_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -69,7 +67,7 @@ def list_status( :class:`ExceptionResponseException` """ # Construct URL - url = self.list_status.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), 'providerId': self._serialize.url("provider_id", provider_id, 'str'), @@ -113,4 +111,316 @@ def list_status( return client_raw_response return deserialized - list_status.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}'} + + + def _create_or_update_initial( + self, subscription_id, provider_id, location, resource_name, properties=None, custom_headers=None, raw=False, **operation_config): + create_quota_request = models.CurrentQuotaLimitBase(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'providerId': self._serialize.url("provider_id", provider_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_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(create_quota_request, 'CurrentQuotaLimitBase') + + # 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.ExceptionResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('QuotaRequestOneResourceSubmitResponse', response) + if response.status_code == 201: + deserialized = self._deserialize('QuotaRequestSubmitResponse201', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, subscription_id, provider_id, location, resource_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update the service limits (quota) of a resource to requested + value. + Steps: + 1. Make the Get request to get the quota information for specific + resource. + 2. To increase the quota, update the limit field in the response from + Get request to new value. + 3. Submit the JSON to the quota request API to update the quota. + The Create quota request may be constructed as follows. The PUT + operation can be used to update the quota. + + :param subscription_id: Azure subscription id. + :type subscription_id: str + :param provider_id: Azure resource provider id. + :type provider_id: str + :param location: Azure region. + :type location: str + :param resource_name: The resource name for a resource provider, such + as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for + Microsoft.MachineLearningServices + :type resource_name: str + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.models.QuotaProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns object or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] + :raises: + :class:`ExceptionResponseException` + """ + raw_result = self._create_or_update_initial( + subscription_id=subscription_id, + provider_id=provider_id, + location=location, + resource_name=resource_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('object', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}'} + + + def _update_initial( + self, subscription_id, provider_id, location, resource_name, properties=None, custom_headers=None, raw=False, **operation_config): + create_quota_request = models.CurrentQuotaLimitBase(properties=properties) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'providerId': self._serialize.url("provider_id", provider_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_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(create_quota_request, 'CurrentQuotaLimitBase') + + # 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, 201]: + raise models.ExceptionResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('QuotaRequestOneResourceSubmitResponse', response) + if response.status_code == 201: + deserialized = self._deserialize('QuotaRequestSubmitResponse201', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, subscription_id, provider_id, location, resource_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the service limits (quota) of a resource to requested value. + Steps: + 1. Make the Get request to get the quota information for specific + resource. + 2. To increase the quota, update the limit field in the response from + Get request to new value. + 3. Submit the JSON to the quota request API to update the quota. + The Update quota request may be constructed as follows. The PATCH + operation can be used to update the quota. + + :param subscription_id: Azure subscription id. + :type subscription_id: str + :param provider_id: Azure resource provider id. + :type provider_id: str + :param location: Azure region. + :type location: str + :param resource_name: The resource name for a resource provider, such + as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for + Microsoft.MachineLearningServices + :type resource_name: str + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.models.QuotaProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns object or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] + :raises: + :class:`ExceptionResponseException` + """ + raw_result = self._update_initial( + subscription_id=subscription_id, + provider_id=provider_id, + location=location, + resource_name=resource_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('object', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}'} + + def list( + self, subscription_id, provider_id, location, custom_headers=None, raw=False, **operation_config): + """Get a list of current service limits (quota) and usages of all the + resources. The response from List API can be leveraged to submit quota + update requests. + + :param subscription_id: Azure subscription id. + :type subscription_id: str + :param provider_id: Azure resource provider id. + :type provider_id: str + :param location: Azure region. + :type location: 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 CurrentQuotaLimitBase + :rtype: + ~azure.mgmt.reservations.models.CurrentQuotaLimitBasePaged[~azure.mgmt.reservations.models.CurrentQuotaLimitBase] + :raises: + :class:`ExceptionResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'providerId': self._serialize.url("provider_id", provider_id, 'str'), + 'location': self._serialize.url("location", location, '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.ExceptionResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.CurrentQuotaLimitBasePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits'} diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_request_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_request_operations.py deleted file mode 100644 index 5b8aa7eba99..00000000000 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_request_operations.py +++ /dev/null @@ -1,295 +0,0 @@ -# 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 msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class QuotaRequestOperations(object): - """QuotaRequestOperations 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: Api version. Constant value: "2019-07-19-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-07-19-preview" - - self.config = config - - - def _create_initial( - self, subscription_id, provider_id, location, resource_name, create_quota_request, if_match, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), - 'providerId': self._serialize.url("provider_id", provider_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - 'resourceName': self._serialize.url("resource_name", resource_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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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(create_quota_request, 'CurrentQuotaLimitBase') - - # 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.ExceptionResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('QuotaRequestOneResourceSubmitResponse', response) - if response.status_code == 201: - deserialized = self._deserialize('QuotaRequestSubmitResponse201', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, subscription_id, provider_id, location, resource_name, create_quota_request, if_match, custom_headers=None, raw=False, polling=True, **operation_config): - """Submits a Quota Request for a resource provider at the specified - location for the specific resource in the parameter. - - Submits Quota change request for a resource provider for the specified - location for the specific resource in the parameter. To use, first make - a Get request to get quota information. This information consists of a - list of resources and information regarding those resources. For all - the resources in that list which require an update to their quotas, - update their limit fields in the response from the Get request to their - new values. Then, submit this updated JSON object to this quota request - API. This will update the quota to the values specified. The location - header in the response will be used to track the status of the quota - request. Please check the provisioningState field in the response. - - :param subscription_id: Azure subscription id. - :type subscription_id: str - :param provider_id: Azure resource Provider id. - :type provider_id: str - :param location: Azure region. - :type location: str - :param resource_name: The Resource name for the specific resource - provider, such as SKU name for Microsoft.Compute, pool for - Microsoft.Batch. - :type resource_name: str - :param create_quota_request: Quota requests payload. - :type create_quota_request: - ~azure.mgmt.reservations.models.CurrentQuotaLimitBase - :param if_match: ETag of the Entity. ETag should match the current - entity state from the header response of the GET request or it should - be * for unconditional update. - :type if_match: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns object or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] - :raises: - :class:`ExceptionResponseException` - """ - raw_result = self._create_initial( - subscription_id=subscription_id, - provider_id=provider_id, - location=location, - resource_name=resource_name, - create_quota_request=create_quota_request, - if_match=if_match, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('object', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}'} - - - def _update_initial( - self, subscription_id, provider_id, location, resource_name, create_quota_request, if_match, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), - 'providerId': self._serialize.url("provider_id", provider_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - 'resourceName': self._serialize.url("resource_name", resource_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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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(create_quota_request, 'CurrentQuotaLimitBase') - - # 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, 201]: - raise models.ExceptionResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('QuotaRequestOneResourceSubmitResponse', response) - if response.status_code == 201: - deserialized = self._deserialize('QuotaRequestSubmitResponse201', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, subscription_id, provider_id, location, resource_name, create_quota_request, if_match, custom_headers=None, raw=False, polling=True, **operation_config): - """Submits a Quota Request for a resource provider at the specified - location for the specific resource in the parameter. - - Submits Quota change request for a resource provider for the specified - location for the specific resource in the parameter. To use, first make - a Get request to get quota information. This information consists of a - list of resources and information regarding those resources. For all - the resources in that list which require an update to their quotas, - update their limit fields in the response from the Get request to their - new values. Then, submit this updated JSON object to this quota request - API. This will update the quota to the values specified. The location - header in the response will be used to track the status of the quota - request. Please check the provisioningState field in the response. - - :param subscription_id: Azure subscription id. - :type subscription_id: str - :param provider_id: Azure resource Provider id. - :type provider_id: str - :param location: Azure region. - :type location: str - :param resource_name: The Resource name for the specific resource - provider, such as SKU name for Microsoft.Compute, pool for - Microsoft.Batch. - :type resource_name: str - :param create_quota_request: Quota requests payload. - :type create_quota_request: - ~azure.mgmt.reservations.models.CurrentQuotaLimitBase - :param if_match: ETag of the Entity. ETag should match the current - entity state from the header response of the GET request or it should - be * for unconditional update. - :type if_match: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns object or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] - :raises: - :class:`ExceptionResponseException` - """ - raw_result = self._update_initial( - subscription_id=subscription_id, - provider_id=provider_id, - location=location, - resource_name=resource_name, - create_quota_request=create_quota_request, - if_match=if_match, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('object', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}'} diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_requests_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_request_status_operations.py similarity index 86% rename from sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_requests_operations.py rename to sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_request_status_operations.py index 1ed7b7c9bb4..c3481d82be0 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_requests_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_request_status_operations.py @@ -15,8 +15,8 @@ from .. import models -class QuotaRequestsOperations(object): - """QuotaRequestsOperations operations. +class QuotaRequestStatusOperations(object): + """QuotaRequestStatusOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -24,7 +24,7 @@ class QuotaRequestsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Api version. Constant value: "2019-07-19-preview". + :ivar api_version: API version. Constant value: "2019-07-19-preview". """ models = models @@ -38,19 +38,16 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get_status( + def get( self, subscription_id, provider_id, location, id, custom_headers=None, raw=False, **operation_config): - """Gets the Quota request status by requestId, for the specified resource - provider at specified location. - - Gets the QuotaRequest details and status by the quota requestId for the - resources for the resource provider at a specific location. The + """Gets the QuotaRequest details and status by the quota request Id for + the resources for the resource provider at a specific location. The requestId is returned as response to the Put requests for serviceLimits. :param subscription_id: Azure subscription id. :type subscription_id: str - :param provider_id: Azure resource Provider id. + :param provider_id: Azure resource provider id. :type provider_id: str :param location: Azure region. :type location: str @@ -68,7 +65,7 @@ def get_status( :class:`ExceptionResponseException` """ # Construct URL - url = self.get_status.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), 'providerId': self._serialize.url("provider_id", provider_id, 'str'), @@ -107,23 +104,18 @@ def get_status( return client_raw_response return deserialized - get_status.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests/{id}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests/{id}'} - def list_status( + def list( self, subscription_id, provider_id, location, filter=None, top=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): - """For the specified location and resource Provider, gets the quota - requests under the subscription over the time - period of one year ago from now to one year back, based on the filter - specified. - - For the specified location and Resource provider gets the current quota + """For the specified location and Resource provider gets the current quota requests under the subscription over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. :param subscription_id: Azure subscription id. :type subscription_id: str - :param provider_id: Azure resource Provider id. + :param provider_id: Azure resource provider id. :type provider_id: str :param location: Azure region. :type location: str @@ -152,7 +144,7 @@ def list_status( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_status.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), 'providerId': self._serialize.url("provider_id", provider_id, 'str'), @@ -205,4 +197,4 @@ def internal_paging(next_link=None): deserialized = models.QuotaRequestDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_status.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests'} diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quotas_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quotas_operations.py deleted file mode 100644 index 3254a46ba47..00000000000 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quotas_operations.py +++ /dev/null @@ -1,117 +0,0 @@ -# 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 QuotasOperations(object): - """QuotasOperations 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: Api version. Constant value: "2019-07-19-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-07-19-preview" - - self.config = config - - def list_status( - self, subscription_id, provider_id, location, custom_headers=None, raw=False, **operation_config): - """Gets the current quota limit and usages for all the resources by the - resource provider at the specified location. - - This API gets the current quota limits and usages for the resource - provider for the specified location. This response can be used to - submit quotaRequests. - - :param subscription_id: Azure subscription id. - :type subscription_id: str - :param provider_id: Azure resource Provider id. - :type provider_id: str - :param location: Azure region. - :type location: 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 CurrentQuotaLimitBase - :rtype: - ~azure.mgmt.reservations.models.CurrentQuotaLimitBasePaged[~azure.mgmt.reservations.models.CurrentQuotaLimitBase] - :raises: - :class:`ExceptionResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_status.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), - 'providerId': self._serialize.url("provider_id", provider_id, 'str'), - 'location': self._serialize.url("location", location, '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.ExceptionResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.CurrentQuotaLimitBasePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_status.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits'} diff --git a/sdk/reservations/azure-mgmt-reservations/setup.py b/sdk/reservations/azure-mgmt-reservations/setup.py index 0e8c3f1ae36..eaf6266b555 100644 --- a/sdk/reservations/azure-mgmt-reservations/setup.py +++ b/sdk/reservations/azure-mgmt-reservations/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)