Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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)
Click to show internal directories.
Click to hide internal directories.