/
config_service.proto
163 lines (122 loc) · 4.99 KB
/
config_service.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
syntax = "proto3";
option java_multiple_files = true;
package org.hypertrace.config.service.v1;
import "google/protobuf/struct.proto";
service ConfigService {
// Overrides the specified config with the config provided and upserts the
// provided config into the store. Also returns the config which is upserted.
rpc UpsertConfig(UpsertConfigRequest) returns (UpsertConfigResponse) {}
// Gets the config for the specified request
rpc GetConfig(GetConfigRequest) returns (GetConfigResponse) {}
// Gets all the configs(i.e. across all the contexts) for the specified request
rpc GetAllConfigs(GetAllConfigsRequest) returns (GetAllConfigsResponse) {}
// Deletes the config for the specified request
rpc DeleteConfig(DeleteConfigRequest) returns (DeleteConfigResponse) {}
rpc UpsertAllConfigs(UpsertAllConfigsRequest) returns (UpsertAllConfigsResponse) {}
rpc DeleteConfigs(DeleteConfigsRequest) returns (DeleteConfigsResponse) {}
}
message UpsertConfigRequest {
// required - name of the resource associated with the config
string resource_name = 1;
// required - namespace with which the config resource is associated
string resource_namespace = 2;
// required - config value to be upserted
google.protobuf.Value config = 3;
// optional - only required if config applies to a specific context.
// If empty, specified config is associated with a default context.
string context = 4;
}
message UpsertConfigResponse {
// config value upserted into the store
google.protobuf.Value config = 1;
// timestamp (in milliseconds since epoch) at which this config was created
int64 creation_timestamp = 2;
// timestamp (in milliseconds since epoch) at which this config was last updated
int64 update_timestamp = 3;
// prev version of config value in the store
optional google.protobuf.Value prev_config = 4;
}
message GetConfigRequest {
// required - name of the resource associated with the config
string resource_name = 1;
// required - namespace with which the config resource is associated
string resource_namespace = 2;
// optional; order matters - specify the contexts in the order of increasing
// priority. Example: ["service1", "api1"].
// Default context is implicitly appended to the beginning of the list.
repeated string contexts = 3;
}
message GetConfigResponse {
// config value returned for the specified request
google.protobuf.Value config = 1;
// timestamp (in milliseconds since epoch) at which this config was created
int64 creation_timestamp = 2;
// timestamp (in milliseconds since epoch) at which this config was last updated
int64 update_timestamp = 3;
}
message GetAllConfigsRequest {
// required - name of the resource associated with the config
string resource_name = 1;
// required - namespace with which the config resource is associated
string resource_namespace = 2;
}
message GetAllConfigsResponse {
// list of config values along with the associated contexts, sorted in the descending order of their creation time
repeated ContextSpecificConfig context_specific_configs = 1;
}
message ContextSpecificConfig {
// context associated with the below config
string context = 1;
// config value which applies to the above context
google.protobuf.Value config = 2;
// timestamp (in milliseconds since epoch) at which this config was created
int64 creation_timestamp = 3;
// timestamp (in milliseconds since epoch) at which this config was last updated
int64 update_timestamp = 4;
}
message DeleteConfigRequest {
// required - name of the resource associated with the config
string resource_name = 1;
// required - namespace with which the config resource is associated
string resource_namespace = 2;
// optional - only required if config applies to a specific context.
// If empty, specified config is associated with a default context.
string context = 3;
}
message DeleteConfigResponse {
ContextSpecificConfig deleted_config = 1;
}
message DeleteConfigsRequest {
repeated ConfigToDelete configs = 1;
message ConfigToDelete {
// required - name of the resource associated with the config
string resource_name = 1;
// required - namespace with which the config resource is associated
string resource_namespace = 2;
// optional - only required if config applies to a specific context.
// If empty, specified config is associated with a default context.
string context = 3;
}
}
message DeleteConfigsResponse {
repeated ContextSpecificConfig deleted_configs = 1;
}
message UpsertAllConfigsRequest {
repeated ConfigToUpsert configs = 1;
message ConfigToUpsert {
string resource_name = 1;
string resource_namespace = 2;
string context = 3;
google.protobuf.Value config = 4;
}
}
message UpsertAllConfigsResponse {
repeated UpsertedConfig upserted_configs = 1;
message UpsertedConfig {
string context = 1;
google.protobuf.Value config = 2;
int64 creation_timestamp = 3;
int64 update_timestamp = 4;
optional google.protobuf.Value prev_config = 5;
}
}