github.com/zoomfoo/nomad@v0.8.5-0.20180907175415-f28fd3a1a056/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_version indicates the version of the Nomad Plugin API 37 // this plugin is built against. 38 string plugin_api_version = 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 63 // SetConfigResponse is used to respond to setting the configuration 64 message SetConfigResponse {}