@@ -15,7 +15,7 @@ npm install @azure/arm-monitor
1515
1616### How to use
1717
18- #### nodejs - Authentication, client creation and listByResourceGroup autoscaleSettings as an example written in TypeScript.
18+ #### nodejs - client creation and get activityLogAlertRule as an example written in TypeScript.
1919
2020##### Install @azure/ms-rest-nodeauth
2121
@@ -26,17 +26,17 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0"
2626
2727##### Sample code
2828
29+ 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
2930``` typescript
30- import * as msRest from " @azure/ms-rest-js" ;
31- import * as msRestAzure from " @azure/ms-rest-azure-js" ;
32- import * as msRestNodeAuth from " @azure/ms-rest-nodeauth" ;
33- import { MonitorManagementClient , MonitorManagementModels , MonitorManagementMappers } from " @azure/arm-monitor" ;
31+ const msRestNodeAuth = require (" @azure/ms-rest-nodeauth" );
32+ const { MonitorManagementClient } = require (" @azure/arm-monitor" );
3433const subscriptionId = process .env [" AZURE_SUBSCRIPTION_ID" ];
3534
3635msRestNodeAuth .interactiveLogin ().then ((creds ) => {
3736 const client = new MonitorManagementClient (creds , subscriptionId );
3837 const resourceGroupName = " testresourceGroupName" ;
39- client .autoscaleSettings .listByResourceGroup (resourceGroupName ).then ((result ) => {
38+ const alertRuleName = " testalertRuleName" ;
39+ client .activityLogAlertRule .get (resourceGroupName , alertRuleName ).then ((result ) => {
4040 console .log (" The result is:" );
4141 console .log (result );
4242 });
@@ -45,7 +45,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => {
4545});
4646```
4747
48- #### browser - Authentication, client creation and listByResourceGroup autoscaleSettings as an example written in JavaScript.
48+ #### browser - Authentication, client creation and get activityLogAlertRule as an example written in JavaScript.
4949
5050##### Install @azure/ms-rest-browserauth
5151
@@ -80,7 +80,8 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
8080 }
8181 const client = new Azure.ArmMonitor.MonitorManagementClient (res .creds , subscriptionId);
8282 const resourceGroupName = " testresourceGroupName" ;
83- client .autoscaleSettings .listByResourceGroup (resourceGroupName).then ((result ) => {
83+ const alertRuleName = " testalertRuleName" ;
84+ client .activityLogAlertRule .get (resourceGroupName, alertRuleName).then ((result ) => {
8485 console .log (" The result is:" );
8586 console .log (result);
8687 }).catch ((err ) => {
@@ -98,4 +99,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
9899
99100- [ Microsoft Azure SDK for Javascript] ( https://github.com/Azure/azure-sdk-for-js )
100101
101- ![ Impressions] ( https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmonitor%2Farm -monitor%2FREADME .png )
102+ ![ Impressions] ( https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/monitor/arm -monitor/README .png )
0 commit comments