Skip to content
level2producer.proto 4.29 KiB
Newer Older
Wei Shoulin's avatar
Wei Shoulin committed
syntax = "proto3";

package dfs.facility.level2producer;
option go_package = "cnlab.net/csst/proto/facility/level2producer";
import "common/error.proto";

service Level2ProducerSrv {
        rpc Register(RegisterReq) returns (RegisterResp) {}
        rpc Find(FindReq) returns (FindResp) {}
        rpc FindNexts(FindNextsReq) returns (FindNextsResp) {}
        rpc FindStart(FindStartReq) returns (FindStartResp) {}
        rpc Get(GetReq) returns (GetResp) {}
        rpc Update(UpdateReq) returns (UpdateResp) {}
        rpc Delete(DeleteReq) returns (DeleteResp) {}

        rpc NewJob(NewJobReq) returns (NewJobResp) {}
        rpc GetJob(GetJobReq) returns (GetJobResp) {}
        rpc UpdateJob(UpdateJobReq) returns (UpdateJobResp) {}

        rpc WriteRunning(WriteRunningReq) returns (WriteRunningResp) {}
        rpc GetRunning(GetRunningReq) returns (GetRunningResp) {}
        rpc UpdateRunning(UpdateRunningReq) returns (UpdateRunningResp) {}
        rpc FindRunning(FindRunningReq) returns (FindRunningResp) {}
}
message Level2ProducerRecord {
        int64 id = 1;
        string name = 2;
        string gitlink = 3;
        string paramfiles = 4;
        string image = 5;
        int32 priority = 6;
        repeated int64 pre_producers = 7;
        string create_time = 8;
        string update_time = 9;
}
message Level2JobRecord {
        int64 id = 1;
        string name = 2;
        string dag = 3;
        int32 status = 4;
        string create_time = 5;
        string update_time = 6;        
}
message Level2ProducerRuningRecord {
        int64 id = 1;
        int64 job_id = 2;
        int64 producer_id = 3;
        int64 brick_id = 4;
        string start_time = 5;
        string end_time = 6;
        int32 prc_status = 7;
        string prc_result = 8;
        string create_time = 9;
        string update_time = 10;
}
message RegisterReq {
        Level2ProducerRecord record = 1;
}
message RegisterResp {
        bool success = 1;
        common.Error error = 2;
        Level2ProducerRecord record = 3;
}
message FindReq {
        string key = 1;
        int32 limit = 2;
}
message FindResp {
        bool success = 1;
        int32 totalCount = 2;
        common.Error error = 3;
        repeated Level2ProducerRecord records = 4;
}
message FindStartReq {
        string key = 1;
}
message FindStartResp {
        bool success = 1;
        int32 totalCount = 2;
        common.Error error = 3;
        repeated Level2ProducerRecord records = 4;
}
message FindNextsReq {
        int64 id = 1;
}
message FindNextsResp {
        bool success = 1;
        int32 totalCount = 2;
        common.Error error = 3;
        repeated Level2ProducerRecord records = 4;
}
message GetReq {
        int64 id = 1;
}
message GetResp {
        Level2ProducerRecord record = 1;
}
message UpdateReq {
        Level2ProducerRecord record = 1;
}
message UpdateResp {
        bool success = 1;
        common.Error error = 2;
}
message DeleteReq {
        int64 id = 1;
}
message DeleteResp {
        bool success = 1;
        common.Error error = 2;
}
message NewJobReq {
        Level2JobRecord record = 1;
}
message NewJobResp {
        bool success = 1;
        common.Error error = 2;
        Level2JobRecord record = 3;
}
message GetJobReq {
        int64 id = 1;
}
message GetJobResp {
        Level2JobRecord record = 1;
}
message UpdateJobReq {
        Level2JobRecord record = 1;
}
message UpdateJobResp {
        bool success = 1;
        common.Error error = 2;
}
message WriteRunningReq {
        Level2ProducerRuningRecord record = 1;
}
message WriteRunningResp {
        bool success = 1;
        common.Error error = 2;
        Level2ProducerRuningRecord record = 3;
}
message GetRunningReq {
        int64 id = 1;
}
message GetRunningResp {
        Level2ProducerRuningRecord record = 1;
}
message UpdateRunningReq {
        Level2ProducerRuningRecord record = 1;
}
message UpdateRunningResp {
        bool success = 1;
        common.Error error = 2;
}
message FindRunningReq {
        int64 job_id = 1;
        int64 producer_id = 2;
        int64 brick_id = 3;
        int32 prc_status = 4;
        string start_time = 5;
        string end_time = 6;
        int32 limit = 7;
}
message FindRunningResp {
        bool success = 1;
        int32 totalCount = 2;
        common.Error error = 3;
        repeated Level2ProducerRuningRecord records = 4;
}