Documentation ¶
Overview ¶
Package devices contains device management functionality in security portal API
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractDevicesInto ¶
func ExtractDevicesInto(r pagination.Page, v interface{}) error
ExtractDevicesInto interprets the results of a single page from a List() call, producing a slice of Device entities.
func List ¶
func List(client *eclcloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
List returns a Pager which allows you to iterate over a collection of devices.
Types ¶
type Device ¶
type Device struct { MSADeviceID string `json:"msa_device_id"` OSServerID string `json:"os_server_id"` OSServerName string `json:"os_server_name"` OSAvailabilityZone string `json:"os_availability_zone"` OSAdminUserName string `json:"os_admin_username"` MSADeviceType string `json:"msa_device_type"` OSServerStatus string `json:"os_server_status"` }
Device represents the result of a each element in response of device api result.
func ExtractDevices ¶
func ExtractDevices(r pagination.Page) ([]Device, error)
ExtractDevices accepts a Page struct, specifically a DevicePage struct, and extracts the elements into a slice of Device structs. In other words, a generic collection is mapped into a relevant slice.
type DevicePage ¶
type DevicePage struct {
pagination.LinkedPageBase
}
DevicePage is the page returned by a pager when traversing over a collection of Device.
func (DevicePage) IsEmpty ¶
func (r DevicePage) IsEmpty() (bool, error)
IsEmpty checks whether a Device struct is empty.
func (DevicePage) NextPageURL ¶
func (r DevicePage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of Device 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 ¶
ListOpts enables filtering of a list request.
func (ListOpts) ToDevicesQuery ¶
ToDevicesQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request