-
Notifications
You must be signed in to change notification settings - Fork 0
/
form.go
33 lines (25 loc) · 879 Bytes
/
form.go
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
package vmmanagerapi
import (
"encoding/json"
"fmt"
"github.com/gadost/go-vmmanager-api/types"
)
// Migrate create migrations
func (a *Api) Migrate(queryParams *ParamsQuery) (*types.MigrateFormResponse, error) {
uri := fmt.Sprintf("/migrate%s", queryParams.Query)
bodyResp, err := a.NewRequest(NilPayload, uri, requestTypeGet, DefaultService)
var f *types.MigrateFormResponse
json.Unmarshal(bodyResp, &f)
return f, err
}
// RandomNames returns random names
func (a *Api) RandomNames(number int) ([]byte, error) {
uri := fmt.Sprintf("/random_name/%d", number)
bodyResp, err := a.NewRequest(NilPayload, uri, requestTypeGet, DefaultService)
return bodyResp, err
}
// TimeZone get current vmmanager timezone
func (a *Api) TimeZone() ([]byte, error) {
bodyResp, err := a.NewRequest(NilPayload, "/time_zone", requestTypeGet, DefaultService)
return bodyResp, err
}