// If you make changes to this file, run "python -m dagster._grpc.compile" after.

syntax = "proto3";

package api;

service DagsterApi {
  rpc Ping (PingRequest) returns (PingReply) {}
  rpc Heartbeat (PingRequest) returns (PingReply) {}
  rpc StreamingPing (StreamingPingRequest) returns (stream StreamingPingEvent) {}
  rpc GetServerId (Empty) returns (GetServerIdReply) {}
  rpc ExecutionPlanSnapshot (ExecutionPlanSnapshotRequest) returns (ExecutionPlanSnapshotReply) {}
  rpc ListRepositories (ListRepositoriesRequest) returns (ListRepositoriesReply) {}
  rpc ExternalPartitionNames (ExternalPartitionNamesRequest) returns (ExternalPartitionNamesReply) {}
  rpc ExternalNotebookData (ExternalNotebookDataRequest) returns (ExternalNotebookDataReply) {}
  rpc ExternalPartitionConfig (ExternalPartitionConfigRequest) returns (ExternalPartitionConfigReply) {}
  rpc ExternalPartitionTags (ExternalPartitionTagsRequest) returns (ExternalPartitionTagsReply) {}
  rpc ExternalPartitionSetExecutionParams (ExternalPartitionSetExecutionParamsRequest) returns (stream StreamingChunkEvent) {}
  rpc ExternalPipelineSubsetSnapshot (ExternalPipelineSubsetSnapshotRequest) returns (ExternalPipelineSubsetSnapshotReply) {}
  rpc ExternalRepository (ExternalRepositoryRequest) returns (ExternalRepositoryReply) {}
  rpc ExternalJob (ExternalJobRequest) returns (ExternalJobReply) {}
  rpc StreamingExternalRepository (ExternalRepositoryRequest) returns (stream StreamingExternalRepositoryEvent) {}
  rpc ExternalScheduleExecution (ExternalScheduleExecutionRequest) returns (stream StreamingChunkEvent) {}
  rpc ExternalSensorExecution (ExternalSensorExecutionRequest) returns (stream StreamingChunkEvent) {}
  rpc ShutdownServer (Empty) returns (ShutdownServerReply) {}
  rpc CancelExecution (CancelExecutionRequest) returns (CancelExecutionReply) {}
  rpc CanCancelExecution (CanCancelExecutionRequest) returns (CanCancelExecutionReply) {}
  rpc StartRun (StartRunRequest) returns (StartRunReply) {}
  rpc GetCurrentImage (Empty) returns (GetCurrentImageReply) {}
  rpc GetCurrentRuns (Empty) returns (GetCurrentRunsReply) {}
  rpc ReloadCode (ReloadCodeRequest) returns (ReloadCodeReply) {}
}

message Empty {}

message PingRequest {
  string echo = 1;
}

message PingReply {
  string echo = 1;
}

message StreamingPingRequest {
  int32 sequence_length = 1;
  string echo = 2;
}

message StreamingPingEvent {
  int32 sequence_number = 1;
  string echo = 2;
}

message GetServerIdReply {
  string server_id = 1;
}

message ExecutionPlanSnapshotRequest {
  string serialized_execution_plan_snapshot_args = 1;
}

message ExecutionPlanSnapshotReply {
  string serialized_execution_plan_snapshot = 1;
}

message ExternalPartitionNamesRequest {
  string serialized_partition_names_args = 1;
}

message ExternalPartitionNamesReply {
  string serialized_external_partition_names_or_external_partition_execution_error = 1;
}

message ExternalNotebookDataRequest {
  string notebook_path = 1;
}

message ExternalNotebookDataReply {
  bytes content = 1;
}

message ExternalPartitionConfigRequest {
  string serialized_partition_args = 1;
}

message ExternalPartitionConfigReply {
  string serialized_external_partition_config_or_external_partition_execution_error = 1;
}

message ExternalPartitionTagsRequest {
  string serialized_partition_args = 1;
}

message ExternalPartitionTagsReply {
  string serialized_external_partition_tags_or_external_partition_execution_error = 1;
}

message ExternalPartitionSetExecutionParamsRequest {
  string serialized_partition_set_execution_param_args = 1;
}

message ListRepositoriesRequest {
}

message ListRepositoriesReply {
  string serialized_list_repositories_response_or_error = 1;
}

message ExternalPipelineSubsetSnapshotRequest {
  string serialized_pipeline_subset_snapshot_args = 1;
}

message ExternalPipelineSubsetSnapshotReply {
  string serialized_external_pipeline_subset_result = 1;
}

message ExternalRepositoryRequest {
  string serialized_repository_python_origin = 1;
  bool defer_snapshots = 2;
}

message ExternalRepositoryReply {
  string serialized_external_repository_data = 1;
}

message StreamingExternalRepositoryEvent {
  int32 sequence_number = 1;
  string serialized_external_repository_chunk = 2;
}

message ExternalScheduleExecutionRequest {
  string serialized_external_schedule_execution_args = 1;
}

message ExternalSensorExecutionRequest {
  string serialized_external_sensor_execution_args = 1;
}

message StreamingChunkEvent {
  int32 sequence_number = 1;
  string serialized_chunk = 2;
}

message ShutdownServerReply {
  string serialized_shutdown_server_result = 1;
}

message CancelExecutionRequest {
  string serialized_cancel_execution_request = 1;
}

message CancelExecutionReply {
  string serialized_cancel_execution_result = 1;
}

message CanCancelExecutionRequest {
  string serialized_can_cancel_execution_request = 1;
}

message CanCancelExecutionReply {
  string serialized_can_cancel_execution_result = 1;
}

message StartRunRequest {
  string serialized_execute_run_args = 1;
}

message StartRunReply {
  string serialized_start_run_result = 1;
}

message GetCurrentImageReply {
  string serialized_current_image = 1;
}

message GetCurrentRunsReply {
  string serialized_current_runs = 1;
}

message ExternalJobRequest {
  string serialized_repository_origin = 1;
  string job_name = 2;
}

message ExternalJobReply {
  string serialized_job_data = 1;
  string serialized_error = 2;
}

message ReloadCodeRequest {
}

message ReloadCodeReply {
  string serialized_error = 2;
}
