@@ -307,15 +307,6 @@ function getJSONForTable(call, sessionDataVar) {
307
307
} ) ;
308
308
}
309
309
310
- /**
311
- * Wraps the getJSONForTable function to call the new server
312
- * TODO: Remove this function once the new server is fully integrated
313
- */
314
- function getJSONfromNewServer ( call , sessionDataVar ) {
315
- const url = 'http://localhost:43331' + call ;
316
- return getJSONForTable ( url , sessionDataVar ) ;
317
- }
318
-
319
310
/**
320
311
* Performs POST call and builds console logging message if successful
321
312
* @param {string } call REST url called
@@ -471,181 +462,231 @@ function clearAllTableCells(tableId) {
471
462
472
463
// NEW REST CALLS
473
464
465
+ const REST_V2_PREFIX = '/rest-v2' ;
466
+
467
+ /**
468
+ * REST GET call for /problems,
469
+ * stores it on a sessionStorage variable
470
+ */
471
+ function getProblems ( ) {
472
+ return getJSONForTable ( REST_V2_PREFIX + '/problems' , 'problems' ) ;
473
+ }
474
+
475
+ /**
476
+ * REST GET call for /lastUpdate,
477
+ * stores it on a sessionStorage variable
478
+ */
479
+ function getLastUpdate ( ) {
480
+ return getJSONForTable ( REST_V2_PREFIX + '/lastUpdate' , 'lastUpdate' ) ;
481
+ }
482
+
483
+ /**
484
+ * REST GET call for /tservers/summary/{group},
485
+ * stores it on a sessionStorage variable
486
+ * @param {string } group Group name
487
+ */
488
+ function getTserversSummary ( group ) {
489
+ const url = `${ REST_V2_PREFIX } /tservers/summary/${ group } ` ;
490
+ const sessionDataVar = `tserversSummary_${ group } ` ;
491
+ return getJSONForTable ( url , sessionDataVar ) ;
492
+ }
493
+
494
+ /**
495
+ * REST GET call for /suggestions,
496
+ * stores it on a sessionStorage variable
497
+ */
498
+ function getSuggestions ( ) {
499
+ return getJSONForTable ( REST_V2_PREFIX + '/suggestions' , 'suggestions' ) ;
500
+ }
501
+
502
+ /**
503
+ * REST GET call for /compactors/detail/{group},
504
+ * stores it on a sessionStorage variable
505
+ * @param {string } group Group name
506
+ */
507
+ function getCompactorsDetail ( group ) {
508
+ const url = `${ REST_V2_PREFIX } /compactors/detail/${ group } ` ;
509
+ const sessionDataVar = `compactorsDetail_${ group } ` ;
510
+ return getJSONForTable ( url , sessionDataVar ) ;
511
+ }
512
+
474
513
/**
475
514
* REST GET call for /stats,
476
515
* stores it on a sessionStorage variable
477
516
*/
478
517
function getStats ( ) {
479
- return getJSONfromNewServer ( '/stats' , 'stats' ) ;
518
+ return getJSONForTable ( REST_V2_PREFIX + '/stats' , 'stats' ) ;
480
519
}
481
520
482
521
/**
483
- * REST GET call for /metrics ,
522
+ * REST GET call for /compactors/summary/{group} ,
484
523
* stores it on a sessionStorage variable
524
+ * @param {string } group Group name
485
525
*/
486
- function getMetrics ( ) {
487
- return getJSONfromNewServer ( '/metrics' , 'metrics' ) ;
526
+ function getCompactorsSummary ( group ) {
527
+ const url = `${ REST_V2_PREFIX } /compactors/summary/${ group } ` ;
528
+ const sessionDataVar = `compactorsSummary_${ group } ` ;
529
+ return getJSONForTable ( url , sessionDataVar ) ;
488
530
}
489
531
490
532
/**
491
- * REST GET call for /metrics/lastUpdate ,
533
+ * REST GET call for /sservers/summary ,
492
534
* stores it on a sessionStorage variable
493
535
*/
494
- function getMetricsLastUpdate ( ) {
495
- return getJSONfromNewServer ( '/metrics/lastUpdate ', 'metricsLastUpdate ' ) ;
536
+ function getSserversSummary ( ) {
537
+ return getJSONForTable ( REST_V2_PREFIX + '/sservers/summary ', 'sserversSummary ' ) ;
496
538
}
497
539
498
540
/**
499
- * REST GET call for /metrics/instance ,
541
+ * REST GET call for /tables/{name}/tablets ,
500
542
* stores it on a sessionStorage variable
543
+ * @param {string } name Table name
501
544
*/
502
- function getMetricsInstance ( ) {
503
- return getJSONfromNewServer ( '/metrics/instance' , 'metricsInstance' ) ;
545
+ function getTableTablets ( name ) {
546
+ const url = `${ REST_V2_PREFIX } /tables/${ name } /tablets` ;
547
+ const sessionDataVar = `tableTablets_${ name } ` ;
548
+ return getJSONForTable ( url , sessionDataVar ) ;
504
549
}
505
550
506
551
/**
507
- * REST GET call for /metrics/groups ,
552
+ * REST GET call for /metrics,
508
553
* stores it on a sessionStorage variable
509
554
*/
510
- function getMetricsGroups ( ) {
511
- return getJSONfromNewServer ( '/metrics/groups ' , 'metricsGroups ' ) ;
555
+ function getMetrics ( ) {
556
+ return getJSONForTable ( REST_V2_PREFIX + '/metrics' , 'metrics ' ) ;
512
557
}
513
558
514
559
/**
515
- * REST GET call for /metrics/manager ,
560
+ * REST GET call for /gc ,
516
561
* stores it on a sessionStorage variable
517
562
*/
518
- function getMetricsManager ( ) {
519
- return getJSONfromNewServer ( '/metrics/manager ', 'metricsManager ' ) ;
563
+ function getGc ( ) {
564
+ return getJSONForTable ( REST_V2_PREFIX + '/gc ', 'gc ' ) ;
520
565
}
521
566
522
567
/**
523
- * REST GET call for /metrics/gc ,
568
+ * REST GET call for /tservers/detail/{group} ,
524
569
* stores it on a sessionStorage variable
570
+ * @param {string } group Group name
525
571
*/
526
- function getMetricsGc ( ) {
527
- return getJSONfromNewServer ( '/metrics/gc' , 'metricsGc' ) ;
572
+ function getTserversDetail ( group ) {
573
+ const url = `${ REST_V2_PREFIX } /tservers/detail/${ group } ` ;
574
+ const sessionDataVar = `tserversDetail_${ group } ` ;
575
+ return getJSONForTable ( url , sessionDataVar ) ;
528
576
}
529
577
530
578
/**
531
- * REST GET call for /metrics/compactors/summary and /metrics/compactors/summary/{group} ,
579
+ * REST GET call for /tables ,
532
580
* stores it on a sessionStorage variable
533
- * @param {string } [group] Optional group name
534
581
*/
535
- function getMetricsCompactorsSummary ( group ) {
536
- const url = group ? `/metrics/compactors/summary/${ group } ` : '/metrics/compactors/summary' ;
537
- const sessionDataVar = group ? `metricsCompactorsSummary_${ group } ` : 'metricsCompactorsSummary' ;
538
- return getJSONfromNewServer ( url , sessionDataVar ) ;
582
+ function getTables ( ) {
583
+ return getJSONForTable ( REST_V2_PREFIX + '/tables' , 'tables' ) ;
539
584
}
540
585
541
586
/**
542
- * REST GET call for /metrics/compactors/detail/{group} ,
587
+ * REST GET call for /groups ,
543
588
* stores it on a sessionStorage variable
544
- * @param {string } group Group name
545
589
*/
546
- function getMetricsCompactorsDetail ( group ) {
547
- const url = `/metrics/compactors/detail/${ group } ` ;
548
- const sessionDataVar = `metricsCompactorsDetail_${ group } ` ;
549
- return getJSONfromNewServer ( url , sessionDataVar ) ;
590
+ function getGroups ( ) {
591
+ return getJSONForTable ( REST_V2_PREFIX + '/groups' , 'groups' ) ;
550
592
}
551
593
552
594
/**
553
- * REST GET call for /metrics/sservers/summary and /metrics/sservers/summary/{group} ,
595
+ * REST GET call for /deployment ,
554
596
* stores it on a sessionStorage variable
555
- * @param {string } [group] Optional group name
556
597
*/
557
- function getMetricsSserversSummary ( group ) {
558
- const url = group ? `/metrics/sservers/summary/${ group } ` : '/metrics/sservers/summary' ;
559
- const sessionDataVar = group ? `metricsSserversSummary_${ group } ` : 'metricsSserversSummary' ;
560
- return getJSONfromNewServer ( url , sessionDataVar ) ;
598
+ function getDeployment ( ) {
599
+ return getJSONForTable ( REST_V2_PREFIX + '/deployment' , 'deployment' ) ;
561
600
}
562
601
563
602
/**
564
- * REST GET call for /metrics/ sservers/detail /{group},
603
+ * REST GET call for /sservers/summary /{group},
565
604
* stores it on a sessionStorage variable
566
605
* @param {string } group Group name
567
606
*/
568
- function getMetricsSserversDetail ( group ) {
569
- const url = `/metrics/sservers/detail/${ group } ` ;
570
- const sessionDataVar = `metricsSserversDetail_${ group } ` ;
571
- return getJSONfromNewServer ( url , sessionDataVar ) ;
607
+ function getSserversSummaryGroup ( group ) {
608
+ const url = `${ REST_V2_PREFIX } /sservers/summary/${ group } ` ;
609
+ const sessionDataVar = `sserversSummary_${ group } ` ;
610
+ return getJSONForTable ( url , sessionDataVar ) ;
611
+ }
612
+
613
+ /**
614
+ * REST GET call for /tservers/summary,
615
+ * stores it on a sessionStorage variable
616
+ */
617
+ function getTserversSummary ( ) {
618
+ return getJSONForTable ( REST_V2_PREFIX + '/tservers/summary' , 'tserversSummary' ) ;
572
619
}
573
620
574
621
/**
575
- * REST GET call for /metrics/tservers/summary and /metrics/tservers/summary/{group} ,
622
+ * REST GET call for /instance ,
576
623
* stores it on a sessionStorage variable
577
- * @param {string } [group] Optional group name
578
624
*/
579
- function getMetricsTserversSummary ( group ) {
580
- const url = group ? `/metrics/tservers/summary/${ group } ` : '/metrics/tservers/summary' ;
581
- const sessionDataVar = group ? `metricsTserversSummary_${ group } ` : 'metricsTserversSummary' ;
582
- return getJSONfromNewServer ( url , sessionDataVar ) ;
625
+ function getInstanceInfo ( ) {
626
+ return getJSONForTable ( REST_V2_PREFIX + '/instance' , 'instance' ) ;
583
627
}
584
628
585
629
/**
586
- * REST GET call for /metrics/tservers /detail/{group},
630
+ * REST GET call for /sservers /detail/{group},
587
631
* stores it on a sessionStorage variable
588
632
* @param {string } group Group name
589
633
*/
590
- function getMetricsTserversDetail ( group ) {
591
- const url = `/metrics/tservers /detail/${ group } ` ;
592
- const sessionDataVar = `metricsTserversDetail_ ${ group } ` ;
593
- return getJSONfromNewServer ( url , sessionDataVar ) ;
634
+ function getSserversDetail ( group ) {
635
+ const url = `${ REST_V2_PREFIX } /sservers /detail/${ group } ` ;
636
+ const sessionDataVar = `sserversDetail_ ${ group } ` ;
637
+ return getJSONForTable ( url , sessionDataVar ) ;
594
638
}
595
639
596
640
/**
597
- * REST GET call for /metrics/compactions/summary ,
641
+ * REST GET call for /manager ,
598
642
* stores it on a sessionStorage variable
599
643
*/
600
- function getMetricsCompactionsSummary ( ) {
601
- return getJSONfromNewServer ( '/metrics/compactions/summary ', 'metricsCompactionsSummary ' ) ;
644
+ function getManager ( ) {
645
+ return getJSONForTable ( REST_V2_PREFIX + '/manager ', 'manager ' ) ;
602
646
}
603
647
604
648
/**
605
- * REST GET call for /metrics/compactions/detail and /metrics/compactions/detail/{num} ,
649
+ * REST GET call for /compactors/summary ,
606
650
* stores it on a sessionStorage variable
607
- * @param {number } [num] Optional detail number
608
651
*/
609
- function getMetricsCompactionsDetail ( num ) {
610
- const url = num ? `/metrics/compactions/detail/${ num } ` : '/metrics/compactions/detail' ;
611
- const sessionDataVar = num ? `metricsCompactionsDetail_${ num } ` : 'metricsCompactionsDetail' ;
612
- return getJSONfromNewServer ( url , sessionDataVar ) ;
652
+ function getCompactorsSummary ( ) {
653
+ return getJSONForTable ( REST_V2_PREFIX + '/compactors/summary' , 'compactorsSummary' ) ;
613
654
}
614
655
615
656
/**
616
- * REST GET call for /metrics/tables and /metrics/ tables/{name},
657
+ * REST GET call for /tables/{name},
617
658
* stores it on a sessionStorage variable
618
- * @param {string } [ name] Optional table name
659
+ * @param {string } name Table name
619
660
*/
620
- function getMetricsTables ( name ) {
621
- const url = name ? `/metrics/ tables/${ name } ` : '/metrics/tables' ;
622
- const sessionDataVar = name ? `metricsTables_ ${ name } ` : 'metricsTables' ;
623
- return getJSONfromNewServer ( url , sessionDataVar ) ;
661
+ function getTable ( name ) {
662
+ const url = ` ${ REST_V2_PREFIX } / tables/${ name } `;
663
+ const sessionDataVar = `table_ ${ name } `;
664
+ return getJSONForTable ( url , sessionDataVar ) ;
624
665
}
625
666
626
667
/**
627
- * REST GET call for /metrics/tables/{name}/tablets ,
668
+ * REST GET call for /compactions/detail/{num} ,
628
669
* stores it on a sessionStorage variable
629
- * @param {string } name The table name
670
+ * @param {number } num Detail number
630
671
*/
631
- function getMetricsTableTabletsByName ( name ) {
632
- const url = `/metrics/tables /${ name } /tablets ` ;
633
- const sessionDataVar = `metricsTableTablets_ ${ name } ` ;
634
- return getJSONfromNewServer ( url , sessionDataVar ) ;
672
+ function getCompactionsDetail ( num ) {
673
+ const url = `${ REST_V2_PREFIX } /compactions/detail /${ num } ` ;
674
+ const sessionDataVar = `compactionsDetail_ ${ num } ` ;
675
+ return getJSONForTable ( url , sessionDataVar ) ;
635
676
}
636
677
637
678
/**
638
- * REST GET call for /metrics/deployment ,
679
+ * REST GET call for /compactions/detail ,
639
680
* stores it on a sessionStorage variable
640
681
*/
641
- function getMetricsDeployment ( ) {
642
- return getJSONfromNewServer ( '/metrics/deployment ', 'metricsDeployment ' ) ;
682
+ function getCompactionsDetail ( ) {
683
+ return getJSONForTable ( REST_V2_PREFIX + '/compactions/detail ', 'compactionsDetail ' ) ;
643
684
}
644
685
645
686
/**
646
- * REST GET call for /metrics/suggestions ,
687
+ * REST GET call for /compactions/summary ,
647
688
* stores it on a sessionStorage variable
648
689
*/
649
- function getMetricsSuggestions ( ) {
650
- return getJSONfromNewServer ( '/metrics/suggestions ', 'metricsSuggestions ' ) ;
690
+ function getCompactionsSummary ( ) {
691
+ return getJSONForTable ( REST_V2_PREFIX + '/compactions/summary ', 'compactionsSummary ' ) ;
651
692
}
0 commit comments