Skip to content

Commit f1d7e0e

Browse files
committed
update fabric.proto
1 parent fd89f2b commit f1d7e0e

File tree

5 files changed

+3218
-1949
lines changed

5 files changed

+3218
-1949
lines changed

io/defang/v1/fabric.proto

Lines changed: 91 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ option go_package = "github.com/DefangLabs/defang/src/protos/io/defang/v1";
66
package io.defang.v1;
77

88
import "google/protobuf/empty.proto";
9-
import "google/protobuf/struct.proto";
109
import "google/protobuf/timestamp.proto";
1110

1211
service FabricController {
@@ -27,11 +26,16 @@ service FabricController {
2726
rpc Deploy(DeployRequest) returns (DeployResponse);
2827
rpc Get(ServiceID) returns (ServiceInfo) {
2928
option idempotency_level = NO_SIDE_EFFECTS;
30-
}; // should be GetService
31-
rpc Delete(DeleteRequest) returns (DeleteResponse){
29+
}; // should be GetService
30+
rpc Delete(DeleteRequest) returns (DeleteResponse) {
3231
option deprecated = true;
33-
}; // used by pulumi-defang provider; should use Deploy
34-
rpc Publish(PublishRequest) returns (google.protobuf.Empty);
32+
}; // used by pulumi-defang provider; should use Deploy or Destroy
33+
rpc Destroy(DestroyRequest) returns (DestroyResponse) {
34+
option idempotency_level = IDEMPOTENT;
35+
}
36+
rpc Publish(PublishRequest) returns (google.protobuf.Empty) {
37+
option deprecated = true;
38+
}
3539
rpc Subscribe(SubscribeRequest) returns (stream SubscribeResponse);
3640
// rpc Promote(google.protobuf.Empty) returns (google.protobuf.Empty);
3741
rpc GetServices(google.protobuf.Empty) returns (ListServicesResponse) {
@@ -53,8 +57,12 @@ service FabricController {
5357
}
5458

5559
// deprecate - change to use *Config functions
56-
rpc PutSecret(SecretValue) returns (google.protobuf.Empty) {option deprecated = true;};
57-
rpc DeleteSecrets(Secrets) returns (google.protobuf.Empty) {option deprecated = true;};
60+
rpc PutSecret(PutConfigRequest) returns (google.protobuf.Empty) {
61+
option deprecated = true;
62+
};
63+
rpc DeleteSecrets(Secrets) returns (google.protobuf.Empty) {
64+
option deprecated = true;
65+
};
5866
rpc ListSecrets(google.protobuf.Empty) returns (Secrets) {
5967
option idempotency_level = NO_SIDE_EFFECTS;
6068
option deprecated = true;
@@ -65,9 +73,10 @@ service FabricController {
6573
}; // no values
6674
rpc PutConfig(PutConfigRequest) returns (google.protobuf.Empty) {
6775
option idempotency_level = IDEMPOTENT;
68-
6976
};
70-
rpc DeleteConfigs(DeleteConfigsRequest) returns (google.protobuf.Empty);
77+
rpc DeleteConfigs(DeleteConfigsRequest) returns (google.protobuf.Empty) {
78+
option idempotency_level = IDEMPOTENT;
79+
}
7180
rpc ListConfigs(ListConfigsRequest) returns (ListConfigsResponse) {
7281
option idempotency_level = NO_SIDE_EFFECTS;
7382
}; // no values
@@ -86,8 +95,28 @@ service FabricController {
8695
option idempotency_level = NO_SIDE_EFFECTS;
8796
};
8897
rpc Track(TrackRequest) returns (google.protobuf.Empty);
98+
99+
// Endpoint for GDPR compliance
100+
rpc DeleteMe(google.protobuf.Empty) returns (google.protobuf.Empty) {
101+
option idempotency_level = IDEMPOTENT;
102+
}
103+
104+
rpc VerifyDNSSetup(VerifyDNSSetupRequest) returns (google.protobuf.Empty) {
105+
option idempotency_level = NO_SIDE_EFFECTS;
106+
}
107+
}
108+
109+
message VerifyDNSSetupRequest {
110+
string domain = 1;
111+
repeated string targets = 2;
112+
}
113+
114+
message DestroyRequest {
115+
string project = 1; // defaults to tenant ID
89116
}
90117

118+
message DestroyResponse { string etag = 1; }
119+
91120
message DebugRequest {
92121
repeated File files = 1;
93122
string etag = 2;
@@ -123,17 +152,18 @@ message TrackRequest {
123152
}
124153

125154
enum DeploymentMode {
126-
UNSPECIFIED_MODE= 0;
155+
UNSPECIFIED_MODE = 0;
127156
DEVELOPMENT = 1;
128157
STAGING = 2;
129158
PRODUCTION = 3;
130159
}
131160

132161
message DeployRequest {
133-
repeated Service services = 1 [deprecated = true]; // deprecated; use compose
134-
string project = 2 [deprecated = true]; // deprecated; use compose.name
162+
repeated Service services = 1
163+
[ deprecated = true ]; // deprecated; use compose
164+
string project = 2 [ deprecated = true ]; // deprecated; use compose.name
135165
DeploymentMode mode = 3;
136-
google.protobuf.Struct compose = 4;
166+
bytes compose = 4; // yaml (or json)
137167
}
138168

139169
message DeployResponse {
@@ -169,7 +199,6 @@ message UploadURLRequest { string digest = 1; }
169199

170200
message UploadURLResponse { string url = 1; }
171201

172-
173202
enum ServiceState {
174203
NOT_SPECIFIED = 0;
175204

@@ -198,70 +227,70 @@ message ServiceInfo {
198227
string etag = 4;
199228
string status = 5;
200229
repeated string nat_ips = 6; // comma-separated list of NAT IPs
201-
repeated string lb_ips = 7; // comma-separated list of internal CIDRs for the load-balancer
230+
repeated string lb_ips =
231+
7; // comma-separated list of internal CIDRs for the load-balancer
202232
string private_fqdn = 8; // fully qualified domain name (host)
203233
string public_fqdn = 9; // fully qualified domain name (ingress)
204234
google.protobuf.Timestamp created_at = 10;
205235
google.protobuf.Timestamp updated_at = 11;
206236
string zone_id = 12; // zone ID for byod domain
207-
bool use_acme_cert = 13; // If we should setup the facilities to use ACME(let's encrypt) certs
208-
reserved 14; // was: string lb_dns
237+
bool use_acme_cert =
238+
13; // If we should setup the facilities to use ACME(let's encrypt) certs
239+
reserved 14; // was: string lb_dns
209240
ServiceState state = 15; // enumerated status of the service
210-
string domainname = 16; // domain name for the service
241+
string domainname = 16; // domain name for the service
211242

212243
// bool is_function = 5; // true if service is a function
213244
}
214245

215246
message Secrets {
247+
option deprecated = true;
216248
repeated string names = 1;
217249
string project = 2; // defaults to tenant ID
218250
}
219251

220252
message SecretValue {
253+
option deprecated = true;
221254
string name = 1;
222255
string value = 2;
223256
string project = 3; // defaults to tenant ID
224257
}
225258

259+
enum ConfigType {
260+
CONFIGTYPE_UNSPECIFIED = 0;
261+
CONFIGTYPE_SENSITIVE = 1;
262+
}
263+
226264
message Config {
227265
string name = 1;
228266
string value = 2;
229267
string project = 3;
230-
bool is_sensitive = 4;
268+
ConfigType type = 4;
231269
}
232270

233271
message ConfigKey {
234272
string name = 1;
235273
string project = 2; // defaults to tenant ID
236274
}
237275

238-
message GetConfigsRequest {
239-
repeated ConfigKey configs = 1;
240-
}
241-
242-
message GetConfigsResponse {
243-
repeated Config configs = 1;
244-
}
245-
246-
247-
message DeleteConfigsRequest {
248-
repeated ConfigKey configs = 1;
249-
}
250-
251276
message PutConfigRequest {
252277
string name = 1;
253278
string value = 2;
254279
string project = 3;
255-
bool is_sensitive = 4;
280+
ConfigType type = 4;
256281
}
257282

283+
message GetConfigsRequest { repeated ConfigKey configs = 1; }
284+
285+
message GetConfigsResponse { repeated Config configs = 1; }
286+
287+
message DeleteConfigsRequest { repeated ConfigKey configs = 1; }
288+
258289
message ListConfigsRequest {
259290
string project = 1; // defaults to tenant ID
260291
}
261292

262-
message ListConfigsResponse {
263-
repeated ConfigKey configs = 1;
264-
}
293+
message ListConfigsResponse { repeated ConfigKey configs = 1; }
265294

266295
message TokenRequest {
267296
string tenant = 1;
@@ -305,6 +334,7 @@ message LogEntry {
305334
string service = 4;
306335
string etag = 5;
307336
string host = 6;
337+
string job = 7;
308338
}
309339

310340
message TailResponse {
@@ -320,12 +350,12 @@ message ListServicesResponse {
320350
string project = 2;
321351
}
322352

323-
// TODO: internal message; move to a separate proto file
324353
message ProjectUpdate {
325354
repeated ServiceInfo services = 1;
326355
string alb_arn = 2;
327-
string project = 3; // should we use compose.name?
328-
google.protobuf.Struct compose = 4;
356+
string project = 3 [deprecated = true]; // deprecated; use compose.name
357+
bytes compose = 4;
358+
string cd_version = 5;
329359
}
330360

331361
enum Platform {
@@ -434,7 +464,7 @@ message Service {
434464
string name = 1;
435465
string image = 2;
436466
Platform platform = 3;
437-
bool internal = 4 [deprecated = true]; // deprecated: use networks
467+
bool internal = 4 [ deprecated = true ]; // deprecated: use networks
438468
Deploy deploy = 5;
439469
repeated Port ports = 6;
440470
map<string, string> environment = 7;
@@ -444,12 +474,13 @@ message Service {
444474
repeated string command = 11;
445475
string domainname = 12;
446476
bool init = 13;
447-
string dns_role = 14; // x-defang-dns-role: role arn used to access route53 to create dns records
477+
string dns_role = 14; // x-defang-dns-role: role arn used to access route53 to
478+
// create dns records
448479
StaticFiles static_files = 15; // x-defang-static-files: use a managed CDN
449480
Network networks = 16; // currently only 1 network is supported
450-
Redis redis = 18; // x-defang-redis: use a managed redis
451-
Postgres postgres = 19; // x-defang-postgres: use a managed
452-
string project = 20; // defaults to tenant ID
481+
Redis redis = 18; // x-defang-redis: use a managed redis
482+
Postgres postgres = 19; // x-defang-postgres: use a managed
483+
string project = 20; // defaults to tenant ID
453484
}
454485

455486
message StaticFiles {
@@ -458,14 +489,24 @@ message StaticFiles {
458489
repeated string redirects = 2;
459490
}
460491

461-
message Redis {
462-
option deprecated = true;
463-
}
464-
message Postgres {
465-
option deprecated = true;
492+
message Redis { option deprecated = true; }
493+
message Postgres { option deprecated = true; }
494+
495+
// TODO: internal message; move to a separate proto file; was Event
496+
message DeployEvent {
497+
DeploymentMode mode = 1;
498+
string type = 2; // required
499+
string source = 3;
500+
string id = 4; // etag
501+
string datacontenttype = 5;
502+
string dataschema = 6;
503+
string subject = 7; // tenant|stack; also used as SQS group ID
504+
google.protobuf.Timestamp time = 8;
505+
bytes data = 9;
466506
}
467507

468508
message Event {
509+
option deprecated = true;
469510
string specversion = 1; // required (but we don't care)
470511
string type = 2; // required
471512
string source = 3; // required
@@ -485,7 +526,7 @@ message SubscribeRequest {
485526
}
486527

487528
message SubscribeResponse {
488-
ServiceInfo service = 1 [deprecated = true];
529+
ServiceInfo service = 1 [ deprecated = true ];
489530
string name = 2;
490531
string status = 3;
491532
ServiceState state = 4;

0 commit comments

Comments
 (0)