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, gatewayId, ruleId string) error

Delete is a method used to delete an existing SNAT rule.

Types

type CreateOpts

type CreateOpts struct {
	// The ID of the gateway to which the SNAT rule belongs.
	GatewayId string `json:"nat_gateway_id" required:"true"`
	//  IDs of floating IPs connected by SNAT rules (separated by commas).
	FloatingIpId string `json:"floating_ip_id" required:"true"`
	// The description of the SNAT rule.
	Description string `json:"description,omitempty"`
	// The network IDs of subnet connected by SNAT rule (VPC side).
	NetworkId string `json:"network_id,omitempty"`
	// The CIDR block connected by SNAT rule (DC side).
	Cidr string `json:"cidr,omitempty"`
	// The resource type of the SNAT rule.
	// The valid values are as follows:
	// + 0: VPC side.
	// + 1: DC side.
	SourceType int `json:"source_type,omitempty"`
}

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

type Rule

type Rule struct {
	// The ID of SNAT rule.
	ID string `json:"id"`
	// The ID of the gateway to which the SNAT rule belongs.
	GatewayId string `json:"nat_gateway_id"`
	// The network IDs of subnet connected by SNAT rule (VPC side).
	NetworkId string `json:"network_id"`
	// The project ID.
	TenantId string `json:"tenant_id"`
	// The IDs (separated by commas) of the floating IP that the SNAT rule have.
	FloatingIpId string `json:"floating_ip_id"`
	// The floating IP addresses (separated by commas) connected by SNAT rule.
	FloatingIpAddress string `json:"floating_ip_address"`
	// The description of the SNAT rule.
	Description string `json:"description"`
	// The status of the SNAT rule.
	Status string `json:"status"`
	// The frozen status.
	AdminStateUp bool `json:"admin_state_up"`
	// The CIDR block connected by SNAT rule (DC side).
	Cidr string `json:"cidr"`
	// The resource type of the SNAT rule.
	// The valid values are as follows:
	// + 0: VPC side.
	// + 1: DC side.
	SourceType int `json:"source_type"`
}

Rule is a struct that represents the SNAT rule detail.

func Create

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

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

func Get

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

Get is a method used to obtain the detail of the SNAT rule 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 of the gateway to which the SNAT rule belongs.
	GatewayId string `json:"nat_gateway_id" required:"true"`
	// The floating IP addresses (separated by commas) connected by SNAT rule.
	FloatingIpAddress string `json:"public_ip_address,omitempty"`
	// The description of the SNAT rule.
	Description *string `json:"description,omitempty"`
}

CreateOpts is the structure that used to update the configuration of the SNAT rule.

Jump to

Keyboard shortcuts

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