{
  "repo": "tidbcloud/mimir",
  "binary": "server",
  "binary_path": "cmd/server/main.go",
  "dependencies": {
    "HealthAndMetrics.ping": {
      "infrastructure": {},
      "services": []
    },
    "HealthAndMetrics.metrics": {
      "infrastructure": {
        "prometheus": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Expose Prometheus handler",
              "trigger": "Serve internal server metrics",
              "implementation": "prom.RegisterOnMux(router)"
            }
          ]
        }
      },
      "services": []
    },
    "HealthAndMetrics.live": {
      "infrastructure": {},
      "services": []
    },
    "HealthAndMetrics.ready": {
      "infrastructure": {},
      "services": []
    },
    "JobManagementAPI.SubmitJob": {
      "infrastructure": {
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Persist and query job state",
              "trigger": "Submit and track jobs",
              "implementation": "model.Dial, model.Migrate, NewJobDao/NewSavepointDao/NewIngressDao"
            }
          ]
        },
        "kubernetes": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Create or update workload resources",
              "trigger": "Launch Flink workloads and related objects",
              "implementation": "config.Options.K8S.BuildClientset / BuildControllerClient and service.New(...)"
            }
          ]
        }
      },
      "services": [
        {
          "name": "flink-session-cluster",
          "target_interface": "Configured Flink REST endpoint",
          "operation_type": "rest_client",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Submit jobs and interact with session cluster",
              "trigger": "Serve v1 submit requests",
              "implementation": "service.FlinkSessionOpt(config.Options.Flink.SessionEndpoint)"
            }
          ]
        }
      ]
    },
    "JobManagementAPI.ListJob": {
      "infrastructure": {
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Read job metadata",
              "trigger": "List tracked jobs",
              "implementation": "jobDao queries from apiService"
            }
          ]
        }
      },
      "services": []
    },
    "JobManagementAPI.StopJob": {
      "infrastructure": {
        "kubernetes": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Update workload state",
              "trigger": "Stop a submitted job",
              "implementation": "apiService uses Kubernetes clientset and DAOs"
            }
          ]
        },
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Persist stop state",
              "trigger": "Track stopped jobs",
              "implementation": "jobDao and savepointDao"
            }
          ]
        }
      },
      "services": []
    },
    "JobManagementAPI.ResumeJob": {
      "infrastructure": {
        "kubernetes": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Recreate or resume workloads",
              "trigger": "Resume a stopped job",
              "implementation": "apiService.ResumeJob(...)"
            }
          ]
        },
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Persist resumed job state",
              "trigger": "Track resumed jobs",
              "implementation": "jobDao and savepointDao"
            }
          ]
        }
      },
      "services": []
    },
    "JobManagementAPI.GetLogs": {
      "infrastructure": {
        "kubernetes": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Read pod logs",
              "trigger": "Stream logs for a job id",
              "implementation": "svc.k8sClientSet.CoreV1().Pods(...).GetLogs(...)"
            }
          ]
        }
      },
      "services": []
    },
    "JobManagementAPI.RmJob": {
      "infrastructure": {
        "kubernetes": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Delete workload resources",
              "trigger": "Remove a submitted job",
              "implementation": "apiService.RmJob(...)"
            }
          ]
        },
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Delete tracked job records",
              "trigger": "Remove stored job metadata",
              "implementation": "jobDao / savepointDao updates"
            }
          ]
        }
      },
      "services": []
    },
    "JobManagementAPI.ShowSql": {
      "infrastructure": {},
      "services": [
        {
          "name": "flink-executor-template",
          "target_interface": "Configured executor command and mapper image inputs",
          "operation_type": "template_render",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Render SQL or job spec preview",
              "trigger": "Serve show-sql requests",
              "implementation": "service.ExecutorCMDOpt and service.MapperOpt"
            }
          ]
        }
      ]
    },
    "JobManagementAPI.CreateIngress": {
      "infrastructure": {
        "kubernetes": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Create ingress resources",
              "trigger": "Expose job endpoints",
              "implementation": "apiService.CreateIngress(...)"
            }
          ]
        },
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Persist ingress metadata",
              "trigger": "Track created ingress records",
              "implementation": "ingressDao"
            }
          ]
        }
      },
      "services": []
    },
    "JobManagementAPI.RmIngress": {
      "infrastructure": {
        "kubernetes": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Delete ingress resources",
              "trigger": "Remove job endpoint exposure",
              "implementation": "apiService.RmIngress(...)"
            }
          ]
        },
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Delete ingress metadata",
              "trigger": "Remove stored ingress records",
              "implementation": "ingressDao"
            }
          ]
        }
      },
      "services": []
    },
    "JobManagementAPI.SubmitJobV2": {
      "infrastructure": {
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Persist v2 job metadata",
              "trigger": "Create jobs through the v2 API",
              "implementation": "jobDao / sinkDao / savepointDao"
            }
          ]
        },
        "kubernetes": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Create workload resources",
              "trigger": "Launch jobs through the v2 API",
              "implementation": "apiService.SubmitJobV2(...)"
            }
          ]
        }
      },
      "services": [
        {
          "name": "kafka",
          "target_interface": "Configured Kafka brokers and credentials",
          "operation_type": "message_bus",
          "conditions": [
            "Depends on sink/job configuration"
          ],
          "operations": [
            {
              "operation": "Configure Kafka-backed job flow",
              "trigger": "Submit v2 jobs with sink integration",
              "implementation": "service.KafkaOpt(config.Options.Kafka)"
            }
          ]
        }
      ]
    },
    "JobManagementAPI.ListIngress": {
      "infrastructure": {
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Read ingress metadata",
              "trigger": "List tracked ingress entries",
              "implementation": "ingressDao"
            }
          ]
        }
      },
      "services": []
    },
    "SinkAPI.CreateSink": {
      "infrastructure": {
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Persist sink definition",
              "trigger": "Create a sink",
              "implementation": "sinkDao"
            }
          ]
        }
      },
      "services": [
        {
          "name": "biz-db-secret",
          "target_interface": "Kubernetes secret with downstream business DB DSN",
          "operation_type": "secret_lookup",
          "conditions": [
            "Secret exists in configured namespace"
          ],
          "operations": [
            {
              "operation": "Load downstream DB credentials",
              "trigger": "Initialize sink-facing DSN details",
              "implementation": "service.BizDsnOpt(client, secretName, namespace)"
            }
          ]
        }
      ]
    },
    "SinkAPI.ListSink": {
      "infrastructure": {
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Read sink definitions",
              "trigger": "List sinks",
              "implementation": "sinkDao"
            }
          ]
        }
      },
      "services": []
    },
    "SinkAPI.RmSink": {
      "infrastructure": {
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Delete sink definition",
              "trigger": "Remove a sink",
              "implementation": "sinkDao"
            }
          ]
        }
      },
      "services": []
    },
    "FlinkSessionProxy.Proxy": {
      "infrastructure": {},
      "services": [
        {
          "name": "flink-session-cluster",
          "target_interface": "Configured Flink REST endpoint",
          "operation_type": "reverse_proxy",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Forward arbitrary Flink API traffic",
              "trigger": "Handle /flink-api/* requests",
              "implementation": "apiService.FlinkSessionProxy(prefix)"
            }
          ]
        }
      ]
    },
    "TableCheckerEventSubscriber.Register": {
      "infrastructure": {
        "kubernetes": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Build controller-runtime client",
              "trigger": "Register table checker subscriber at startup",
              "implementation": "config.Options.K8S.BuildControllerClient()"
            }
          ]
        }
      },
      "services": [
        {
          "name": "event-bus",
          "target_interface": "In-process event bus subscriber registry",
          "operation_type": "worker_registration",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Register TableCheckerSubscriber",
              "trigger": "Initialize background event handling",
              "implementation": "event_bus.EventBus.Register(&event.TableCheckerSubscriber{...})"
            }
          ]
        }
      ]
    }
  },
  "notes": [
    "The deployed chart and Dockerfile only wire the API server from cmd/server; cmd/oauth2 is a separate auxiliary login helper without deployment manifests in this repo.",
    "Request handlers are wrapped by fn plugins, so API calls are subject to the auth middleware and TLS CN extraction when security certificates are configured."
  ]
}
