From fd133482b0dbfd999505e3973d6934490e789a38 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 13 Mar 2018 14:07:46 -0700 Subject: [PATCH] [AutoPR consumption/resource-manager] Added Tags filter for budgets and updated the api version (#2134) * Generated from 7b927cf53f15dfbde515c6e0cc96f0b2b953efc3 Added Tags filter for budgets and updated the api version Added Tags filter for budgets and updated the api version * Generated from c641158a0e8753654c0d36343ba3244865283f3a Updated comments Updated comments * Generated from 0e276b2b94ebe626431581607e9ddf975a29df86 Incorporated review comments Incorporated review comments * Generated from 7be436462b7c40da7cc4f8054bd8ea195f7a5146 Incorporated review comments Incorporated review comments --- .../consumption_management_client.py | 17 +++++++++++++---- .../azure/mgmt/consumption/models/filters.py | 10 +++++++--- .../mgmt/consumption/models/marketplace.py | 2 +- .../models/price_sheet_properties.py | 2 +- .../mgmt/consumption/models/usage_detail.py | 2 +- .../operations/budgets_operations.py | 4 ++-- .../operations/marketplaces_operations.py | 4 ++-- .../mgmt/consumption/operations/operations.py | 4 ++-- .../operations/price_sheet_operations.py | 4 ++-- .../reservations_details_operations.py | 4 ++-- .../reservations_summaries_operations.py | 18 ++++++------------ .../operations/usage_details_operations.py | 4 ++-- .../azure/mgmt/consumption/version.py | 3 ++- 13 files changed, 43 insertions(+), 35 deletions(-) diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py b/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py index 07c7aae34910..7f9dd828fe5a 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py @@ -33,16 +33,21 @@ class ConsumptionManagementClientConfiguration(AzureConfiguration): object` :param subscription_id: Azure Subscription ID. :type subscription_id: str + :param grain: Can be daily or monthly. Possible values include: + 'DailyGrain', 'MonthlyGrain' + :type grain: str or ~azure.mgmt.consumption.models.Datagrain :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): + self, credentials, subscription_id, grain, base_url=None): if credentials is None: raise ValueError("Parameter 'credentials' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") + if grain is None: + raise ValueError("Parameter 'grain' must not be None.") if not base_url: base_url = 'https://management.azure.com' @@ -53,6 +58,7 @@ def __init__( self.credentials = credentials self.subscription_id = subscription_id + self.grain = grain class ConsumptionManagementClient(object): @@ -81,17 +87,20 @@ class ConsumptionManagementClient(object): object` :param subscription_id: Azure Subscription ID. :type subscription_id: str + :param grain: Can be daily or monthly. Possible values include: + 'DailyGrain', 'MonthlyGrain' + :type grain: str or ~azure.mgmt.consumption.models.Datagrain :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): + self, credentials, subscription_id, grain, base_url=None): - self.config = ConsumptionManagementClientConfiguration(credentials, subscription_id, base_url) + self.config = ConsumptionManagementClientConfiguration(credentials, subscription_id, grain, base_url) self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-01-31' + self.api_version = '2018-03-31' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py index dc010a065900..c111e55dca96 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py @@ -20,9 +20,11 @@ class Filters(Model): :type resource_groups: list[str] :param resources: The list of filters on resources. :type resources: list[str] - :param meters: The list of filters on meters, mandatory for budgets of - usage category. + :param meters: The list of filters on meters (GUID), mandatory for budgets + of usage category. :type meters: list[str] + :param tags: The dictionary of filters on tags. + :type tags: dict[str, list[str]] """ _validation = { @@ -35,10 +37,12 @@ class Filters(Model): 'resource_groups': {'key': 'resourceGroups', 'type': '[str]'}, 'resources': {'key': 'resources', 'type': '[str]'}, 'meters': {'key': 'meters', 'type': '[str]'}, + 'tags': {'key': 'tags', 'type': '{[str]}'}, } - def __init__(self, resource_groups=None, resources=None, meters=None): + def __init__(self, resource_groups=None, resources=None, meters=None, tags=None): super(Filters, self).__init__() self.resource_groups = resource_groups self.resources = resources self.meters = meters + self.tags = tags diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py index d401f3fdc397..c4d0affc442e 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py @@ -60,7 +60,7 @@ class Marketplace(Resource): :vartype pretax_cost: decimal.Decimal :ivar is_estimated: The estimated usage is subject to change. :vartype is_estimated: bool - :ivar meter_id: The meter id. + :ivar meter_id: The meter id (GUID). :vartype meter_id: str :ivar subscription_guid: Subscription guid. :vartype subscription_guid: str diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties.py index b7beea2f8d29..3afa24716983 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties.py @@ -21,7 +21,7 @@ class PriceSheetProperties(Model): :ivar billing_period_id: The id of the billing period resource that the usage belongs to. :vartype billing_period_id: str - :ivar meter_id: The meter id + :ivar meter_id: The meter id (GUID) :vartype meter_id: str :ivar meter_details: The details about the meter. By default this is not populated, unless it's specified in $expand. diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail.py index d7f9dfa3e395..e22ffd2f342d 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail.py @@ -58,7 +58,7 @@ class UsageDetail(Resource): :vartype pretax_cost: decimal.Decimal :ivar is_estimated: The estimated usage is subject to change. :vartype is_estimated: bool - :ivar meter_id: The meter id. + :ivar meter_id: The meter id (GUID). :vartype meter_id: str :ivar meter_details: The details about the meter. By default this is not populated, unless it's specified in $expand. diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py index 0e078e867b22..66e231becb43 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py @@ -22,7 +22,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 2018-01-31. Constant value: "2018-01-31". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-31. Constant value: "2018-03-31". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-31" + self.api_version = "2018-03-31" self.config = config diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/marketplaces_operations.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/marketplaces_operations.py index 094f5311e80d..a1b597f10be8 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/operations/marketplaces_operations.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/marketplaces_operations.py @@ -22,7 +22,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 2018-01-31. Constant value: "2018-01-31". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-31. Constant value: "2018-03-31". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-31" + self.api_version = "2018-03-31" self.config = config diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py index eac3a4c96895..f05f17e1d099 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py @@ -22,7 +22,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 2018-01-31. Constant value: "2018-01-31". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-31. Constant value: "2018-03-31". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-31" + self.api_version = "2018-03-31" self.config = config diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py index 1d68845b73a3..fc3c2d318e15 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py @@ -22,7 +22,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 2018-01-31. Constant value: "2018-01-31". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-31. Constant value: "2018-03-31". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-31" + self.api_version = "2018-03-31" self.config = config diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py index b35304f4f344..3eeae8b36e1a 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py @@ -22,7 +22,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 2018-01-31. Constant value: "2018-01-31". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-31. Constant value: "2018-03-31". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-31" + self.api_version = "2018-03-31" self.config = config diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py index 7423c590b6f6..70b25308e47e 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py @@ -22,7 +22,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 2018-01-31. Constant value: "2018-01-31". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-31. Constant value: "2018-03-31". """ models = models @@ -32,19 +32,16 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-31" + self.api_version = "2018-03-31" self.config = config def list_by_reservation_order( - self, reservation_order_id, grain, filter=None, custom_headers=None, raw=False, **operation_config): + self, reservation_order_id, filter=None, custom_headers=None, raw=False, **operation_config): """Lists the reservations summaries for daily or monthly grain. :param reservation_order_id: Order Id of the reservation :type reservation_order_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 @@ -71,7 +68,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['grain'] = self._serialize.query("grain", grain, 'str') + query_parameters['grain'] = self._serialize.query("self.config.grain", self.config.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') @@ -112,16 +109,13 @@ def internal_paging(next_link=None, raw=False): list_by_reservation_order.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries'} def list_by_reservation_order_and_reservation( - self, reservation_order_id, reservation_id, grain, filter=None, custom_headers=None, raw=False, **operation_config): + self, reservation_order_id, reservation_id, filter=None, custom_headers=None, raw=False, **operation_config): """Lists the reservations summaries for daily or monthly grain. :param reservation_order_id: Order Id of the reservation :type reservation_order_id: str :param reservation_id: Id of the reservation :type reservation_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 @@ -149,7 +143,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['grain'] = self._serialize.query("grain", grain, 'str') + query_parameters['grain'] = self._serialize.query("self.config.grain", self.config.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') diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py index b1d3b4c8cde3..de5ee51b5b77 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py @@ -22,7 +22,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 2018-01-31. Constant value: "2018-01-31". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-31. Constant value: "2018-03-31". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-31" + self.api_version = "2018-03-31" self.config = config diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/version.py b/azure-mgmt-consumption/azure/mgmt/consumption/version.py index a89ae9805392..9c644827672b 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/version.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/version.py @@ -9,4 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.2.0" +