nics

package
v0.5.27 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FixedIP

type FixedIP struct {
	SubnetID  string `json:"subnet_id"`
	IPAddress string `json:"ip_address"`
}

type ListOpts

type ListOpts struct {
	// ID is the unique identifier for the nic.
	ID string `json:"port_id"`

	// Status indicates whether a nic is currently operational.
	Status string `json:"port_state"`
}

ListOpts allows the filtering and sorting of paginated collections through the API.

type Nic

type Nic struct {
	// ID is the unique identifier for the nic.
	ID string `json:"port_id"`
	// Specifies the ID of the network to which the NIC port belongs.
	NetworkID string `json:"net_id"`
	// Status indicates whether a nic is currently operational.
	Status string `json:"port_state"`
	// Specifies the NIC private IP address.
	FixedIP []FixedIP `json:"fixed_ips"`
	// Specifies the MAC address of the NIC.
	MACAddress string `json:"mac_addr"`
}

Nic Manage and perform other operations on Nic, including querying Nics as well as querying Nic.

func ExtractNics

func ExtractNics(r pagination.Page) ([]Nic, error)

ExtractNics accepts a Page struct, specifically a NicPage struct, and extracts the elements into a slice of Nic structs. In other words, a generic collection is mapped into a relevant slice.

func Get

func Get(c *golangsdk.ServiceClient, serverId string, id string) (*Nic, error)

Get retrieves a particular nic based on its unique ID.

func List

func List(client *golangsdk.ServiceClient, serverId string, opts ListOpts) ([]Nic, error)

List returns collection of nics. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

type NicPage

type NicPage struct {
	pagination.LinkedPageBase
}

NicPage is the page returned by a pager when traversing over a collection of nics.

func (NicPage) IsEmpty

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

IsEmpty checks whether a NicPage struct is empty.

func (NicPage) NextPageURL

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

NextPageURL is invoked when a paginated collection of nics 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.

Jump to

Keyboard shortcuts

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