2018-08-07 05:27:47 +00:00
|
|
|
|
syntax = "proto3";
|
2018-08-09 22:29:00 +00:00
|
|
|
|
package hashicorp.nomad.plugins.base.proto;
|
2018-08-10 17:50:09 +00:00
|
|
|
|
option go_package = "proto";
|
2018-08-07 05:27:47 +00:00
|
|
|
|
|
2020-11-10 16:42:35 +00:00
|
|
|
|
import "plugins/shared/hclspec/hcl_spec.proto";
|
2018-08-07 05:27:47 +00:00
|
|
|
|
|
|
|
|
|
// BasePlugin is the methods that all Nomad plugins must support.
|
|
|
|
|
service BasePlugin {
|
|
|
|
|
|
|
|
|
|
// PluginInfo describes the type and version of a plugin.
|
2018-08-07 23:16:23 +00:00
|
|
|
|
rpc PluginInfo(PluginInfoRequest) returns (PluginInfoResponse) {}
|
2018-08-07 05:27:47 +00:00
|
|
|
|
|
|
|
|
|
// ConfigSchema returns the schema for parsing the plugins configuration.
|
2018-08-07 23:16:23 +00:00
|
|
|
|
rpc ConfigSchema(ConfigSchemaRequest) returns (ConfigSchemaResponse) {}
|
|
|
|
|
|
|
|
|
|
// SetConfig is used to set the configuration.
|
|
|
|
|
rpc SetConfig(SetConfigRequest) returns (SetConfigResponse) {}
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PluginType enumerates the type of plugins Nomad supports
|
|
|
|
|
enum PluginType {
|
|
|
|
|
UNKNOWN = 0;
|
2018-08-10 17:50:09 +00:00
|
|
|
|
DRIVER = 2;
|
|
|
|
|
DEVICE = 3;
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 23:16:23 +00:00
|
|
|
|
// PluginInfoRequest is used to request the plugins basic information.
|
|
|
|
|
message PluginInfoRequest {}
|
|
|
|
|
|
2018-08-07 05:27:47 +00:00
|
|
|
|
// PluginInfoResponse returns basic information about the plugin such
|
|
|
|
|
// that Nomad can decide whether to load the plugin or not.
|
|
|
|
|
message PluginInfoResponse {
|
|
|
|
|
// type indicates what type of plugin this is.
|
|
|
|
|
PluginType type = 1;
|
2018-10-17 02:21:15 +00:00
|
|
|
|
|
2018-12-14 22:46:32 +00:00
|
|
|
|
// plugin_api_versions indicates the versions of the Nomad Plugin API
|
|
|
|
|
// this plugin supports.
|
|
|
|
|
repeated string plugin_api_versions = 2;
|
2018-08-07 05:27:47 +00:00
|
|
|
|
|
|
|
|
|
// plugin_version is the semver version of this individual plugin.
|
|
|
|
|
// This is divorce from Nomad’s development and versioning.
|
|
|
|
|
string plugin_version = 3;
|
|
|
|
|
|
|
|
|
|
// name is the name of the plugin
|
|
|
|
|
string name = 4;
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 23:16:23 +00:00
|
|
|
|
// ConfigSchemaRequest is used to request the configurations schema.
|
|
|
|
|
message ConfigSchemaRequest {}
|
|
|
|
|
|
2018-08-07 05:27:47 +00:00
|
|
|
|
// ConfigSchemaResponse returns the plugins configuration schema.
|
|
|
|
|
message ConfigSchemaResponse {
|
|
|
|
|
// spec is the plugins configuration schema
|
|
|
|
|
hashicorp.nomad.plugins.shared.hclspec.Spec spec = 1;
|
|
|
|
|
}
|
2018-08-07 23:16:23 +00:00
|
|
|
|
|
|
|
|
|
// SetConfigRequest is used to set the configuration
|
|
|
|
|
message SetConfigRequest {
|
|
|
|
|
// msgpack_config is the configuration encoded as MessagePack.
|
2018-10-17 02:21:15 +00:00
|
|
|
|
bytes msgpack_config = 1;
|
|
|
|
|
|
|
|
|
|
// nomad_config is the nomad client configuration sent to all plugins.
|
|
|
|
|
NomadConfig nomad_config = 2;
|
2018-12-14 22:46:32 +00:00
|
|
|
|
|
|
|
|
|
// plugin_api_version is the api version to use.
|
|
|
|
|
string plugin_api_version = 3;
|
2018-10-17 02:21:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NomadConfig is the client configuration sent to all plugins
|
|
|
|
|
message NomadConfig {
|
2018-10-19 03:31:01 +00:00
|
|
|
|
// driver specific configuration sent to all plugins
|
|
|
|
|
NomadDriverConfig driver = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NomadDriverConfig is the driver specific client configuration sent to all
|
|
|
|
|
// driver plugins
|
|
|
|
|
message NomadDriverConfig {
|
2018-10-17 02:21:15 +00:00
|
|
|
|
// ClientMaxPort is the upper range of the ports that the client uses for
|
2020-11-25 21:03:01 +00:00
|
|
|
|
// communicating with plugin subsystems over loopback
|
|
|
|
|
// buf:lint:ignore FIELD_LOWER_SNAKE_CASE
|
|
|
|
|
uint32 ClientMaxPort = 1;
|
|
|
|
|
|
|
|
|
|
// ClientMinPort is the lower range of the ports that the client uses for
|
|
|
|
|
// communicating with plugin subsystems over loopback
|
|
|
|
|
// buf:lint:ignore FIELD_LOWER_SNAKE_CASE
|
|
|
|
|
uint32 ClientMinPort = 2;
|
2018-08-07 23:16:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SetConfigResponse is used to respond to setting the configuration
|
|
|
|
|
message SetConfigResponse {}
|