esg

package
v0.9.176 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	URI_PREFIX = bce.URI_PREFIX + "v1"

	DEFAULT_ENI = "bcc." + bce.DEFAULT_REGION + ".baidubce.com"

	REQUEST_ENI_URL = "/enterprise/security"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*bce.BceClient
}

Client of ESG service is a kind of BceClient, so derived from BceClient

func NewClient

func NewClient(ak, sk, endPoint string) (*Client, error)

func (*Client) CreateEsg

func (c *Client) CreateEsg(args *CreateEsgArgs) (*CreateEsgResult, error)

CreateEsg - create an esg with the specific parameters

PARAMS:

  • args: the arguments to create an esg

RETURNS:

  • *CreateEsgResult: the result of create esg
  • error: nil if success otherwise the specific error

func (*Client) CreateEsgRules

func (c *Client) CreateEsgRules(args *CreateEsgRuleArgs) error

CreateEsgRules - create esg rules

PARAMS:

  • CreateEsgRuleArgs: the arguments to create esg rules

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteEsg

func (c *Client) DeleteEsg(args *DeleteEsgArgs) error

DeleteEsg - delete an esg

PARAMS:

  • DeleteEsgArgs: the arguments to delete an esg

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteEsgRule

func (c *Client) DeleteEsgRule(args *DeleteEsgRuleArgs) error

DeleteEsgRule - delete an esg rule

PARAMS:

  • DeleteEsgArgs: the arguments to delete an esg rule

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ListEsg

func (c *Client) ListEsg(args *ListEsgArgs) (*ListEsgResult, error)

ListEsg - list all esg with the specific parameters

PARAMS:

  • args: the arguments to list all esg

RETURNS:

  • *ListEsgResult: the result of list all esg
  • error: nil if success otherwise the specific error

func (*Client) UpdateEsgRule

func (c *Client) UpdateEsgRule(args *UpdateEsgRuleArgs) error

UpdateEsgRule - update esg rule

PARAMS:

  • CreateEsgRuleArgs: the arguments to update esg rule

RETURNS:

  • error: nil if success otherwise the specific error

type CreateEsgArgs

type CreateEsgArgs struct {
	ClientToken string                        `json:"-"`
	Name        string                        `json:"name"`
	Desc        string                        `json:"desc"`
	Rules       []EnterpriseSecurityGroupRule `json:"rules"`
	Tags        []model.TagModel              `json:"tags,omitempty"`
}

type CreateEsgResult

type CreateEsgResult struct {
	EnterpriseSecurityGroupId string `json:"enterpriseSecurityGroupId"`
}

type CreateEsgRuleArgs

type CreateEsgRuleArgs struct {
	ClientToken               string                        `json:"-"`
	EnterpriseSecurityGroupId string                        `json:"enterpriseSecurityGroupId"`
	Rules                     []EnterpriseSecurityGroupRule `json:"rules"`
}

type DeleteEsgArgs

type DeleteEsgArgs struct {
	EnterpriseSecurityGroupId string
	ClientToken               string
}

type DeleteEsgRuleArgs

type DeleteEsgRuleArgs struct {
	EnterpriseSecurityGroupRuleId string
}

type EnterpriseSecurityGroup

type EnterpriseSecurityGroup struct {
	Id          string                        `json:"id"`
	Name        string                        `json:"name"`
	Desc        string                        `json:"desc"`
	Rules       []EnterpriseSecurityGroupRule `json:"rules"`
	Tags        []model.TagModel              `json:"tags"`
	CreatedTime string                        `json:"createdTime"`
}

type EnterpriseSecurityGroupRule

type EnterpriseSecurityGroupRule struct {
	EnterpriseSecurityGroupRuleId string `json:"enterpriseSecurityGroupRuleId"`
	Remark                        string `json:"remark"`
	Direction                     string `json:"direction"`
	Ethertype                     string `json:"ethertype"`
	PortRange                     string `json:"portRange"`
	Protocol                      string `json:"protocol"`
	SourceIp                      string `json:"sourceIp"`
	DestIp                        string `json:"destIp"`
	Action                        string `json:"action"`
	Priority                      int    `json:"priority"`
	CreatedTime                   string `json:"createdTime"`
	UpdatedTime                   string `json:"updatedTime"`
}

type ListEsgArgs

type ListEsgArgs struct {
	InstanceId string
	Marker     string
	MaxKeys    int
}

type ListEsgResult

type ListEsgResult struct {
	EnterpriseSecurityGroups []EnterpriseSecurityGroup `json:"enterpriseSecurityGroups"`
	Marker                   string                    `json:"marker"`
	IsTruncated              bool                      `json:"isTruncated"`
	NextMarker               string                    `json:"nextMarker"`
	MaxKeys                  int                       `json:"maxKeys"`
}

type UpdateEsgRuleArgs

type UpdateEsgRuleArgs struct {
	ClientToken                   string
	EnterpriseSecurityGroupRuleId string `json:"-"`
	Remark                        string `json:"remark"`
	PortRange                     string `json:"portRange"`
	Protocol                      string `json:"protocol"`
	SourceIp                      string `json:"sourceIp"`
	DestIp                        string `json:"destIp"`
	Action                        string `json:"action"`
	Priority                      int    `json:"priority"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL