{
  "repo": "tidbcloud/infra-api",
  "binary": "debug",
  "binary_path": "cmd/debug/main.go",
  "surface_kind": "mixed_service",
  "type": "mixed_service",
  "services": [
    {
      "name": "DebugLifecycle",
      "package": "cmd/debug",
      "methods": [
        {
          "name": "LoadFlags",
          "name_key": "Runtime DebugLifecycle.LoadFlags",
          "input": "gardener-config, base-config, infra-api-config, projectName, addr",
          "output": "parsed startup flags",
          "type": "local"
        },
        {
          "name": "BuildBaseClusterClients",
          "name_key": "Runtime DebugLifecycle.BuildBaseClusterClients",
          "input": "base-config kubeconfig path",
          "output": "controller-runtime client and client-go clientset for the base cluster",
          "type": "local"
        },
        {
          "name": "BuildGardenerClusterClients",
          "name_key": "Runtime DebugLifecycle.BuildGardenerClusterClients",
          "input": "gardener-config kubeconfig path",
          "output": "controller-runtime client and client-go clientset for the gardener cluster",
          "type": "local"
        },
        {
          "name": "DiscoverSharedClusterContext",
          "name_key": "Runtime DebugLifecycle.DiscoverSharedClusterContext",
          "input": "default kubeconfig contexts matching .*f01.*",
          "output": "optional shared-provider clientset",
          "type": "local"
        },
        {
          "name": "RegisterRoutes",
          "name_key": "Runtime DebugLifecycle.RegisterRoutes",
          "input": "default net/http mux",
          "output": "index and log-stream routes registered",
          "type": "local"
        },
        {
          "name": "StartHTTPServer",
          "name_key": "Runtime DebugLifecycle.StartHTTPServer",
          "input": "addr",
          "output": "debug HTTP listener serving log aggregation endpoints",
          "type": "local"
        }
      ]
    },
    {
      "name": "DebugHTTP",
      "package": "cmd/debug",
      "type": "http",
      "methods": [
        {
          "name": "GET /",
          "name_key": "HTTP GET /",
          "path": "/",
          "http_method": "GET",
          "input": "none",
          "output": "HTML index page with links to registered log endpoints",
          "type": "http"
        },
        {
          "name": "GET /logs/infra-api/infra-provider",
          "name_key": "HTTP GET /logs/infra-api/infra-provider",
          "path": "/logs/infra-api/infra-provider",
          "http_method": "GET",
          "input": "none",
          "output": "concatenated infra-provider pod logs from namespace infra",
          "type": "http"
        },
        {
          "name": "GET /logs/dbaas/worker",
          "name_key": "HTTP GET /logs/dbaas/worker",
          "path": "/logs/dbaas/worker",
          "http_method": "GET",
          "input": "none",
          "output": "concatenated worker pod logs from the project namespace",
          "type": "http"
        },
        {
          "name": "GET /logs/dbaas/central-server",
          "name_key": "HTTP GET /logs/dbaas/central-server",
          "path": "/logs/dbaas/central-server",
          "http_method": "GET",
          "input": "none",
          "output": "concatenated central-server pod logs from the project namespace",
          "type": "http"
        },
        {
          "name": "GET /logs/dbaas/shared-provider",
          "name_key": "HTTP GET /logs/dbaas/shared-provider",
          "path": "/logs/dbaas/shared-provider",
          "http_method": "GET",
          "input": "none",
          "output": "concatenated aws-shared-provider-manager pod logs from namespace tidb-admin",
          "type": "http"
        }
      ]
    }
  ],
  "extensions": {
    "notes": [
      "The binary requires both -gardener-config and -base-config; it exits after printing flag usage if either is missing.",
      "The shared-provider route is conditionally registered only when a kubeconfig context matching .*f01.* is discovered, even though the index page always prints a link for it.",
      "Each log endpoint fans out concurrent pod log streams and concatenates them into a single HTTP response."
    ]
  }
}
