Help us shape the future of Go! Take the 2026 Go Developer Survey

dnatrules

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(client *golangsdk.ServiceClient, id string) (err error)

Types

type CreateOpts

type CreateOpts struct {
	// Specifies the NAT gateway ID.
	NatGatewayID string `json:"nat_gateway_id" required:"true"`
	// Specifies the port ID of the cloud server (ECS or BMS).
	// Either this parameter or private_ip must be specified.
	// When the DNAT rule is used in the VPC scenario, use this parameter.
	PortID string `json:"port_id,omitempty"`
	// Specifies the private IP address, for example, the IP address of an on-premises network connected by a Direct Connect connection.
	// This parameter and port_id are alternative.
	// When the DNAT rule is used in the Direct Connect scenario, use this parameter.
	PrivateIp string `json:"private_ip,omitempty"`
	// Specifies the port number used by the cloud server (ECS or BMS) to provide services for external systems.
	// In VPC DNAT scenarios, this parameter indicates the protocol port number of the NIC of
	// the cloud server (ECS or BMS) in the DNAT rule. In Direct Connect DNAT scenarios,
	// this parameter indicates the protocol port number of your private IP address in the DNAT rule.
	// The value ranges from 0 to 65535.
	InternalServicePort *int `json:"internal_service_port" required:"true"`
	// Specifies the EIP ID.
	FloatingIpID string `json:"floating_ip_id" required:"true"`
	// Specifies the port for providing services for external systems.
	// The value ranges from 0 to 65535.
	ExternalServicePort *int `json:"external_service_port" required:"true"`
	// Specifies the protocol. TCP, UDP, and ANY are supported.
	// The protocol number of TCP, UDP, and ANY are 6, 17, and 0, respectively.
	Protocol string `json:"protocol" required:"true"`
	// Provides supplementary information about the DNAT rule.
	Description string `json:"description,omitempty"`
}

CreateOpts contains all the values needed to create a new dnat rule resource.

type DnatRule

type DnatRule struct {
	// Specifies the DNAT rule ID.
	ID string `json:"id"`
	// Specifies the project ID.
	ProjectId string `json:"tenant_id"`
	// Specifies the NAT gateway ID.
	NatGatewayId string `json:"nat_gateway_id"`
	// Specifies the port ID of the cloud server (ECS or BMS).
	// This parameter is used in the VPC scenario, where this parameter or private_ip must be specified.
	PortId string `json:"port_id"`
	// Specifies the IP address of an on-premises network connected by a Direct Connect connection.
	// This parameter is used in the Direct Connect scenario. This parameter and port_id are alternative.
	PrivateIp string `json:"private_ip"`
	// Specifies the port number used by the cloud server (ECS or BMS) to provide services for external systems.
	InternalServicePort int `json:"internal_service_port"`
	// Specifies the EIP ID.
	FloatingIpId string `json:"floating_ip_id"`
	// Specifies the EIP address.
	FloatingIpAddress string `json:"floating_ip_address"`
	// Specifies the port for providing services for external systems.
	ExternalServicePort int `json:"external_service_port"`
	// Specifies the protocol. TCP, UDP, and ANY are supported.
	// The protocol number of TCP, UDP, and ANY are 6, 17, and 0, respectively.
	Protocol string `json:"protocol"`
	// Provides supplementary information about the DNAT rule.
	Description string `json:"description"`
	// Specifies the status of the DNAT rule.
	Status string `json:"status"`
	// Specifies whether the NAT gateway is up or down.
	// The value can be:
	// true: The DNAT rule is enabled.
	// false: The DNAT rule is disabled.
	AdminStateUp *bool `json:"admin_state_up"`
	// Specifies when the DNAT rule was created (UTC time).
	// Its value rounds to 6 decimal places for seconds. The format is yyyy-mm-dd hh:mm:ss.
	CreatedAt string `json:"created_at"`
}

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*DnatRule, error)

Create will create a new Waf Certificate on the values in CreateOpts.

func Get

func Get(client *golangsdk.ServiceClient, id string) (*DnatRule, error)

func List added in v0.9.0

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]DnatRule, error)

type ListOpts added in v0.9.0

type ListOpts struct {
	// Specifies the DNAT rule ID.
	Id string `q:"id,omitempty"`
	// Specifies the number of records returned on each page.
	Limit int `q:"limit,omitempty"`
	// Specifies the project ID.
	ProjectId string `q:"tenant_id,omitempty"`
	// Specifies the NAT gateway ID.
	NatGatewayId string `q:"nat_gateway_id,omitempty"`
	// Specifies the port ID of the cloud server (ECS or BMS).
	PortId string `q:"port_id,omitempty"`
	// Private IP address
	PrivateIp string `q:"private_ip,omitempty"`
	// Specifies the port number used by the cloud server (ECS or BMS) to provide services for external systems.
	InternalServicePort int `q:"internal_service_port,omitempty"`
	// Specifies the EIP ID.
	FloatingIpId string `q:"floating_ip_id,omitempty"`
	// Specifies the EIP address.
	FloatingIpAddress string `q:"floating_ip_address,omitempty"`
	// Specifies the port for providing services for external systems.
	ExternalServicePort int `q:"external_service_port,omitempty"`
	// Specifies the protocol. TCP, UDP, and ANY are supported.
	// The protocol number of TCP, UDP, and ANY are 6, 17, and 0, respectively.
	Protocol string `q:"protocol,omitempty"`
	// Provides supplementary information about the DNAT rule.
	Description string `q:"description,omitempty"`
	// Specifies the status of the DNAT rule.
	Status string `q:"status,omitempty"`
	// Specifies whether the DNAT rule is enabled or disabled.
	// The value can be:
	// true: The DNAT rule is enabled.
	// false: The DNAT rule is disabled.
	AdminStateUp bool `q:"admin_state_up,omitempty"`
	// Specifies when the DNAT rule was created (UTC time).
	// Its value rounds to 6 decimal places for seconds. The format is yyyy-mm-dd hh:mm:ss.
	CreatedAt bool `q:"created_at,omitempty"`
}

Jump to

Keyboard shortcuts

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