Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

[AutoPR] consumption/resource-manager #4836

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion lib/services/consumptionManagement/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Microsoft
Copyright (c) 2019 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
40 changes: 22 additions & 18 deletions lib/services/consumptionManagement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,47 @@ uid: azure-arm-consumption
summary: *content

---
# Microsoft Azure SDK for Node.js - ConsumptionManagementClient
**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://github.com/Azure/azure-sdk-for-js) which works on Node.js and browsers.**
## Microsoft Azure SDK for Node.js - ConsumptionManagementClient

This project provides a Node.js package for accessing Azure. Right now it supports:
- **Node.js version 6.x.x or higher**

## Features
### Features


## How to Install
### How to Install

```bash
npm install azure-arm-consumption
```

## How to use
### How to use

### Authentication, client creation and list usageDetails as an example.
#### Authentication, client creation, and list usageDetails as an example.

```javascript
const msRestAzure = require("ms-rest-azure");
const ConsumptionManagementClient = require("azure-arm-consumption");
msRestAzure.interactiveLogin().then((creds) => {
const subscriptionId = "<Subscription_Id>";
const client = new ConsumptionManagementClient(creds, subscriptionId);
const expand = "testexpand";
const filter = "testfilter";
const skiptoken = "testskiptoken";
const top = 1;
const apply = "testapply";
return client.usageDetails.list(expand, filter, skiptoken, top, apply).then((result) => {
console.log("The result is:");
console.log(result);
});
const subscriptionId = "<Subscription_Id>";
const client = new ConsumptionManagementClient(creds, subscriptionId);
const scope = "testscope";
const expand = "testexpand";
const filter = "testfilter";
const skiptoken = "testskiptoken";
const top = 1;
const apply = "testapply";

return client.usageDetails.list(scope, expand, filter, skiptoken, top, apply).then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.log('An error occurred:');
console.dir(err, {depth: null, colors: true});
});

## Related projects
```
### Related projects

- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node)
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ export default class ConsumptionManagementClient extends AzureServiceClient {
// Operation groups
usageDetails: operations.UsageDetails;
marketplaces: operations.Marketplaces;
budgets: operations.Budgets;
tags: operations.Tags;
charges: operations.Charges;
balances: operations.Balances;
reservationsSummaries: operations.ReservationsSummaries;
reservationsDetails: operations.ReservationsDetails;
reservationRecommendations: operations.ReservationRecommendations;
budgets: operations.Budgets;
priceSheet: operations.PriceSheet;
tags: operations.Tags;
forecasts: operations.Forecasts;
operations: operations.Operations;
aggregatedCost: operations.AggregatedCost;
charges: operations.Charges;
}

