blob: 554e0a9ba921efd538172a90d2064e8a79adb92c [file] [log] [blame]
Don Newton276cd1f2019-02-06 17:14:03 -05001syntax = "proto3";
2
3package xos;
4
5import "google/protobuf/empty.proto";
6import "annotations.proto";
7import "common.proto";
8import "xosoptions.proto";
9
10message LoginRequest {
11 string username = 1;
12 string password = 2;
13};
14
15message LoginResponse {
16 string sessionid = 1;
17};
18
19message ModelFilter {
20 string class_name = 1;
21};
22
23message ModelListEntry {
24 string class_name = 1;
25 int32 id = 2;
26 string info = 3;
27};
28
29message ModelList {
30 repeated ModelListEntry items = 1;
31};
32
33message XProtos {
34 string xproto = 1;
35};
36
37message PopulatedServiceInstance {
38 option (contentTypeId) = "core.serviceinstance";
39 oneof id_present {
40 int32 id = 1;
41 }
42 oneof leaf_model_name_present {
43 string leaf_model_name = 2[(val).maxLength = 1024, (val).nonNull = true];
44 }
45 oneof name_present {
46 string name = 3[(val).maxLength = 200];
47 }
48 oneof owner_present {
49 int32 owner_id = 4[(val).nonNull = true, (foreignKey).modelName = "Service", (foreignKey).reverseFieldName = "service_instances"];
50 }
51 repeated int32 provided_service_instances = 5;
52 repeated int32 subscribed_service_instances = 6;
53 repeated int32 subscribed_service = 7;
54 repeated int32 subscribed_network = 8;
55};
56
57service utility {
58
59 rpc Login(LoginRequest) returns (LoginResponse) {
60 option (googleapi.http) = {
61 post: "/xosapi/v1/utility/login"
62 body: "*"
63 };
64 }
65
66 rpc Logout(google.protobuf.Empty) returns (google.protobuf.Empty) {
67 option (googleapi.http) = {
68 post: "/xosapi/v1/utility/logout"
69 body: "*"
70 };
71 }
72
73 rpc NoOp(google.protobuf.Empty) returns (google.protobuf.Empty) {
74 option (googleapi.http) = {
75 post: "/xosapi/v1/utility/noop"
76 body: "*"
77 };
78 }
79
80 rpc AuthenticatedNoOp(google.protobuf.Empty) returns (google.protobuf.Empty) {
81 option (googleapi.http) = {
82 post: "/xosapi/v1/utility/auth_noop"
83 body: "*"
84 };
85 }
86
87 rpc SetDirtyModels(ModelFilter) returns (ModelList) {
88 option (googleapi.http) = {
89 post: "/xosapi/v1/utility/dirty_models"
90 body: "*"
91 };
92 }
93
94 rpc ListDirtyModels(ModelFilter) returns (ModelList) {
95 option (googleapi.http) = {
96 get: "/xosapi/v1/utility/dirty_models"
97 };
98 }
99
100 rpc GetXproto(google.protobuf.Empty) returns (XProtos) {
101 option (googleapi.http) = {
102 get: "/xosapi/v1/xproto"
103 };
104 }
105
106 rpc GetPopulatedServiceInstances(ID) returns (PopulatedServiceInstance) {
107 option (googleapi.http) = {
108 get: "/xosapi/v1/core/populatedserviceinstance/{id}"
109 };
110 }
111};