coder/provisionersdk/proto/provisioner.proto

252 lines
5.9 KiB
Protocol Buffer
Raw Normal View History

syntax = "proto3";
option go_package = "github.com/coder/coder/provisionersdk/proto";
package provisioner;
// Empty indicates a successful request/response.
message Empty {}
// 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;
}
// ParameterValue represents the resolved source and destination of a parameter.
message ParameterValue {
ParameterDestination.Scheme destination_scheme = 1;
string name = 2;
string value = 3;
}
// ParameterSchema represents validation and type information for a parsed parameter.
message ParameterSchema {
string name = 1;
string description = 2;
ParameterSource default_source = 3;
bool allow_override_source = 4;
ParameterDestination default_destination = 5;
bool allow_override_destination = 6;
bool redisplay_value = 7;
enum TypeSystem {
None = 0;
HCL = 1;
}
TypeSystem validation_type_system = 8;
string validation_value_type = 9;
string validation_error = 10;
string validation_condition = 11;
}
// RichParameterOption represents a singular option that a parameter may expose.
message RichParameterOption {
string name = 1;
string description = 2;
string value = 3;
string icon = 4;
}
// RichParameter represents a variable that is exposed.
message RichParameter {
string name = 1;
string description = 2;
string type = 3;
bool mutable = 4;
string default_value = 5;
string icon = 6;
repeated RichParameterOption options = 7;
string validation_regex = 8;
string validation_error = 9;
int32 validation_min = 10;
int32 validation_max = 11;
}
// RichParameterValue holds the key/value mapping of a parameter.
message RichParameterValue {
string name = 1;
string value = 2;
}
// 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;
}
message InstanceIdentityAuth {
string instance_id = 1;
}
// Agent represents a running agent on the workspace.
message Agent {
string id = 1;
string name = 2;
map<string, string> env = 3;
string startup_script = 4;
string operating_system = 5;
string architecture = 6;
string directory = 7;
feat: Add workspace application support (#1773) * feat: Add app support This adds apps as a property to a workspace agent. The resource is added to the Terraform provider here: https://github.com/coder/terraform-provider-coder/pull/17 Apps will be opened in the dashboard or via the CLI with `coder open <name>`. If `command` is specified, a terminal will appear locally and in the web. If `target` is specified, the browser will open to an exposed instance of that target. * Compare fields in apps test * Update Terraform provider to use relative path * Add some basic structure for routing * chore: Remove interface from coderd and lift API surface Abstracting coderd into an interface added misdirection because the interface was never intended to be fulfilled outside of a single implementation. This lifts the abstraction, and attaches all handlers to a root struct named `*coderd.API`. * Add basic proxy logic * Add proxying based on path * Add app proxying for wildcards * Add wsconncache * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * Add workspace route proxying endpoint - Makes the workspace conn cache concurrency-safe - Reduces unnecessary open checks in `peer.Channel` - Fixes the use of a temporary context when dialing a workspace agent * Add embed errors * chore: Refactor site to improve testing It was difficult to develop this package due to the embed build tag being mandatory on the tests. The logic to test doesn't require any embedded files. * Add test for error handler * Remove unused access url * Add RBAC tests * Fix dial agent syntax * Fix linting errors * Fix gen * Fix icon required * Adjust migration number * Fix proxy error status code * Fix empty db lookup
2022-06-04 20:13:37 +00:00
repeated App apps = 8;
oneof auth {
feat: Add workspace application support (#1773) * feat: Add app support This adds apps as a property to a workspace agent. The resource is added to the Terraform provider here: https://github.com/coder/terraform-provider-coder/pull/17 Apps will be opened in the dashboard or via the CLI with `coder open <name>`. If `command` is specified, a terminal will appear locally and in the web. If `target` is specified, the browser will open to an exposed instance of that target. * Compare fields in apps test * Update Terraform provider to use relative path * Add some basic structure for routing * chore: Remove interface from coderd and lift API surface Abstracting coderd into an interface added misdirection because the interface was never intended to be fulfilled outside of a single implementation. This lifts the abstraction, and attaches all handlers to a root struct named `*coderd.API`. * Add basic proxy logic * Add proxying based on path * Add app proxying for wildcards * Add wsconncache * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * Add workspace route proxying endpoint - Makes the workspace conn cache concurrency-safe - Reduces unnecessary open checks in `peer.Channel` - Fixes the use of a temporary context when dialing a workspace agent * Add embed errors * chore: Refactor site to improve testing It was difficult to develop this package due to the embed build tag being mandatory on the tests. The logic to test doesn't require any embedded files. * Add test for error handler * Remove unused access url * Add RBAC tests * Fix dial agent syntax * Fix linting errors * Fix gen * Fix icon required * Adjust migration number * Fix proxy error status code * Fix empty db lookup
2022-06-04 20:13:37 +00:00
string token = 9;
string instance_id = 10;
}
int32 connection_timeout_seconds = 11;
string troubleshooting_url = 12;
string motd_file = 13;
bool login_before_ready = 14;
int32 startup_script_timeout_seconds = 15;
}
enum AppSharingLevel {
OWNER = 0;
AUTHENTICATED = 1;
PUBLIC = 2;
}
feat: Add workspace application support (#1773) * feat: Add app support This adds apps as a property to a workspace agent. The resource is added to the Terraform provider here: https://github.com/coder/terraform-provider-coder/pull/17 Apps will be opened in the dashboard or via the CLI with `coder open <name>`. If `command` is specified, a terminal will appear locally and in the web. If `target` is specified, the browser will open to an exposed instance of that target. * Compare fields in apps test * Update Terraform provider to use relative path * Add some basic structure for routing * chore: Remove interface from coderd and lift API surface Abstracting coderd into an interface added misdirection because the interface was never intended to be fulfilled outside of a single implementation. This lifts the abstraction, and attaches all handlers to a root struct named `*coderd.API`. * Add basic proxy logic * Add proxying based on path * Add app proxying for wildcards * Add wsconncache * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * Add workspace route proxying endpoint - Makes the workspace conn cache concurrency-safe - Reduces unnecessary open checks in `peer.Channel` - Fixes the use of a temporary context when dialing a workspace agent * Add embed errors * chore: Refactor site to improve testing It was difficult to develop this package due to the embed build tag being mandatory on the tests. The logic to test doesn't require any embedded files. * Add test for error handler * Remove unused access url * Add RBAC tests * Fix dial agent syntax * Fix linting errors * Fix gen * Fix icon required * Adjust migration number * Fix proxy error status code * Fix empty db lookup
2022-06-04 20:13:37 +00:00
// App represents a dev-accessible application on the workspace.
message App {
// slug is the unique identifier for the app, usually the name from the
// template. It must be URL-safe and hostname-safe.
string slug = 1;
string display_name = 2;
string command = 3;
string url = 4;
string icon = 5;
bool subdomain = 6;
Healthcheck healthcheck = 7;
AppSharingLevel sharing_level = 8;
bool external = 9;
}
// Healthcheck represents configuration for checking for app readiness.
message Healthcheck {
string url = 1;
int32 interval = 2;
int32 threshold = 3;
feat: Add workspace application support (#1773) * feat: Add app support This adds apps as a property to a workspace agent. The resource is added to the Terraform provider here: https://github.com/coder/terraform-provider-coder/pull/17 Apps will be opened in the dashboard or via the CLI with `coder open <name>`. If `command` is specified, a terminal will appear locally and in the web. If `target` is specified, the browser will open to an exposed instance of that target. * Compare fields in apps test * Update Terraform provider to use relative path * Add some basic structure for routing * chore: Remove interface from coderd and lift API surface Abstracting coderd into an interface added misdirection because the interface was never intended to be fulfilled outside of a single implementation. This lifts the abstraction, and attaches all handlers to a root struct named `*coderd.API`. * Add basic proxy logic * Add proxying based on path * Add app proxying for wildcards * Add wsconncache * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * fix: Race when writing to a closed pipe This is such an intermittent race it's difficult to track, but regardless this is an improvement to the code. * Add workspace route proxying endpoint - Makes the workspace conn cache concurrency-safe - Reduces unnecessary open checks in `peer.Channel` - Fixes the use of a temporary context when dialing a workspace agent * Add embed errors * chore: Refactor site to improve testing It was difficult to develop this package due to the embed build tag being mandatory on the tests. The logic to test doesn't require any embedded files. * Add test for error handler * Remove unused access url * Add RBAC tests * Fix dial agent syntax * Fix linting errors * Fix gen * Fix icon required * Adjust migration number * Fix proxy error status code * Fix empty db lookup
2022-06-04 20:13:37 +00:00
}
// Resource represents created infrastructure.
message Resource {
string name = 1;
string type = 2;
repeated Agent agents = 3;
message Metadata {
string key = 1;
string value = 2;
bool sensitive = 3;
bool is_null = 4;
}
repeated Metadata metadata = 4;
2022-09-09 19:38:00 +00:00
bool hide = 5;
string icon = 6;
string instance_type = 7;
int32 daily_cost = 8;
}
// Parse consumes source-code from a directory to produce inputs.
message Parse {
message Request {
string directory = 1;
}
message Complete {
repeated ParameterSchema parameter_schemas = 2;
}
message Response {
oneof type {
Log log = 1;
Complete complete = 2;
}
}
}
enum WorkspaceTransition {
START = 0;
STOP = 1;
DESTROY = 2;
}
// Provision consumes source-code from a directory to produce resources.
// Exactly one of Plan or Apply must be provided in a single session.
message Provision {
message Metadata {
string coder_url = 1;
WorkspaceTransition workspace_transition = 2;
string workspace_name = 3;
string workspace_owner = 4;
string workspace_id = 5;
string workspace_owner_id = 6;
string workspace_owner_email = 7;
}
// Config represents execution configuration shared by both Plan and
// Apply commands.
message Config {
string directory = 1;
bytes state = 2;
Metadata metadata = 3;
}
message Plan {
Config config = 1;
repeated ParameterValue parameter_values = 2;
repeated RichParameterValue rich_parameter_values = 3;
}
message Apply {
Config config = 1;
bytes plan = 2;
}
message Cancel {}
message Request {
oneof type {
Plan plan = 1;
Apply apply = 2;
Cancel cancel = 3;
}
}
message Complete {
bytes state = 1;
string error = 2;
repeated Resource resources = 3;
repeated RichParameter parameters = 4;
bytes plan = 5;
}
message Response {
oneof type {
Log log = 1;
Complete complete = 2;
}
}
}
service Provisioner {
rpc Parse(Parse.Request) returns (stream Parse.Response);
rpc Provision(stream Provision.Request) returns (stream Provision.Response);
}