-
Notifications
You must be signed in to change notification settings - Fork 38
/
update_sslbinding.go
62 lines (46 loc) · 1.6 KB
/
update_sslbinding.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
//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors.
//go:generate ucloud-gen-go-api ULB UpdateSSLBinding
package ulb
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// UpdateSSLBindingRequest is request schema for UpdateSSLBinding action
type UpdateSSLBindingRequest struct {
request.CommonBase
// 所操作ULB实例ID
ULBId *string `required:"true"`
// 所操作VServer实例ID
VServerId *string `required:"true"`
// VServer实例绑定的旧的证书
OldSSLId *string `required:"true"`
// VServer实例需要绑定的新的证书
NewSSLId *string `required:"true"`
}
// UpdateSSLBindingResponse is response schema for UpdateSSLBinding action
type UpdateSSLBindingResponse struct {
response.CommonBase
// 返回码
RetCode int
// 响应名称
Action string
}
// NewUpdateSSLBindingRequest will create request of UpdateSSLBinding action.
func (c *ULBClient) NewUpdateSSLBindingRequest() *UpdateSSLBindingRequest {
req := &UpdateSSLBindingRequest{}
// 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
}
// UpdateSSLBinding - 将VServer绑定的证书更换为另一个证书
func (c *ULBClient) UpdateSSLBinding(req *UpdateSSLBindingRequest) (*UpdateSSLBindingResponse, error) {
var err error
var res UpdateSSLBindingResponse
err = c.Client.InvokeAction("UpdateSSLBinding", req, &res)
if err != nil {
return &res, err
}
return &res, nil
}