{
  "repo": "tidbcloud/cluster-service-ng",
  "binary": "executor",
  "binary_path": "cmd/executor/main.go",
  "dependencies": {
    "ExecutorService.Submit": {
      "infrastructure": {
        "mysql": {
          "conditions": ["Always"],
          "operations": ["SELECT", "INSERT", "UPDATE"]
        },
        "k8s_etcd": {
          "conditions": ["Always"],
          "operations": ["GET", "PUT", "DELETE"]
        }
      },
      "services": [
        {
          "name": "dataplane-manager",
          "target_interface": "DataPlaneService.CreateDataPlane",
          "operation_type": "grpc_unary",
          "conditions": ["When DAG action is create-dataplane"],
          "operations": ["create K8s cluster"]
        },
        {
          "name": "dataplane-manager",
          "target_interface": "DataPlaneService.GetDataPlane",
          "operation_type": "grpc_unary",
          "conditions": ["When DAG action needs dataplane status"],
          "operations": ["get K8s cluster status"]
        },
        {
          "name": "dataplane-manager",
          "target_interface": "DataPlaneService.DeleteDataPlane",
          "operation_type": "grpc_unary",
          "conditions": ["When DAG action is clear-dataplane"],
          "operations": ["delete K8s cluster"]
        },
        {
          "name": "dataplane-manager",
          "target_interface": "DataPlaneService.CreateNodePool",
          "operation_type": "grpc_unary",
          "conditions": ["When DAG action is create-node-instance-group"],
          "operations": ["create node pool"]
        },
        {
          "name": "dataplane-manager",
          "target_interface": "DataPlaneService.UpdateNodePool",
          "operation_type": "grpc_unary",
          "conditions": ["When DAG action updates node pool"],
          "operations": ["update node pool"]
        },
        {
          "name": "dataplane-manager",
          "target_interface": "DataPlaneService.DeleteNodePool",
          "operation_type": "grpc_unary",
          "conditions": ["When DAG action deletes node pool"],
          "operations": ["delete node pool"]
        },
        {
          "name": "dataplane-manager",
          "target_interface": "BucketService.CreateBucket",
          "operation_type": "grpc_unary",
          "conditions": ["When DAG action is create-bucket"],
          "operations": ["create S3 bucket"]
        },
        {
          "name": "dataplane-manager",
          "target_interface": "BucketService.ApplyLifecycleRules",
          "operation_type": "grpc_unary",
          "conditions": ["When DAG action is apply-bucket-lifecycle"],
          "operations": ["apply bucket lifecycle rules"]
        },
        {
          "name": "dataplane-manager",
          "target_interface": "BucketService.GrantDataplanePermission",
          "operation_type": "grpc_unary",
          "conditions": ["When DAG action grants bucket permission"],
          "operations": ["grant dataplane bucket permission"]
        },
        {
          "name": "dataplane-manager",
          "target_interface": "LoadBalancerService.CreateLoadBalancer",
          "operation_type": "grpc_unary",
          "conditions": ["When DAG action is apply-lb"],
          "operations": ["create load balancer"]
        },
        {
          "name": "dataplane-manager",
          "target_interface": "LoadBalancerService.DeleteLoadBalancer",
          "operation_type": "grpc_unary",
          "conditions": ["When DAG action is delete-lb"],
          "operations": ["delete load balancer"]
        },
        {
          "name": "dataplane-manager",
          "target_interface": "PrivateLinkConnectionService.CreatePrivateLinkService",
          "operation_type": "grpc_unary",
          "conditions": ["When DAG action creates private link"],
          "operations": ["create private link service"]
        },
        {
          "name": "dataplane-manager",
          "target_interface": "PrivateLinkConnectionService.CreatePrivateLinkEndpoint",
          "operation_type": "grpc_unary",
          "conditions": ["When DAG action creates private link endpoint"],
          "operations": ["create private link endpoint"]
        },
        {
          "name": "cluster-config-center",
          "target_interface": "ConfigService.GetDefaultVersion",
          "operation_type": "grpc_unary",
          "conditions": ["When DAG action needs default version"],
          "operations": ["get default template version"]
        },
        {
          "name": "k8s-api",
          "target_interface": "Kubernetes.Apply",
          "operation_type": "k8s_apply",
          "conditions": ["When DAG action applies K8s resources"],
          "operations": ["apply CRDs, Deployments, Services, etc."]
        },
        {
          "name": "k8s-api",
          "target_interface": "Kubernetes.Get",
          "operation_type": "k8s_get",
          "conditions": ["When DAG action checks resource status"],
          "operations": ["get resource status"]
        },
        {
          "name": "k8s-api",
          "target_interface": "Kubernetes.Delete",
          "operation_type": "k8s_delete",
          "conditions": ["When DAG action deletes resources"],
          "operations": ["delete K8s resources"]
        }
      ]
    },
    "ExecutorService.Abort": {
      "infrastructure": {
        "k8s_etcd": {
          "conditions": ["Always"],
          "operations": ["GET", "PUT", "DELETE"]
        }
      },
      "services": []
    },
    "ExecutorService.QueryRunnings": {
      "infrastructure": {
        "k8s_etcd": {
          "conditions": ["Always"],
          "operations": ["GET", "LIST"]
        }
      },
      "services": []
    }
  },
  "workflow_actions": [
    {
      "name": "create-dataplane",
      "description": "Creates a K8s cluster via dataplane-manager",
      "dependencies": {
        "services": [
          {
            "name": "dataplane-manager",
            "target_interface": "DataPlaneService.CreateDataPlane",
            "operation_type": "grpc_unary"
          },
          {
            "name": "dataplane-manager",
            "target_interface": "DataPlaneService.GetDataPlane",
            "operation_type": "grpc_unary"
          }
        ]
      }
    },
    {
      "name": "create-bucket",
      "description": "Creates S3 bucket via dataplane-manager",
      "dependencies": {
        "services": [
          {
            "name": "dataplane-manager",
            "target_interface": "BucketService.CreateBucket",
            "operation_type": "grpc_unary"
          }
        ]
      }
    },
    {
      "name": "apply-component-group",
      "description": "Applies TiDB/TiKV/PD component groups to K8s",
      "dependencies": {
        "infrastructure": {
          "k8s": {
            "conditions": ["Always"],
            "operations": ["APPLY CRDs"]
          }
        }
      }
    },
    {
      "name": "apply-tidb-group",
      "description": "Applies TiDB group to K8s",
      "dependencies": {
        "infrastructure": {
          "k8s": {
            "conditions": ["Always"],
            "operations": ["APPLY TiDBGroup CRD"]
          }
        }
      }
    },
    {
      "name": "apply-dm-cluster",
      "description": "Applies DM cluster to K8s",
      "dependencies": {
        "infrastructure": {
          "k8s": {
            "conditions": ["Always"],
            "operations": ["APPLY DMCluster CRD"]
          }
        }
      }
    },
    {
      "name": "apply-hpa",
      "description": "Applies HPA configuration",
      "dependencies": {
        "infrastructure": {
          "k8s": {
            "conditions": ["Always"],
            "operations": ["APPLY HPA resource"]
          }
        }
      }
    },
    {
      "name": "apply-lb",
      "description": "Creates load balancer via dataplane-manager",
      "dependencies": {
        "services": [
          {
            "name": "dataplane-manager",
            "target_interface": "LoadBalancerService.CreateLoadBalancer",
            "operation_type": "grpc_unary"
          }
        ]
      }
    },
    {
      "name": "apply-cluster-agent",
      "description": "Deploys cluster-agent to K8s",
      "dependencies": {
        "infrastructure": {
          "k8s": {
            "conditions": ["Always"],
            "operations": ["APPLY Deployment"]
          }
        }
      }
    },
    {
      "name": "create-node-instance-group",
      "description": "Creates node pool via dataplane-manager",
      "dependencies": {
        "services": [
          {
            "name": "dataplane-manager",
            "target_interface": "DataPlaneService.CreateNodePool",
            "operation_type": "grpc_unary"
          }
        ]
      }
    },
    {
      "name": "create-cert",
      "description": "Creates TLS certificates",
      "dependencies": {
        "infrastructure": {
          "k8s": {
            "conditions": ["Always"],
            "operations": ["APPLY Certificate, Issuer"]
          }
        }
      }
    },
    {
      "name": "create-service-account",
      "description": "Creates K8s service account",
      "dependencies": {
        "infrastructure": {
          "k8s": {
            "conditions": ["Always"],
            "operations": ["APPLY ServiceAccount, RBAC"]
          }
        }
      }
    },
    {
      "name": "clear-dataplane",
      "description": "Deletes K8s cluster via dataplane-manager",
      "dependencies": {
        "services": [
          {
            "name": "dataplane-manager",
            "target_interface": "DataPlaneService.DeleteDataPlane",
            "operation_type": "grpc_unary"
          }
        ]
      }
    },
    {
      "name": "send-metering-metadata",
      "description": "Sends metering metadata",
      "dependencies": {
        "services": [
          {
            "name": "metering-service",
            "target_interface": "MeteringService.Write",
            "operation_type": "grpc_unary"
          }
        ]
      }
    }
  ]
}
