github.com/kiali/kiali@v1.84.0/routing/routes.go (about) 1 package routing 2 3 import ( 4 "net/http" 5 6 "github.com/kiali/kiali/business" 7 "github.com/kiali/kiali/business/authentication" 8 "github.com/kiali/kiali/config" 9 "github.com/kiali/kiali/handlers" 10 "github.com/kiali/kiali/kubernetes" 11 "github.com/kiali/kiali/kubernetes/cache" 12 "github.com/kiali/kiali/prometheus" 13 "github.com/kiali/kiali/tracing" 14 ) 15 16 // Route describes a single route 17 type Route struct { 18 Name string 19 Method string 20 Pattern string 21 HandlerFunc http.HandlerFunc 22 Authenticated bool 23 } 24 25 // Routes holds an array of Route. A note on swagger documentation. The path variables and query parameters 26 // are defined in ../doc.go. YOu need to manually associate params and routes. 27 type Routes struct { 28 Routes []Route 29 } 30 31 // NewRoutes creates and returns all the API routes 32 func NewRoutes( 33 conf *config.Config, 34 kialiCache cache.KialiCache, 35 clientFactory kubernetes.ClientFactory, 36 prom prometheus.ClientInterface, 37 traceClientLoader func() tracing.ClientInterface, 38 cpm business.ControlPlaneMonitor, 39 authController authentication.AuthController, 40 ) (r *Routes) { 41 r = new(Routes) 42 43 r.Routes = []Route{ 44 // swagger:route GET /healthz kiali healthz 45 // --- 46 // Endpoint to get the health of Kiali 47 // 48 // Produces: 49 // - application/json 50 // 51 // Schemes: http, https 52 // responses: 53 // 500: internalError 54 // 200 55 { 56 "Healthz", 57 "GET", 58 "/healthz", 59 handlers.Healthz, 60 false, 61 }, 62 // swagger:route GET / kiali root 63 // --- 64 // Endpoint to get the status of Kiali 65 // 66 // Produces: 67 // - application/json 68 // 69 // Schemes: http, https 70 // responses: 71 // 500: internalError 72 // 200: statusInfo 73 { 74 "Root", 75 "GET", 76 "/api", 77 handlers.Root, 78 false, 79 }, 80 // swagger:route GET /authenticate auth authenticate 81 // --- 82 // Endpoint to authenticate the user 83 // 84 // Produces: 85 // - application/json 86 // 87 // Schemes: http, https 88 // 89 // Security: 90 // authorization: user, password 91 // 92 // responses: 93 // 500: internalError 94 // 200: userSessionData 95 { 96 "Authenticate", 97 "GET", 98 "/api/authenticate", 99 handlers.Authenticate(conf, authController), 100 false, 101 }, 102 // swagger:route POST /authenticate auth openshiftCheckToken 103 // --- 104 // Endpoint to check if a token from Openshift is working correctly 105 // 106 // Produces: 107 // - application/json 108 // 109 // Schemes: http, https 110 // 111 // responses: 112 // 500: internalError 113 // 200: userSessionData 114 { 115 "OpenshiftCheckToken", 116 "POST", 117 "/api/authenticate", 118 handlers.Authenticate(conf, authController), 119 false, 120 }, 121 // swagger:route GET /logout auth logout 122 // --- 123 // Endpoint to logout an user (unset the session cookie) 124 // 125 // Schemes: http, https 126 // 127 // responses: 128 // 204: noContent 129 { 130 "Logout", 131 "GET", 132 "/api/logout", 133 handlers.Logout(conf, authController), 134 false, 135 }, 136 // swagger:route GET /auth/info auth authenticationInfo 137 // --- 138 // Endpoint to get login info, such as strategy, authorization endpoints 139 // for OAuth providers and so on. 140 // 141 // Consumes: 142 // - application/json 143 // 144 // Produces: 145 // - application/json 146 // 147 // Schemes: http, https 148 // 149 // responses: 150 // 500: internalError 151 // 200: authenticationInfo 152 { 153 "AuthenticationInfo", 154 "GET", 155 "/api/auth/info", 156 handlers.AuthenticationInfo(conf, authController), 157 false, 158 }, 159 // swagger:route GET /status status getStatus 160 // --- 161 // Endpoint to get the status of Kiali 162 // 163 // Produces: 164 // - application/json 165 // 166 // Schemes: http, https 167 // 168 // responses: 169 // 500: internalError 170 // 200: statusInfo 171 { 172 "Status", 173 "GET", 174 "/api/status", 175 handlers.Root, 176 true, 177 }, 178 // swagger:route GET /config kiali getConfig 179 // --- 180 // Endpoint to get the config of Kiali 181 // 182 // Produces: 183 // - application/json 184 // 185 // Schemes: http, https 186 // 187 // responses: 188 // 500: internalError 189 // 200: statusInfo 190 { 191 "Config", 192 "GET", 193 "/api/config", 194 handlers.Config, 195 true, 196 }, 197 // swagger:route GET /crippled kiali getCrippledFeatures 198 // --- 199 // Endpoint to get the crippled features of Kiali 200 // 201 // Produces: 202 // - application/json 203 // 204 // Schemes: http, https 205 // 206 // responses: 207 // 500: internalError 208 // 200: statusInfo 209 { 210 "Crippled", 211 "GET", 212 "/api/crippled", 213 handlers.CrippledFeatures, 214 true, 215 }, 216 // swagger:route GET /istio/permissions config getPermissions 217 // --- 218 // Endpoint to get the caller permissions on new Istio Config objects 219 // 220 // Produces: 221 // - application/json 222 // 223 // Schemes: http, https 224 // 225 // responses: 226 // 500: internalError 227 // 200: istioConfigPermissions 228 { 229 "IstioConfigPermissions", 230 "GET", 231 "/api/istio/permissions", 232 handlers.IstioConfigPermissions, 233 true, 234 }, 235 // swagger:route GET /namespaces/{namespace}/istio config istioConfigList 236 // --- 237 // Endpoint to get the list of Istio Config of a namespace 238 // 239 // Produces: 240 // - application/json 241 // 242 // Schemes: http, https 243 // 244 // responses: 245 // 500: internalError 246 // 200: istioConfigList 247 // 248 { 249 "IstioConfigList", 250 "GET", 251 "/api/namespaces/{namespace}/istio", 252 handlers.IstioConfigList, 253 true, 254 }, 255 // swagger:route GET /istio config istioConfigListAll 256 // --- 257 // Endpoint to get the list of Istio Config of all namespaces 258 // 259 // Produces: 260 // - application/json 261 // 262 // Schemes: http, https 263 // 264 // responses: 265 // 500: internalError 266 // 200: istioConfigList 267 // 268 { 269 "IstioConfigListAll", 270 "GET", 271 "/api/istio/config", 272 handlers.IstioConfigList, 273 true, 274 }, 275 // swagger:route GET /namespaces/{namespace}/istio/{object_type}/{object} config istioConfigDetails 276 // --- 277 // Endpoint to get the Istio Config of an Istio object 278 // 279 // Produces: 280 // - application/json 281 // 282 // Schemes: http, https 283 // 284 // responses: 285 // 400: badRequestError 286 // 404: notFoundError 287 // 500: internalError 288 // 200: istioConfigDetailsResponse 289 // 290 { 291 "IstioConfigDetails", 292 "GET", 293 "/api/namespaces/{namespace}/istio/{object_type}/{object}", 294 handlers.IstioConfigDetails, 295 true, 296 }, 297 // swagger:route DELETE /namespaces/{namespace}/istio/{object_type}/{object} config istioConfigDelete 298 // --- 299 // Endpoint to delete the Istio Config of an (arbitrary) Istio object 300 // 301 // Produces: 302 // - application/json 303 // 304 // Schemes: http, https 305 // 306 // responses: 307 // 404: notFoundError 308 // 500: internalError 309 // 200 310 // 311 { 312 "IstioConfigDelete", 313 "DELETE", 314 "/api/namespaces/{namespace}/istio/{object_type}/{object}", 315 handlers.IstioConfigDelete, 316 true, 317 }, 318 // swagger:route PATCH /namespaces/{namespace}/istio/{object_type}/{object} config istioConfigUpdate 319 // --- 320 // Endpoint to update the Istio Config of an Istio object used for templates and adapters using Json Merge Patch strategy. 321 // 322 // Consumes: 323 // - application/json 324 // 325 // Produces: 326 // - application/json 327 // 328 // Schemes: http, https 329 // 330 // responses: 331 // 400: badRequestError 332 // 404: notFoundError 333 // 500: internalError 334 // 200: istioConfigDetailsResponse 335 // 336 { 337 "IstioConfigUpdate", 338 "PATCH", 339 "/api/namespaces/{namespace}/istio/{object_type}/{object}", 340 handlers.IstioConfigUpdate, 341 true, 342 }, 343 // swagger:route POST /namespaces/{namespace}/istio/{object_type} config istioConfigCreate 344 // --- 345 // Endpoint to create an Istio object by using an Istio Config item 346 // 347 // Produces: 348 // - application/json 349 // 350 // Schemes: http, https 351 // 352 // responses: 353 // 404: notFoundError 354 // 500: internalError 355 // 202 356 // 201: istioConfigDetailsResponse 357 // 200: istioConfigDetailsResponse 358 // 359 { 360 "IstioConfigCreate", 361 "POST", 362 "/api/namespaces/{namespace}/istio/{object_type}", 363 handlers.IstioConfigCreate, 364 true, 365 }, 366 // swagger:route GET /clusters/services services serviceList 367 // --- 368 // Endpoint to get the list of services for a given cluster 369 // 370 // Produces: 371 // - application/json 372 // 373 // Schemes: http, https 374 // 375 // responses: 376 // 500: internalError 377 // 200: serviceListResponse 378 // 379 { 380 "ClustersServices", 381 "GET", 382 "/api/clusters/services", 383 handlers.ClustersServices, 384 true, 385 }, 386 // swagger:route GET /namespaces/{namespace}/services/{service} services serviceDetails 387 // --- 388 // Endpoint to get the details of a given service 389 // 390 // Produces: 391 // - application/json 392 // 393 // Schemes: http, https 394 // 395 // responses: 396 // 404: notFoundError 397 // 500: internalError 398 // 200: serviceDetailsResponse 399 // 400 { 401 "ServiceDetails", 402 "GET", 403 "/api/namespaces/{namespace}/services/{service}", 404 handlers.ServiceDetails, 405 true, 406 }, 407 // swagger:route PATCH /namespaces/{namespace}/services/{service} services serviceUpdate 408 // --- 409 // Endpoint to update the Service configuration using Json Merge Patch strategy. 410 // 411 // Consumes: 412 // - application/json 413 // 414 // Produces: 415 // - application/json 416 // 417 // Schemes: http, https 418 // 419 // responses: 420 // 400: badRequestError 421 // 404: notFoundError 422 // 500: internalError 423 // 200: serviceDetailsResponse 424 // 425 { 426 "ServiceUpdate", 427 "PATCH", 428 "/api/namespaces/{namespace}/services/{service}", 429 handlers.ServiceUpdate, 430 true, 431 }, 432 // swagger:route GET /namespaces/{namespace}/apps/{app}/spans traces appSpans 433 // --- 434 // Endpoint to get Tracing spans for a given app 435 // 436 // Produces: 437 // - application/json 438 // 439 // Schemes: http, https 440 // 441 // responses: 442 // 500: internalError 443 // 200: spansResponse 444 { 445 "AppSpans", 446 "GET", 447 "/api/namespaces/{namespace}/apps/{app}/spans", 448 handlers.AppSpans, 449 true, 450 }, 451 // swagger:route GET /namespaces/{namespace}/workloads/{workload}/spans traces workloadSpans 452 // --- 453 // Endpoint to get Tracing spans for a given workload 454 // 455 // Produces: 456 // - application/json 457 // 458 // Schemes: http, https 459 // 460 // responses: 461 // 500: internalError 462 // 200: spansResponse 463 { 464 "WorkloadSpans", 465 "GET", 466 "/api/namespaces/{namespace}/workloads/{workload}/spans", 467 handlers.WorkloadSpans, 468 true, 469 }, 470 // swagger:route GET /namespaces/{namespace}/services/{service}/spans traces serviceSpans 471 // --- 472 // Endpoint to get Tracing spans for a given service 473 // 474 // Produces: 475 // - application/json 476 // 477 // Schemes: http, https 478 // 479 // responses: 480 // 500: internalError 481 // 200: spansResponse 482 { 483 "ServiceSpans", 484 "GET", 485 "/api/namespaces/{namespace}/services/{service}/spans", 486 handlers.ServiceSpans, 487 true, 488 }, 489 // swagger:route GET /namespaces/{namespace}/apps/{app}/traces traces appTraces 490 // --- 491 // Endpoint to get the traces of a given app 492 // 493 // Produces: 494 // - application/json 495 // 496 // Schemes: http, https 497 // 498 // responses: 499 // 404: notFoundError 500 // 500: internalError 501 // 200: traceDetailsResponse 502 // 503 { 504 "AppTraces", 505 "GET", 506 "/api/namespaces/{namespace}/apps/{app}/traces", 507 handlers.AppTraces, 508 true, 509 }, 510 // swagger:route GET /namespaces/{namespace}/services/{service}/traces traces serviceTraces 511 // --- 512 // Endpoint to get the traces of a given service 513 // 514 // Produces: 515 // - application/json 516 // 517 // Schemes: http, https 518 // 519 // responses: 520 // 404: notFoundError 521 // 500: internalError 522 // 200: traceDetailsResponse 523 // 524 { 525 "ServiceTraces", 526 "GET", 527 "/api/namespaces/{namespace}/services/{service}/traces", 528 handlers.ServiceTraces, 529 true, 530 }, 531 // swagger:route GET /namespaces/{namespace}/workloads/{workload}/traces traces workloadTraces 532 // --- 533 // Endpoint to get the traces of a given workload 534 // 535 // Produces: 536 // - application/json 537 // 538 // Schemes: http, https 539 // 540 // responses: 541 // 404: notFoundError 542 // 500: internalError 543 // 200: traceDetailsResponse 544 // 545 { 546 "WorkloadTraces", 547 "GET", 548 "/api/namespaces/{namespace}/workloads/{workload}/traces", 549 handlers.WorkloadTraces, 550 true, 551 }, 552 // swagger:route GET /namespaces/{namespace}/apps/{app}/errortraces traces errorTraces 553 // --- 554 // Endpoint to get the number of traces in error for a given service 555 // 556 // Produces: 557 // - application/json 558 // 559 // Schemes: http, https 560 // 561 // responses: 562 // 404: notFoundError 563 // 500: internalError 564 // 200: errorTracesResponse 565 // 566 { 567 "ErrorTraces", 568 "GET", 569 "/api/namespaces/{namespace}/apps/{app}/errortraces", 570 handlers.ErrorTraces, 571 true, 572 }, 573 // swagger:route GET /traces/{traceID} traces traceDetails 574 // --- 575 // Endpoint to get a specific trace from ID 576 // 577 // Produces: 578 // - application/json 579 // 580 // Schemes: http, https 581 // 582 // responses: 583 // 404: notFoundError 584 // 500: internalError 585 // 200: traceDetailsResponse 586 // 587 { 588 "TracesDetails", 589 "GET", 590 "/api/traces/{traceID}", 591 handlers.TraceDetails, 592 true, 593 }, 594 // swagger:route GET /clusters/workloads workloads workloadList 595 // --- 596 // Endpoint to get the list of workloads for a cluster 597 // 598 // Produces: 599 // - application/json 600 // 601 // Schemes: http, https 602 // 603 // responses: 604 // 500: internalError 605 // 200: workloadListResponse 606 // 607 { 608 "ClustersWorkloads", 609 "GET", 610 "/api/clusters/workloads", 611 handlers.ClustersWorkloads, 612 true, 613 }, 614 // swagger:route GET /namespaces/{namespace}/workloads/{workload} workloads workloadDetails 615 // --- 616 // Endpoint to get the workload details 617 // 618 // Produces: 619 // - application/json 620 // 621 // Schemes: http, https 622 // 623 // responses: 624 // 500: internalError 625 // 404: notFoundError 626 // 200: workloadDetails 627 // 628 { 629 "WorkloadDetails", 630 "GET", 631 "/api/namespaces/{namespace}/workloads/{workload}", 632 handlers.WorkloadDetails, 633 true, 634 }, 635 // swagger:route PATCH /namespaces/{namespace}/workloads/{workload} workloads workloadUpdate 636 // --- 637 // Endpoint to update the Workload configuration using Json Merge Patch strategy. 638 // 639 // Consumes: 640 // - application/json 641 // 642 // Produces: 643 // - application/json 644 // 645 // Schemes: http, https 646 // 647 // responses: 648 // 400: badRequestError 649 // 404: notFoundError 650 // 500: internalError 651 // 200: workloadDetails 652 // 653 { 654 "WorkloadUpdate", 655 "PATCH", 656 "/api/namespaces/{namespace}/workloads/{workload}", 657 handlers.WorkloadUpdate, 658 true, 659 }, 660 // swagger:route GET /clusters/apps apps appList 661 // --- 662 // Endpoint to get the list of apps for a cluster 663 // 664 // Produces: 665 // - application/json 666 // 667 // Schemes: http, https 668 // 669 // responses: 670 // 500: internalError 671 // 200: appListResponse 672 // 673 { 674 "ClustersApps", 675 "GET", 676 "/api/clusters/apps", 677 handlers.ClustersApps, 678 true, 679 }, 680 // swagger:route GET /namespaces/{namespace}/apps/{app} apps appDetails 681 // --- 682 // Endpoint to get the app details 683 // 684 // Produces: 685 // - application/json 686 // 687 // Schemes: http, https 688 // 689 // responses: 690 // 500: internalError 691 // 404: notFoundError 692 // 200: appDetails 693 // 694 { 695 "AppDetails", 696 "GET", 697 "/api/namespaces/{namespace}/apps/{app}", 698 handlers.AppDetails, 699 true, 700 }, 701 // swagger:route GET /namespaces namespaces namespaceList 702 // --- 703 // Endpoint to get the list of the available namespaces 704 // 705 // Produces: 706 // - application/json 707 // 708 // Schemes: http, https 709 // 710 // responses: 711 // 500: internalError 712 // 200: namespaceList 713 // 714 { 715 "NamespaceList", 716 "GET", 717 "/api/namespaces", 718 handlers.NamespaceList, 719 true, 720 }, 721 // swagger:route PATCH /namespaces/{namespace} namespaces namespaceUpdate 722 // --- 723 // Endpoint to update the Namespace configuration using Json Merge Patch strategy. 724 // 725 // Consumes: 726 // - application/json 727 // 728 // Produces: 729 // - application/json 730 // 731 // Schemes: http, https 732 // 733 // responses: 734 // 400: badRequestError 735 // 404: notFoundError 736 // 500: internalError 737 // 200: namespaceResponse 738 // 739 { 740 "NamespaceUpdate", 741 "PATCH", 742 "/api/namespaces/{namespace}", 743 handlers.NamespaceUpdate, 744 true, 745 }, 746 // swagger:route GET /namespaces/{namespace}/info namespaces namespaceInfo 747 // --- 748 // Endpoint to get info about a single namespace 749 // 750 // Produces: 751 // - application/json 752 // 753 // Schemes: http, https 754 // 755 // responses: 756 // 500: internalError 757 // 200: namespaceList 758 // 759 { 760 "NamespaceInfo", 761 "GET", 762 "/api/namespaces/{namespace}/info", 763 handlers.NamespaceInfo, 764 true, 765 }, 766 // swagger:route GET /namespaces/{namespace}/services/{service}/metrics services serviceMetrics 767 // --- 768 // Endpoint to fetch metrics to be displayed, related to a single service 769 // 770 // Produces: 771 // - application/json 772 // 773 // Schemes: http, https 774 // 775 // responses: 776 // 400: badRequestError 777 // 503: serviceUnavailableError 778 // 200: metricsResponse 779 // 780 { 781 "ServiceMetrics", 782 "GET", 783 "/api/namespaces/{namespace}/services/{service}/metrics", 784 handlers.ServiceMetrics, 785 true, 786 }, 787 // swagger:route GET /namespaces/{namespace}/aggregates/{aggregate}/{aggregateValue}/metrics aggregates aggregateMetrics 788 // --- 789 // Endpoint to fetch metrics to be displayed, related to a single aggregate 790 // 791 // Produces: 792 // - application/json 793 // 794 // Schemes: http, https 795 // 796 // responses: 797 // 400: badRequestError 798 // 503: serviceUnavailableError 799 // 200: metricsResponse 800 // 801 { 802 "AggregateMetrics", 803 "GET", 804 "/api/namespaces/{namespace}/aggregates/{aggregate}/{aggregateValue}/metrics", 805 handlers.AggregateMetrics, 806 true, 807 }, 808 // swagger:route GET /namespaces/{namespace}/apps/{app}/metrics apps appMetrics 809 // --- 810 // Endpoint to fetch metrics to be displayed, related to a single app 811 // 812 // Produces: 813 // - application/json 814 // 815 // Schemes: http, https 816 // 817 // responses: 818 // 400: badRequestError 819 // 503: serviceUnavailableError 820 // 200: metricsResponse 821 // 822 { 823 "AppMetrics", 824 "GET", 825 "/api/namespaces/{namespace}/apps/{app}/metrics", 826 handlers.AppMetrics, 827 true, 828 }, 829 // swagger:route GET /namespaces/{namespace}/workloads/{workload}/metrics workloads workloadMetrics 830 // --- 831 // Endpoint to fetch metrics to be displayed, related to a single workload 832 // 833 // Produces: 834 // - application/json 835 // 836 // Schemes: http, https 837 // 838 // responses: 839 // 400: badRequestError 840 // 503: serviceUnavailableError 841 // 200: metricsResponse 842 // 843 { 844 "WorkloadMetrics", 845 "GET", 846 "/api/namespaces/{namespace}/workloads/{workload}/metrics", 847 handlers.WorkloadMetrics, 848 true, 849 }, 850 // swagger:route GET /namespaces/{namespace}/services/{service}/dashboard services serviceDashboard 851 // --- 852 // Endpoint to fetch dashboard to be displayed, related to a single service 853 // 854 // Produces: 855 // - application/json 856 // 857 // Schemes: http, https 858 // 859 // responses: 860 // 400: badRequestError 861 // 503: serviceUnavailableError 862 // 200: dashboardResponse 863 // 864 { 865 "ServiceDashboard", 866 "GET", 867 "/api/namespaces/{namespace}/services/{service}/dashboard", 868 handlers.ServiceDashboard, 869 true, 870 }, 871 // swagger:route GET /namespaces/{namespace}/apps/{app}/dashboard apps appDashboard 872 // --- 873 // Endpoint to fetch dashboard to be displayed, related to a single app 874 // 875 // Produces: 876 // - application/json 877 // 878 // Schemes: http, https 879 // 880 // responses: 881 // 400: badRequestError 882 // 503: serviceUnavailableError 883 // 200: dashboardResponse 884 // 885 { 886 "AppDashboard", 887 "GET", 888 "/api/namespaces/{namespace}/apps/{app}/dashboard", 889 handlers.AppDashboard, 890 true, 891 }, 892 // swagger:route GET /namespaces/{namespace}/workloads/{workload}/dashboard workloads workloadDashboard 893 // --- 894 // Endpoint to fetch dashboard to be displayed, related to a single workload 895 // 896 // Produces: 897 // - application/json 898 // 899 // Schemes: http, https 900 // 901 // responses: 902 // 400: badRequestError 903 // 503: serviceUnavailableError 904 // 200: dashboardResponse 905 // 906 { 907 "WorkloadDashboard", 908 "GET", 909 "/api/namespaces/{namespace}/workloads/{workload}/dashboard", 910 handlers.WorkloadDashboard, 911 true, 912 }, 913 // swagger:route GET /namespaces/{namespace}/customdashboard/{dashboard} dashboards customDashboard 914 // --- 915 // Endpoint to fetch a custom dashboard 916 // 917 // Produces: 918 // - application/json 919 // 920 // Schemes: http, https 921 // 922 // responses: 923 // 400: badRequestError 924 // 503: serviceUnavailableError 925 // 200: dashboardResponse 926 // 927 { 928 "CustomDashboard", 929 "GET", 930 "/api/namespaces/{namespace}/customdashboard/{dashboard}", 931 handlers.CustomDashboard, 932 true, 933 }, 934 // swagger:route GET /namespaces/{namespace}/metrics namespaces namespaceMetrics 935 // --- 936 // Endpoint to fetch metrics to be displayed, related to a namespace 937 // 938 // Produces: 939 // - application/json 940 // 941 // Schemes: http, https 942 // 943 // responses: 944 // 400: badRequestError 945 // 503: serviceUnavailableError 946 // 200: metricsResponse 947 // 948 { 949 "NamespaceMetrics", 950 "GET", 951 "/api/namespaces/{namespace}/metrics", 952 handlers.NamespaceMetrics, 953 true, 954 }, 955 // swagger:route GET /clusters/health cluster namespaces Health 956 // --- 957 // Get health for all objects in namespaces of the given cluster 958 // 959 // Produces: 960 // - application/json 961 // 962 // Schemes: http, https 963 // 964 // responses: 965 // 200: clustersNamespaceHealthResponse 966 // 400: badRequestError 967 // 500: internalError 968 // 969 { 970 "ClustersHealth", 971 "GET", 972 "/api/clusters/health", 973 handlers.ClustersHealth, 974 true, 975 }, 976 // swagger:route GET /namespaces/{namespace}/validations namespaces namespaceValidations 977 // --- 978 // Get validation summary for all objects in the given namespace 979 // 980 // Produces: 981 // - application/json 982 // 983 // Schemes: http, https 984 // 985 // responses: 986 // 200: namespaceValidationSummaryResponse 987 // 400: badRequestError 988 // 500: internalError 989 // 990 { 991 "NamespaceValidationSummary", 992 "GET", 993 "/api/namespaces/{namespace}/validations", 994 handlers.NamespaceValidationSummary, 995 true, 996 }, 997 // swagger:route GET /istio/validations namespaces namespacesValidations 998 // --- 999 // Get validation summary for all objects in the given namespaces 1000 // 1001 // Produces: 1002 // - application/json 1003 // 1004 // Schemes: http, https 1005 // 1006 // responses: 1007 // 200: namespaceValidationSummaryResponse 1008 // 400: badRequestError 1009 // 500: internalError 1010 // 1011 { 1012 "ConfigValidationSummary", 1013 "GET", 1014 "/api/istio/validations", 1015 handlers.ConfigValidationSummary, 1016 true, 1017 }, 1018 // swagger:route GET /mesh mesh configuration 1019 // --- 1020 // Get Mesh status and configuration 1021 // 1022 // Produces: 1023 // - application/json 1024 // 1025 // Schemes: http, https 1026 // 1027 // responses: 1028 // 200: meshResponse 1029 // 400: badRequestError 1030 // 500: internalError 1031 // 1032 { 1033 "Mesh", 1034 "GET", 1035 "/api/mesh", 1036 handlers.GetMesh, 1037 true, 1038 }, 1039 // swagger:route GET /mesh/tls tls meshTls 1040 // --- 1041 // Get TLS status for the whole mesh 1042 // 1043 // Produces: 1044 // - application/json 1045 // 1046 // Schemes: http, https 1047 // 1048 // responses: 1049 // 200: meshTlsResponse 1050 // 400: badRequestError 1051 // 500: internalError 1052 // 1053 { 1054 "NamespaceTls", 1055 "GET", 1056 "/api/mesh/tls", 1057 handlers.MeshTls, 1058 true, 1059 }, 1060 // swagger:route GET /namespaces/{namespace}/tls tls namespaceTls 1061 // --- 1062 // Get TLS status for the given namespace 1063 // 1064 // Produces: 1065 // - application/json 1066 // 1067 // Schemes: http, https 1068 // 1069 // responses: 1070 // 200: namespaceTlsResponse 1071 // 400: badRequestError 1072 // 500: internalError 1073 // 1074 { 1075 "NamespaceTls", 1076 "GET", 1077 "/api/namespaces/{namespace}/tls", 1078 handlers.NamespaceTls, 1079 true, 1080 }, 1081 // swagger:route GET /clusters/tls tls ClustersTls 1082 // --- 1083 // Get TLS statuses for given namespaces of the given cluster 1084 // 1085 // Produces: 1086 // - application/json 1087 // 1088 // Schemes: http, https 1089 // 1090 // responses: 1091 // 200: clusterTlsResponse 1092 // 400: badRequestError 1093 // 500: internalError 1094 // 1095 { 1096 "ClusterTls", 1097 "GET", 1098 "/api/clusters/tls", 1099 handlers.ClustersTls, 1100 true, 1101 }, 1102 // swagger:route GET /istio/status status istioStatus 1103 // --- 1104 // Get the status of each components needed in the control plane 1105 // 1106 // Produces: 1107 // - application/json 1108 // 1109 // Schemes: http, https 1110 // 1111 // responses: 1112 // 200: istioStatusResponse 1113 // 400: badRequestError 1114 // 500: internalError 1115 // 1116 { 1117 "IstioStatus", 1118 "GET", 1119 "/api/istio/status", 1120 handlers.IstioStatus, 1121 true, 1122 }, 1123 // swagger:route GET /istio/certs certs istioCerts 1124 // --- 1125 // Get certificates (internal) information used by Istio 1126 // 1127 // Produces: 1128 // - application/json 1129 // 1130 // Schemes: http, https 1131 // 1132 // responses: 1133 // 200: certsInfoResponse 1134 // 500: internalError 1135 // 1136 { 1137 "IstioCerts", 1138 "GET", 1139 "/api/istio/certs", 1140 handlers.IstioCerts, 1141 true, 1142 }, 1143 // swagger:route GET /namespaces/graph graphs graphNamespaces 1144 // --- 1145 // The backing JSON for a namespaces graph. 1146 // 1147 // Produces: 1148 // - application/json 1149 // 1150 // Schemes: http, https 1151 // 1152 // responses: 1153 // 400: badRequestError 1154 // 500: internalError 1155 // 200: graphResponse 1156 // 1157 { 1158 "GraphNamespaces", 1159 "GET", 1160 "/api/namespaces/graph", 1161 handlers.GraphNamespaces, 1162 true, 1163 }, 1164 // swagger:route GET /namespaces/{namespace}/aggregates/{aggregate}/{aggregateValue}/graph graphs graphAggregate 1165 // --- 1166 // The backing JSON for an aggregate node detail graph. (supported graphTypes: app | versionedApp | workload) 1167 // 1168 // Produces: 1169 // - application/json 1170 // 1171 // Schemes: http, https 1172 // 1173 // responses: 1174 // 400: badRequestError 1175 // 500: internalError 1176 // 200: graphResponse 1177 // 1178 { 1179 "GraphAggregate", 1180 "GET", 1181 "/api/namespaces/{namespace}/aggregates/{aggregate}/{aggregateValue}/graph", 1182 handlers.GraphNode, 1183 true, 1184 }, 1185 // swagger:route GET /namespaces/{namespace}/aggregates/{aggregate}/{aggregateValue}/{service}/graph graphs graphAggregateByService 1186 // --- 1187 // The backing JSON for an aggregate node detail graph, specific to a service. (supported graphTypes: app | versionedApp | workload) 1188 // 1189 // Produces: 1190 // - application/json 1191 // 1192 // Schemes: http, https 1193 // 1194 // responses: 1195 // 400: badRequestError 1196 // 500: internalError 1197 // 200: graphResponse 1198 // 1199 { 1200 "GraphAggregateByService", 1201 "GET", 1202 "/api/namespaces/{namespace}/aggregates/{aggregate}/{aggregateValue}/{service}/graph", 1203 handlers.GraphNode, 1204 true, 1205 }, 1206 // swagger:route GET /namespaces/{namespace}/applications/{app}/versions/{version}/graph graphs graphAppVersion 1207 // --- 1208 // The backing JSON for a versioned app node detail graph. (supported graphTypes: app | versionedApp) 1209 // 1210 // Produces: 1211 // - application/json 1212 // 1213 // Schemes: http, https 1214 // 1215 // responses: 1216 // 400: badRequestError 1217 // 500: internalError 1218 // 200: graphResponse 1219 // 1220 { 1221 "GraphAppVersion", 1222 "GET", 1223 "/api/namespaces/{namespace}/applications/{app}/versions/{version}/graph", 1224 handlers.GraphNode, 1225 true, 1226 }, 1227 // swagger:route GET /namespaces/{namespace}/applications/{app}/graph graphs graphApp 1228 // --- 1229 // The backing JSON for an app node detail graph. (supported graphTypes: app | versionedApp) 1230 // 1231 // Produces: 1232 // - application/json 1233 // 1234 // Schemes: http, https 1235 // 1236 // responses: 1237 // 400: badRequestError 1238 // 500: internalError 1239 // 200: graphResponse 1240 // 1241 { 1242 "GraphApp", 1243 "GET", 1244 "/api/namespaces/{namespace}/applications/{app}/graph", 1245 handlers.GraphNode, 1246 true, 1247 }, 1248 // swagger:route GET /namespaces/{namespace}/services/{service}/graph graphs graphService 1249 // --- 1250 // The backing JSON for a service node detail graph. 1251 // 1252 // Produces: 1253 // - application/json 1254 // 1255 // Schemes: http, https 1256 // 1257 // responses: 1258 // 400: badRequestError 1259 // 500: internalError 1260 // 200: graphResponse 1261 // 1262 { 1263 "GraphService", 1264 "GET", 1265 "/api/namespaces/{namespace}/services/{service}/graph", 1266 handlers.GraphNode, 1267 true, 1268 }, 1269 // swagger:route GET /namespaces/{namespace}/workloads/{workload}/graph graphs graphWorkload 1270 // --- 1271 // The backing JSON for a workload node detail graph. 1272 // 1273 // Produces: 1274 // - application/json 1275 // 1276 // Schemes: http, https 1277 // 1278 // responses: 1279 // 400: badRequestError 1280 // 500: internalError 1281 // 200: graphResponse 1282 // 1283 { 1284 "GraphWorkload", 1285 "GET", 1286 "/api/namespaces/{namespace}/workloads/{workload}/graph", 1287 handlers.GraphNode, 1288 true, 1289 }, 1290 // swagger:route GET /mesh/graph meshGraph 1291 // --- 1292 // The backing JSON for a mesh graph 1293 // 1294 // Produces: 1295 // - application/json 1296 // 1297 // Schemes: http, https 1298 // 1299 // responses: 1300 // 400: badRequestError 1301 // 500: internalError 1302 // 200: graphResponse 1303 // 1304 { 1305 "MeshGraph", 1306 "GET", 1307 "/api/mesh/graph", 1308 handlers.MeshGraph, 1309 true, 1310 }, 1311 // swagger:route GET /grafana integrations grafanaInfo 1312 // --- 1313 // Get the grafana URL and other descriptors 1314 // 1315 // Produces: 1316 // - application/json 1317 // 1318 // Schemes: http, https 1319 // 1320 // responses: 1321 // 500: internalError 1322 // 503: serviceUnavailableError 1323 // 200: grafanaInfoResponse 1324 // 204: noContent 1325 // 1326 { 1327 "GrafanaURL", 1328 "GET", 1329 "/api/grafana", 1330 handlers.GetGrafanaInfo, 1331 true, 1332 }, 1333 // swagger:route GET /tracing integrations tracingInfo 1334 // --- 1335 // Get the tracing URL and other descriptors 1336 // 1337 // Produces: 1338 // - application/json 1339 // 1340 // Schemes: http, https 1341 // 1342 // responses: 1343 // 404: notFoundError 1344 // 406: notAcceptableError 1345 // 200: tracingInfoResponse 1346 // 1347 { 1348 "TracingURL", 1349 "GET", 1350 "/api/tracing", 1351 handlers.GetTracingInfo, 1352 true, 1353 }, 1354 // swagger:route GET /namespaces/{namespace}/pods/{pod} pods podDetails 1355 // --- 1356 // Endpoint to get pod details 1357 // 1358 // Produces: 1359 // - application/json 1360 // 1361 // Schemes: http, https 1362 // 1363 // responses: 1364 // 500: internalError 1365 // 404: notFoundError 1366 // 200: workloadDetails 1367 // 1368 { 1369 "PodDetails", 1370 "GET", 1371 "/api/namespaces/{namespace}/pods/{pod}", 1372 handlers.PodDetails, 1373 true, 1374 }, 1375 // swagger:route GET /namespaces/{namespace}/pods/{pod}/logs pods podLogs 1376 // --- 1377 // Endpoint to get pod logs 1378 // 1379 // Produces: 1380 // - application/json 1381 // 1382 // Schemes: http, https 1383 // 1384 // responses: 1385 // 500: internalError 1386 // 404: notFoundError 1387 // 200: workloadDetails 1388 // 1389 { 1390 "PodLogs", 1391 "GET", 1392 "/api/namespaces/{namespace}/pods/{pod}/logs", 1393 handlers.PodLogs, 1394 true, 1395 }, 1396 // swagger:route GET /namespaces/{namespace}/pods/{pod}/config_dump pods podProxyDump 1397 // --- 1398 // Endpoint to get pod proxy dump 1399 // 1400 // Produces: 1401 // - application/json 1402 // 1403 // Schemes: http, https 1404 // 1405 // responses: 1406 // 500: internalError 1407 // 404: notFoundError 1408 // 200: configDump 1409 // 1410 { 1411 "PodConfigDump", 1412 "GET", 1413 "/api/namespaces/{namespace}/pods/{pod}/config_dump", 1414 handlers.ConfigDump, 1415 true, 1416 }, 1417 // swagger:route GET /namespaces/{namespace}/pods/{pod}/config_dump/{resource} pods podProxyResource 1418 // --- 1419 // Endpoint to get pod logs 1420 // 1421 // Produces: 1422 // - application/json 1423 // 1424 // Schemes: http, https 1425 // 1426 // responses: 1427 // 500: internalError 1428 // 404: notFoundError 1429 // 200: configDumpResource 1430 // 1431 { 1432 "PodConfigDump", 1433 "GET", 1434 "/api/namespaces/{namespace}/pods/{pod}/config_dump/{resource}", 1435 handlers.ConfigDumpResourceEntries, 1436 true, 1437 }, 1438 // swagger:route POST /namespaces/{namespace}/pods/{pod}/logging pods podProxyLogging 1439 // --- 1440 // Endpoint to set pod proxy log level 1441 // 1442 // Produces: 1443 // - application/json 1444 // 1445 // Schemes: http, https 1446 // 1447 // responses: 1448 // 500: internalError 1449 // 404: notFoundError 1450 // 400: badRequestError 1451 // 200: noContent 1452 // 1453 { 1454 "PodProxyLogging", 1455 "POST", 1456 "/api/namespaces/{namespace}/pods/{pod}/logging", 1457 handlers.LoggingUpdate, 1458 true, 1459 }, 1460 // swagger:route GET /clusters/metrics clusterName namespaces clustersMetrics 1461 // --- 1462 // Endpoint to fetch metrics to be displayed, related to all provided namespaces of provided cluster 1463 // 1464 // Produces: 1465 // - application/json 1466 // 1467 // Schemes: http, https 1468 // 1469 // responses: 1470 // 400: badRequestError 1471 // 503: serviceUnavailableError 1472 // 200: metricsResponse 1473 // 1474 { 1475 "ClustersMetrics", 1476 "GET", 1477 "/api/clusters/metrics", 1478 handlers.ClustersMetrics, 1479 true, 1480 }, 1481 // swagger:route POST /stats/metrics stats metricsStats 1482 // --- 1483 // Produces metrics statistics 1484 // 1485 // Produces: 1486 // - application/json 1487 // 1488 // Schemes: http, https 1489 // 1490 // responses: 1491 // 400: badRequestError 1492 // 503: serviceUnavailableError 1493 // 500: internalError 1494 // 200: metricsStatsResponse 1495 { 1496 Name: "MetricsStats", 1497 Method: "POST", 1498 Pattern: "/api/stats/metrics", 1499 HandlerFunc: handlers.MetricsStats, 1500 Authenticated: true, 1501 }, 1502 // swagger:route GET /api/clusters 1503 // --- 1504 // Endpoint to get the list of the clusters that are hosting the service mesh. 1505 // Produces: 1506 // - application/json 1507 // 1508 // Schemes: http, https 1509 // 1510 // responses: 1511 // 500: internalError 1512 // 200: clustersResponse 1513 { 1514 "GetClusters", 1515 "GET", 1516 "/api/clusters", 1517 handlers.GetClusters(conf, kialiCache, clientFactory, prom, traceClientLoader, cpm), 1518 true, 1519 }, 1520 // swagger:route GET /api/mesh/outbound_traffic_policy/mode 1521 // --- 1522 // Endpoint to get the OutboundTrafficPolicy Mode configured in the service mesh. 1523 // Produces: 1524 // - application/json 1525 // 1526 // Schemes: http, https 1527 // 1528 // responses: 1529 // 500: internalError 1530 // 200: clustersResponse 1531 { 1532 "OutboundTrafficPolicyMode", 1533 "GET", 1534 "/api/mesh/outbound_traffic_policy/mode", 1535 handlers.OutboundTrafficPolicyMode, 1536 true, 1537 }, 1538 // swagger:route GET /api/mesh/resources/thresholds 1539 // --- 1540 // Endpoint to get the IstiodResourceThresholds. 1541 // Produces: 1542 // - application/json 1543 // 1544 // Schemes: http, https 1545 // 1546 // responses: 1547 // 500: internalError 1548 // 200: istiodResourceThresholds 1549 { 1550 "IstiodResourceThresholds", 1551 "GET", 1552 "/api/mesh/resources/thresholds", 1553 handlers.IstiodResourceThresholds, 1554 true, 1555 }, 1556 // swagger:route GET /api/mesh/canaries/status 1557 // --- 1558 // Endpoint to get the IstiodCanariesStatus. 1559 // Produces: 1560 // - application/json 1561 // 1562 // Schemes: http, https 1563 // 1564 // responses: 1565 // 500: internalError 1566 // 200: istiodCanariesStatus 1567 { 1568 "IstiodCanariesStatus", 1569 "GET", 1570 "/api/mesh/canaries/status", 1571 handlers.IstiodCanariesStatus, 1572 true, 1573 }, 1574 } 1575 1576 return 1577 }