diff --git a/sdk/reservations/arm-reservations/README.md b/sdk/reservations/arm-reservations/README.md index 156ab2e58ad8..55afa77dc5e3 100644 --- a/sdk/reservations/arm-reservations/README.md +++ b/sdk/reservations/arm-reservations/README.md @@ -15,7 +15,7 @@ npm install @azure/arm-reservations ### How to use -#### nodejs - Authentication, client creation and get quota as an example written in TypeScript. +#### nodejs - client creation and getCatalog as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -26,17 +26,16 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0" ##### Sample code -```javascript +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package +```typescript +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); const { AzureReservationAPI } = require("@azure/arm-reservations"); -const { interactiveLogin } = require("@azure/ms-rest-nodeauth"); +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; -interactiveLogin().then((creds) => { - const client = new AzureReservationAPI(creds); +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new AzureReservationAPI(creds, subscriptionId); const subscriptionId = "testsubscriptionId"; - const providerId = "testproviderId"; - const location = "westus"; - const resourceName = "testresourceName"; - client.quota.get(subscriptionId, providerId, location, resourceName).then((result) => { + client.getCatalog(subscriptionId).then((result) => { console.log("The result is:"); console.log(result); }); @@ -45,7 +44,7 @@ interactiveLogin().then((creds) => { }); ``` -#### browser - Authentication, client creation and get quota as an example written in JavaScript. +#### browser - Authentication, client creation and getCatalog as an example written in JavaScript. ##### Install @azure/ms-rest-browserauth @@ -68,6 +67,7 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to