dnats

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 DNAT rule using its ID.

Types

type CreateOpts

type CreateOpts struct {
	// The ID of the gateway to which the private DNAT rule belongs.
	GatewayId string `json:"gateway_id" required:"true"`
	// The ID of the transit IP for private NAT.
	TransitIpId string `json:"transit_ip_id" required:"true"`
	// The description of the DNAT rule, which contain maximum of `255` characters, and angle brackets (< and >) are
	// not allowed.
	Description string `json:"description,omitempty"`
	// The network interface ID of the transit IP for private NAT.
	NetworkInterfaceId string `json:"network_interface_id,omitempty"`
	// The protocol type of the private DNAT rule.
	// The valid values (and the related protocol numbers) are 'UDP/udp (6)', 'TCP/tcp' (17) and 'ANY/any (0)'.
	Protocol string `json:"protocol,omitempty"`
	// The private IP address of the backend instance.
	PrivateIpAddress string `json:"private_ip_address,omitempty"`
	// The port of the backend instance.
	InternalServicePort string `json:"internal_service_port,omitempty"`
	// The port of the transit IP.
	TransitServicePort string `json:"transit_service_port,omitempty"`
}

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

type Rule

type Rule struct {
	// The ID of the DNAT rule.
	ID string `json:"id"`
	// The project ID.
	ProjectId string `json:"project_id"`
	// The description of the DNAT rule, which contain maximum of `255` characters, and angle brackets (< and >) are
	// not allowed.
	Description string `json:"description"`
	// The ID of the transit IP.
	TransitIpId string `json:"transit_ip_id"`
	// The ID of the gateway to which the private DNAT rule belongs.
	GatewayId string `json:"gateway_id"`
	// The network interface ID of the transit IP for private NAT.
	NetworkInterfaceId string `json:"network_interface_id"`
	// The backend type of the DNAT rule.
	// The values of the backend type are as follow:
	// + COMPUTE
	// + VIP
	// + ELB
	// + ELBv3
	// + CUSTOMIZE
	Type string `json:"type"`
	// The protocol type. The valid values (and the related protocol numbers) are 'UDP/udp (6)', 'TCP/tcp' (17) and
	// 'ANY/any (0)'.
	Protocol string `json:"protocol"`
	// The private IP address of the backend instance.
	PrivateIpAddress string `json:"private_ip_address"`
	// The port of the backend instance.
	InternalServicePort string `json:"internal_service_port"`
	// The port of the transit IP.
	TransitServicePort string `json:"transit_service_port"`
	// The ID of the enterprise project to which the private DNAT rule belongs.
	EnterpriseProjectId string `json:"enterprise_project_id"`
	// The creation time of the private DNAT rule.
	CreatedAt string `json:"created_at"`
	// The latest update time of the private DNAT rule.
	UpdatedAt string `json:"updated_at"`
}

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

func Create

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

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

func Get

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

Get is a method used to obtain the private DNAT 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 DNAT rule using given parameters.

type UpdateOpts

type UpdateOpts struct {
	// The ID of the transit IP for private NAT.
	TransitIpId string `json:"transit_ip_id,omitempty"`
	// The description of the DNAT rule, which contain maximum of `255` characters, and angle brackets (< and >) are
	// not allowed.
	Description *string `json:"description,omitempty"`
	// The network interface ID of the transit IP for private NAT.
	NetworkInterfaceId string `json:"network_interface_id,omitempty"`
	// The protocol type. The valid values (and the related protocol numbers) are 'UDP/udp (6)', 'TCP/tcp' (17) and
	// 'ANY/any (0)'.
	Protocol string `json:"protocol,omitempty"`
	// The private IP address of the backend instance.
	PrivateIpAddress string `json:"private_ip_address,omitempty"`
	// The port of the backend instance.
	InternalServicePort string `json:"internal_service_port,omitempty"`
	// The port of the transit IP.
	TransitServicePort string `json:"transit_service_port,omitempty"`
}

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

Jump to

Keyboard shortcuts

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