schedulerstats

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package schedulerstats returns information about shared file systems capacity and utilisation. Example:

listOpts := schedulerstats.ListOpts{
}

allPages, err := schedulerstats.List(client, listOpts).AllPages()
if err != nil {
	panic(err)
}

allStats, err := schedulerstats.ExtractPools(allPages)
if err != nil {
	panic(err)
}

for _, stat := range allStats {
	fmt.Printf("%+v\n", stat)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List makes a request against the API to list pool information.

func ListDetail

ListDetail makes a request against the API to list detailed pool information.

Types

type Capabilities

type Capabilities struct {

	// The quality of service (QoS) support.
	Qos bool `json:"qos"`
	// The date and time stamp when the API request was issued.
	Timestamp string `json:"timestamp"`
	// The name of the share back end.
	ShareBackendName string `json:"share_backend_name"`
	// Share server is usually a storage virtual machine or a lightweight container that is used to export shared file systems.
	DriverHandlesShareServers bool `json:"driver_handles_share_servers"`
	// The driver version of the back end.
	DriverVersion string `json:"driver_version"`
	// The amount of free capacity for the back end, in GiBs. A valid value is a string, such as unknown, or an integer.
	FreeCapacityGB float64 `json:"-"`
	// The storage protocol for the back end. For example, NFS_CIFS, glusterfs, HDFS, etc.
	StorageProtocol string `json:"storage_protocol"`
	// The total capacity for the back end, in GiBs. A valid value is a string, such as unknown, or an integer.
	TotalCapacityGB float64 `json:"-"`
	// The specification that filters back ends by whether they do or do not support share snapshots.
	SnapshotSupport bool `json:"snapshot_support"`
	// The back end replication domain.
	ReplicationDomain string `json:"replication_domain"`
	// The name of the vendor for the back end.
	VendorName string `json:"vendor_name"`

	// on the storage driver in use.
	ReservedPercentage  int64   `json:"reserved_percentage"`
	AllocatedCapacityGB float64 `json:"-"`
}

Capabilities represents the information of an individual Pool.

func (*Capabilities) UnmarshalJSON

func (r *Capabilities) UnmarshalJSON(b []byte) error

type ListDetailOpts

type ListDetailOpts struct {
	// The pool name for the back end.
	ProjectID string `json:"project_id,omitempty"`
	// The pool name for the back end.
	PoolName string `json:"pool_name"`
	// The host name for the back end.
	HostName string `json:"host_name"`
	// The name of the back end.
	BackendName string `json:"backend_name"`
	// The capabilities for the storage back end.
	Capabilities string `json:"capabilities"`
	// The share type name or UUID. Allows filtering back end pools based on the extra-specs in the share type.
	ShareType string `json:"share_type,omitempty"`
}

ListOpts controls the view of data returned (e.g globally or per project).

func (ListDetailOpts) ToPoolsListQuery

func (opts ListDetailOpts) ToPoolsListQuery() (string, error)

ToPoolsListQuery formats a ListDetailOpts into a query string.

type ListDetailOptsBuilder

type ListDetailOptsBuilder interface {
	ToPoolsListQuery() (string, error)
}

ListDetailOptsBuilder allows extensions to add additional parameters to the ListDetail request.

type ListOpts

type ListOpts struct {
	// The pool name for the back end.
	ProjectID string `json:"project_id,omitempty"`
	// The pool name for the back end.
	PoolName string `json:"pool_name"`
	// The host name for the back end.
	HostName string `json:"host_name"`
	// The name of the back end.
	BackendName string `json:"backend_name"`
	// The capabilities for the storage back end.
	Capabilities string `json:"capabilities"`
	// The share type name or UUID. Allows filtering back end pools based on the extra-specs in the share type.
	ShareType string `json:"share_type,omitempty"`
}

ListOpts controls the view of data returned (e.g globally or per project).

func (ListOpts) ToPoolsListQuery

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

ToPoolsListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

ListOptsBuilder allows extensions to add additional parameters to the List request.

type Pool

type Pool struct {
	// The name of the back end.
	Name string `json:"name"`
	// The name of the back end.
	Backend string `json:"backend"`
	// The pool name for the back end.
	Pool string `json:"pool"`
	// The host name for the back end.
	Host string `json:"host"`
	// The back end capabilities which include qos, total_capacity_gb, etc.
	Capabilities Capabilities `json:"capabilities,omitempty"`
}

Pool represents an individual Pool retrieved from the schedulerstats API.

func ExtractPools

func ExtractPools(p pagination.Page) ([]Pool, error)

ExtractPools takes a List result and extracts the collection of Pools returned by the API.

type PoolPage

type PoolPage struct {
	pagination.SinglePageBase
}

PoolPage is a single page of all List results.

func (PoolPage) IsEmpty

func (page PoolPage) IsEmpty() (bool, error)

IsEmpty satisfies the IsEmpty method of the Page interface. It returns true if a List contains no results.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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