2022-04-25 12:24:18 -05:00

155 lines
3.6 KiB
Protocol Buffer

syntax = "proto3";
package hashicorp.vagrant;
option go_package = "github.com/hashicorp/vagrant/internal/server/proto/ruby_vagrant";
import "google/protobuf/empty.proto";
import "google/protobuf/any.proto";
// The service that is implemented for the server backend.
service RubyVagrant {
// Gets available ruby plugins
rpc GetPlugins(google.protobuf.Empty) returns (GetPluginsResponse);
rpc ParseVagrantfile(ParseVagrantfileRequest) returns (ParseVagrantfileResponse);
}
/********************************************************************
* Plugins
********************************************************************/
message GetPluginsResponse {
repeated Plugin plugins = 1;
}
message Plugin {
// name of the plugin
string name = 1;
// type of the plugin
Type type = 2;
// Supported plugin types, the values here MUST match the enum values
// in the Go sdk/component package exactly. A test in internal/server
// validates this.
enum Type {
COMMAND = 0;
COMMUNICATOR = 1;
GUEST = 2;
HOST = 3;
PROVIDER = 4;
PROVISIONER = 5;
SYNCED_FOLDER = 6;
}
}
/********************************************************************
* Vagrantfile
********************************************************************/
message ParseVagrantfileRequest {
// Path to the Vagrantfile
string path = 1;
// TODO: might be good to add an option for passing cmd line args
}
message ParseVagrantfileResponse {
// Vagrantfile representation
VagrantfileComponents.Vagrantfile vagrantfile = 1;
}
message VagrantfileComponents {
message ConfigVM {
bool allow_fstab_modification = 1;
bool allow_hosts_modificaion = 2;
string box = 3;
// TODO: CloudInit = 4 (Experimental)
repeated Provider providers = 5;
// TODO: Disks = 6 (Experimental)
repeated Network networks = 7;
repeated Provisioner provisioners = 8;
repeated SyncedFolder synced_folders = 9;
}
message ConfigSSH {
bool compresssion = 1;
int64 connect_timeout = 2;
// TODO
}
message ConfigWinRM {
string username = 1;
string password = 2;
// TODO
}
message ConfigWinssh {
bool forward_agent = 1;
repeated string forward_env = 2;
// TODO
}
message ConfigVagrant {
string host = 1;
repeated string plugins = 2;
// TODO
}
// TODO: Review what needs to be sent here
message MachineConfig {
string name = 1;
ConfigVM config_vm = 2;
ConfigSSH config_ssh = 3;
ConfigWinRM config_winrm = 4;
ConfigWinssh config_winssh = 5;
ConfigVagrant config_vagrant = 6;
}
message Provisioner {
string name = 1;
string type = 2;
string before = 3;
string after = 4;
bool communicator_required = 5;
// A Provisioner plugin defines it's own configuration,
// that gets added in here
google.protobuf.Any config = 6;
}
message Provider {
string type = 1;
google.protobuf.Any config = 2;
}
message Network {
string type = 1;
string id = 2;
google.protobuf.Any config = 3;
}
message SyncedFolder {
string source = 1;
string destination = 2;
// A SyncedFolder plugin defines it's own configuration,
// that gets added in here
google.protobuf.Any config = 3;
bool create = 4;
bool disabled = 5;
string group = 6;
string id = 7;
repeated string mount_options = 8;
string owner = 9;
string type = 10;
}
// TODO: Review what needs to be sent here
message Vagrantfile {
string path = 1;
string raw = 2;
string current_version = 3;
repeated MachineConfig machine_configs = 4;
}
}