mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-30 18:23:35 +08:00
21 lines
411 B
Go
21 lines
411 B
Go
package modules
|
|
|
|
import (
|
|
"io/ioutil"
|
|
|
|
"yunion.io/x/onecloud/pkg/mcclient"
|
|
)
|
|
|
|
func GetVersion(s *mcclient.ClientSession, serviceType string) (string, error) {
|
|
man := &BaseManager{serviceType: serviceType}
|
|
resp, err := man.rawRequest(s, "GET", "/version", nil, nil)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
body, err := ioutil.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return string(body), nil
|
|
}
|