2022-01-08 17:24:02 +00:00
|
|
|
|
|
|
|
syntax = "proto3";
|
2022-01-29 23:45:42 +00:00
|
|
|
option go_package = "github.com/coder/coder/provisionersdk/proto";
|
2022-01-08 17:24:02 +00:00
|
|
|
|
|
|
|
package provisioner;
|
|
|
|
|
2022-01-29 23:45:42 +00:00
|
|
|
// ParameterSource represents the source location for a parameter to get it's value from.
|
|
|
|
message ParameterSource {
|
|
|
|
enum Scheme {
|
|
|
|
DATA = 0;
|
|
|
|
}
|
|
|
|
Scheme scheme = 1;
|
|
|
|
string value = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ParameterDestination represents the target location for a provisioner to set the value.
|
|
|
|
message ParameterDestination {
|
|
|
|
enum Scheme {
|
|
|
|
ENVIRONMENT_VARIABLE = 0;
|
|
|
|
PROVISIONER_VARIABLE = 1;
|
|
|
|
}
|
|
|
|
Scheme scheme = 1;
|
|
|
|
string value = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ParameterValue represents the resolved source and destination of a parameter.
|
|
|
|
message ParameterValue {
|
|
|
|
ParameterDestination.Scheme destination_scheme = 1;
|
|
|
|
string name = 2;
|
|
|
|
string value = 3;
|
|
|
|
}
|
|
|
|
|
2022-01-08 17:24:02 +00:00
|
|
|
// ParameterSchema represents validation and type information for a parsed parameter.
|
|
|
|
message ParameterSchema {
|
|
|
|
string name = 1;
|
|
|
|
string description = 2;
|
2022-01-29 23:45:42 +00:00
|
|
|
ParameterSource default_source = 3;
|
|
|
|
bool allow_override_source = 4;
|
|
|
|
ParameterDestination default_destination = 5;
|
|
|
|
bool allow_override_destination = 6;
|
|
|
|
bool redisplay_value = 7;
|
2022-01-08 17:24:02 +00:00
|
|
|
|
|
|
|
enum TypeSystem {
|
2022-02-04 19:36:43 +00:00
|
|
|
None = 0;
|
|
|
|
HCL = 1;
|
2022-01-08 17:24:02 +00:00
|
|
|
}
|
2022-01-29 23:45:42 +00:00
|
|
|
TypeSystem validation_type_system = 8;
|
|
|
|
string validation_value_type = 9;
|
|
|
|
string validation_error = 10;
|
|
|
|
string validation_condition = 11;
|
2022-01-08 17:24:02 +00:00
|
|
|
}
|
|
|
|
|
2022-02-01 05:36:15 +00:00
|
|
|
// LogLevel represents severity of the log.
|
|
|
|
enum LogLevel {
|
|
|
|
TRACE = 0;
|
|
|
|
DEBUG = 1;
|
|
|
|
INFO = 2;
|
|
|
|
WARN = 3;
|
|
|
|
ERROR = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Log represents output from a request.
|
|
|
|
message Log {
|
|
|
|
LogLevel level = 1;
|
|
|
|
string output = 2;
|
|
|
|
}
|
|
|
|
|
2022-01-08 17:24:02 +00:00
|
|
|
// Parse consumes source-code from a directory to produce inputs.
|
|
|
|
message Parse {
|
|
|
|
message Request {
|
|
|
|
string directory = 1;
|
|
|
|
}
|
2022-02-01 05:36:15 +00:00
|
|
|
message Complete {
|
|
|
|
repeated ParameterSchema parameter_schemas = 2;
|
|
|
|
}
|
2022-01-08 17:24:02 +00:00
|
|
|
message Response {
|
2022-02-01 05:36:15 +00:00
|
|
|
oneof type {
|
|
|
|
Log log = 1;
|
|
|
|
Complete complete = 2;
|
|
|
|
}
|
2022-01-08 17:24:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Resource is a provisioned unit.
|
|
|
|
message Resource {
|
|
|
|
string name = 1;
|
|
|
|
string type = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Provision consumes source-code from a directory to produce resources.
|
|
|
|
message Provision {
|
|
|
|
message Request {
|
|
|
|
string directory = 1;
|
|
|
|
repeated ParameterValue parameter_values = 2;
|
|
|
|
bytes state = 3;
|
|
|
|
}
|
2022-02-01 05:36:15 +00:00
|
|
|
message Complete {
|
2022-01-08 17:24:02 +00:00
|
|
|
bytes state = 1;
|
|
|
|
repeated Resource resources = 2;
|
|
|
|
}
|
2022-02-01 05:36:15 +00:00
|
|
|
message Response {
|
|
|
|
oneof type {
|
|
|
|
Log log = 1;
|
|
|
|
Complete complete = 2;
|
|
|
|
}
|
|
|
|
}
|
2022-01-08 17:24:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
service Provisioner {
|
2022-02-01 05:36:15 +00:00
|
|
|
rpc Parse(Parse.Request) returns (stream Parse.Response);
|
|
|
|
rpc Provision(Provision.Request) returns (stream Provision.Response);
|
2022-01-29 23:45:42 +00:00
|
|
|
}
|