diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_consumption_management_client.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_consumption_management_client.py index 999644e0cefd..169fd4d3e624 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_consumption_management_client.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_consumption_management_client.py @@ -77,7 +77,7 @@ def __init__( super(ConsumptionManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-05-01-preview' + self.api_version = '2019-05-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py index a4d4f0fdbd22..26d9294c4e05 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py @@ -41,7 +41,6 @@ from ._models_py3 import Tag from ._models_py3 import TagsResult from ._models_py3 import UsageDetail - from ._models_py3 import UsageDetailsDownloadResponse except (SyntaxError, ImportError): from ._models import Balance from ._models import BalancePropertiesAdjustmentDetailsItem @@ -74,7 +73,6 @@ from ._models import Tag from ._models import TagsResult from ._models import UsageDetail - from ._models import UsageDetailsDownloadResponse from ._paged_models import BudgetPaged from ._paged_models import ForecastPaged from ._paged_models import MarketplacePaged @@ -127,7 +125,6 @@ 'Tag', 'TagsResult', 'UsageDetail', - 'UsageDetailsDownloadResponse', 'UsageDetailPaged', 'MarketplacePaged', 'BudgetPaged', diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_consumption_management_client_enums.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_consumption_management_client_enums.py index b888ebdec7e0..0e7e4b9f6805 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_consumption_management_client_enums.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_consumption_management_client_enums.py @@ -30,6 +30,9 @@ class TimeGrainType(str, Enum): monthly = "Monthly" quarterly = "Quarterly" annually = "Annually" + billing_month = "BillingMonth" + billing_quarter = "BillingQuarter" + billing_annual = "BillingAnnual" class OperatorType(str, Enum): diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models.py index 6e71da4b787d..d7b93404300a 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models.py @@ -287,7 +287,8 @@ class Budget(ProxyResource): :type amount: decimal.Decimal :param time_grain: Required. The time covered by a budget. Tracking of the amount will be reset based on the time grain. Possible values include: - 'Monthly', 'Quarterly', 'Annually' + 'Monthly', 'Quarterly', 'Annually', 'BillingMonth', 'BillingQuarter', + 'BillingAnnual' :type time_grain: str or ~azure.mgmt.consumption.models.TimeGrainType :param time_period: Required. Has start and end date of the budget. The start date must be first of the month and should be less than the end @@ -1306,6 +1307,10 @@ class ReservationDetail(Resource): purchase transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the reservations. :vartype reservation_order_id: str + :ivar instance_flexibility_ratio: The instance Flexibility Ratio. + :vartype instance_flexibility_ratio: str + :ivar instance_flexibility_group: The instance Flexibility Group. + :vartype instance_flexibility_group: str :ivar reservation_id: The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for applying the benefit scope and also specifies the number of instances @@ -1336,6 +1341,8 @@ class ReservationDetail(Resource): 'type': {'readonly': True}, 'tags': {'readonly': True}, 'reservation_order_id': {'readonly': True}, + 'instance_flexibility_ratio': {'readonly': True}, + 'instance_flexibility_group': {'readonly': True}, 'reservation_id': {'readonly': True}, 'sku_name': {'readonly': True}, 'reserved_hours': {'readonly': True}, @@ -1351,6 +1358,8 @@ class ReservationDetail(Resource): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, + 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'str'}, + 'instance_flexibility_group': {'key': 'properties.instanceFlexibilityGroup', 'type': 'str'}, 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, 'reserved_hours': {'key': 'properties.reservedHours', 'type': 'decimal'}, @@ -1363,6 +1372,8 @@ class ReservationDetail(Resource): def __init__(self, **kwargs): super(ReservationDetail, self).__init__(**kwargs) self.reservation_order_id = None + self.instance_flexibility_ratio = None + self.instance_flexibility_group = None self.reservation_id = None self.sku_name = None self.reserved_hours = None @@ -1393,6 +1404,15 @@ class ReservationRecommendation(Model): :ivar look_back_period: The number of days of usage to look back for recommendation. :vartype look_back_period: str + :ivar instance_flexibility_ratio: The instance Flexibility Ratio. + :vartype instance_flexibility_ratio: int + :ivar instance_flexibility_group: The instance Flexibility Group. + :vartype instance_flexibility_group: str + :ivar normalized_size: The normalized Size. + :vartype normalized_size: str + :ivar recommended_quantity_normalized: The recommended Quantity + Normalized. + :vartype recommended_quantity_normalized: float :ivar meter_id: The meter id (GUID) :vartype meter_id: str :ivar term: RI recommendations in one or three year terms. @@ -1421,6 +1441,10 @@ class ReservationRecommendation(Model): 'location': {'readonly': True}, 'sku': {'readonly': True}, 'look_back_period': {'readonly': True}, + 'instance_flexibility_ratio': {'readonly': True}, + 'instance_flexibility_group': {'readonly': True}, + 'normalized_size': {'readonly': True}, + 'recommended_quantity_normalized': {'readonly': True}, 'meter_id': {'readonly': True}, 'term': {'readonly': True}, 'cost_with_no_reserved_instances': {'readonly': True}, @@ -1439,6 +1463,10 @@ class ReservationRecommendation(Model): 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'str'}, 'look_back_period': {'key': 'properties.lookBackPeriod', 'type': 'str'}, + 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'int'}, + 'instance_flexibility_group': {'key': 'properties.instanceFlexibilityGroup', 'type': 'str'}, + 'normalized_size': {'key': 'properties.normalizedSize', 'type': 'str'}, + 'recommended_quantity_normalized': {'key': 'properties.recommendedQuantityNormalized', 'type': 'float'}, 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, 'term': {'key': 'properties.term', 'type': 'str'}, 'cost_with_no_reserved_instances': {'key': 'properties.costWithNoReservedInstances', 'type': 'decimal'}, @@ -1458,6 +1486,10 @@ def __init__(self, **kwargs): self.location = None self.sku = None self.look_back_period = None + self.instance_flexibility_ratio = None + self.instance_flexibility_group = None + self.normalized_size = None + self.recommended_quantity_normalized = None self.meter_id = None self.term = None self.cost_with_no_reserved_instances = None @@ -1912,47 +1944,3 @@ def __init__(self, **kwargs): self.plan_name = None self.charge_type = None self.frequency = None - - -class UsageDetailsDownloadResponse(Resource): - """Download response of Usage Details. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar download_url: The URL to the csv file. - :vartype download_url: str - :ivar valid_till: The time in UTC at which this download URL will expire. - :vartype valid_till: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'download_url': {'readonly': True}, - 'valid_till': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'download_url': {'key': 'properties.downloadUrl', 'type': 'str'}, - 'valid_till': {'key': 'properties.validTill', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UsageDetailsDownloadResponse, self).__init__(**kwargs) - self.download_url = None - self.valid_till = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models_py3.py index c68339913f98..b5be29c1a48c 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models_py3.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models_py3.py @@ -287,7 +287,8 @@ class Budget(ProxyResource): :type amount: decimal.Decimal :param time_grain: Required. The time covered by a budget. Tracking of the amount will be reset based on the time grain. Possible values include: - 'Monthly', 'Quarterly', 'Annually' + 'Monthly', 'Quarterly', 'Annually', 'BillingMonth', 'BillingQuarter', + 'BillingAnnual' :type time_grain: str or ~azure.mgmt.consumption.models.TimeGrainType :param time_period: Required. Has start and end date of the budget. The start date must be first of the month and should be less than the end @@ -1306,6 +1307,10 @@ class ReservationDetail(Resource): purchase transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the reservations. :vartype reservation_order_id: str + :ivar instance_flexibility_ratio: The instance Flexibility Ratio. + :vartype instance_flexibility_ratio: str + :ivar instance_flexibility_group: The instance Flexibility Group. + :vartype instance_flexibility_group: str :ivar reservation_id: The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for applying the benefit scope and also specifies the number of instances @@ -1336,6 +1341,8 @@ class ReservationDetail(Resource): 'type': {'readonly': True}, 'tags': {'readonly': True}, 'reservation_order_id': {'readonly': True}, + 'instance_flexibility_ratio': {'readonly': True}, + 'instance_flexibility_group': {'readonly': True}, 'reservation_id': {'readonly': True}, 'sku_name': {'readonly': True}, 'reserved_hours': {'readonly': True}, @@ -1351,6 +1358,8 @@ class ReservationDetail(Resource): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, + 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'str'}, + 'instance_flexibility_group': {'key': 'properties.instanceFlexibilityGroup', 'type': 'str'}, 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, 'reserved_hours': {'key': 'properties.reservedHours', 'type': 'decimal'}, @@ -1363,6 +1372,8 @@ class ReservationDetail(Resource): def __init__(self, **kwargs) -> None: super(ReservationDetail, self).__init__(**kwargs) self.reservation_order_id = None + self.instance_flexibility_ratio = None + self.instance_flexibility_group = None self.reservation_id = None self.sku_name = None self.reserved_hours = None @@ -1393,6 +1404,15 @@ class ReservationRecommendation(Model): :ivar look_back_period: The number of days of usage to look back for recommendation. :vartype look_back_period: str + :ivar instance_flexibility_ratio: The instance Flexibility Ratio. + :vartype instance_flexibility_ratio: int + :ivar instance_flexibility_group: The instance Flexibility Group. + :vartype instance_flexibility_group: str + :ivar normalized_size: The normalized Size. + :vartype normalized_size: str + :ivar recommended_quantity_normalized: The recommended Quantity + Normalized. + :vartype recommended_quantity_normalized: float :ivar meter_id: The meter id (GUID) :vartype meter_id: str :ivar term: RI recommendations in one or three year terms. @@ -1421,6 +1441,10 @@ class ReservationRecommendation(Model): 'location': {'readonly': True}, 'sku': {'readonly': True}, 'look_back_period': {'readonly': True}, + 'instance_flexibility_ratio': {'readonly': True}, + 'instance_flexibility_group': {'readonly': True}, + 'normalized_size': {'readonly': True}, + 'recommended_quantity_normalized': {'readonly': True}, 'meter_id': {'readonly': True}, 'term': {'readonly': True}, 'cost_with_no_reserved_instances': {'readonly': True}, @@ -1439,6 +1463,10 @@ class ReservationRecommendation(Model): 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'str'}, 'look_back_period': {'key': 'properties.lookBackPeriod', 'type': 'str'}, + 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'int'}, + 'instance_flexibility_group': {'key': 'properties.instanceFlexibilityGroup', 'type': 'str'}, + 'normalized_size': {'key': 'properties.normalizedSize', 'type': 'str'}, + 'recommended_quantity_normalized': {'key': 'properties.recommendedQuantityNormalized', 'type': 'float'}, 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, 'term': {'key': 'properties.term', 'type': 'str'}, 'cost_with_no_reserved_instances': {'key': 'properties.costWithNoReservedInstances', 'type': 'decimal'}, @@ -1458,6 +1486,10 @@ def __init__(self, **kwargs) -> None: self.location = None self.sku = None self.look_back_period = None + self.instance_flexibility_ratio = None + self.instance_flexibility_group = None + self.normalized_size = None + self.recommended_quantity_normalized = None self.meter_id = None self.term = None self.cost_with_no_reserved_instances = None @@ -1912,47 +1944,3 @@ def __init__(self, **kwargs) -> None: self.plan_name = None self.charge_type = None self.frequency = None - - -class UsageDetailsDownloadResponse(Resource): - """Download response of Usage Details. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar download_url: The URL to the csv file. - :vartype download_url: str - :ivar valid_till: The time in UTC at which this download URL will expire. - :vartype valid_till: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'download_url': {'readonly': True}, - 'valid_till': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'download_url': {'key': 'properties.downloadUrl', 'type': 'str'}, - 'valid_till': {'key': 'properties.validTill', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UsageDetailsDownloadResponse, self).__init__(**kwargs) - self.download_url = None - self.valid_till = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_aggregated_cost_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_aggregated_cost_operations.py index e0a53cdf7d24..9fe9f47c4f6e 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_aggregated_cost_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_aggregated_cost_operations.py @@ -24,7 +24,7 @@ class AggregatedCostOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01-preview. Constant value: "2019-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2019-05-01" self.config = config diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_balances_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_balances_operations.py index b67f712aca9d..1b830a8dbed7 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_balances_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_balances_operations.py @@ -24,7 +24,7 @@ class BalancesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01-preview. Constant value: "2019-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2019-05-01" self.config = config diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_budgets_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_budgets_operations.py index f85e9eb492aa..3258fa9645e5 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_budgets_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_budgets_operations.py @@ -24,7 +24,7 @@ class BudgetsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01-preview. Constant value: "2019-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2019-05-01" self.config = config diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_charges_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_charges_operations.py index f22ad599fb45..2100c6a4dcf9 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_charges_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_charges_operations.py @@ -24,7 +24,7 @@ class ChargesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01-preview. Constant value: "2019-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2019-05-01" self.config = config diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_forecasts_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_forecasts_operations.py index ee088efc5c6f..134120beabb9 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_forecasts_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_forecasts_operations.py @@ -24,7 +24,7 @@ class ForecastsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01-preview. Constant value: "2019-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2019-05-01" self.config = config diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_marketplaces_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_marketplaces_operations.py index f523fabee4a4..751531e6cc95 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_marketplaces_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_marketplaces_operations.py @@ -24,7 +24,7 @@ class MarketplacesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01-preview. Constant value: "2019-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2019-05-01" self.config = config diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_operations.py index 2a483e8acae7..6806b8d3d1ce 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_operations.py @@ -24,7 +24,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01-preview. Constant value: "2019-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2019-05-01" self.config = config diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_price_sheet_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_price_sheet_operations.py index 179888a894e3..503a4faf3462 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_price_sheet_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_price_sheet_operations.py @@ -24,7 +24,7 @@ class PriceSheetOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01-preview. Constant value: "2019-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2019-05-01" self.config = config diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_recommendations_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_recommendations_operations.py index 4e562cf45220..b8d56cb814aa 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_recommendations_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_recommendations_operations.py @@ -24,7 +24,7 @@ class ReservationRecommendationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01-preview. Constant value: "2019-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2019-05-01" self.config = config @@ -107,3 +107,76 @@ def internal_paging(next_link=None): return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/reservationRecommendations'} + + def list_by_billing_account_id( + self, billing_account_id, filter=None, custom_headers=None, raw=False, **operation_config): + """List of recommendations for purchasing reserved instances on billing + account scope. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param filter: May be used to filter reservationRecommendations by + properties/scope and properties/lookBackPeriod. + :type filter: 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 ReservationRecommendation + :rtype: + ~azure.mgmt.consumption.models.ReservationRecommendationPaged[~azure.mgmt.consumption.models.ReservationRecommendation] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_billing_account_id.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ReservationRecommendationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_billing_account_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/microsoft.consumption/ReservationRecommendations'} diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_details_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_details_operations.py index dc3f87d3d538..9146b3ba9192 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_details_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_details_operations.py @@ -24,7 +24,7 @@ class ReservationsDetailsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01-preview. Constant value: "2019-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2019-05-01" self.config = config @@ -184,3 +184,75 @@ def internal_paging(next_link=None): return deserialized list_by_reservation_order_and_reservation.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails'} + + def list_by_billing_account_id( + self, billing_account_id, filter, custom_headers=None, raw=False, **operation_config): + """Lists the reservations details for provided date range. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param filter: Filter reservation details by date range. The + properties/UsageDate for start date and end date. The filter supports + 'le' and 'ge' + :type filter: 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 ReservationDetail + :rtype: + ~azure.mgmt.consumption.models.ReservationDetailPaged[~azure.mgmt.consumption.models.ReservationDetail] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_billing_account_id.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ReservationDetailPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_billing_account_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationDetails'} diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_summaries_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_summaries_operations.py index 4e2ef7394684..77c6a4ed603f 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_summaries_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_summaries_operations.py @@ -24,7 +24,7 @@ class ReservationsSummariesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01-preview. Constant value: "2019-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2019-05-01" self.config = config @@ -192,3 +192,79 @@ def internal_paging(next_link=None): return deserialized list_by_reservation_order_and_reservation.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationSummaries'} + + def list_by_billing_account_id( + self, billing_account_id, grain, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the reservations summaries for daily or monthly grain. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param grain: Can be daily or monthly. Possible values include: + 'DailyGrain', 'MonthlyGrain' + :type grain: str or ~azure.mgmt.consumption.models.Datagrain + :param filter: Required only for daily grain. The properties/UsageDate + for start date and end date. The filter supports 'le' and 'ge' + :type filter: 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 ReservationSummary + :rtype: + ~azure.mgmt.consumption.models.ReservationSummaryPaged[~azure.mgmt.consumption.models.ReservationSummary] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_billing_account_id.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['grain'] = self._serialize.query("grain", grain, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ReservationSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_billing_account_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationSummaries'} diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_tags_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_tags_operations.py index 45d3c9fcbce7..ce96843cad35 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_tags_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_tags_operations.py @@ -24,7 +24,7 @@ class TagsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01-preview. Constant value: "2019-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2019-05-01" self.config = config diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_usage_details_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_usage_details_operations.py index 6a75ad5237f0..04bc76e8df2e 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_usage_details_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_usage_details_operations.py @@ -11,8 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -26,7 +24,7 @@ class UsageDetailsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01-preview. Constant value: "2019-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-05-01. Constant value: "2019-05-01". """ models = models @@ -36,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2019-05-01" self.config = config @@ -159,140 +157,3 @@ def internal_paging(next_link=None): return deserialized list.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/usageDetails'} - - - def _download_initial( - self, scope, metric=None, filter=None, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.download.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if metric is not None: - query_parameters['metric'] = self._serialize.query("metric", metric, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('UsageDetailsDownloadResponse', response) - header_dict = { - 'Location': 'str', - 'Retry-After': 'str', - 'Azure-AsyncOperation': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - - def download( - self, scope, metric=None, filter=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Download usage details data. - - :param scope: The scope associated with usage details operations. This - includes '/subscriptions/{subscriptionId}/' for subscription scope, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for resourceGroup scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - Billing Account scope, - '/providers/Microsoft.Billing/departments/{departmentId}' for - Department scope, - '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope and - '/providers/Microsoft.Management/managementGroups/{managementGroupId}' - for Management Group scope. For subscription, billing account, - department, enrollment account and management group, you can also add - billing period to the scope using - '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For - e.g. to specify billing period at department scope use - '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' - :type scope: str - :param metric: Allows to select different type of cost/usage records. - Possible values include: 'ActualCostMetricType', - 'AmortizedCostMetricType', 'UsageMetricType' - :type metric: str or ~azure.mgmt.consumption.models.Metrictype - :param filter: May be used to filter usageDetails by - properties/resourceGroup, properties/resourceName, - properties/resourceId, properties/chargeType, - properties/reservationId, properties/publisherType or tags. The filter - supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - string where key and value is separated by a colon (:). PublisherType - Filter accepts two values azure and marketplace and it is currently - supported for Web Direct Offer Type - :type filter: 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 - UsageDetailsDownloadResponse or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.consumption.models.UsageDetailsDownloadResponse] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.consumption.models.UsageDetailsDownloadResponse]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._download_initial( - scope=scope, - metric=metric, - filter=filter, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - header_dict = { - 'Location': 'str', - 'Retry-After': 'str', - 'Azure-AsyncOperation': 'str', - } - deserialized = self._deserialize('UsageDetailsDownloadResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - 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, lro_options={'final-state-via': 'location'}, **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) - download.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/usageDetails/download'}