GetDaemonConfig returns the configuration of a specific daemon in a cluster.
(baseParams BaseParams, node *cluster.Snode)
| 133 | |
| 134 | // GetDaemonConfig returns the configuration of a specific daemon in a cluster. |
| 135 | func 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 | |
| 157 | func GetDaemonStats(baseParams BaseParams, node *cluster.Snode) (ds *stats.DaemonStats, err error) { |
| 158 | baseParams.Method = http.MethodGet |
no test coverage detected