{
  "repo": "pingcap/dm",
  "binary": "dm-master",
  "binary_path": "cmd/dm-master/main.go",
  "dependencies": {
    "MasterRPC.StartTask": {
      "infrastructure": {
        "etcd": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Run master state machine on embedded etcd and scheduler state",
              "trigger": "gRPC request reaches dm-master leader",
              "implementation": "master.NewServer(cfg); server.Start(ctx)"
            }
          ]
        }
      },
      "services": []
    },
    "MasterRPC.QueryStatus": {
      "infrastructure": {
        "etcd": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Read scheduler and worker status from cluster state",
              "trigger": "gRPC status query",
              "implementation": "pb.RegisterMasterServer(gs, s)"
            }
          ]
        }
      },
      "services": []
    },
    "MasterRPC.OperateTask": {
      "infrastructure": {
        "etcd": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Persist task operation and coordinate workers",
              "trigger": "gRPC task operation",
              "implementation": "Server.OperateTask"
            }
          ]
        }
      },
      "services": []
    },
    "GatewayAPI.TaskStatus": {
      "infrastructure": {
        "grpc_gateway": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Translate HTTP task status requests into master gRPC calls",
              "trigger": "GET /apis/v1alpha1/status/{task}",
              "implementation": "pb.RegisterMasterHandler(ctx, gwmux, conn)"
            }
          ]
        }
      },
      "services": []
    },
    "OpenAPI.GetClusterMasterList": {
      "infrastructure": {
        "http": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Serve OpenAPI requests through Echo router",
              "trigger": "GET /api/v1/cluster/masters",
              "implementation": "openapi.RegisterHandlers(e, s)"
            }
          ]
        }
      },
      "services": []
    },
    "OpenAPI.GetDocJSON": {
      "infrastructure": {},
      "services": []
    },
    "StatusAPI.Status": {
      "infrastructure": {},
      "services": []
    },
    "MetricsAPI.Metrics": {
      "infrastructure": {
        "prometheus": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Expose metrics on embedded etcd listener",
              "trigger": "Master process starts",
              "implementation": "startEtcd(..., userHandles, etcdStartTimeout)"
            }
          ]
        }
      },
      "services": []
    },
    "DebugAPI.PprofIndex": {
      "infrastructure": {},
      "services": []
    }
  }
}
