packer-cn/vendor/github.com/ucloud/ucloud-sdk-go/services/unet/bind_eip.go

60 lines
1.8 KiB
Go
Raw Normal View History

2019-06-13 03:16:49 -04:00
//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors.
//go:generate ucloud-gen-go-api UNet BindEIP
package unet
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// BindEIPRequest is request schema for BindEIP action
type BindEIPRequest struct {
request.CommonBase
// [公共参数] 地域
// Region *string `required:"true"`
// [公共参数] 项目ID。不填写为默认项目子帐号必须填写
// ProjectId *string `required:"false"`
// 弹性IP的资源Id
EIPId *string `required:"true"`
// 弹性IP请求绑定的资源类型, 枚举值为: uhost: 云主机; ulb, 负载均衡器 upm: 物理机; hadoophost: 大数据集群;fortresshost堡垒机udockhost容器udhost私有专区主机natgwnatgwudbudbvpngwipsec vpnucdr云灾备dbaudit数据库审计
ResourceType *string `required:"true"`
// 弹性IP请求绑定的资源ID
ResourceId *string `required:"true"`
}
// BindEIPResponse is response schema for BindEIP action
type BindEIPResponse struct {
response.CommonBase
}
// NewBindEIPRequest will create request of BindEIP action.
func (c *UNetClient) NewBindEIPRequest() *BindEIPRequest {
req := &BindEIPRequest{}
// 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
}
// BindEIP - 将尚未使用的弹性IP绑定到指定的资源
func (c *UNetClient) BindEIP(req *BindEIPRequest) (*BindEIPResponse, error) {
var err error
var res BindEIPResponse
err = c.Client.InvokeAction("BindEIP", req, &res)
if err != nil {
return &res, err
}
return &res, nil
}