Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(688)

Side by Side Diff: appengine/config_service/proto/service_config.proto

Issue 1221643020: config services: services.cfg and validation (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Swarming Authors. All rights reserved. 1 // Copyright 2015 The Swarming Authors. All rights reserved.
2 // Use of this source code is governed by the Apache v2.0 license that can be 2 // Use of this source code is governed by the Apache v2.0 license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Schemas for config files in services/luci-config config set. 5 // Schemas for config files in services/luci-config config set.
6 // 6 //
7 // In this file, "string pattern" is an exact string (can't have a colon) or a 7 // In this file, "string pattern" is an exact string (can't have a colon) or a
8 // string that starts with "regex:", followed by a regular expression. In case 8 // string that starts with "regex:", followed by a regular expression. In case
9 // of regex, the pattern must match an entire string, as if it was sorrounded by 9 // of regex, the pattern must match an entire string, as if it was sorrounded by
10 // ^ and $. 10 // ^ and $.
(...skipping 29 matching lines...) Expand all
40 // Where to import "projects/<id>" config set from. 40 // Where to import "projects/<id>" config set from.
41 optional ConfigSetLocation config_location = 2; 41 optional ConfigSetLocation config_location = 2;
42 } 42 }
43 43
44 // Schema of projects.cfg file. Represents luci tenants registry. 44 // Schema of projects.cfg file. Represents luci tenants registry.
45 message ProjectsCfg { 45 message ProjectsCfg {
46 // All projects served by this instance of Luci. 46 // All projects served by this instance of Luci.
47 repeated Project projects = 1; 47 repeated Project projects = 1;
48 } 48 }
49 49
50 /******************************************************************************/
51 /* Services */
52 /******************************************************************************/
53
54 // Describes one luci service.
55 message Service {
56 // Globally unique id of the service. Required.
57 // Used in "services/<service_id>" config set name.
58 optional string id = 1;
59 // Email addresses of responsible and point-of-contacts for the service.
60 repeated string owners = 2;
61 // Where to import "services/<id>" config set from. If config_location.url is
62 // relative, it is relative to the current configuration file.
63 // If not specified, defaults to "../<id>/".
64 optional ConfigSetLocation config_location = 3;
65 // An HTTPS endpoint that returns JSON-encoded ServiceDynamicMetadata in body.
66 optional string metadata_url = 4;
67 }
68
69 // Machine-generated service metadata, exposed by a service endpoint.
70 // Typically implemented by config component, embedded in an app:
71 // see appengine/components/components/config/endpoint.py
72 //
73 // If you add a field here, also add it to ServiceDynamicMetadata in endpoint.py
74 message ServiceDynamicMetadata {
75 // Format version. Supported versions: 1.0.
76 optional string version = 1;
77 // What configs this service can validate and how to validate them.
78 optional Validator validation = 2;
79 }
80
81 // Schema of services.cfg
82 message ServicesCfg {
83 // A list of all luci services. Should be sorted by id.
84 repeated Service services = 1;
85 }
86
87 /******************************************************************************/
88 /* Misc */
89 /******************************************************************************/
90
91
50 // Schema of acl.cfg file. 92 // Schema of acl.cfg file.
51 message AclCfg { 93 message AclCfg {
52 // Name of the group that has access to all services/* config sets. 94 // Name of the group that has access to all services/* config sets.
53 optional string service_access_group = 1; 95 optional string service_access_group = 1;
54 // Name of the group that has access to all projects/* config sets. 96 // Name of the group that has access to all projects/* config sets.
55 optional string project_access_group = 2; 97 optional string project_access_group = 2;
56 } 98 }
57 99
58 // Schema for import.cfg. It specified how to import configuration files from 100 // Schema for import.cfg. It specified how to import configuration files from
59 // external sources. 101 // external sources.
(...skipping 29 matching lines...) Expand all
89 } 131 }
90 // List of known schemas. They are available at /schemas/<name> as a short 132 // List of known schemas. They are available at /schemas/<name> as a short
91 // mutable link. 133 // mutable link.
92 repeated Schema schemas = 1; 134 repeated Schema schemas = 1;
93 } 135 }
94 136
95 /******************************************************************************/ 137 /******************************************************************************/
96 /* Validation */ 138 /* Validation */
97 /******************************************************************************/ 139 /******************************************************************************/
98 140
99 // Schema of validation.cfg 141 // Defines a pattern of a config identity. Both config_set and path must
100 message ValidationCfg { 142 // match.
101 // Defines one validation rule. It can match configs in different config-sets 143 message ConfigPattern {
102 // and paths. 144 // A string pattern for config_set.
103 message Rule { 145 optional string config_set = 1;
104 // A string pattern (see above) for config_set. 146 // A string pattern for config file path.
105 optional string config_set = 1; 147 optional string path = 2;
106 // A string pattern (see above) for config file path.
107 optional string path = 2;
108 // URL of a validation endpoint. The config service will send an HTTP POST
109 // request to the endpoint, where body is JSON-encoded
110 // ValidationRequestMessage. The endpoint is expected to respond with
111 // HTTP status 200 and JSON-encoded ValidationResponseMessage.
112 optional string url = 3;
113 }
114
115 // Defines validation rules for externally-validated configs.
116 // All rules that match a config by config_set and path must pass in order
117 // for a config to be considered valid.
118 repeated Rule rules = 1;
119 } 148 }
120 149
150 // Describes what configuration can be validated and how to validate them.
151 message Validator {
152 // A list of configuration patterns that this validator can validate.
153 repeated ConfigPattern patterns = 1;
154 // URL of a validation endpoint. The config service will send an HTTP POST
155 // request to the endpoint, where body is JSON-encoded
156 // ValidationRequestMessage. The endpoint is expected to respond with
157 // HTTP status 200 and JSON-encoded ValidationResponseMessage.
158 optional string url = 2;
159 }
121 160
122 // This message is used only in JSON form. It is sent as request body to an 161 // This message is used only in JSON form. It is sent as request body to an
123 // external validation endpoint in order to validate a config. 162 // external validation endpoint in order to validate a config.
124 message ValidationRequestMessage { 163 message ValidationRequestMessage {
125 // Config set of the config file to validate. 164 // Config set of the config file to validate.
126 optional string config_set = 1; 165 optional string config_set = 1;
127 // Path of the config file to validate. 166 // Path of the config file to validate.
128 optional string path = 2; 167 optional string path = 2;
129 // Base64-encoded contents of the file. 168 // Base64-encoded contents of the file.
130 optional string content = 3; 169 optional string content = 3;
(...skipping 14 matching lines...) Expand all
145 message Message { 184 message Message {
146 // Textual representation of the message. 185 // Textual representation of the message.
147 optional string text = 1; 186 optional string text = 1;
148 // If an error, a config is considered invalid. Defaults to INFO. 187 // If an error, a config is considered invalid. Defaults to INFO.
149 optional Severity severity = 2; 188 optional Severity severity = 2;
150 } 189 }
151 // Errors, warnings and other information found during validation. 190 // Errors, warnings and other information found during validation.
152 // If at least one error is found, the config is considered invalid. 191 // If at least one error is found, the config is considered invalid.
153 repeated Message messages = 1; 192 repeated Message messages = 1;
154 } 193 }
OLDNEW
« no previous file with comments | « appengine/config_service/gitiles_import.py ('k') | appengine/config_service/proto/service_config_pb2.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698