| syntax = "proto3"; |
| |
| package xos; |
| |
| import "google/protobuf/empty.proto"; |
| import "annotations.proto"; |
| |
| message Xproto { |
| string filename = 1; |
| string contents = 2; |
| } |
| |
| message DeclFile { |
| string filename = 1; |
| string contents = 2; |
| }; |
| |
| message AtticFile { |
| string filename = 1; |
| string contents = 2; |
| }; |
| |
| message APIConvenienceFile { |
| string filename = 1; |
| string contents = 2; |
| }; |
| |
| message MigrationFile { |
| string filename = 1; |
| string contents = 2; |
| }; |
| |
| message LoadModelsRequest { |
| string name = 1; |
| string version = 2; // this is the service version |
| repeated Xproto xprotos = 3; |
| repeated DeclFile decls = 4; |
| repeated AtticFile attics = 5; |
| repeated APIConvenienceFile convenience_methods = 6; |
| repeated MigrationFile migrations = 7; |
| string core_version = 8; // this is the core version |
| }; |
| |
| message ListConvenienceMethodsReply { |
| repeated APIConvenienceFile convenience_methods = 1; |
| } |
| |
| message LoadModelsReply { |
| enum LoadModelsStatus { |
| SUCCESS = 0; |
| SUCCESS_NOTHING_CHANGED = 1; // Succeeded by not doing anything |
| ERROR = 101; // Unspecified Error |
| ERROR_LIVE_MODELS = 102; // Live models are present during unload request |
| ERROR_DELETION_IN_PROGRESS = 103; // Soft-deleted models are present, waiting for delete steps |
| TRYAGAIN = 201; // Caller should try again |
| } |
| LoadModelsStatus status = 1; |
| }; |
| |
| message UnloadModelsRequest { |
| enum CleanupBehavior { |
| REQUIRE_CLEAN = 0; // Return an error if live data is present (DEFAULT) |
| AUTOMATICALLY_CLEAN = 1; // Automatically delete live data, return an in-progress response as necessary |
| PURGE = 2; // Forcibly purge database tables without running delete steps |
| }; |
| |
| string name = 1; |
| string version = 2; |
| CleanupBehavior cleanup_behavior = 3; |
| }; |
| |
| message ServiceModelStatus { |
| string name = 1; |
| string version = 2; |
| string state = 3; |
| }; |
| |
| message LoadStatusReply { |
| int32 model_status = 1; |
| string model_output = 2; |
| repeated ServiceModelStatus services = 3; |
| } |
| |
| service dynamicload { |
| rpc LoadModels(LoadModelsRequest) returns (LoadModelsReply) { |
| option (googleapi.http) = { |
| post: "/xosapi/v1/dynamicload/load_models" |
| body: "*" |
| }; |
| } |
| rpc UnloadModels(UnloadModelsRequest) returns (LoadModelsReply) { |
| option (googleapi.http) = { |
| post: "/xosapi/v1/dynamicload/unload_models" |
| body: "*" |
| }; |
| } |
| rpc GetLoadStatus(google.protobuf.Empty) returns (LoadStatusReply) { |
| option (googleapi.http) = { |
| get: "/xosapi/v1/dynamicload/load_status" |
| }; |
| } |
| rpc GetConvenienceMethods(google.protobuf.Empty) returns (ListConvenienceMethodsReply) { |
| option (googleapi.http) = { |
| // NOTE do we need to expose this via rest? maybe for debug... |
| get: "/xosapi/v1/dynamicload/convenience_methods" |
| }; |
| } |
| }; |