{
  "swagger": "2.0",
  "info": {
    "title": "replay/replay.proto",
    "version": "0.1"
  },
  "tags": [
    {
      "name": "ReplayService"
    }
  ],
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/api/v1/orgs/{org_id}/clusters/{cluster_id}/replays": {
      "get": {
        "summary": "ListReplays lists all replay tasks for a cluster or organization",
        "operationId": "ListReplays",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/replayListReplaysResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "ReplayService"
        ]
      },
      "post": {
        "summary": "CreateReplay creates a new replay task",
        "operationId": "CreateReplay",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/replayCreateReplayResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "replay": {
                  "$ref": "#/definitions/replayReplaySpec"
                }
              },
              "required": [
                "replay"
              ]
            }
          }
        ],
        "tags": [
          "ReplayService"
        ]
      }
    },
    "/api/v1/orgs/{org_id}/clusters/{cluster_id}/replays/{replay_id}": {
      "get": {
        "summary": "GetReplay retrieves a replay task by ID",
        "operationId": "GetReplay",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/replayGetReplayResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "replay_id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "ReplayService"
        ]
      },
      "delete": {
        "summary": "DeleteReplay deletes a replay task",
        "operationId": "DeleteReplay",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object",
              "properties": {}
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "replay_id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "ReplayService"
        ]
      },
      "patch": {
        "summary": "UpdateReplay updates an existing replay task configuration",
        "operationId": "UpdateReplay",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/replayUpdateReplayResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "replay_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "replay": {
                  "$ref": "#/definitions/replayReplaySpec"
                }
              },
              "required": [
                "replay"
              ]
            }
          }
        ],
        "tags": [
          "ReplayService"
        ]
      }
    },
    "/api/v1/orgs/{org_id}/clusters/{cluster_id}/replays/{replay_id}:start": {
      "post": {
        "summary": "StartReplay starts a replay task",
        "operationId": "StartReplay",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object",
              "properties": {}
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "replay_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object"
            }
          }
        ],
        "tags": [
          "ReplayService"
        ]
      }
    },
    "/api/v1/orgs/{org_id}/clusters/{cluster_id}/replays/{replay_id}:stop": {
      "post": {
        "summary": "StopReplay stops a running replay task",
        "operationId": "StopReplay",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object",
              "properties": {}
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "replay_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object"
            }
          }
        ],
        "tags": [
          "ReplayService"
        ]
      }
    }
  },
  "definitions": {
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "replayAWSAuditLog": {
      "type": "object",
      "properties": {
        "s3_url": {
          "type": "string",
          "title": "s3_url is the S3 URL of the audit log"
        },
        "role_arn": {
          "type": "string",
          "title": "role_arn is the IAM role ARN for accessing S3"
        },
        "external_id": {
          "type": "string",
          "title": "external_id is the external ID for role assumption"
        }
      },
      "title": "AWSAuditLog specifies AWS S3 audit log location",
      "required": [
        "s3_url",
        "role_arn"
      ]
    },
    "replayAliyunAuditLog": {
      "type": "object",
      "properties": {
        "access_key_id": {
          "type": "string",
          "description": "access_key_id is the Aliyun access key id for OSS conversion. Provide it\ntogether with secret_access_key only when bucket_url is an oss:// URL."
        },
        "secret_access_key": {
          "type": "string",
          "description": "secret_access_key is the Aliyun secret access key for OSS conversion.\nProvide it together with access_key_id only when bucket_url is an oss:// URL."
        },
        "bucket_url": {
          "type": "string",
          "description": "bucket_url is the audit log URL/prefix. Without access keys it is accepted\nas the final audit-log URL, including endpoint, credential, or signed query\nparameters; with access keys it must be an oss:// URL/prefix. The service\nstores bucket_url as sensitive material and redacts credential-like query\nparameters from read/status payloads."
        }
      },
      "description": "AliyunAuditLog specifies an audit log source for Aliyun replay flows.\n\nIt supports two bucket_url modes:\n- URL-only: when access_key_id and secret_access_key are omitted, bucket_url\n  is used as an already-resolved audit log URL/prefix as provided. This may\n  include endpoint, credential, or signed query parameters.\n- OSS conversion: when access_key_id and secret_access_key are provided,\n  bucket_url must be an oss:// URL/prefix and the service builds an\n  S3-compatible OSS URL for replay execution."
    },
    "replayAuditLogAddr": {
      "type": "object",
      "properties": {
        "aws": {
          "$ref": "#/definitions/replayAWSAuditLog"
        },
        "gcp": {
          "$ref": "#/definitions/replayGCPAuditLog"
        },
        "aliyun": {
          "$ref": "#/definitions/replayAliyunAuditLog"
        }
      },
      "title": "AuditLogAddr specifies the address of audit logs"
    },
    "replayCreateReplayResponse": {
      "type": "object",
      "properties": {
        "replay_id": {
          "type": "string"
        },
        "replay": {
          "$ref": "#/definitions/replayReplay"
        }
      }
    },
    "replayGCPAuditLog": {
      "type": "object",
      "properties": {
        "gcs_url": {
          "type": "string",
          "title": "gcs_url is the GCS URL of the audit log"
        },
        "service_account_json": {
          "type": "string",
          "title": "service_account_json is the GCP service account JSON for accessing GCS"
        }
      },
      "title": "GCPAuditLog specifies GCP GCS audit log location",
      "required": [
        "gcs_url"
      ]
    },
    "replayGetReplayResponse": {
      "type": "object",
      "properties": {
        "replay": {
          "$ref": "#/definitions/replayReplay"
        }
      }
    },
    "replayListReplaysResponse": {
      "type": "object",
      "properties": {
        "replays": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/replayReplay"
          }
        },
        "total_size": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "replayReplay": {
      "type": "object",
      "properties": {
        "replay_id": {
          "type": "string",
          "title": "replay_id is the unique identifier for the replay task",
          "readOnly": true
        },
        "org_id": {
          "type": "string",
          "title": "org_id is the organization ID",
          "readOnly": true
        },
        "project_id": {
          "type": "string",
          "title": "project_id is the project ID",
          "readOnly": true
        },
        "cluster_id": {
          "type": "string",
          "title": "cluster_id is the target cluster ID (same as target_cluster_id in spec)",
          "readOnly": true
        },
        "desired_state": {
          "$ref": "#/definitions/replayReplayDesiredState",
          "title": "desired_state is the user-desired state"
        },
        "current_state": {
          "$ref": "#/definitions/replayReplayCurrentState",
          "title": "current_state is the actual runtime state",
          "readOnly": true
        },
        "source_cluster_id": {
          "type": "string",
          "title": "source_cluster_id is the cluster to replay audit logs from"
        },
        "cloud_provider": {
          "type": "string",
          "title": "cloud_provider is the cloud provider (aws/gcp/azure/aliyun)",
          "readOnly": true
        },
        "region": {
          "type": "string",
          "title": "region is the deployment region",
          "readOnly": true
        },
        "replay_tasks": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/replayReplayTask"
          },
          "title": "replay_tasks contains the replay task list"
        },
        "replay_config": {
          "$ref": "#/definitions/replayReplayCommonConfig",
          "title": "replay_config contains common replay configuration"
        },
        "replicas": {
          "type": "integer",
          "format": "int32",
          "title": "replicas specifies the number of replicas"
        },
        "task_resources": {
          "$ref": "#/definitions/replayReplayTaskResources",
          "title": "task_resources defines resource allocation"
        },
        "replay_image": {
          "type": "string",
          "title": "replay_image specifies the container image"
        },
        "source_audit_credential": {
          "$ref": "#/definitions/replayAuditLogAddr",
          "title": "source_audit_credential specifies audit log access credential"
        },
        "replay_status": {
          "$ref": "#/definitions/replayReplayStatus",
          "title": "replay_status contains detailed status information",
          "readOnly": true
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "created_at is the creation timestamp",
          "readOnly": true
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "updated_at is the last update timestamp",
          "readOnly": true
        }
      },
      "title": "Replay represents a complete replay task with status",
      "required": [
        "desired_state",
        "replay_tasks",
        "replay_config"
      ]
    },
    "replayReplayCommonConfig": {
      "type": "object",
      "properties": {
        "replay_config": {
          "$ref": "#/definitions/replayReplayConfig",
          "title": "replay_config contains replay-specific configurations"
        },
        "username": {
          "type": "string",
          "title": "username for database connection"
        },
        "password": {
          "type": "string",
          "title": "password for database connection (will be encrypted)"
        }
      },
      "title": "ReplayCommonConfig contains common configuration for all replay tasks"
    },
    "replayReplayConfig": {
      "type": "object",
      "properties": {
        "replay_start_time": {
          "type": "string",
          "title": "replay_start_time is the start time in the upstream cluster"
        },
        "run_start_time": {
          "type": "string",
          "title": "run_start_time is the local time when replay starts"
        },
        "replay_index": {
          "type": "integer",
          "format": "int32",
          "title": "replay_index specifies the replay index"
        },
        "custom_arguments": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "title": "custom_arguments contains custom key-value arguments"
        },
        "format": {
          "type": "string",
          "title": "format of the audit log"
        },
        "ignore_errs": {
          "type": "boolean",
          "title": "ignore_errs ignores errors during replay"
        },
        "ps_close": {
          "type": "string",
          "title": "ps_close closes prepared statements"
        },
        "buf_size": {
          "type": "integer",
          "format": "int32",
          "title": "buf_size specifies the buffer size"
        },
        "speed": {
          "type": "string",
          "title": "speed specifies the replay speed (e.g., \"1x\", \"2x\", \"0.5x\")"
        },
        "dynamic_input": {
          "type": "boolean",
          "title": "dynamic_input enables dynamic input mode"
        },
        "read_only": {
          "type": "boolean",
          "title": "read_only enables read-only mode"
        }
      },
      "title": "ReplayConfig contains detailed replay configuration"
    },
    "replayReplayCurrentState": {
      "type": "string",
      "enum": [
        "REPLAY_CURRENT_STATE_UNSPECIFIED",
        "REPLAY_CURRENT_STATE_PENDING",
        "REPLAY_CURRENT_STATE_DEPLOYING",
        "REPLAY_CURRENT_STATE_DEPLOYED",
        "REPLAY_CURRENT_STATE_STARTING",
        "REPLAY_CURRENT_STATE_RUNNING",
        "REPLAY_CURRENT_STATE_PAUSING",
        "REPLAY_CURRENT_STATE_PAUSED",
        "REPLAY_CURRENT_STATE_DELETING",
        "REPLAY_CURRENT_STATE_DELETED"
      ],
      "default": "REPLAY_CURRENT_STATE_UNSPECIFIED",
      "description": "- REPLAY_CURRENT_STATE_PENDING: Waiting to start\n - REPLAY_CURRENT_STATE_DEPLOYING: Deploying resources\n - REPLAY_CURRENT_STATE_DEPLOYED: Resources deployed\n - REPLAY_CURRENT_STATE_STARTING: Starting replay\n - REPLAY_CURRENT_STATE_RUNNING: Running replay\n - REPLAY_CURRENT_STATE_PAUSING: Pausing replay\n - REPLAY_CURRENT_STATE_PAUSED: Paused\n - REPLAY_CURRENT_STATE_DELETING: Deleting resources\n - REPLAY_CURRENT_STATE_DELETED: Deleted",
      "title": "ReplayCurrentState represents the actual runtime state of the replay"
    },
    "replayReplayDataSource": {
      "type": "object",
      "properties": {
        "source_audit_log_addrs": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/replayAuditLogAddr"
          }
        }
      },
      "title": "ReplayDataSource specifies the source of audit logs",
      "required": [
        "source_audit_log_addrs"
      ]
    },
    "replayReplayDataTarget": {
      "type": "object",
      "properties": {
        "endpoint": {
          "type": "string",
          "title": "endpoint is the database endpoint"
        },
        "username": {
          "type": "string",
          "title": "username for database connection"
        },
        "password": {
          "type": "string",
          "title": "password for database connection"
        }
      },
      "title": "ReplayDataTarget specifies the target database connection",
      "required": [
        "endpoint"
      ]
    },
    "replayReplayDesiredState": {
      "type": "string",
      "enum": [
        "REPLAY_DESIRED_STATE_UNSPECIFIED",
        "REPLAY_DESIRED_STATE_DEPLOY",
        "REPLAY_DESIRED_STATE_ACTIVE",
        "REPLAY_DESIRED_STATE_PAUSE"
      ],
      "default": "REPLAY_DESIRED_STATE_UNSPECIFIED",
      "description": "- REPLAY_DESIRED_STATE_DEPLOY: User wants to deploy\n - REPLAY_DESIRED_STATE_ACTIVE: User wants it active\n - REPLAY_DESIRED_STATE_PAUSE: User wants to pause",
      "title": "ReplayDesiredState represents the user-desired state of the replay"
    },
    "replayReplayPhase": {
      "type": "string",
      "enum": [
        "REPLAY_PHASE_UNSPECIFIED",
        "REPLAY_PHASE_PENDING",
        "REPLAY_PHASE_CREATING",
        "REPLAY_PHASE_RUNNING",
        "REPLAY_PHASE_STOPPED",
        "REPLAY_PHASE_DELETED",
        "REPLAY_PHASE_FAILED"
      ],
      "default": "REPLAY_PHASE_UNSPECIFIED",
      "description": "- REPLAY_PHASE_PENDING: Waiting to start\n - REPLAY_PHASE_CREATING: Creating resources\n - REPLAY_PHASE_RUNNING: Running replay\n - REPLAY_PHASE_STOPPED: Stopped\n - REPLAY_PHASE_DELETED: Deleted\n - REPLAY_PHASE_FAILED: Failed",
      "title": "ReplayPhase represents the phase in replay status"
    },
    "replayReplayReplicaStatus": {
      "type": "object",
      "properties": {
        "pod_name": {
          "type": "string",
          "title": "pod_name is the Kubernetes pod name"
        },
        "index": {
          "type": "integer",
          "format": "int32",
          "title": "index is the replica index"
        },
        "phase": {
          "$ref": "#/definitions/replayReplayTaskPhase",
          "title": "phase is the current phase of the replica"
        },
        "ready": {
          "type": "boolean",
          "title": "ready indicates if the replica is ready"
        },
        "message": {
          "type": "string",
          "title": "message contains replica-level status message"
        },
        "task_info": {
          "$ref": "#/definitions/replayReplayTaskInfo",
          "title": "task_info contains detailed task information"
        }
      },
      "title": "ReplayReplicaStatus contains status of a single replica"
    },
    "replayReplaySpec": {
      "type": "object",
      "properties": {
        "source_cluster_id": {
          "type": "string",
          "title": "source_cluster_id is the cluster to replay audit logs from"
        },
        "target_cluster_id": {
          "type": "string",
          "title": "target_cluster_id is the cluster to replay audit logs to"
        },
        "replay_tasks": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/replayReplayTask"
          },
          "title": "replay_tasks contains advanced replay task configurations"
        },
        "replay_config": {
          "$ref": "#/definitions/replayReplayCommonConfig",
          "title": "replay_config contains common replay configuration"
        },
        "replicas": {
          "type": "integer",
          "format": "int32",
          "title": "replicas specifies the number of replicas (default: 1)"
        },
        "task_resources": {
          "$ref": "#/definitions/replayReplayTaskResources",
          "title": "task_resources defines resource allocation for replay tasks"
        },
        "replay_image": {
          "type": "string",
          "title": "replay_image specifies the container image for replay tasks"
        },
        "source_audit_credential": {
          "$ref": "#/definitions/replayAuditLogAddr",
          "title": "source_audit_credential specifies the audit log access credential"
        },
        "cloud_provider": {
          "type": "string",
          "title": "cloud_provider is the cloud provider (aws, gcp, azure, aliyun)"
        },
        "region": {
          "type": "string",
          "title": "region is the cloud region"
        },
        "project_id": {
          "type": "string",
          "title": "project id"
        }
      },
      "title": "ReplaySpec defines the specification for creating/updating a replay",
      "required": [
        "source_cluster_id",
        "target_cluster_id",
        "cloud_provider",
        "region"
      ]
    },
    "replayReplayStatus": {
      "type": "object",
      "properties": {
        "phase": {
          "$ref": "#/definitions/replayReplayPhase",
          "title": "phase is the current phase of the replay"
        },
        "message": {
          "type": "string",
          "title": "message contains human-readable status message"
        },
        "tasks": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/replayReplayTaskStatus"
          },
          "title": "tasks contains status of individual replay tasks"
        },
        "last_update_time": {
          "type": "string",
          "format": "date-time",
          "title": "last_update_time is the last status update time"
        },
        "aws_node_role_arn": {
          "type": "string",
          "title": "aws_node_role_arn is the AWS IAM role ARN for replay nodes"
        }
      },
      "title": "ReplayStatus represents the current status of a replay"
    },
    "replayReplayTask": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "title": "name of the replay task"
        },
        "data_source": {
          "$ref": "#/definitions/replayReplayDataSource",
          "title": "data_source specifies the source of audit logs"
        },
        "data_target": {
          "$ref": "#/definitions/replayReplayDataTarget",
          "title": "data_target specifies the target database"
        },
        "replicas": {
          "type": "integer",
          "format": "int32",
          "title": "replicas specifies the number of replicas for this task"
        },
        "replay_start_time": {
          "type": "string",
          "title": "replay_start_time is the start time in the upstream cluster"
        },
        "run_start_time": {
          "type": "string",
          "title": "run_start_time is the local time when replay starts"
        },
        "resources": {
          "$ref": "#/definitions/replayReplayTaskResources",
          "title": "resources for this specific task"
        },
        "per_replay_configs": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/replayReplayConfig"
          },
          "title": "per_replay_configs contains per-replica configurations"
        },
        "image": {
          "type": "string",
          "title": "image specifies the container image for this task"
        }
      },
      "title": "ReplayTask represents a single replay task",
      "required": [
        "name",
        "data_source",
        "data_target"
      ]
    },
    "replayReplayTaskInfo": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "title": "type of the replay task"
        },
        "status": {
          "type": "string",
          "title": "status of the replay task"
        },
        "start_time": {
          "type": "string",
          "title": "start_time when the task started"
        },
        "end_time": {
          "type": "string",
          "title": "end_time when the task ended"
        },
        "progress": {
          "type": "integer",
          "format": "int32",
          "title": "progress percentage (0-100)"
        },
        "error": {
          "type": "string",
          "title": "error message if any"
        },
        "last_command_timestamp": {
          "type": "string",
          "title": "last_command_timestamp is the timestamp of the last replayed command"
        },
        "sync_time": {
          "type": "string",
          "title": "sync_time is the synchronization time"
        },
        "source_audit_log_addrs": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/replayAuditLogAddr"
          },
          "title": "source_audit_log_addrs lists the audit log sources"
        },
        "total_commands": {
          "type": "string",
          "format": "int64",
          "title": "total_commands is the total number of commands to replay"
        },
        "replayed_commands": {
          "type": "string",
          "format": "int64",
          "title": "replayed_commands is the number of commands replayed"
        },
        "failed_commands": {
          "type": "string",
          "format": "int64",
          "title": "failed_commands is the number of failed commands"
        },
        "total_bytes": {
          "type": "string",
          "format": "int64",
          "title": "total_bytes is the total size of audit logs in bytes"
        },
        "processed_bytes": {
          "type": "string",
          "format": "int64",
          "title": "processed_bytes is the number of bytes processed"
        }
      },
      "title": "ReplayTaskInfo contains detailed information about a replay task"
    },
    "replayReplayTaskPhase": {
      "type": "string",
      "enum": [
        "REPLAY_TASK_PHASE_UNSPECIFIED",
        "REPLAY_TASK_PHASE_PENDING",
        "REPLAY_TASK_PHASE_RUNNING",
        "REPLAY_TASK_PHASE_STOPPED",
        "REPLAY_TASK_PHASE_DELETED"
      ],
      "default": "REPLAY_TASK_PHASE_UNSPECIFIED",
      "title": "ReplayTaskPhase represents the phase of a replay task"
    },
    "replayReplayTaskResources": {
      "type": "object",
      "properties": {
        "instance_type": {
          "type": "string",
          "title": "instance_type specifies the instance type (e.g., \"c6i.8xlarge\")"
        },
        "storage_size": {
          "type": "string",
          "title": "storage_size specifies the storage size (e.g., \"200G\")"
        }
      },
      "title": "ReplayTaskResources defines resource requirements for replay tasks"
    },
    "replayReplayTaskStatus": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "title": "name of the task"
        },
        "replica_statuses": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/replayReplayReplicaStatus"
          },
          "title": "replica_statuses contains status of each replica"
        },
        "message": {
          "type": "string",
          "title": "message contains task-level status message"
        }
      },
      "title": "ReplayTaskStatus contains status of a single replay task"
    },
    "replayUpdateReplayResponse": {
      "type": "object",
      "properties": {
        "replay": {
          "$ref": "#/definitions/replayReplay"
        }
      }
    },
    "rpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/protobufAny"
          }
        }
      }
    }
  },
  "securityDefinitions": {
    "bearer": {
      "type": "apiKey",
      "description": "Authentication token, prefixed by Bearer: Bearer \u003ctoken\u003e",
      "name": "Authorization",
      "in": "header"
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "externalDocs": {
    "description": "DBaaS Dataflow Service",
    "url": "https://github.com/tidbcloud/dataflow-service"
  }
}
