-
Notifications
You must be signed in to change notification settings - Fork 38
/
allocate_secondary_ip.go
71 lines (52 loc) · 2.04 KB
/
allocate_secondary_ip.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
//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors.
//go:generate ucloud-gen-go-api VPC AllocateSecondaryIp
package vpc
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// AllocateSecondaryIpRequest is request schema for AllocateSecondaryIp action
type AllocateSecondaryIpRequest struct {
request.CommonBase
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"true"`
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"true"`
// 节点mac
Mac *string `required:"true"`
// 子网Id(若未指定,则根据zone获取默认子网进行创建)
SubnetId *string `required:"false"`
// vpcId
VPCId *string `required:"false"`
// 指定Ip分配
Ip *string `required:"false"`
// 资源Id
ObjectId *string `required:"false"`
}
// AllocateSecondaryIpResponse is response schema for AllocateSecondaryIp action
type AllocateSecondaryIpResponse struct {
response.CommonBase
//
IpInfo IpInfo
}
// NewAllocateSecondaryIpRequest will create request of AllocateSecondaryIp action.
func (c *VPCClient) NewAllocateSecondaryIpRequest() *AllocateSecondaryIpRequest {
req := &AllocateSecondaryIpRequest{}
// 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(false)
return req
}
// AllocateSecondaryIp - 分配ip(用于uk8s使用)
func (c *VPCClient) AllocateSecondaryIp(req *AllocateSecondaryIpRequest) (*AllocateSecondaryIpResponse, error) {
var err error
var res AllocateSecondaryIpResponse
err = c.Client.InvokeAction("AllocateSecondaryIp", req, &res)
if err != nil {
return &res, err
}
return &res, nil
}