ip

package
v0.0.0-...-d74374d Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List returns a Pager which allows you to iterate over a collection of ipadresses.

Types

type GetResult

type GetResult struct {
	gophercloud.Result
}

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

func Get

func Get(c *gophercloud.ServiceClient, ipaddress string) (r GetResult)

Get retrieves a specific ipaddress.

func (GetResult) Extract

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

Extract is a function that accepts a result and extracts a IPAddress resource.

func (GetResult) ExtractInto

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

type IPAddress

type IPAddress struct {
	IP          string `json:"ipaddress"`
	PortUUID    string `json:"port"`
	Description string `json:"description,omitempty"`
	Status      string `json:"status,omitempty"`
	DeviceID    string `json:"deviceID,omitempty"`
	DeviceOwner string `json:"deviceOwner,omitempty"`
	FixedPortID string `json:"fixedPortID,omitempty"`
	FixedIP     string `json:"fixedIP,omitempty"`
	NetworkID   string `json:"networkID,omitempty"`
	NetworkName string `json:"networkName,omitempty"`
	SubnetID    string `json:"subnetID,omitempty"`
	SubnetName  string `json:"subnetName,omitempty"`
	DomainID    string `json:"domainID,omitempty"`
	DomainName  string `json:"domainName,omitempty"`
	ProjectID   string `json:"projectID,omitempty"`
	ProjectName string `json:"projectName,omitempty"`
	Created     string `json:"created,omitempty"`
	LastChanged string `json:"lastChanged,omitempty"`
}

func Extract

func Extract(r pagination.Page) ([]IPAddress, error)

Extract accepts a Page struct, specifically an v1.CommonPage struct, and extracts the elements into a slice of IPAddress structs.

type ListOpts

type ListOpts struct {
	// IPAddresses will only return ipaddresses with the specified UUIDs.
	IPAddresses []string `q:"ip"`
	// CIDR will only return ipaddresses with the specified CIDR.
	CIDR []string `q:"cidr"`
	// DomainID will only return ipaddresses with the specified DomainID.
	DomainID string `q:"domain"`
	// ProjectID will only return ipaddresses with the specified ProjectID.
	ProjectID string `q:"project"`
	// Limit will limit the number of results returned per page.
	Limit int `q:"limit"`
}

ListOpts is a structure that holds options for listing ipaddresses.

func (ListOpts) ToIPAddressListQuery

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

ToIPAddressListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

ListOptsBuilder allows extensions to add additional parameters to the List request.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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