Documentation ¶
Overview ¶
Package nics enables management and retrieval of NICs BMS service.
Example to List Flavors
listOpts := nics.ListOpts{} allNics, err := nics.List(bmsClient, listOpts) if err != nil { panic(err) } for _, nic := range allNics { fmt.Printf("%+v\n", nic) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 Nic.
type ListOpts ¶
type ListOpts struct { // ID is the unique identifier for the nic. ID string `json:"port_id"` // Status indicates whether or not 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 or not 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 FilterNICs ¶
FilterNICs used to filter nics using id and status.
type NicPage ¶
type NicPage struct {
pagination.LinkedPageBase
}
NicPage is the page returned by a pager when traversing over a collection of nics.
func (NicPage) NextPageURL ¶
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.