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, gatewayId, 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 DNAT rule belongs.
	GatewayId string `json:"nat_gateway_id" required:"true"`
	// The IDs of floating IP connected by DNAT rule.
	FloatingIpId string `json:"floating_ip_id" required:"true"`
	// The protocol type. The valid values are 'udp', 'tcp' and 'any'.
	Protocol string `json:"protocol" required:"true"`
	// The port used by Floating IP provide services for external systems.
	InternalServicePort *int `json:"internal_service_port" required:"true"`
	// The port used by ECSs or BMSs to provide services for external systems.
	ExternalServicePort *int `json:"external_service_port" required:"true"`
	// The port range used by Floating IP provide services for external systems.
	InternalServicePortRange string `json:"internal_service_port_range,omitempty"`
	// The port range used by ECSs or BMSs to provide services for external systems.
	EXternalServicePortRange string `json:"external_service_port_range,omitempty"`
	// The description of the DNAT rule.
	Description string `json:"description,omitempty"`
	// The port ID of network.
	PortId string `json:"port_id,omitempty"`
	// The private IP address of a user.
	PrivateIp string `json:"private_ip,omitempty"`
}

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

type Rule

type Rule struct {
	// The ID of the DNAT rule.
	ID string `json:"id"`
	// The project ID.
	TenantId string `json:"tenant_id"`
	// The description of the DNAT rule.
	Description string `json:"description"`
	// The port ID of network.
	PortId string `json:"port_id"`
	// The private IP address of a user.
	PrivateIp string `json:"private_ip"`
	// The ID of the gateway to which the DNAT rule belongs.
	GatewayId string `json:"nat_gateway_id"`
	// The IDs of floating IP connected by DNAT rule.
	FloatingIpId string `json:"floating_ip_id"`
	// The floating IP address connected by DNAT rule.
	FloatingIpAddress string `json:"floating_ip_address"`
	// The current status of the DNAT rule.
	Status string `json:"status"`
	// The frozen status.
	AdminStateUp bool `json:"admin_state_up"`
	// The port used by Floating IP provide services for external systems.
	InternalServicePort int `json:"internal_service_port"`
	// The port used by ECSs or BMSs to provide services for external systems.
	ExternalServicePort int `json:"external_service_port"`
	// The port range used by Floating IP provide services for external systems.
	InternalServicePortRange string `json:"internal_service_port_range"`
	// The port range used by ECSs or BMSs to provide services for external systems.
	EXternalServicePortRange string `json:"external_service_port_range"`
	// The protocol type. The valid values are 'udp', 'tcp' and 'any'.
	Protocol string `json:"protocol"`
	// The creation time of the dnat rule.
	CreatedAt string `json:"created_at"`
}

Rule is a struct that represents the DNAT rule detail.

func Create

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

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

func Get

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

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

func Update

func Update(c *golangsdk.ServiceClient, gatewayId 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 gateway to which the DNAT rule belongs.
	GatewayId string `json:"nat_gateway_id,omitempty"`
	// The description of the DNAT rule.
	Description *string `json:"description,omitempty"`
	// The port ID of network.
	PortId string `json:"port_id,omitempty"`
	// The private IP address of a user.
	PrivateIp string `json:"private_ip,omitempty"`
	// The protocol type. The valid values are 'udp', 'tcp' and 'any'.
	Protocol string `json:"protocol,omitempty"`
	// The IDs of floating IP connected by DNAT rule.
	FloatingIpId string `json:"floating_ip_id,omitempty"`
	// The port used by Floating IP provide services for external systems.
	InternalServicePort *int `json:"internal_service_port,omitempty"`
	// The port used by ECSs or BMSs to provide services for external systems.
	ExternalServicePort *int `json:"external_service_port,omitempty"`
	// The port range used by Floating IP provide services for external systems.
	InternalServicePortRange string `json:"internal_service_port_range,omitempty"`
	// The port range used by ECSs or BMSs to provide services for external systems.
	ExternalServicePortRange string `json:"external_service_port_range,omitempty"`
}

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

Jump to

Keyboard shortcuts

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