Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.
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/reservationsManagement/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
38 changes: 19 additions & 19 deletions lib/services/reservationsManagement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,44 @@ uid: azure-arm-reservations
summary: *content

---
# Microsoft Azure SDK for Node.js - AzureReservationAPI
**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 - AzureReservationAPI

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-reservations
```

## How to use
### How to use

### Authentication, client creation and getCatalog as an example.
#### Authentication, client creation, and getCatalog as an example.

```javascript
const msRestAzure = require("ms-rest-azure");
const AzureReservationAPI = require("azure-arm-reservations");
msRestAzure.interactiveLogin().then((creds) => {
const subscriptionId = "<Subscription_Id>";
const client = new AzureReservationAPI(creds, subscriptionId);
const subscriptionId = "testsubscriptionId";
const reservedResourceType = "testreservedResourceType";
const location = "westus";
return client.getCatalog(subscriptionId, reservedResourceType, location).then((result) => {
console.log("The result is:");
console.log(result);
});
const subscriptionId = "<Subscription_Id>";
const client = new AzureReservationAPI(creds, subscriptionId);
const subscriptionId = "testsubscriptionId";
const reservedResourceType = "testreservedResourceType";
const location = "westus";

return client.getCatalog(subscriptionId, reservedResourceType, location).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)


![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-node%2Flib%2Fservices%2FreservationsManagement%2FREADME.png)
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ class AzureReservationAPI extends ServiceClient {

super(credentials, options);

this.apiVersion = '2018-06-01';
this.apiVersion = '2019-04-01';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.generateClientRequestId = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
class AppliedReservationList {
/**
* Create a AppliedReservationList.
* @member {array} [value]
* @member {string} [nextLink] Url to get the next page of reservations
* @property {array} [value]
* @property {string} [nextLink] Url to get the next page of reservations
*/
constructor() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
class AppliedReservations {
/**
* Create a AppliedReservations.
* @member {string} [id] Identifier of the applied reservations
* @member {string} [name] Name of resource
* @member {string} [type] Type of resource.
* @property {string} [id] Identifier of the applied reservations
* @property {string} [name] Name of resource
* @property {string} [type] Type of resource.
* "Microsoft.Capacity/AppliedReservations"
* @member {object} [reservationOrderIds]
* @member {array} [reservationOrderIds.value]
* @member {string} [reservationOrderIds.nextLink] Url to get the next page
* @property {object} [reservationOrderIds]
* @property {array} [reservationOrderIds.value]
* @property {string} [reservationOrderIds.nextLink] Url to get the next page
* of reservations
*/
constructor() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

/**
* Class representing a CalculatePriceResponse.
*/
class CalculatePriceResponse {
/**
* Create a CalculatePriceResponse.
* @property {object} [properties]
* @property {object} [properties.billingCurrencyTotal]
* @property {string} [properties.billingCurrencyTotal.currencyCode]
* @property {number} [properties.billingCurrencyTotal.estimatedTotal]
* @property {boolean} [properties.isTaxIncluded]
* @property {object} [properties.purchaseRequest]
* @property {object} [properties.purchaseRequest.sku]
* @property {string} [properties.purchaseRequest.sku.name]
* @property {string} [properties.purchaseRequest.location] The Azure Region
* where the reserved resource lives.
* @property {string} [properties.purchaseRequest.reservedResourceType]
* Possible values include: 'VirtualMachines', 'SqlDatabases', 'SuseLinux',
* 'CosmosDb', 'RedHat'
* @property {string} [properties.purchaseRequest.billingScopeId]
* @property {string} [properties.purchaseRequest.term] Possible values
* include: 'P1Y', 'P3Y'
* @property {number} [properties.purchaseRequest.quantity]
* @property {string} [properties.purchaseRequest.displayName] Friendly name
* of the Reservation
* @property {string} [properties.purchaseRequest.appliedScopeType] Possible
* values include: 'Single', 'Shared'
* @property {array} [properties.purchaseRequest.appliedScopes]
* @property {string} [properties.purchaseRequest.instanceFlexibility]
* Possible values include: 'true', 'false', 'NotSupported'
* @property {boolean} [properties.isBillingPartnerManaged]
* @property {string} [properties.reservationOrderId]
* @property {string} [properties.skuTitle]
* @property {string} [properties.skuDescription]
* @property {object} [properties.pricingCurrencyTotal]
* @property {string} [properties.pricingCurrencyTotal.currencyCode]
* @property {number} [properties.pricingCurrencyTotal.estimatedTotal]
*/
constructor() {
}

/**
* Defines the metadata of CalculatePriceResponse
*
* @returns {object} metadata of CalculatePriceResponse
*
*/
mapper() {
return {
required: false,
serializedName: 'CalculatePriceResponse',
type: {
name: 'Composite',
className: 'CalculatePriceResponse',
modelProperties: {
properties: {
required: false,
serializedName: 'properties',
type: {
name: 'Composite',
className: 'CalculateResponseProperties'
}
}
}
}
};
}
}

module.exports = CalculatePriceResponse;
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

/**
* Class representing a CalculateResponseProperties.
*/
class CalculateResponseProperties {
/**
* Create a CalculateResponseProperties.
* @property {object} [billingCurrencyTotal]
* @property {string} [billingCurrencyTotal.currencyCode]
* @property {number} [billingCurrencyTotal.estimatedTotal]
* @property {boolean} [isTaxIncluded]
* @property {object} [purchaseRequest]
* @property {object} [purchaseRequest.sku]
* @property {string} [purchaseRequest.sku.name]
* @property {string} [purchaseRequest.location] The Azure Region where the
* reserved resource lives.
* @property {string} [purchaseRequest.reservedResourceType] Possible values
* include: 'VirtualMachines', 'SqlDatabases', 'SuseLinux', 'CosmosDb',
* 'RedHat'
* @property {string} [purchaseRequest.billingScopeId]
* @property {string} [purchaseRequest.term] Possible values include: 'P1Y',
* 'P3Y'
* @property {number} [purchaseRequest.quantity]
* @property {string} [purchaseRequest.displayName] Friendly name of the
* Reservation
* @property {string} [purchaseRequest.appliedScopeType] Possible values
* include: 'Single', 'Shared'
* @property {array} [purchaseRequest.appliedScopes]
* @property {string} [purchaseRequest.instanceFlexibility] Possible values
* include: 'true', 'false', 'NotSupported'
* @property {boolean} [isBillingPartnerManaged]
* @property {string} [reservationOrderId]
* @property {string} [skuTitle]
* @property {string} [skuDescription]
* @property {object} [pricingCurrencyTotal]
* @property {string} [pricingCurrencyTotal.currencyCode]
* @property {number} [pricingCurrencyTotal.estimatedTotal]
*/
constructor() {
}

/**
* Defines the metadata of CalculateResponseProperties
*
* @returns {object} metadata of CalculateResponseProperties
*
*/
mapper() {
return {
required: false,
serializedName: 'CalculateResponseProperties',
type: {
name: 'Composite',
className: 'CalculateResponseProperties',
modelProperties: {
billingCurrencyTotal: {
required: false,
serializedName: 'billingCurrencyTotal',
type: {
name: 'Composite',
className: 'CalculateResponsePropertiesBillingCurrencyTotal'
}
},
isTaxIncluded: {
required: false,
serializedName: 'isTaxIncluded',
type: {
name: 'Boolean'
}
},
purchaseRequest: {
required: false,
serializedName: 'purchaseRequest',
type: {
name: 'Composite',
className: 'PurchaseRequest'
}
},
isBillingPartnerManaged: {
required: false,
serializedName: 'isBillingPartnerManaged',
type: {
name: 'Boolean'
}
},
reservationOrderId: {
required: false,
serializedName: 'reservationOrderId',
type: {
name: 'String'
}
},
skuTitle: {
required: false,
serializedName: 'skuTitle',
type: {
name: 'String'
}
},
skuDescription: {
required: false,
serializedName: 'skuDescription',
type: {
name: 'String'
}
},
pricingCurrencyTotal: {
required: false,
serializedName: 'pricingCurrencyTotal',
type: {
name: 'Composite',
className: 'CalculateResponsePropertiesPricingCurrencyTotal'
}
}
}
}
};
}
}

module.exports = CalculateResponseProperties;
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

/**
* Class representing a CalculateResponsePropertiesBillingCurrencyTotal.
*/
class CalculateResponsePropertiesBillingCurrencyTotal {
/**
* Create a CalculateResponsePropertiesBillingCurrencyTotal.
* @property {string} [currencyCode]
* @property {number} [estimatedTotal]
*/
constructor() {
}

/**
* Defines the metadata of CalculateResponsePropertiesBillingCurrencyTotal
*
* @returns {object} metadata of CalculateResponsePropertiesBillingCurrencyTotal
*
*/
mapper() {
return {
required: false,
serializedName: 'CalculateResponseProperties_billingCurrencyTotal',
type: {
name: 'Composite',
className: 'CalculateResponsePropertiesBillingCurrencyTotal',
modelProperties: {
currencyCode: {
required: false,
serializedName: 'currencyCode',
type: {
name: 'String'
}
},
estimatedTotal: {
required: false,
serializedName: 'estimatedTotal',
type: {
name: 'Number'
}
}
}
}
};
}
}

module.exports = CalculateResponsePropertiesBillingCurrencyTotal;
Loading