devices

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

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

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

ListOpts enables filtering of a list request.

func (ListOpts) ToDevicesQuery

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

ToDevicesQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

ListOptsBuilder allows extensions to add additional parameters to the List request

Directories

Path Synopsis
Package testing contains devices unit tests
Package testing contains devices unit tests

Jump to

Keyboard shortcuts

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