github.com/ferranbt/nomad@v0.9.3-0.20190607002617-85c449b7667c/plugins/base/proto/base.proto (about) 1 syntax = "proto3"; 2 package hashicorp.nomad.plugins.base.proto; 3 option go_package = "proto"; 4 5 import "github.com/hashicorp/nomad/plugins/shared/hclspec/hcl_spec.proto"; 6 7 // BasePlugin is the methods that all Nomad plugins must support. 8 service BasePlugin { 9 10 // PluginInfo describes the type and version of a plugin. 11 rpc PluginInfo(PluginInfoRequest) returns (PluginInfoResponse) {} 12 13 // ConfigSchema returns the schema for parsing the plugins configuration. 14 rpc ConfigSchema(ConfigSchemaRequest) returns (ConfigSchemaResponse) {} 15 16 // SetConfig is used to set the configuration. 17 rpc SetConfig(SetConfigRequest) returns (SetConfigResponse) {} 18 } 19 20 // PluginType enumerates the type of plugins Nomad supports 21 enum PluginType { 22 UNKNOWN = 0; 23 DRIVER = 2; 24 DEVICE = 3; 25 } 26 27 // PluginInfoRequest is used to request the plugins basic information. 28 message PluginInfoRequest {} 29 30 // PluginInfoResponse returns basic information about the plugin such 31 // that Nomad can decide whether to load the plugin or not. 32 message PluginInfoResponse { 33 // type indicates what type of plugin this is. 34 PluginType type = 1; 35 36 // plugin_api_versions indicates the versions of the Nomad Plugin API 37 // this plugin supports. 38 repeated string plugin_api_versions = 2; 39 40 // plugin_version is the semver version of this individual plugin. 41 // This is divorce from Nomad’s development and versioning. 42 string plugin_version = 3; 43 44 // name is the name of the plugin 45 string name = 4; 46 } 47 48 // ConfigSchemaRequest is used to request the configurations schema. 49 message ConfigSchemaRequest {} 50 51 // ConfigSchemaResponse returns the plugins configuration schema. 52 message ConfigSchemaResponse { 53 // spec is the plugins configuration schema 54 hashicorp.nomad.plugins.shared.hclspec.Spec spec = 1; 55 } 56 57 // SetConfigRequest is used to set the configuration 58 message SetConfigRequest { 59 // msgpack_config is the configuration encoded as MessagePack. 60 bytes msgpack_config = 1; 61 62 // nomad_config is the nomad client configuration sent to all plugins. 63 NomadConfig nomad_config = 2; 64 65 // plugin_api_version is the api version to use. 66 string plugin_api_version = 3; 67 } 68 69 // NomadConfig is the client configuration sent to all plugins 70 message NomadConfig { 71 // driver specific configuration sent to all plugins 72 NomadDriverConfig driver = 1; 73 } 74 75 // NomadDriverConfig is the driver specific client configuration sent to all 76 // driver plugins 77 message NomadDriverConfig { 78 // ClientMaxPort is the upper range of the ports that the client uses for 79 // communicating with plugin subsystems over loopback 80 uint32 ClientMaxPort = 1; 81 82 // ClientMinPort is the lower range of the ports that the client uses for 83 // communicating with plugin subsystems over loopback 84 uint32 ClientMinPort = 2; 85 } 86 87 // SetConfigResponse is used to respond to setting the configuration 88 message SetConfigResponse {}