export { ConsumptionManagementClient, models as ConsumptionManagementModels };
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ConsumptionManagementClient extends ServiceClient {

super(credentials, options);

this.apiVersion = '2018-10-01';
this.apiVersion = '2019-01-01';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.generateClientRequestId = true;
Expand All @@ -74,17 +74,17 @@ class ConsumptionManagementClient extends ServiceClient {
}
this.usageDetails = new operations.UsageDetails(this);
this.marketplaces = new operations.Marketplaces(this);
this.budgets = new operations.Budgets(this);
this.tags = new operations.Tags(this);
this.charges = new operations.Charges(this);
this.balances = new operations.Balances(this);
this.reservationsSummaries = new operations.ReservationsSummaries(this);
this.reservationsDetails = new operations.ReservationsDetails(this);
this.reservationRecommendations = new operations.ReservationRecommendations(this);
this.budgets = new operations.Budgets(this);
this.priceSheet = new operations.PriceSheet(this);
this.tags = new operations.Tags(this);
this.forecasts = new operations.Forecasts(this);
this.operations = new operations.Operations(this);
this.aggregatedCost = new operations.AggregatedCost(this);
this.charges = new operations.Charges(this);
this.models = models;
msRest.addSerializationMixin(this);
}
Expand Down
41 changes: 21 additions & 20 deletions lib/services/consumptionManagement/lib/models/balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,28 @@ const models = require('./index');
class Balance extends models['Resource'] {
/**
* Create a Balance.
* @member {string} [currency] The ISO currency in which the meter is
* @property {string} [currency] The ISO currency in which the meter is
* charged, for example, USD.
* @member {number} [beginningBalance] The beginning balance for the billing
* period.
* @member {number} [endingBalance] The ending balance for the billing period
* (for open periods this will be updated daily).
* @member {number} [newPurchases] Total new purchase amount.
* @member {number} [adjustments] Total adjustment amount.
* @member {number} [utilized] Total Commitment usage.
* @member {number} [serviceOverage] Overage for Azure services.
* @member {number} [chargesBilledSeparately] Charges Billed separately.
* @member {number} [totalOverage] serviceOverage + chargesBilledSeparately.
* @member {number} [totalUsage] Azure service commitment + total Overage.
* @member {number} [azureMarketplaceServiceCharges] Total charges for Azure
* Marketplace.
* @member {string} [billingFrequency] The billing frequency. Possible values
* include: 'Month', 'Quarter', 'Year'
* @member {boolean} [priceHidden] Price is hidden or not.
* @member {array} [newPurchasesDetails] List of new purchases.
* @member {array} [adjustmentDetails] List of Adjustments (Promo credit, SIE
* credit etc.).
* @property {number} [beginningBalance] The beginning balance for the
* billing period.
* @property {number} [endingBalance] The ending balance for the billing
* period (for open periods this will be updated daily).
* @property {number} [newPurchases] Total new purchase amount.
* @property {number} [adjustments] Total adjustment amount.
* @property {number} [utilized] Total Commitment usage.
* @property {number} [serviceOverage] Overage for Azure services.
* @property {number} [chargesBilledSeparately] Charges Billed separately.
* @property {number} [totalOverage] serviceOverage +
* chargesBilledSeparately.
* @property {number} [totalUsage] Azure service commitment + total Overage.
* @property {number} [azureMarketplaceServiceCharges] Total charges for
* Azure Marketplace.
* @property {string} [billingFrequency] The billing frequency. Possible
* values include: 'Month', 'Quarter', 'Year'
* @property {boolean} [priceHidden] Price is hidden or not.
* @property {array} [newPurchasesDetails] List of new purchases.
* @property {array} [adjustmentDetails] List of Adjustments (Promo credit,
* SIE credit etc.).
*/
constructor() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
class BalancePropertiesAdjustmentDetailsItem {
/**
* Create a BalancePropertiesAdjustmentDetailsItem.
* @member {string} [name] the name of new adjustment.
* @member {number} [value] the value of new adjustment.
* @property {string} [name] the name of new adjustment.
* @property {number} [value] the value of new adjustment.
*/
constructor() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
class BalancePropertiesNewPurchasesDetailsItem {
/**
* Create a BalancePropertiesNewPurchasesDetailsItem.
* @member {string} [name] the name of new purchase.
* @member {number} [value] the value of new purchase.
* @property {string} [name] the name of new purchase.
* @property {number} [value] the value of new purchase.
*/
constructor() {
}
Expand Down
35 changes: 18 additions & 17 deletions lib/services/consumptionManagement/lib/models/budget.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,37 @@ const models = require('./index');
class Budget extends models['ProxyResource'] {
/**
* Create a Budget.
* @member {string} category The category of the budget, whether the budget
* @property {string} category The category of the budget, whether the budget
* tracks cost or usage. Possible values include: 'Cost', 'Usage'
* @member {number} amount The total amount of cost to track with the budget
* @member {string} timeGrain The time covered by a budget. Tracking of the
* @property {number} amount The total amount of cost to track with the
* budget
* @property {string} timeGrain The time covered by a budget. Tracking of the
* amount will be reset based on the time grain. Possible values include:
* 'Monthly', 'Quarterly', 'Annually'
* @member {object} timePeriod Has start and end date of the budget. The
* @property {object} timePeriod Has start and end date of the budget. The
* start date must be first of the month and should be less than the end
* date. Budget start date must be on or after June 1, 2017. Future start
* date should not be more than three months. Past start date should be
* selected within the timegrain preiod. There are no restrictions on the end
* selected within the timegrain period. There are no restrictions on the end
* date.
* @member {date} [timePeriod.startDate] The start date for the budget.
* @member {date} [timePeriod.endDate] The end date for the budget. If not
* @property {date} [timePeriod.startDate] The start date for the budget.
* @property {date} [timePeriod.endDate] The end date for the budget. If not
* provided, we default this to 10 years from the start date.
* @member {object} [filters] May be used to filter budgets by resource
* @property {object} [filters] May be used to filter budgets by resource
* group, resource, or meter.
* @member {array} [filters.resourceGroups] The list of filters on resource
* @property {array} [filters.resourceGroups] The list of filters on resource
* groups, allowed at subscription level only.
* @member {array} [filters.resources] The list of filters on resources.
* @member {array} [filters.meters] The list of filters on meters (GUID),
* @property {array} [filters.resources] The list of filters on resources.
* @property {array} [filters.meters] The list of filters on meters (GUID),
* mandatory for budgets of usage category.
* @member {object} [filters.tags] The dictionary of filters on tags.
* @member {object} [currentSpend] The current amount of cost which is being
* tracked for a budget.
* @member {number} [currentSpend.amount] The total amount of cost which is
* @property {object} [filters.tags] The dictionary of filters on tags.
* @property {object} [currentSpend] The current amount of cost which is
* being tracked for a budget.
* @property {number} [currentSpend.amount] The total amount of cost which is
* being tracked by the budget.
* @member {string} [currentSpend.unit] The unit of measure for the budget
* @property {string} [currentSpend.unit] The unit of measure for the budget
* amount.
* @member {object} [notifications] Dictionary of notifications associated
* @property {object} [notifications] Dictionary of notifications associated
* with the budget. Budget can have up to five notifications.
*/
constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
class BudgetTimePeriod {
/**
* Create a BudgetTimePeriod.
* @member {date} startDate The start date for the budget.
* @member {date} [endDate] The end date for the budget. If not provided, we
* default this to 10 years from the start date.
* @property {date} startDate The start date for the budget.
* @property {date} [endDate] The end date for the budget. If not provided,
* we default this to 10 years from the start date.
*/
constructor() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class BudgetsListResult extends Array {
/**
* Create a BudgetsListResult.
* @member {string} [nextLink] The link (url) to the next page of results.
* @property {string} [nextLink] The link (url) to the next page of results.
*/
constructor() {
super();
Expand Down
14 changes: 7 additions & 7 deletions lib/services/consumptionManagement/lib/models/chargeSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ const models = require('./index');
class ChargeSummary extends models['Resource'] {
/**
* Create a ChargeSummary.
* @member {string} [billingPeriodId] The id of the billing period resource
* @property {string} [billingPeriodId] The id of the billing period resource
* that the charge belongs to.
* @member {string} [usageStart] Usage start date.
* @member {string} [usageEnd] Usage end date.
* @member {number} [azureCharges] Azure Charges.
* @member {number} [chargesBilledSeparately] Charges Billed separately.
* @member {number} [marketplaceCharges] Marketplace Charges.
* @member {string} [currency] Currency Code
* @property {string} [usageStart] Usage start date.
* @property {string} [usageEnd] Usage end date.
* @property {number} [azureCharges] Azure Charges.
* @property {number} [chargesBilledSeparately] Charges Billed separately.
* @property {number} [marketplaceCharges] Marketplace Charges.
* @property {string} [currency] Currency Code
*/
constructor() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class ChargesListResult {
/**
* Create a ChargesListResult.
* @member {array} [value] The list of charge summary
* @property {array} [value] The list of charge summary
*/
constructor() {
}
Expand Down
6 changes: 3 additions & 3 deletions lib/services/consumptionManagement/lib/models/currentSpend.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
class CurrentSpend {
/**
* Create a CurrentSpend.
* @member {number} [amount] The total amount of cost which is being tracked
* by the budget.
* @member {string} [unit] The unit of measure for the budget amount.
* @property {number} [amount] The total amount of cost which is being
* tracked by the budget.
* @property {string} [unit] The unit of measure for the budget amount.
*/
constructor() {
}
Expand Down
4 changes: 2 additions & 2 deletions lib/services/consumptionManagement/lib/models/errorDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
class ErrorDetails {
/**
* Create a ErrorDetails.
* @member {string} [code] Error code.
* @member {string} [message] Error message indicating why the operation
* @property {string} [code] Error code.
* @property {string} [message] Error message indicating why the operation
* failed.
*/
constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
class ErrorResponse {
/**
* Create a ErrorResponse.
* @member {object} [error] The details of the error.
* @member {string} [error.code] Error code.
* @member {string} [error.message] Error message indicating why the
* @property {object} [error] The details of the error.
* @property {string} [error.code] Error code.
* @property {string} [error.message] Error message indicating why the
* operation failed.
*/
constructor() {
Expand Down
8 changes: 4 additions & 4 deletions lib/services/consumptionManagement/lib/models/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
class Filters {
/**
* Create a Filters.
* @member {array} [resourceGroups] The list of filters on resource groups,
* @property {array} [resourceGroups] The list of filters on resource groups,
* allowed at subscription level only.
* @member {array} [resources] The list of filters on resources.
* @member {array} [meters] The list of filters on meters (GUID), mandatory
* @property {array} [resources] The list of filters on resources.
* @property {array} [meters] The list of filters on meters (GUID), mandatory
* for budgets of usage category.
* @member {object} [tags] The dictionary of filters on tags.
* @property {object} [tags] The dictionary of filters on tags.
*/
constructor() {
}
Expand Down
12 changes: 6 additions & 6 deletions lib/services/consumptionManagement/lib/models/forecast.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ const models = require('./index');
class Forecast extends models['Resource'] {
/**
* Create a Forecast.
* @member {string} [usageDate] The usage date of the forecast.
* @member {string} [grain] The granularity of forecast. Possible values
* @property {string} [usageDate] The usage date of the forecast.
* @property {string} [grain] The granularity of forecast. Possible values
* include: 'Daily', 'Monthly', 'Yearly'
* @member {number} [charge] The amount of charge
* @member {string} [currency] The ISO currency in which the meter is
* @property {number} [charge] The amount of charge
* @property {string} [currency] The ISO currency in which the meter is
* charged, for example, USD.
* @member {string} [chargeType] The type of the charge. Could be actual or
* @property {string} [chargeType] The type of the charge. Could be actual or
* forecast. Possible values include: 'Actual', 'Forecast'
* @member {array} [confidenceLevels] The details about the forecast
* @property {array} [confidenceLevels] The details about the forecast
* confidence levels. This is populated only when chargeType is Forecast.
*/
constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
class ForecastPropertiesConfidenceLevelsItem {
/**
* Create a ForecastPropertiesConfidenceLevelsItem.
* @member {number} [percentage] The percentage level of the confidence
* @member {string} [bound] The boundary of the percentage, values could be
* @property {number} [percentage] The percentage level of the confidence
* @property {string} [bound] The boundary of the percentage, values could be
* 'Upper' or 'Lower'. Possible values include: 'Upper', 'Lower'
* @member {number} [value] The amount of forecast within the percentage
* @property {number} [value] The amount of forecast within the percentage
* level
*/
constructor() {
Expand Down
Loading