{
  "repo": "tidbcloud/aws-shared-provider",
  "binary": "gateway-controller",
  "binary_path": "cmd/gateway-controller/main.go",
  "dependencies": {
    "HTTP GET /healthz": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /readyz": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /metrics": {
      "infrastructure": {},
      "services": []
    },
    "Runtime GatewayReconciler.Reconcile": {
      "infrastructure": {},
      "services": [
        {
          "name": "kubernetes-api",
          "target_interface": "GET /apis/apps/v1/namespaces/{ns}/deployments/{name}",
          "operation_type": "http_get",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Get Gateway deployment",
              "trigger": "Read existing gateway deployment status",
              "conditions": ["Always"],
              "implementation": "r.Get"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "GET /apis/apps/v1/namespaces/{ns}/deployments",
          "operation_type": "http_get",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "List deployments",
              "trigger": "List all gateway deployments for recycling old versions",
              "conditions": ["Always"],
              "implementation": "r.List"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "POST /apis/apps/v1/namespaces/{ns}/deployments",
          "operation_type": "http_post",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Create Gateway deployment",
              "trigger": "Create new gateway deployment when not exists",
              "conditions": ["DeploymentNotExists"],
              "implementation": "r.Create"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "DELETE /apis/apps/v1/namespaces/{ns}/deployments/{name}",
          "operation_type": "http_delete",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Delete old version deployment",
              "trigger": "Recycle old zero-replica deployments after retention timeout",
              "conditions": ["OldVersionCleanup"],
              "implementation": "r.Delete"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "PUT /apis/apps/v1/namespaces/{ns}/deployments/{name}",
          "operation_type": "http_put",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Scale deployment to zero",
              "trigger": "Scale old deployment to zero for graceful connection drain",
              "conditions": ["OldVersionCleanup"],
              "implementation": "r.Update"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "GET /apis/gateway.tidbcloud.com/v1alpha1/namespaces/{ns}/gateways/{name}",
          "operation_type": "http_get",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Get Gateway CRD",
              "trigger": "Read gateway configuration",
              "conditions": ["Always"],
              "implementation": "r.Get"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "PUT /apis/gateway.tidbcloud.com/v1alpha1/namespaces/{ns}/gateways/{name}/status",
          "operation_type": "http_put",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Update Gateway status",
              "trigger": "Update gateway CRD status subresource",
              "conditions": ["StatusUpdateNeeded"],
              "implementation": "r.Status().Update"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "GET /apis/autoscaling/v2/namespaces/{ns}/horizontalpodautoscalers/{name}",
          "operation_type": "http_get",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Get HPA",
              "trigger": "Read existing HPA for gateway",
              "conditions": ["Always"],
              "implementation": "r.Get"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "POST /apis/autoscaling/v2/namespaces/{ns}/horizontalpodautoscalers",
          "operation_type": "http_post",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Create HPA",
              "trigger": "Create HPA for gateway deployment",
              "conditions": ["HPANotExists"],
              "implementation": "r.Create"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "PUT /apis/autoscaling/v2/namespaces/{ns}/horizontalpodautoscalers/{name}",
          "operation_type": "http_put",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Update HPA",
              "trigger": "Update HPA configuration",
              "conditions": ["HPAExists"],
              "implementation": "r.Update"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "GET /api/v1/namespaces/{ns}/services/{name}",
          "operation_type": "http_get",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Get Service",
              "trigger": "Read existing gateway service",
              "conditions": ["Always"],
              "implementation": "r.Get"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "POST /api/v1/namespaces/{ns}/services",
          "operation_type": "http_post",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Create Service",
              "trigger": "Create gateway service when not exists",
              "conditions": ["ServiceNotExists"],
              "implementation": "r.Create"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "PUT /api/v1/namespaces/{ns}/services/{name}",
          "operation_type": "http_put",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Update Service",
              "trigger": "Update gateway service labels",
              "conditions": ["ServiceExists"],
              "implementation": "r.Update"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "GET /apis/monitoring.coreos.com/v1/namespaces/{ns}/servicemonitors/{name}",
          "operation_type": "http_get",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Get ServiceMonitor",
              "trigger": "Read existing service monitor",
              "conditions": ["Always"],
              "implementation": "r.Get"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "POST /apis/monitoring.coreos.com/v1/namespaces/{ns}/servicemonitors",
          "operation_type": "http_post",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Create ServiceMonitor",
              "trigger": "Create service monitor for gateway",
              "conditions": ["ServiceMonitorNotExists"],
              "implementation": "r.Create"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "GET /apis/haproxy.ingress.io/v1/namespaces/{ns}/tcps/{name}",
          "operation_type": "http_get",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Get TCP resource",
              "trigger": "Read existing HAProxy TCP config",
              "conditions": ["Always"],
              "implementation": "r.Get"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "POST /apis/haproxy.ingress.io/v1/namespaces/{ns}/tcps",
          "operation_type": "http_post",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Create TCP resource",
              "trigger": "Create HAProxy TCP config when not exists",
              "conditions": ["TCPNotExists"],
              "implementation": "r.Create"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "PUT /apis/haproxy.ingress.io/v1/namespaces/{ns}/tcps/{name}",
          "operation_type": "http_put",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Update TCP resource",
              "trigger": "Update HAProxy TCP configuration",
              "conditions": ["TCPExists"],
              "implementation": "r.Update"
            }
          ]
        },
        {
          "name": "prometheus",
          "target_interface": "GET /api/v1/query",
          "operation_type": "http_get",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Query traffic metrics",
              "trigger": "Query Prometheus for gateway traffic data",
              "conditions": ["Always"],
              "implementation": "query.NewPromQueryer.Query(O11yGlobalReadURL)"
            }
          ]
        }
      ]
    },
    "Runtime PodAnnotationReconciler.Reconcile": {
      "infrastructure": {},
      "services": [
        {
          "name": "kubernetes-api",
          "target_interface": "GET /api/v1/namespaces/{ns}/pods/{name}",
          "operation_type": "http_get",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Get pod resource",
              "trigger": "Read pod annotations before update",
              "conditions": ["Always"],
              "implementation": "r.Get"
            }
          ]
        },
        {
          "name": "kubernetes-api",
          "target_interface": "PUT /api/v1/namespaces/{ns}/pods/{name}",
          "operation_type": "http_put",
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "Update pod annotations",
              "trigger": "Update gateway pod routing annotations",
              "conditions": ["Always"],
              "implementation": "r.Update"
            }
          ]
        }
      ]
    }
  }
}
