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

66 lines
2.0 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 CreateFirewall
package unet
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// CreateFirewallRequest is request schema for CreateFirewall action
type CreateFirewallRequest struct {
request.CommonBase
// [公共参数] 地域
// Region *string `required:"true"`
// [公共参数] 项目ID。不填写为默认项目子帐号必须填写
// ProjectId *string `required:"false"`
// 防火墙规则例如TCP|22|192.168.1.1/22|DROP|LOW|禁用22端口第一个参数代表协议第二个参数代表端口号第三个参数为ip第四个参数为ACCEPT接受和DROP拒绝第五个参数优先级HIGHMEDIUMLOW第六个参数为该条规则的自定义备注
Rule []string `required:"true"`
// 防火墙名称
Name *string `required:"true"`
// 防火墙业务组默认为Default
Tag *string `required:"false"`
// 防火墙描述,默认为空
Remark *string `required:"false"`
}
// CreateFirewallResponse is response schema for CreateFirewall action
type CreateFirewallResponse struct {
response.CommonBase
// 防火墙ID
FWId string
}
// NewCreateFirewallRequest will create request of CreateFirewall action.
func (c *UNetClient) NewCreateFirewallRequest() *CreateFirewallRequest {
req := &CreateFirewallRequest{}
// 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
}
// CreateFirewall - 创建防火墙
func (c *UNetClient) CreateFirewall(req *CreateFirewallRequest) (*CreateFirewallResponse, error) {
var err error
var res CreateFirewallResponse
err = c.Client.InvokeAction("CreateFirewall", req, &res)
if err != nil {
return &res, err
}
return &res, nil
}