(baseURL string)
| 2525 | } |
| 2526 | |
| 2527 | func (p *proxy) smapFromURL(baseURL string) (smap *smapX, err error) { |
| 2528 | cargs := allocCargs() |
| 2529 | { |
| 2530 | cargs.req = cmn.HreqArgs{ |
| 2531 | Method: http.MethodGet, |
| 2532 | Base: baseURL, |
| 2533 | Path: apc.URLPathDae.S, |
| 2534 | Query: url.Values{apc.QparamWhat: []string{apc.GetWhatSmap}}, |
| 2535 | } |
| 2536 | cargs.timeout = apc.DefaultTimeout |
| 2537 | cargs.cresv = cresSM{} // -> smapX |
| 2538 | } |
| 2539 | res := p.call(cargs) |
| 2540 | if res.err != nil { |
| 2541 | err = res.errorf("failed to get Smap from %s", baseURL) |
| 2542 | } else { |
| 2543 | smap = res.v.(*smapX) |
| 2544 | if err = smap.validate(); err != nil { |
| 2545 | err = fmt.Errorf("%s: invalid %s from %s: %v", p, smap, baseURL, err) |
| 2546 | smap = nil |
| 2547 | } |
| 2548 | } |
| 2549 | freeCargs(cargs) |
| 2550 | freeCR(res) |
| 2551 | return |
| 2552 | } |
| 2553 | |
| 2554 | // forceful primary change - is used when the original primary network is down |
| 2555 | // for a while and the remained nodes selected a new primary. After the |
no test coverage detected