MCPcopy
hub / github.com/NVIDIA/aistore / GetDaemonConfig

Function GetDaemonConfig

api/daemon.go:135–155  ·  view source on GitHub ↗

GetDaemonConfig returns the configuration of a specific daemon in a cluster.

(baseParams BaseParams, node *cluster.Snode)

Source from the content-addressed store, hash-verified

133
134// GetDaemonConfig returns the configuration of a specific daemon in a cluster.
135func GetDaemonConfig(baseParams BaseParams, node *cluster.Snode) (config *cmn.Config, err error) {
136 baseParams.Method = http.MethodGet
137 reqParams := AllocRp()
138 {
139 reqParams.BaseParams = baseParams
140 reqParams.Path = apc.URLPathReverseDaemon.S
141 reqParams.Query = url.Values{apc.QparamWhat: []string{apc.GetWhatConfig}}
142 reqParams.Header = http.Header{apc.HdrNodeID: []string{node.ID()}}
143 }
144 err = reqParams.DoHTTPReqResp(&config)
145 FreeRp(reqParams)
146 if err != nil {
147 return nil, err
148 }
149 // FIXME: transform backend structures on the client side
150 // - as a side effect, config.Backend validation populates non-JSON structs that client can utilize;
151 // - secondly, HDFS networking, etc.
152 // TODO: revise and remove
153 _ = config.Backend.Validate()
154 return config, nil
155}
156
157func GetDaemonStats(baseParams BaseParams, node *cluster.Snode) (ds *stats.DaemonStats, err error) {
158 baseParams.Method = http.MethodGet

Callers 8

getRandTargetConfigFunction · 0.92
defaultBckPropsFunction · 0.92
showNodeConfigFunction · 0.92
initFSFunction · 0.92
retrieveBackendProvidersFunction · 0.92
isClusterLocalFunction · 0.92
GetDaemonConfigFunction · 0.92
getClusterConfigFunction · 0.92

Calls 5

AllocRpFunction · 0.85
FreeRpFunction · 0.85
DoHTTPReqRespMethod · 0.80
IDMethod · 0.65
ValidateMethod · 0.65

Tested by

no test coverage detected