| 212 | } |
| 213 | |
| 214 | func (qss *QuerySupervisorDetails) getURLs(nodeDefs *cbgt.NodeDefs, |
| 215 | indexName string, longerThan string) (map[string]string, map[string]error) { |
| 216 | nodeURLs := make(map[string]string) |
| 217 | errs := make(map[string]error) |
| 218 | ss := cbgt.GetSecuritySetting() |
| 219 | for uuid, node := range nodeDefs.NodeDefs { |
| 220 | hostPortUrl := "http://" + node.HostPort |
| 221 | if ss.EncryptionEnabled { |
| 222 | if u, err := node.HttpsURL(); err == nil { |
| 223 | hostPortUrl = u |
| 224 | } |
| 225 | } |
| 226 | urlStr := hostPortUrl + "/api/query" |
| 227 | if indexName != "" { |
| 228 | urlStr += "/index/" + indexName |
| 229 | } |
| 230 | if longerThan != "" { |
| 231 | urlStr += "?longerThan=" + longerThan |
| 232 | } |
| 233 | urlStr, err := cbgt.CBAuthURL(urlStr) |
| 234 | if err != nil { |
| 235 | urlStr = "" |
| 236 | errs[uuid] = err |
| 237 | } |
| 238 | nodeURLs[uuid] = urlStr |
| 239 | } |
| 240 | return nodeURLs, errs |
| 241 | } |
| 242 | |
| 243 | func (qss *QuerySupervisorDetails) getSupervisorMaps(nodeDefs *cbgt.NodeDefs, |
| 244 | indexName string, longerThan string) ([]response, map[string]string) { |