-
Notifications
You must be signed in to change notification settings - Fork 38
/
reinstall_phost.go
74 lines (54 loc) · 1.95 KB
/
reinstall_phost.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors.
//go:generate ucloud-gen-go-api UPHost ReinstallPHost
package uphost
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// ReinstallPHostRequest is request schema for ReinstallPHost action
type ReinstallPHostRequest struct {
request.CommonBase
// 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"true"`
// PHost资源ID
PHostId *string `required:"true"`
// 密码
Password *string `required:"true"`
// 镜像Id,参考镜像列表,默认使用原镜像
ImageId *string `required:"false"`
// 物理机名称,默认不更改
Name *string `required:"false"`
// 物理机备注,默认为不更改。
Remark *string `required:"false"`
// 业务组,默认不更改。
Tag *string `required:"false"`
// 是否保留数据盘,保留:Yes,不报留:No, 默认:Yes
ReserveDisk *string `required:"false"`
// 不保留数据盘重装,可选Raid
Raid *string `required:"false"`
}
// ReinstallPHostResponse is response schema for ReinstallPHost action
type ReinstallPHostResponse struct {
response.CommonBase
// PHost 的资源ID
PHostId string
}
// NewReinstallPHostRequest will create request of ReinstallPHost action.
func (c *UPHostClient) NewReinstallPHostRequest() *ReinstallPHostRequest {
req := &ReinstallPHostRequest{}
// setup request with client config
c.Client.SetupRequest(req)
// setup retryable with default retry policy (retry for non-create action and common error)
req.SetRetryable(true)
return req
}
// ReinstallPHost - 重装物理机操作系统
func (c *UPHostClient) ReinstallPHost(req *ReinstallPHostRequest) (*ReinstallPHostResponse, error) {
var err error
var res ReinstallPHostResponse
err = c.Client.InvokeAction("ReinstallPHost", req, &res)
if err != nil {
return &res, err
}
return &res, nil
}