snatrules

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: Apache-2.0 Imports: 3 Imported by: 1

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 network ID used by the SNAT rule. This parameter and cidr are alternative.
	NetworkID string `json:"network_id,omitempty"`
	// Specifies the EIP ID. Use commas (,) to separate multiple IDs.
	// The maximum length of the ID is 4,096 bytes.
	// Constraints: The number of EIP IDs cannot exceed 20.
	FloatingIPID string `json:"floating_ip_id" required:"true"`
	// Specifies CIDR, which can be in the format of a network segment or a host IP address.
	// This parameter and network_id are alternative.
	// If source_type is set to 0, cidr must be a subset of the VPC subnet.
	// If source_type is set to 1, cidr must be a CIDR block of your on-premises network connected to the VPC through Direct Connect or Cloud Connect.
	Cidr string `json:"cidr,omitempty"`
	// 0: Either network_id or cidr can be specified in a VPC.
	// 1: Only cidr can be specified over a Direct Connect connection.
	// If no value is entered, the default value 0 (VPC) is used.
	SourceType int `json:"source_type,omitempty"`
	// Provides supplementary information about the SNAT rule.
	Description string `json:"description,omitempty"`
}

type ListOpts added in v0.9.4

type ListOpts struct {
	// Specifies the SNAT 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 network ID used by the SNAT rule.
	NetworkId string `q:"network_id,omitempty"`
	// Specifies a subset of the VPC subnet CIDR block or a CIDR block of Direct Connect connection.
	Cidr string `q:"cidr,omitempty"`
	// 0: Either network_id or cidr can be specified in a VPC.
	// 1: Only cidr can be specified over a Direct Connect connection.
	// If no value is entered, the default value 0 (VPC) is used.
	SourceType string `q:"source_type,omitempty"`
	// Specifies the EIP ID.
	FloatingIpId string `q:"floating_ip_id,omitempty"`
	// Specifies the EIP address.
	FloatingIpAddress string `q:"floating_ip_address,omitempty"`
	// Provides supplementary information about the SNAT rule.
	Description string `q:"description,omitempty"`
	// Specifies the status of the SNAT rule.
	Status string `q:"status,omitempty"`
	// Specifies whether the SNAT rule is enabled or disabled.
	// The value can be:
	// true: The SNAT rule is enabled.
	// false: The SNAT rule is disabled.
	AdminStateUp bool `q:"admin_state_up,omitempty"`
	// Specifies when the SNAT 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"`
}

type SnatRule

type SnatRule struct {
	// Specifies the SNAT rule ID.
	ID string `json:"id"`
	// Specifies the NAT gateway ID.
	NatGatewayID string `json:"nat_gateway_id"`
	// Specifies the network ID used by the SNAT rule.
	NetworkID string `json:"network_id"`
	// Specifies the project ID.
	TenantID string `json:"tenant_id"`
	// Specifies the EIP ID. Use commas (,) to separate multiple IDs.
	FloatingIPID string `json:"floating_ip_id"`
	// Specifies the EIP. Use commas (,) to separate multiple EIPs.
	FloatingIPAddress string `json:"floating_ip_address"`
	// Specifies the status of the SNAT rule.
	Status string `json:"status"`
	// Specifies the unfrozen or frozen state.
	// Specifies whether the SNAT rule is enabled or disabled.
	// The state can be:
	// true: The SNAT rule is enabled.
	// false: The SNAT rule is disabled.
	AdminStateUp bool `json:"admin_state_up"`
	// Specifies a subset of the VPC subnet CIDR block or a CIDR block of Direct Connect connection.
	Cidr string `json:"cidr"`
	// 0: Either network_id or cidr can be specified in a VPC.
	// 1: Only cidr can be specified over a Direct Connect connection.
	// If no value is entered, the default value 0 (VPC) is used.
	SourceType interface{} `json:"source_type"`
	// Specifies when the SNAT rule is 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) (*SnatRule, error)

func Get

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

func List added in v0.9.4

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

Jump to

Keyboard shortcuts

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