device_interfaces

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package device_interfaces contains device management functionality in security portal API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractDeviceInterfacesInto

func ExtractDeviceInterfacesInto(r pagination.Page, v interface{}) error

ExtractDeviceInterfacesInto interprets the results of a single page from a List() call, producing a slice of Device Interface entities.

func List

func List(client *eclcloud.ServiceClient, serverUUID string, opts ListOptsBuilder) pagination.Pager

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

Types

type DeviceInterface

type DeviceInterface struct {
	OSIPAddress  string `json:"os_ip_address"`
	MSAPortID    string `json:"msa_port_id"`
	OSPortName   string `json:"os_port_name"`
	OSPortID     string `json:"os_port_id"`
	OSNetworkID  string `json:"os_network_id"`
	OSPortStatus string `json:"os_port_status"`
	OSMACAddress string `json:"os_mac_address"`
	OSSubnetID   string `json:"os_subnet_id"`
}

DeviceInterface represents the result of a each element in response of device interface api result.

func ExtractDeviceInterfaces

func ExtractDeviceInterfaces(r pagination.Page) ([]DeviceInterface, error)

ExtractDeviceInterfaces accepts a Page struct, specifically a DeviceInterfacePage struct, and extracts the elements into a slice of Device Interface structs. In other words, a generic collection is mapped into a relevant slice.

type DeviceInterfacePage

type DeviceInterfacePage struct {
	pagination.LinkedPageBase
}

DeviceInterfacePage is the page returned by a pager when traversing over a collection of Device Interface.

func (DeviceInterfacePage) IsEmpty

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

IsEmpty checks whether a DeviceInterfacePage struct is empty.

func (DeviceInterfacePage) NextPageURL

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

NextPageURL is invoked when a paginated collection of Single Device Interface 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 ListOpts

type ListOpts struct {
	TenantID  string `q:"tenantid"`
	UserToken string `q:"usertoken"`
}

ListOpts converts tenant id and token as query string

func (ListOpts) ToDeviceInterfaceQuery

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

ToDeviceInterfaceQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

ListOptsBuilder allows extensions to add additional parameters to the List request

Directories

Path Synopsis
Package testing contains device interfaces unit tests
Package testing contains device interfaces unit tests

Jump to

Keyboard shortcuts

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