snats

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(c *golangsdk.ServiceClient, ruleId string) error

Delete is a method to remove the specified SNAT rule using its ID.

Types

type AssociatedTransitIp

type AssociatedTransitIp struct {
	// The ID of the transit IP.
	ID string `json:"transit_ip_id"`
	// The address of the transit IP.
	Address string `json:"transit_ip_address"`
}

type CreateOpts

type CreateOpts struct {
	// The ID of the gateway to which the private SNAT rule belongs.
	GatewayId string `json:"gateway_id" required:"true"`
	// The ID list of the transit IPs for private NAT.
	TransitIpIds []string `json:"transit_ip_ids" required:"true"`
	// The CIDR block of the match rule.
	// Exactly one of cidr and virsubnet_id must be set.
	Cidr string `json:"cidr,omitempty"`
	// The subnet ID of the match rule.
	// Exactly one of cidr and virsubnet_id must be set.
	SubnetId string `json:"virsubnet_id,omitempty"`
	// The description of the private SNAT rule, which contain maximum of `255` characters, and angle brackets (< and >)
	// are not allowed.
	Description string `json:"description,omitempty"`
}

CreateOpts is the structure used to create a new private SNAT rule.

type Rule

type Rule struct {
	// The ID of the SNAT rule.
	ID string `json:"id"`
	// The project ID.
	ProjectId string `json:"project_id"`
	// The ID of the gateway to which the private SNAT rule belongs.
	GatewayId string `json:"gateway_id"`
	// The CIDR block of the match rule.
	// Exactly one of cidr and virsubnet_id must be set.
	Cidr string `json:"cidr"`
	// The subnet ID of the match rule.
	// Exactly one of cidr and virsubnet_id must be set.
	SubnetId string `json:"virsubnet_id"`
	// The description of the SNAT rule, which contain maximum of `255` characters, and angle brackets (< and >) are
	// not allowed.
	Description string `json:"description"`
	// The ID of the transit IP.
	TransitIpAssociations []AssociatedTransitIp `json:"transit_ip_associations"`
	// The ID of the enterprise project to which the private SNAT rule belongs.
	EnterpriseProjectId string `json:"enterprise_project_id"`
	// The creation time of the private SNAT rule.
	CreatedAt string `json:"created_at"`
	// The latest update time of the private SNAT rule.
	UpdatedAt string `json:"updated_at"`
}

Rule is a struct that represents the private SNAT rule detail.

func Create

func Create(c *golangsdk.ServiceClient, opts CreateOpts) (*Rule, error)

Create is a method used to create a private SNAT rule using given parameters.

func Get

func Get(c *golangsdk.ServiceClient, ruleId string) (*Rule, error)

Get is a method used to obtain the private SNAT rule detail by its ID.

func Update

func Update(c *golangsdk.ServiceClient, ruleId string, opts UpdateOpts) (*Rule, error)

Update is a method used to modify an existing SNAT rule using given parameters.

type UpdateOpts

type UpdateOpts struct {
	// The ID list of the transit IPs for private NAT.
	TransitIpIds []string `json:"transit_ip_ids,omitempty"`
	// The description of the private SNAT rule, which contain maximum of `255` characters, and angle brackets (< and >)
	// are not allowed.
	Description *string `json:"description,omitempty"`
}

UpdateOpts is the structure used to modify an existing private SNAT rule.

Jump to

Keyboard shortcuts

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