{"modulePath":"github.com/AliceO2Group/Control","version":"v1.51.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package local\n\nPackage local implements a local configuration backend for the configuration service, providing direct access to the backend storage without gRPC.\n\n## Functions\n\n```go\nfunc NewHttpService(service configuration.Service) (svr *http.Server)\n```\n\n## Types\n\n```go\ntype Aliases struct {\n\tFlp struct {\n\t\tAlias string `json:\"alias\"`\n\t} `json:\"flp\"`\n\tCards map[string]struct {\n\t\tAlias string `json:\"alias\"`\n\t\tLinks map[string]struct {\n\t\t\tAlias string `json:\"alias\"`\n\t\t} `json:\"links\"`\n\t} `json:\"cards\"`\n}\n```\n\n```go\ntype Card struct {\n\tType             string `json:\"type\"`\n\tPciAddress       string `json:\"pciAddress\"`\n\tSerial           string `json:\"serial\"`\n\tEndpoint         string `json:\"endpoint\"`\n\tNuma             string `json:\"numa\"`\n\tFirware          string `json:\"firmware\"`\n\tUserLogicVersion string `json:\"userLogicVersion\"`\n}\n```\n\n```go\ntype HttpService struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (httpsvc *HttpService) ApiGetComponentConfiguration(w http.ResponseWriter, r *http.Request)\n```\nApiGetComponentConfiguration returns the processed configuration payload for a given component, run type, role name and entry key\n\n\t@Summary\t\tReturns a configuration payload for a given component, run type, role name and entry key\n\t@Description\tThe provided component, run type, role name and entry key are used to query the configuration service for a configuration entry, which is then processed in the O² Apricot template system to produce the final payload, and returned as string..\n\t@Tags\t\t\tcomponent configuration\n\t@Produce\t\tplain\n\t@Param\t\t\tprocess\t\tquery\t\tboolean\tfalse\t\"If true, template processing is performed to produce the final payload; if false, the entry is returned verbatim. In the true case, any number of additional string key-value pairs may be passed as query parameters (e.g. ?process=true\u0026mykey1=myvalue1\u0026mykey2=myvalue2), which are then fed into the template system as variables that affect configuration payload generation\"\tDefault(false)\n\t@Param\t\t\tcomponent\tpath\t\tstring\ttrue\t\"Configuration component\"\n\t@Param\t\t\truntype\t\tpath\t\tstring\ttrue\t\"O² Run type, must be capitalized\"\n\t@Param\t\t\trolename\tpath\t\tstring\ttrue\t\"Role name\"\n\t@Param\t\t\tentry\t\tpath\t\tstring\ttrue\t\"Entry key\"\n\t@Success\t\t200\t\t\t{string}\tstring\t\"Configuration payload for the queried entry, either processed or verbatim depending on the process flag\"\n\t@Failure\t\t400\t\t\t{string}\tstring\t\"Bad request, if a parameter is invalid\"\n\t@Failure\t\t500\t\t\t{string}\tstring\t\"Internal server error\"\n\t@Router\t\t\t/components/{component}/{runtype}/{rolename}/{entry} [get]\n\n```go\nfunc (httpsvc *HttpService) ApiGetDetectorFlps(w http.ResponseWriter, r *http.Request)\n```\nApiGetDetectorFlps returns the list of FLPs in the cluster that serve a given detector\n\n\t@Summary\t\tReturns the list of FLPs in the cluster that serve a given detector\n\t@Description\tReturns the list of all Apricot-managed hosts in the cluster that are known to be FLPs and serving the given detector, newline-separated or JSON depending on the format parameter\n\t@Tags\t\t\tcluster inventory\n\t@Param\t\t\tformat\tpath\tstring\tfalse\t\"Output format, json or text\"\tEnums(json, text)\tDefault(text)\n\t@Produce\t\tplain\n\t@Success\t\t200\t{string}\tstring\t\"List of FLPs in the cluster known to Apricot, newline-separated or JSON depending on the format parameter\"\n\t@Router\t\t\t/inventory/detectors/{detector}/flps/{format} [get]\n\n```go\nfunc (httpsvc *HttpService) ApiGetDetectorsInventory(w http.ResponseWriter, r *http.Request)\n```\nApiGetDetectorsInventory returns the list of detectors belonging to the installed instance known to Apricot\n\n\t@Summary\t\tReturns the list of detectors belonging to the installed instance known to Apricot\n\t@Description\tReturns the list of all detectors known to Apricot that belong to the installed instance, newline-separated or JSON depending on the format parameter\n\t@Tags\t\t\tcluster inventory\n\t@Param\t\t\tformat\tpath\tstring\tfalse\t\"Output format, json or text\"\tEnums(json, text)\tDefault(text)\n\t@Produce\t\tplain\n\t@Success\t\t200\t{string}\tstring\t\"List of detectors in the instance known to Apricot, newline-separated or JSON depending on the format parameter\"\n\t@Router\t\t\t/inventory/detectors/{format} [get]\n\n```go\nfunc (httpsvc *HttpService) ApiGetFlps(w http.ResponseWriter, r *http.Request)\n```\nApiGetFlps returns the list of FLPs in the cluster known to Apricot\n\n\t@Summary\t\tReturns the list of FLPs in the cluster known to Apricot\n\t@Description\tReturns the list of all Apricot-managed hosts in the cluster that are known to be FLPs, newline-separated or JSON depending on the format parameter\n\t@Tags\t\t\tcluster inventory\n\t@Param\t\t\tformat\tpath\tstring\tfalse\t\"Output format, json or text\"\tEnums(json, text)\tDefault(text)\n\t@Produce\t\tplain\n\t@Success\t\t200\t{string}\tstring\t\"List of FLPs in the cluster known to Apricot, newline-separated or JSON depending on the format parameter\"\n\t@Router\t\t\t/inventory/flps/{format} [get]\n\n```go\nfunc (httpsvc *HttpService) ApiGetHostInventory(w http.ResponseWriter, r *http.Request, detector string)\n```\n\n```go\nfunc (httpsvc *HttpService) ApiInvalidateCache(w http.ResponseWriter, r *http.Request)\n```\nApiInvalidateCache clears the component template cache\n\n\t@Summary\t\tClear cache of Apricot-managed configuration component templates\n\t@Description\tInvalidates all cached templates for all configuration components managed by Apricot\n\t@Tags\t\t\tcomponent configuration\n\t@Produce\t\tplain\n\t@Success\t\t200\n\t@Router\t\t\t/components/_invalidate_cache [post]\n\n```go\nfunc (httpsvc *HttpService) ApiListComponentEntries(w http.ResponseWriter, r *http.Request)\n```\nApiListComponentEntries lists all entries for a given configuration component\n\n\t@Summary\t\tLists all entries for an Apricot-managed configuration component\n\t@Description\tReturns a list of all entries belonging to a given configuration component corresponding to the given query. The component must be provided. If the run type is not provided, entries for all run types are returned. If the role name is not provided, entries for all role names are returned. If the raw flag is true, AApricot will not attempt to include \"ANY\"/\"any\" run types or role names, and will return only the entries stored under the provided Consul path. If the raw flag is false, Apricot will include all entries for the given component, run type and role name, including entries stored under \"ANY\" and \"any\" paths corresponding to fallback values valid for all run types or role names.\n\t@Tags\t\t\tcomponent configuration\n\t@Produce\t\tjson\n\t@Produce\t\tplain\n\t@Param\t\t\tformat\t\tquery\t\tstring\tfalse\t\"Output format, json or text\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEnums(json, text)\tDefault(text)\n\t@Param\t\t\traw\t\t\tquery\t\tboolean\tfalse\t\"If true, the query returns strictly Consul paths without catching all run types or role names with ANY/any\"\tDefault(false)\n\t@Param\t\t\tcomponent\tpath\t\tstring\ttrue\t\"Configuration component\"\n\t@Param\t\t\truntype\t\tpath\t\tstring\tfalse\t\"O² Run type, must be capitalized\"\tDefault(ANY)\n\t@Param\t\t\trolename\tpath\t\tstring\tfalse\t\"Role name\"\t\t\t\t\t\t\tDefault(any)\n\t@Success\t\t200\t\t\t{array}\t\tstring\t\"List of entries, either as JSON array or comma-separated plain text\"\n\t@Failure\t\t400\t\t\t{string}\tstring\t\"Bad request, if the run type is invalid\"\n\t@Failure\t\t500\t\t\t{string}\tstring\t\"Internal server error\"\n\t@Router\t\t\t/components/{component} [get]\n\t@Router\t\t\t/components/{component}/{runtype} [get]\n\t@Router\t\t\t/components/{component}/{runtype}/{rolename} [get]\n\n```go\nfunc (httpsvc *HttpService) ApiListComponents(w http.ResponseWriter, r *http.Request)\n```\nApiListComponents lists configuration components\n\n\t@Summary\t\tList Apricot-managed configuration components\n\t@Description\tReturns a list of all configuration components managed by Apricot\n\t@Tags\t\t\tcomponent configuration\n\t@Produce\t\tjson\n\t@Produce\t\tplain\n\t@Param\t\t\tformat\tquery\t\tstring\tfalse\t\"Output format, json or text\"\tEnums(json, text)\tDefault(text)\n\t@Success\t\t200\t\t{array}\t\tstring\t\"List of components, either as JSON array or comma-separated plain text\"\n\t@Failure\t\t500\t\t{string}\tstring\t\"Internal server error\"\n\t@Router\t\t\t/components [get]\n\n```go\nfunc (httpsvc *HttpService) ApiPrintClusterInformation(w http.ResponseWriter, r *http.Request, hosts []string, inventory map[string][]string)\n```\n\n```go\nfunc (httpsvc *HttpService) ApiResolveComponentQuery(w http.ResponseWriter, r *http.Request)\n```\nApiResolveComponentQuery resolves a query for a given component, run type, role name and entry key\n\n\t@Summary\t\tResolves a query for a given component, run type, role name and entry key\n\t@Description\tReturns a resolved path for a given component, run type, role name and entry key. The path points to an actual existing entry in Consul, resolving ANY run type and any rolename wildcards.\n\t@Tags\t\t\tcomponent configuration\n\t@Produce\t\tplain\n\t@Param\t\t\tcomponent\tpath\t\tstring\ttrue\t\"Configuration component\"\n\t@Param\t\t\truntype\t\tpath\t\tstring\ttrue\t\"O² Run type, must be capitalized\"\n\t@Param\t\t\trolename\tpath\t\tstring\ttrue\t\"Role name\"\n\t@Param\t\t\tentry\t\tpath\t\tstring\ttrue\t\"Entry key\"\n\t@Success\t\t200\t\t\t{string}\tstring\t\"Resolved path for the queried entry\"\n\t@Failure\t\t400\t\t\t{string}\tstring\t\"Bad request, if a parameter is invalid\"\n\t@Failure\t\t500\t\t\t{string}\tstring\t\"Internal server error\"\n\t@Router\t\t\t/components/{component}/{runtype}/{rolename}/{entry}/resolve [get]\n\n```go\ntype Service struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewService(uri string) (svc *Service, err error)\n```\n\n```go\nfunc (s *Service) GenerateWorkflowDescriptor(wfPath string, vars map[string]string) string\n```\nReturns a YAML file OR even a structure made of Roles or Nodes with: import() functions already computed and resolved vars inserted\n\n```go\nfunc (s *Service) GetAliasedLinkIDsForDetector(detector string, onlyEnabled bool) (aliasedLinkIds []string, err error)\n```\n\n```go\nfunc (s *Service) GetAndProcessComponentConfiguration(query *componentcfg.Query, varStack map[string]string) (payload string, err error)\n```\n\n```go\nfunc (s *Service) GetCRUCardsForHost(hostname string) ([]string, error)\n```\n\n```go\nfunc (s *Service) GetComponentConfiguration(query *componentcfg.Query) (payload string, err error)\n```\n\n```go\nfunc (s *Service) GetComponentConfigurationWithLastIndex(query *componentcfg.Query) (payload string, lastIndex uint64, err error)\n```\n\n```go\nfunc (s *Service) GetDefaults() map[string]string\n```\nmaybe this one shouldn't exist at all, because vars should get inserted response: but not all of them! some vars will likely only get parsed at deployment time i.e. right before pushing TaskInfos\n\n```go\nfunc (s *Service) GetDetectorForHost(hostname string) (string, error)\n```\n\n```go\nfunc (s *Service) GetDetectorsForHosts(hosts []string) ([]string, error)\n```\n\n```go\nfunc (s *Service) GetDetectorsInventory() (inventory map[string][]string, err error)\n```\n\n```go\nfunc (s *Service) GetEndpointsForCRUCard(hostname, cardSerial string) ([]string, error)\n```\n\n```go\nfunc (s *Service) GetHostInventory(detector string) (hosts []string, err error)\n```\n\n```go\nfunc (s *Service) GetLinkIDsForCRUEndpoint(host string, cruId string, endpoint string, onlyEnabled bool) (ids []string, err error)\n```\n\n```go\nfunc (s *Service) GetRuntimeEntries(component string) (map[string]string, error)\n```\n\n```go\nfunc (s *Service) GetRuntimeEntry(component string, key string) (string, error)\n```\n\n```go\nfunc (s *Service) GetVars() map[string]string\n```\n\n```go\nfunc (s *Service) ImportComponentConfiguration(query *componentcfg.Query, payload string, newComponent bool) (existingComponentUpdated bool, existingEntryUpdated bool, err error)\n```\n\n```go\nfunc (s *Service) InvalidateComponentTemplateCache()\n```\n\n```go\nfunc (s *Service) ListComponentEntries(query *componentcfg.EntriesQuery) (entries []string, err error)\n```\n\n```go\nfunc (s *Service) ListComponents() (components []string, err error)\n```\n\n```go\nfunc (s *Service) ListDetectors(getAll bool) (detectors []string, err error)\n```\n\n```go\nfunc (s *Service) ListRuntimeEntries(component string) ([]string, error)\n```\n\n```go\nfunc (s *Service) NewRunNumber() (runNumber uint32, err error)\n```\n\n```go\nfunc (s *Service) RawGetRecursive(path string) (string, error)\n```\n\n```go\nfunc (s *Service) ResolveComponentQuery(query *componentcfg.Query) (resolved *componentcfg.Query, err error)\n```\n\n```go\nfunc (s *Service) SetRuntimeEntry(component string, key string, value string) error\n```\n\n","path":"github.com/AliceO2Group/Control/apricot/local","name":"local","synopsis":"Package local implements a local configuration backend for the configuration service, providing direct access to the backend storage without gRPC.","isRedistributable":true}
