Don Newton | 276cd1f | 2019-02-06 17:14:03 -0500 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | |
| 3 | package xos; |
| 4 | |
| 5 | import "google/protobuf/empty.proto"; |
| 6 | import "annotations.proto"; |
| 7 | |
| 8 | message Xproto { |
| 9 | string filename = 1; |
| 10 | string contents = 2; |
| 11 | } |
| 12 | |
| 13 | message DeclFile { |
| 14 | string filename = 1; |
| 15 | string contents = 2; |
| 16 | }; |
| 17 | |
| 18 | message AtticFile { |
| 19 | string filename = 1; |
| 20 | string contents = 2; |
| 21 | }; |
| 22 | |
| 23 | message APIConvenienceFile { |
| 24 | string filename = 1; |
| 25 | string contents = 2; |
| 26 | }; |
| 27 | |
| 28 | message LoadModelsRequest { |
| 29 | string name = 1; |
| 30 | string version = 2; |
| 31 | repeated Xproto xprotos = 3; |
| 32 | repeated DeclFile decls = 4; |
| 33 | repeated AtticFile attics = 5; |
| 34 | repeated APIConvenienceFile convenience_methods = 6; |
| 35 | }; |
| 36 | |
| 37 | message ListConvenienceMethodsReply { |
| 38 | repeated APIConvenienceFile convenience_methods = 1; |
| 39 | } |
| 40 | |
| 41 | message LoadModelsReply { |
| 42 | enum LoadModelsStatus { |
| 43 | SUCCESS = 0; |
| 44 | ERROR = 1; |
| 45 | } |
| 46 | LoadModelsStatus status = 1; |
| 47 | }; |
| 48 | |
| 49 | message UnloadModelsRequest { |
| 50 | string name = 1; |
| 51 | string version = 2; |
| 52 | }; |
| 53 | |
| 54 | message ServiceModelStatus { |
| 55 | string name = 1; |
| 56 | string version = 2; |
| 57 | string state = 3; |
| 58 | }; |
| 59 | |
| 60 | message LoadStatusReply { |
| 61 | int32 model_status = 1; |
| 62 | string model_output = 2; |
| 63 | repeated ServiceModelStatus services = 3; |
| 64 | } |
| 65 | |
| 66 | service dynamicload { |
| 67 | rpc LoadModels(LoadModelsRequest) returns (LoadModelsReply) { |
| 68 | option (googleapi.http) = { |
| 69 | post: "/xosapi/v1/dynamicload/load_models" |
| 70 | body: "*" |
| 71 | }; |
| 72 | } |
| 73 | rpc UnloadModels(UnloadModelsRequest) returns (LoadModelsReply) { |
| 74 | option (googleapi.http) = { |
| 75 | post: "/xosapi/v1/dynamicload/unload_models" |
| 76 | body: "*" |
| 77 | }; |
| 78 | } |
| 79 | rpc GetLoadStatus(google.protobuf.Empty) returns (LoadStatusReply) { |
| 80 | option (googleapi.http) = { |
| 81 | get: "/xosapi/v1/dynamicload/load_status" |
| 82 | }; |
| 83 | } |
| 84 | rpc GetConvenienceMethods(google.protobuf.Empty) returns (ListConvenienceMethodsReply) { |
| 85 | option (googleapi.http) = { |
| 86 | // NOTE do we need to expose this via rest? maybe for debug... |
| 87 | get: "/xosapi/v1/dynamicload/convenience_methods" |
| 88 | }; |
| 89 | } |
| 90 | }; |