staticnat

package
v0.0.0-...-56e5f01 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager

List returns a Pager which allows you to iterate over a collection of Static NAT resources. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

Types

type CreateOpts

type CreateOpts struct {
	PrivateIpAddr string `json:"vmguestip"`     // Private IP address (allocated to the server(VM))
	SubnetID      string `json:"vmnetworkid"`   // ID of the Tier the VM belongs to
	PublicIpID    string `json:"entpublicipid"` // Public IP ID to set up Static NAT
}

CreateOpts contains all the values needed to create a new Static NAT resource. All attributes are required.

func (CreateOpts) ToStaticNatCreateMap

func (opts CreateOpts) ToStaticNatCreateMap() (map[string]interface{}, error)

ToStaticNatCreateMap allows CreateOpts to satisfy the CreateOptsBuilder interface

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToStaticNatCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult represents the result of a create operation. Call its Extract method to interpret it as a PortForwarding.

func Create

func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create accepts a CreateOpts struct and uses the values provided to create a new Static NAT for an existing floating IP.

func (CreateResult) Extract

func (r CreateResult) Extract() (*StaticNAT, error)

Extract will extract a Port Forwarding resource from a result.

func (CreateResult) ExtractInfo

func (r CreateResult) ExtractInfo() (*CreateStaticNatResponse, error)

func (CreateResult) ExtractInto

func (r CreateResult) ExtractInto(v interface{}) error

type CreateStaticNatResponse

type CreateStaticNatResponse struct {
	DisplayText string `json:"displaytext"`
	Success     bool   `json:"success"`
	ID          string `json:"id"`
}

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Delete

func Delete(client *gophercloud.ServiceClient, pfId string) (r DeleteResult)

Delete will permanently delete a particular Static NAT for a given floating ID.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult represents the result of a get operation. Call its Extract method to interpret it as a PortForwarding.

func Get

func Get(client *gophercloud.ServiceClient, floatingIpId string, pfId string) (r GetResult)

Get retrieves a particular Static NAT resource based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*StaticNAT, error)

Extract will extract a Port Forwarding resource from a result.

func (GetResult) ExtractInfo

func (r GetResult) ExtractInfo() (*CreateStaticNatResponse, error)

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

type ListOpts

type ListOpts struct {
}

ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the Static NAT attributes you want to see returned.

func (ListOpts) ToStaticNatListQuery

func (opts ListOpts) ToStaticNatListQuery() (string, error)

ToStaticNatListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToStaticNatListQuery() (string, error)
}

type SNATs

type SNATs struct {
	StaticNATs []StaticNAT `json:"staticnats"`
}

type StaticNAT

type StaticNAT struct {
	PrivateIpAddr string `json:"vmguestip"` // Private IP address (allocated to the server(VM))
	PublicIpAddr  string `json:"ipaddress"` // Public IP to set up Static NAT
	VPCID         string `json:"vpcid"`
	PublicIpID    string `json:"ipaddressid"` // Public IP ID to set up Static NAT
	Name          string `json:"name"`
	SubnetID      string `json:"networkid"` // Tier ID
	ID            string `json:"id"`
}

func ExtractStaticNats

func ExtractStaticNats(r pagination.Page) ([]StaticNAT, error)

ExtractPortForwardings accepts a Page struct, specifically a PortForwardingPage struct, and extracts the elements into a slice of PortForwarding structs. In other words, a generic collection is mapped into a relevant slice.

type StaticNatPage

type StaticNatPage struct {
	pagination.LinkedPageBase
}

PortForwardingPage is the page returned by a pager when traversing over a collection of port forwardings.

func (StaticNatPage) IsEmpty

func (r StaticNatPage) IsEmpty() (bool, error)

IsEmpty checks whether a PortForwardingPage struct is empty.

func (StaticNatPage) NextPageURL

func (r StaticNatPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of port forwardings has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a PortForwarding.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*StaticNAT, error)

Extract will extract a Port Forwarding resource from a result.

func (UpdateResult) ExtractInfo

func (r UpdateResult) ExtractInfo() (*CreateStaticNatResponse, error)

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

Jump to

Keyboard shortcuts

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