Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,21 @@ class ConsumptionManagementClientConfiguration(AzureConfiguration):
object<msrestazure.azure_active_directory>`
: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'

Expand All @@ -53,6 +58,7 @@ def __init__(

self.credentials = credentials
self.subscription_id = subscription_id
self.grain = grain


class ConsumptionManagementClient(object):
Expand Down Expand Up @@ -81,17 +87,20 @@ class ConsumptionManagementClient(object):
object<msrestazure.azure_active_directory>`
: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)

Expand Down
10 changes: 7 additions & 3 deletions azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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')
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
3 changes: 2 additions & 1 deletion azure-mgmt-consumption/azure/mgmt/consumption/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "2.0.0"
VERSION = "1.2.0"