@@ -308,6 +308,15 @@ function getJSONForTable(call, sessionDataVar) {
308
308
} ) ;
309
309
}
310
310
311
+ /**
312
+ * Wraps the getJSONForTable function to call the new server
313
+ * TODO: Remove this function once the new server is fully integrated
314
+ */
315
+ function getJSONfromNewServer ( call , sessionDataVar ) {
316
+ const url = 'http://localhost:43331' + call ;
317
+ return getJSONForTable ( url , sessionDataVar ) ;
318
+ }
319
+
311
320
/**
312
321
* Performs POST call and builds console logging message if successful
313
322
* @param {string } call REST url called
@@ -497,3 +506,184 @@ function clearAllTableCells(tableId) {
497
506
$ ( this ) . text ( "" ) ;
498
507
} ) ;
499
508
}
509
+
510
+ // NEW REST CALLS
511
+
512
+ /**
513
+ * REST GET call for /stats,
514
+ * stores it on a sessionStorage variable
515
+ */
516
+ function getStats ( ) {
517
+ return getJSONfromNewServer ( '/stats' , 'stats' ) ;
518
+ }
519
+
520
+ /**
521
+ * REST GET call for /metrics,
522
+ * stores it on a sessionStorage variable
523
+ */
524
+ function getMetrics ( ) {
525
+ return getJSONfromNewServer ( '/metrics' , 'metrics' ) ;
526
+ }
527
+
528
+ /**
529
+ * REST GET call for /metrics/lastUpdate,
530
+ * stores it on a sessionStorage variable
531
+ */
532
+ function getMetricsLastUpdate ( ) {
533
+ return getJSONfromNewServer ( '/metrics/lastUpdate' , 'metricsLastUpdate' ) ;
534
+ }
535
+
536
+ /**
537
+ * REST GET call for /metrics/instance,
538
+ * stores it on a sessionStorage variable
539
+ */
540
+ function getMetricsInstance ( ) {
541
+ return getJSONfromNewServer ( '/metrics/instance' , 'metricsInstance' ) ;
542
+ }
543
+
544
+ /**
545
+ * REST GET call for /metrics/groups,
546
+ * stores it on a sessionStorage variable
547
+ */
548
+ function getMetricsGroups ( ) {
549
+ return getJSONfromNewServer ( '/metrics/groups' , 'metricsGroups' ) ;
550
+ }
551
+
552
+ /**
553
+ * REST GET call for /metrics/manager,
554
+ * stores it on a sessionStorage variable
555
+ */
556
+ function getMetricsManager ( ) {
557
+ return getJSONfromNewServer ( '/metrics/manager' , 'metricsManager' ) ;
558
+ }
559
+
560
+ /**
561
+ * REST GET call for /metrics/gc,
562
+ * stores it on a sessionStorage variable
563
+ */
564
+ function getMetricsGc ( ) {
565
+ return getJSONfromNewServer ( '/metrics/gc' , 'metricsGc' ) ;
566
+ }
567
+
568
+ /**
569
+ * REST GET call for /metrics/compactors/summary and /metrics/compactors/summary/{group},
570
+ * stores it on a sessionStorage variable
571
+ * @param {string } [group] Optional group name
572
+ */
573
+ function getMetricsCompactorsSummary ( group ) {
574
+ const url = group ? `/metrics/compactors/summary/${ group } ` : '/metrics/compactors/summary' ;
575
+ const sessionDataVar = group ? `metricsCompactorsSummary_${ group } ` : 'metricsCompactorsSummary' ;
576
+ return getJSONfromNewServer ( url , sessionDataVar ) ;
577
+ }
578
+
579
+ /**
580
+ * REST GET call for /metrics/compactors/detail/{group},
581
+ * stores it on a sessionStorage variable
582
+ * @param {string } group Group name
583
+ */
584
+ function getMetricsCompactorsDetail ( group ) {
585
+ const url = `/metrics/compactors/detail/${ group } ` ;
586
+ const sessionDataVar = `metricsCompactorsDetail_${ group } ` ;
587
+ return getJSONfromNewServer ( url , sessionDataVar ) ;
588
+ }
589
+
590
+ /**
591
+ * REST GET call for /metrics/sservers/summary and /metrics/sservers/summary/{group},
592
+ * stores it on a sessionStorage variable
593
+ * @param {string } [group] Optional group name
594
+ */
595
+ function getMetricsSserversSummary ( group ) {
596
+ const url = group ? `/metrics/sservers/summary/${ group } ` : '/metrics/sservers/summary' ;
597
+ const sessionDataVar = group ? `metricsSserversSummary_${ group } ` : 'metricsSserversSummary' ;
598
+ return getJSONfromNewServer ( url , sessionDataVar ) ;
599
+ }
600
+
601
+ /**
602
+ * REST GET call for /metrics/sservers/detail/{group},
603
+ * stores it on a sessionStorage variable
604
+ * @param {string } group Group name
605
+ */
606
+ function getMetricsSserversDetail ( group ) {
607
+ const url = `/metrics/sservers/detail/${ group } ` ;
608
+ const sessionDataVar = `metricsSserversDetail_${ group } ` ;
609
+ return getJSONfromNewServer ( url , sessionDataVar ) ;
610
+ }
611
+
612
+ /**
613
+ * REST GET call for /metrics/tservers/summary and /metrics/tservers/summary/{group},
614
+ * stores it on a sessionStorage variable
615
+ * @param {string } [group] Optional group name
616
+ */
617
+ function getMetricsTserversSummary ( group ) {
618
+ const url = group ? `/metrics/tservers/summary/${ group } ` : '/metrics/tservers/summary' ;
619
+ const sessionDataVar = group ? `metricsTserversSummary_${ group } ` : 'metricsTserversSummary' ;
620
+ return getJSONfromNewServer ( url , sessionDataVar ) ;
621
+ }
622
+
623
+ /**
624
+ * REST GET call for /metrics/tservers/detail/{group},
625
+ * stores it on a sessionStorage variable
626
+ * @param {string } group Group name
627
+ */
628
+ function getMetricsTserversDetail ( group ) {
629
+ const url = `/metrics/tservers/detail/${ group } ` ;
630
+ const sessionDataVar = `metricsTserversDetail_${ group } ` ;
631
+ return getJSONfromNewServer ( url , sessionDataVar ) ;
632
+ }
633
+
634
+ /**
635
+ * REST GET call for /metrics/compactions/summary,
636
+ * stores it on a sessionStorage variable
637
+ */
638
+ function getMetricsCompactionsSummary ( ) {
639
+ return getJSONfromNewServer ( '/metrics/compactions/summary' , 'metricsCompactionsSummary' ) ;
640
+ }
641
+
642
+ /**
643
+ * REST GET call for /metrics/compactions/detail and /metrics/compactions/detail/{num},
644
+ * stores it on a sessionStorage variable
645
+ * @param {number } [num] Optional detail number
646
+ */
647
+ function getMetricsCompactionsDetail ( num ) {
648
+ const url = num ? `/metrics/compactions/detail/${ num } ` : '/metrics/compactions/detail' ;
649
+ const sessionDataVar = num ? `metricsCompactionsDetail_${ num } ` : 'metricsCompactionsDetail' ;
650
+ return getJSONfromNewServer ( url , sessionDataVar ) ;
651
+ }
652
+
653
+ /**
654
+ * REST GET call for /metrics/tables and /metrics/tables/{name},
655
+ * stores it on a sessionStorage variable
656
+ * @param {string } [name] Optional table name
657
+ */
658
+ function getMetricsTables ( name ) {
659
+ const url = name ? `/metrics/tables/${ name } ` : '/metrics/tables' ;
660
+ const sessionDataVar = name ? `metricsTables_${ name } ` : 'metricsTables' ;
661
+ return getJSONfromNewServer ( url , sessionDataVar ) ;
662
+ }
663
+
664
+ /**
665
+ * REST GET call for /metrics/tables/{name}/tablets,
666
+ * stores it on a sessionStorage variable
667
+ * @param {string } name The table name
668
+ */
669
+ function getMetricsTableTabletsByName ( name ) {
670
+ const url = `/metrics/tables/${ name } /tablets` ;
671
+ const sessionDataVar = `metricsTableTablets_${ name } ` ;
672
+ return getJSONfromNewServer ( url , sessionDataVar ) ;
673
+ }
674
+
675
+ /**
676
+ * REST GET call for /metrics/deployment,
677
+ * stores it on a sessionStorage variable
678
+ */
679
+ function getMetricsDeployment ( ) {
680
+ return getJSONfromNewServer ( '/metrics/deployment' , 'metricsDeployment' ) ;
681
+ }
682
+
683
+ /**
684
+ * REST GET call for /metrics/suggestions,
685
+ * stores it on a sessionStorage variable
686
+ */
687
+ function getMetricsSuggestions ( ) {
688
+ return getJSONfromNewServer ( '/metrics/suggestions' , 'metricsSuggestions' ) ;
689
+ }
0 commit comments