This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
/
common.proto
247 lines (205 loc) · 8.89 KB
/
common.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
syntax = "proto3";
package flyteidl.admin;
option go_package = "github.com/lyft/flyteidl/gen/pb-go/flyteidl/admin";
import "flyteidl/core/execution.proto";
import "flyteidl/core/identifier.proto";
// import "validate/validate.proto";
// Encapsulation of fields that identifies a Flyte resource.
// A resource can internally have multiple versions.
message NamedEntityIdentifier {
// Name of the project the resource belongs to.
string project = 1; // [(validate.rules).string.min_bytes = 1];
// Name of the domain the resource belongs to.
// A domain can be considered as a subset within a specific project.
string domain = 2; // [(validate.rules).string.min_bytes = 1];
// User provided value for the resource.
// The combination of project + domain + name uniquely identifies the resource.
// +optional - in certain contexts - like 'List API', 'Launch plans'
string name = 3;
}
// The status of the named entity is used to control its visibility in the UI.
enum NamedEntityState {
// By default, all named entities are considered active and under development.
NAMED_ENTITY_ACTIVE = 0;
// Archived named entities are no longer visible in the UI.
NAMED_ENTITY_ARCHIVED = 1;
// System generated entities that aren't explicitly created or managed by a user.
SYSTEM_GENERATED = 2;
}
message NamedEntityMetadata {
// Common description across all versions of the entity
// +optional
string description = 1;
// Shared state across all version of the entity
// At this point in time, only workflow entities can have their state archived.
NamedEntityState state = 2;
}
// Describes information common to a NamedEntity, identified by a project /
// domain / name / resource type combination
message NamedEntity {
flyteidl.core.ResourceType resource_type = 1;
NamedEntityIdentifier id = 2;
NamedEntityMetadata metadata = 3;
}
// Species sort ordering in a list request.
message Sort {
enum Direction {
DESCENDING = 0;
ASCENDING = 1;
}
// Indicates an attribute to sort the response values.
// TODO(katrogan): Add string validation here. This should never be empty.
string key = 1;
// Indicates the direction to apply sort key for response values.
// +optional
Direction direction = 2;
}
// Represents a request structure to list identifiers.
message NamedEntityIdentifierListRequest {
// Name of the project that contains the identifiers.
string project = 1; // [(validate.rules).string.min_bytes = 1];
// Name of the domain the identifiers belongs to within the project.
string domain = 2; // [(validate.rules).string.min_bytes = 1];
// Indicates the number of resources to be returned.
uint32 limit = 3;
// In the case of multiple pages of results, the server-provided token can be used to fetch the next page
// in a query.
// +optional
string token = 4;
// Sort ordering.
// +optional
Sort sort_by = 5;
// Indicates a list of filters passed as string.
// +optional
string filters = 6;
}
// Represents a request structure to list NamedEntity objects
message NamedEntityListRequest {
flyteidl.core.ResourceType resource_type = 1;
// Name of the project that contains the identifiers.
string project = 2; // [(validate.rules).string.min_bytes = 1];
// Name of the domain the identifiers belongs to within the project.
string domain = 3; // [(validate.rules).string.min_bytes = 1];
// Indicates the number of resources to be returned.
uint32 limit = 4;
// In the case of multiple pages of results, the server-provided token can be used to fetch the next page
// in a query.
// +optional
string token = 5;
// Sort ordering.
// +optional
Sort sort_by = 6;
// Indicates a list of filters passed as string.
// +optional
string filters = 7;
}
// Represents a list of NamedEntityIdentifiers.
message NamedEntityIdentifierList {
// A list of identifiers.
repeated NamedEntityIdentifier entities = 1;
// In the case of multiple pages of results, the server-provided token can be used to fetch the next page
// in a query. If there are no more results, this value will be empty.
string token = 2;
}
// Represents a list of NamedEntityIdentifiers.
message NamedEntityList {
// A list of NamedEntity objects
repeated NamedEntity entities = 1;
// In the case of multiple pages of results, the server-provided token can be used to fetch the next page
// in a query. If there are no more results, this value will be empty.
string token = 2;
}
// A request to retrieve the metadata associated with a NamedEntityIdentifier
message NamedEntityGetRequest {
flyteidl.core.ResourceType resource_type = 1;
NamedEntityIdentifier id = 2;
}
// Request to set the referenced launch plan state to the configured value.
message NamedEntityUpdateRequest {
// Resource type of the metadata to update
flyteidl.core.ResourceType resource_type = 1;
// Identifier of the metadata to update
NamedEntityIdentifier id = 2;
// Metadata object to set as the new value
NamedEntityMetadata metadata = 3;
}
// Purposefully empty, may be populated in the future.
message NamedEntityUpdateResponse {
}
// Represents a structure to fetch a single resource.
message ObjectGetRequest {
// Indicates a unique version of resource.
core.Identifier id = 1;
}
// Represents a request structure to retrieve a list of resources.
// Resources include: Task, Workflow, LaunchPlan
message ResourceListRequest {
// id represents the unique identifier of the resource.
NamedEntityIdentifier id = 1;
// Indicates the number of resources to be returned.
uint32 limit = 2;
// In the case of multiple pages of results, this server-provided token can be used to fetch the next page
// in a query.
// +optional
string token = 3;
// Indicates a list of filters passed as string.
// More info on constructing filters : <Link>
// +optional
string filters = 4;
// Sort ordering.
// +optional
Sort sort_by = 5;
}
message EmailNotification {
// The list of email addresses recipients for this notification.
repeated string recipients_email = 1; // [(validate.rules).repeated = {min_items: 1, unique: true, items: {string: {email: true}}}];
}
message PagerDutyNotification {
// Currently, PagerDuty notifications leverage email to trigger a notification.
repeated string recipients_email = 1; // [(validate.rules).repeated = {min_items: 1, unique: true, items: {string: {email: true}}}];
}
message SlackNotification {
// Currently, Slack notifications leverage email to trigger a notification.
repeated string recipients_email = 1; // [(validate.rules).repeated = {min_items: 1, unique: true, items: {string: {email: true}}}];
}
// Represents a structure for notifications based on execution status.
// The Notification content is configured within Admin. Future iterations could
// expose configuring notifications with custom content.
message Notification {
// A list of phases to which users can associate the notifications to.
repeated core.WorkflowExecution.Phase phases = 1;
oneof type {
// option (validate.required) = true;
EmailNotification email = 2;
PagerDutyNotification pager_duty = 3;
SlackNotification slack = 4;
}
}
// Represents a string url and associated metadata used throughout the platform.
message UrlBlob {
// Actual url value.
string url = 1;
// Represents the size of the file accessible at the above url.
int64 bytes = 2;
}
// Label values to be applied to an execution resource.
// In the future a mode (e.g. OVERRIDE, APPEND, etc) can be defined
// to specify how to merge labels defined at registration and execution time.
message Labels {
// Map of custom labels to be applied to the execution resource.
map<string, string> values = 1;
}
// Annotation values to be applied to an execution resource.
// In the future a mode (e.g. OVERRIDE, APPEND, etc) can be defined
// to specify how to merge annotations defined at registration and execution time.
message Annotations {
// Map of custom annotations to be applied to the execution resource.
map<string, string> values = 1;
}
// Defines permissions associated with executions.
message AuthRole {
oneof method {
string assumable_iam_role = 1;
string kubernetes_service_account = 2;
}
}