{
  "repo": "tidbcloud/dataservices",
  "binary": "adminapi",
  "binary_path": "cmd/adminapi/main.go",
  "surface_kind": "mixed_service",
  "type": "mixed_service",
  "extensions": {
    "notes": [
      "This binary is a long-running service, not an admin CLI tool.",
      "HTTP exposure is a grpc-gateway alias over the same six gRPC services plus /healthz.",
      "The runtime is hosted by tiinf; HTTP and gRPC listeners are not started manually in cmd/adminapi/main.go."
    ]
  },
  "services": [
    {
      "name": "AdminAPILifecycle",
      "package": "cmd/adminapi",
      "methods": [
        {
          "name": "LoadConfigAndDatabase",
          "name_key": "AdminAPILifecycle.LoadConfigAndDatabase",
          "input": "config-path and MySQL connection settings",
          "output": "global config initialized and MySQL connection created",
          "type": "local"
        },
        {
          "name": "StartEventbus",
          "name_key": "AdminAPILifecycle.StartEventbus",
          "input": "MySQL connection",
          "output": "dataservice_adminapi eventbus running when not in local mode",
          "type": "background_worker"
        },
        {
          "name": "InitDynamoDB",
          "name_key": "AdminAPILifecycle.InitDynamoDB",
          "input": "global config",
          "output": "DynamoDB client initialized when not in local mode",
          "type": "local"
        },
        {
          "name": "CreateTiinfRuntime",
          "name_key": "AdminAPILifecycle.CreateTiinfRuntime",
          "input": "config-path and unary interceptor chain",
          "output": "tiinf runtime with gRPC server and Gin engine",
          "type": "local"
        },
        {
          "name": "RegisterGrpcServices",
          "name_key": "AdminAPILifecycle.RegisterGrpcServices",
          "input": "tiinf gRPC server",
          "output": "six adminapi v1beta1 gRPC services registered",
          "type": "local"
        },
        {
          "name": "RegisterHttpGateway",
          "name_key": "AdminAPILifecycle.RegisterHttpGateway",
          "input": "tiinf Gin engine and parsed tiinf config",
          "output": "grpc-gateway mounted on /v1beta1/*any with auth and permission middleware",
          "type": "local"
        },
        {
          "name": "RunTiinfRuntime",
          "name_key": "AdminAPILifecycle.RunTiinfRuntime",
          "input": "configured tiinf runtime",
          "output": "HTTP and gRPC listeners started under tiinf",
          "type": "local"
        }
      ]
    },
    {
      "name": "AdminAPIHTTP",
      "package": "api",
      "type": "http",
      "methods": [
        {
          "name": "GET /healthz",
          "name_key": "HTTP GET /healthz",
          "path": "/healthz",
          "http_method": "GET",
          "input": "none",
          "output": "HTTP 200",
          "type": "http"
        },
        {
          "name": "ANY /v1beta1/*any",
          "name_key": "Runtime AdminAPIGateway.RouteV1beta1",
          "path": "/v1beta1/*any",
          "http_method": "ANY",
          "input": "grpc-gateway generated REST requests for adminapi services",
          "output": "REST-to-gRPC gateway responses",
          "type": "http"
        }
      ]
    },
    {
      "name": "DataAppsService",
      "package": "internal/controller/adminapi_grpc",
      "type": "grpc",
      "methods": [
        {"name": "CreateDataApp", "name_key": "DataAppsService.CreateDataApp", "input": "CreateDataAppRequest", "output": "DataApp", "type": "grpc"},
        {"name": "ListDataApps", "name_key": "DataAppsService.ListDataApps", "input": "ListDataAppsRequest", "output": "ListDataAppsResponse", "type": "grpc"},
        {"name": "GetDataApp", "name_key": "DataAppsService.GetDataApp", "input": "GetDataAppRequest", "output": "DataApp", "type": "grpc"},
        {"name": "UpdateDataApp", "name_key": "DataAppsService.UpdateDataApp", "input": "UpdateDataAppRequest", "output": "DataApp", "type": "grpc"},
        {"name": "DeleteDataApp", "name_key": "DataAppsService.DeleteDataApp", "input": "DeleteDataAppRequest", "output": "Empty", "type": "grpc"},
        {"name": "GetChat2QuerySettings", "name_key": "DataAppsService.GetChat2QuerySettings", "input": "GetChat2QuerySettingsRequest", "output": "Chat2QuerySettings", "type": "grpc"},
        {"name": "UpdateChat2QuerySettings", "name_key": "DataAppsService.UpdateChat2QuerySettings", "input": "UpdateChat2QuerySettingsRequest", "output": "Chat2QuerySettings", "type": "grpc"},
        {"name": "UpdateSystemEndpointConfig", "name_key": "DataAppsService.UpdateSystemEndpointConfig", "input": "UpdateSystemEndpointConfigRequest", "output": "SystemEndpointConfig", "type": "grpc"},
        {"name": "GetSystemEndpointConfig", "name_key": "DataAppsService.GetSystemEndpointConfig", "input": "GetSystemEndpointConfigRequest", "output": "SystemEndpointConfig", "type": "grpc"}
      ]
    },
    {
      "name": "DataSourcesService",
      "package": "internal/controller/adminapi_grpc",
      "type": "grpc",
      "methods": [
        {"name": "CreateDataSource", "name_key": "DataSourcesService.CreateDataSource", "input": "CreateDataSourceRequest", "output": "DataSource", "type": "grpc"},
        {"name": "GetDataSource", "name_key": "DataSourcesService.GetDataSource", "input": "GetDataSourceRequest", "output": "DataSource", "type": "grpc"},
        {"name": "ListDataSources", "name_key": "DataSourcesService.ListDataSources", "input": "ListDataSourcesRequest", "output": "ListDataSourcesResponse", "type": "grpc"},
        {"name": "DeleteDataSource", "name_key": "DataSourcesService.DeleteDataSource", "input": "DeleteDataSourceRequest", "output": "Empty", "type": "grpc"}
      ]
    },
    {
      "name": "EndpointsService",
      "package": "internal/controller/adminapi_grpc",
      "type": "grpc",
      "methods": [
        {"name": "ListEndpoints", "name_key": "EndpointsService.ListEndpoints", "input": "ListEndpointsRequest", "output": "ListEndpointsResponse", "type": "grpc"},
        {"name": "CreateEndpoint", "name_key": "EndpointsService.CreateEndpoint", "input": "CreateEndpointRequest", "output": "Endpoint", "type": "grpc"},
        {"name": "GetEndpoint", "name_key": "EndpointsService.GetEndpoint", "input": "GetEndpointRequest", "output": "Endpoint", "type": "grpc"},
        {"name": "UpdateEndpoint", "name_key": "EndpointsService.UpdateEndpoint", "input": "UpdateEndpointRequest", "output": "Endpoint", "type": "grpc"},
        {"name": "DeleteEndpoint", "name_key": "EndpointsService.DeleteEndpoint", "input": "DeleteEndpointRequest", "output": "Empty", "type": "grpc"},
        {"name": "TestEndpoint", "name_key": "EndpointsService.TestEndpoint", "input": "TestEndpointRequest", "output": "TestEndpointResponse", "type": "grpc"}
      ]
    },
    {
      "name": "DeploymentsService",
      "package": "internal/controller/adminapi_grpc",
      "type": "grpc",
      "methods": [
        {"name": "CreateDeployment", "name_key": "DeploymentsService.CreateDeployment", "input": "CreateDeploymentRequest", "output": "Deployment", "type": "grpc"},
        {"name": "ListDeployments", "name_key": "DeploymentsService.ListDeployments", "input": "ListDeploymentsRequest", "output": "ListDeploymentsResponse", "type": "grpc"},
        {"name": "GetDeployment", "name_key": "DeploymentsService.GetDeployment", "input": "GetDeploymentRequest", "output": "Deployment", "type": "grpc"}
      ]
    },
    {
      "name": "ApiKeyService",
      "package": "internal/controller/adminapi_grpc",
      "type": "grpc",
      "methods": [
        {"name": "ListApiKeys", "name_key": "ApiKeyService.ListApiKeys", "input": "ListApiKeysRequest", "output": "ListApiKeysResponse", "type": "grpc"},
        {"name": "CreateApiKey", "name_key": "ApiKeyService.CreateApiKey", "input": "CreateApiKeyRequest", "output": "ApiKey", "type": "grpc"},
        {"name": "GetApiKey", "name_key": "ApiKeyService.GetApiKey", "input": "GetApiKeyRequest", "output": "ApiKey", "type": "grpc"},
        {"name": "UpdateApiKey", "name_key": "ApiKeyService.UpdateApiKey", "input": "UpdateApiKeyRequest", "output": "ApiKey", "type": "grpc"},
        {"name": "DeleteApiKey", "name_key": "ApiKeyService.DeleteApiKey", "input": "DeleteApiKeyRequest", "output": "Empty", "type": "grpc"}
      ]
    },
    {
      "name": "ApiSpecService",
      "package": "internal/controller/adminapi_grpc",
      "type": "grpc",
      "methods": [
        {"name": "GetApiSpec", "name_key": "ApiSpecService.GetApiSpec", "input": "GetApiSpecRequest", "output": "ApiSpec", "type": "grpc"}
      ]
    }
  ]
}
