Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a85ad3acd5 |
@@ -1,9 +1,4 @@
|
||||
## Version 1.7.0
|
||||
|
||||
## Feature
|
||||
- Added support for authorization using the Basis.Virtual Security system. Add client and config
|
||||
## Version 1.7.1
|
||||
|
||||
## Bugfix
|
||||
- Add model ListInfoSnapshots in cloudapi/bservice/models
|
||||
- Fix func SnapshotList for work with new model cloudapi/bservice/snapshot_list
|
||||
- Add models ItemAffinityGroup, ListAffinityGroup in cloudapi/rg/models
|
||||
- Fix panic in clients
|
||||
|
||||
13
client.go
13
client.go
@@ -164,21 +164,20 @@ func (dc *DecortClient) do(req *http.Request, ctype string) (*http.Response, err
|
||||
// var resp *http.Response
|
||||
// var err error
|
||||
buf, _ := io.ReadAll(req.Body)
|
||||
// req = req.Clone(req.Context())
|
||||
|
||||
// for i := uint64(0); i < dc.cfg.Retries; i++ {
|
||||
// req = req.Clone(req.Context())
|
||||
req.Body = io.NopCloser(bytes.NewBuffer(buf))
|
||||
resp, err := dc.client.Do(req)
|
||||
|
||||
// if err == nil {
|
||||
if resp.StatusCode == 200 {
|
||||
return resp, err
|
||||
if err == nil {
|
||||
if resp.StatusCode == 200 {
|
||||
return resp, err
|
||||
}
|
||||
}
|
||||
// }
|
||||
respBytes, _ := io.ReadAll(resp.Body)
|
||||
err = fmt.Errorf("%s", respBytes)
|
||||
resp.Body.Close()
|
||||
// }
|
||||
// }
|
||||
|
||||
return nil, fmt.Errorf("could not execute request: %w", err)
|
||||
}
|
||||
|
||||
@@ -154,20 +154,20 @@ func (bdc *BVSDecortClient) do(req *http.Request, ctype string) (*http.Response,
|
||||
// var resp *http.Response
|
||||
// var err error
|
||||
buf, _ := io.ReadAll(req.Body)
|
||||
// req = req.Clone(req.Context())
|
||||
|
||||
// for i := uint64(0); i < dc.cfg.Retries; i++ {
|
||||
// for i := uint64(0); i < bdc.cfg.Retries; i++ {
|
||||
// req = req.Clone(req.Context())
|
||||
req.Body = io.NopCloser(bytes.NewBuffer(buf))
|
||||
resp, err := bdc.client.Do(req)
|
||||
// if err == nil {
|
||||
if resp.StatusCode == 200 {
|
||||
return resp, err
|
||||
if err == nil {
|
||||
if resp.StatusCode == 200 {
|
||||
return resp, err
|
||||
}
|
||||
}
|
||||
// }
|
||||
respBytes, _ := io.ReadAll(resp.Body)
|
||||
err = fmt.Errorf("%s", respBytes)
|
||||
resp.Body.Close()
|
||||
// }
|
||||
// }
|
||||
|
||||
return nil, fmt.Errorf("could not execute request: %w", err)
|
||||
}
|
||||
|
||||
@@ -159,22 +159,20 @@ func (ldc *LegacyDecortClient) do(req *http.Request, ctype string) (*http.Respon
|
||||
// var resp *http.Response
|
||||
// var err error
|
||||
buf, _ := io.ReadAll(req.Body)
|
||||
// req = req.Clone(req.Context())
|
||||
|
||||
// for i := uint64(0); i < ldc.cfg.Retries; i++ {
|
||||
|
||||
// req = req.Clone(req.Context())
|
||||
req.Body = io.NopCloser(bytes.NewBuffer(buf))
|
||||
resp, err := ldc.client.Do(req)
|
||||
|
||||
// if err == nil {
|
||||
if resp.StatusCode == 200 {
|
||||
return resp, err
|
||||
if err == nil {
|
||||
if resp.StatusCode == 200 {
|
||||
return resp, err
|
||||
}
|
||||
}
|
||||
// }
|
||||
respBytes, _ := io.ReadAll(resp.Body)
|
||||
err = fmt.Errorf("%s", respBytes)
|
||||
resp.Body.Close()
|
||||
// }
|
||||
// }
|
||||
|
||||
return nil, fmt.Errorf("could not execute request: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user