Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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,omitempty"` // The IDs (separated by commas) of global EIPs connected by SNAT rule. GlobalEipId string `json:"global_eip_id,omitempty"` // 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 IDs (separated by commas) of the global EIPs connected by SNAT rule. GlobalEipId string `json:"global_eip_id"` // The global EIP addresses (separated by commas) connected by SNAT rule. GlobalEipAddress string `json:"global_eip_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 IDs (separated by commas) of global EIPs connected by SNAT rule. GlobalEipId string `json:"global_eip_id,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.
Click to show internal directories.
Click to hide internal directories.