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

60 lines
2.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//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 UpdateFirewall
package unet
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// UpdateFirewallRequest is request schema for UpdateFirewall action
type UpdateFirewallRequest struct {
request.CommonBase
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 项目ID。不填写为默认项目子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// 防火墙资源ID
FWId *string `required:"true"`
// 防火墙规则例如TCP|22|192.168.1.1/22|DROP|LOW|禁用22端口第一个参数代表协议第二个参数代表端口号第三个参数为ip第四个参数为ACCEPT接受和DROP拒绝第五个参数优先级HIGHMEDIUMLOW第六个参数为该条规则的自定义备注
Rule []string `required:"true"`
}
// UpdateFirewallResponse is response schema for UpdateFirewall action
type UpdateFirewallResponse struct {
response.CommonBase
// 防火墙id
FWId string
}
// NewUpdateFirewallRequest will create request of UpdateFirewall action.
func (c *UNetClient) NewUpdateFirewallRequest() *UpdateFirewallRequest {
req := &UpdateFirewallRequest{}
// 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
}
// UpdateFirewall - 更新防火墙规则
func (c *UNetClient) UpdateFirewall(req *UpdateFirewallRequest) (*UpdateFirewallResponse, error) {
var err error
var res UpdateFirewallResponse
err = c.Client.InvokeAction("UpdateFirewall", req, &res)
if err != nil {
return &res, err
}
return &res, nil
}