examples/node/helloworld/firedalerts_async.js
function(firedAlertGroups, done) {
                // Get the list of all fired alert groups, including the all group (represented by "-").
                var groups = firedAlertGroups.list();

                console.log("Fired alert groups:");
                Async.seriesEach(
                    groups,
                    function(firedAlertGroup, index, seriescallback) {
                        firedAlertGroup.list(function(err, firedAlerts){
                            // How many times was this alert fired?
                            console.log(firedAlertGroup.name, "(Count:", firedAlertGroup.count(), ")");
                            // Print the properties for each fired alert (default of 30 per alert group).
                            for(var i = 0; i < firedAlerts.length; i++) {
                                var firedAlert = firedAlerts[i];
                                for (var key in firedAlert.properties()) {
                                    if (firedAlert.properties().hasOwnProperty(key)) {
                                        console.log("\t", key, ":", firedAlert.properties()[key]);
                                    }
                                }
                                console.log();
                            }
                            console.log("======================================");
                        });
                        seriescallback();
                    },
                    function(err) {
                        if (err) {
                            done(err);
                        }
                        done();
                    }
                );
            }
function(firedAlertGroups, done) {
                // Get the list of all fired alert groups, including the all group (represented by "-").
                var groups = firedAlertGroups.list();

                console.log("Fired alert groups:");
                Async.seriesEach(
                    groups,
                    function(firedAlertGroup, index, seriescallback) {
                        firedAlertGroup.list(function(err, firedAlerts){
                            // How many times was this alert fired?
                            console.log(firedAlertGroup.name, "(Count:", firedAlertGroup.count(), ")");
                            // Print the properties for each fired alert (default of 30 per alert group).
                            for(var i = 0; i < firedAlerts.length; i++) {
                                var firedAlert = firedAlerts[i];
                                for (var key in firedAlert.properties()) {
                                    if (firedAlert.properties().hasOwnProperty(key)) {
                                        console.log("\t", key, ":", firedAlert.properties()[key]);
                                    }
                                }
                                console.log();
                            }
                            console.log("======================================");
                        });
                        seriescallback();
                    },
                    function(err) {
                        if (err) {
                            done(err);
                        }
                        done();
                    }
                );
            }
function ( firedAlertGroups , done ) { // Get the list of all fired alert groups, including the all group (represented by "-"). var groups = firedAlertGroups . list ( ) ; console . log ( "Fired alert groups:" ) ; Async . seriesEach ( groups , function ( firedAlertGroup , index , seriescallback ) { firedAlertGroup . list ( function ( err , firedAlerts ) { // How many times was this alert fired? console . log ( firedAlertGroup . name , "(Count:" , firedAlertGroup . count ( ) , ")" ) ; // Print the properties for each fired alert (default of 30 per alert group). for ( var i = 0 ; i < firedAlerts . length ; i ++ ) { var firedAlert = firedAlerts [ i ] ; for ( var key in firedAlert . properties ( ) ) { if ( firedAlert . properties ( ) . hasOwnProperty ( key ) ) { console . log ( "\t" , key , ":" , firedAlert . properties ( ) [ key ] ) ; } } console . log ( ) ; } console . log ( "======================================" ) ; } ) ; seriescallback ( ) ; } , function ( err ) { if ( err ) { done ( err ) ; } done ( ) ; } ) ; }
Print them out.
Print them out .