-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion.go
More file actions
45 lines (35 loc) · 960 Bytes
/
version.go
File metadata and controls
45 lines (35 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
Copyright Contributors to the Feilong Project.
SPDX-License-Identifier: Apache-2.0
**/
package feilong
import (
"encoding/json"
)
// https://cloudlib4zvm.readthedocs.io/en/latest/restapi.html#get-feilong-version
type GetFeilongVersionOutput struct {
Version string `json:"version"`
APIVersion string `json:"api_version"`
MaxVersion string `json:"max_version"`
MinVersion string `json:"min_version"`
}
type GetFeilongVersionResult struct {
OverallRC int `json:"overallRC"`
ReturnCode int `json:"rc"`
Reason int `json:"rs"`
ErrorMsg string `json:"errmsg"`
ModuleId int `json:"modID"`
Output GetFeilongVersionOutput `json:"output"`
}
func (c *Client) GetFeilongVersion() (*GetFeilongVersionResult, error) {
var result GetFeilongVersionResult
body, err := c.doRequest("GET", "/", nil)
if err != nil {
return nil, err
}
err = json.Unmarshal(body, &result)
if err != nil {
return nil, err
}
return &result, nil
}