flashblade

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 13 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	AlertsEndpoint                  = "/alerts"
	APIPrefix                       = "/api"
	APIVersionEndpoint              = "/api/api_version"
	ArraysEndpoint                  = "/arrays"
	ArraysPerformanceEndpoint       = "/arrays/performance"
	ArraysSpaceEndpoint             = "/arrays/space"
	FileSystemCountEndpoint         = "/file-systems?limit=1"
	FileSystemsEndpoint             = "/file-systems"
	FileSystemsPerformanceEndpoint  = "/file-systems/performance?protocol=nfs&limit=5"
	FileSystemSnapshotCountEndpoint = "/file-system-snapshots?limit=1"
	FileSystemSnapshotsEndpoint     = "/file-system-snapshots"
	LoginEndpoint                   = "/api/login"
)

Endpoint constants

View Source
const (
	APITokenHeader                  = "api-token"
	AuthTokenHeader                 = "x-auth-token"
	FileSystemPerformanceResolution = 30000 // ms
	PreferredAPIVersion             = "1.5"
	RequestAttemptCount             = 3
	UserAgent                       = "Pure1 Unplugged FlashBlade Client v1.0"
	UserAgentHeader                 = "User-Agent"
)

Other constants

Variables

This section is empty.

Functions

func NewCollector

func NewCollector(arrayID string, displayName string, managementEndpoint string, apiToken string, metaConnection resources.ArrayMetadata) (resources.ArrayCollector, error)

NewCollector creates both a new array collector and its underlying array client

Types

type APIVersionResponse

type APIVersionResponse struct {
	Version []string `json:"versions"`
}

APIVersionResponse is from /api/api_version

type AlertGenericResponse

type AlertGenericResponse struct {
	Items []*AlertResponse `json:"items"`
}

AlertGenericResponse is from /alerts

type AlertResponse

type AlertResponse struct {
	Action      string                 `json:"action"`
	Code        uint16                 `json:"code"`
	Component   string                 `json:"component"`
	Created     uint64                 `json:"created"`
	Description string                 `json:"description"`
	Flagged     bool                   `json:"flagged"`
	Index       uint64                 `json:"index"`
	Name        string                 `json:"name"`
	Notified    uint64                 `json:"notified"`
	Severity    string                 `json:"severity"`
	State       string                 `json:"state"`
	Subject     string                 `json:"subject"`
	Updated     uint64                 `json:"updated"`
	Variables   map[string]interface{} `json:"variables"`
}

AlertResponse is a sub-object from /alerts

type ArrayCapacityMetricsGenericResponse

type ArrayCapacityMetricsGenericResponse struct {
	Items []*ArrayCapacityMetricsResponse `json:"items"`
}

ArrayCapacityMetricsGenericResponse is from /arrays/space

type ArrayCapacityMetricsResponse

type ArrayCapacityMetricsResponse struct {
	Capacity uint64             `json:"capacity"`
	Name     string             `json:"name"`
	Space    ArrayCapacitySpace `json:"space"`
	Time     uint64             `json:"time"`
}

ArrayCapacityMetricsResponse is a sub-object from /arrays/space

type ArrayCapacitySpace

type ArrayCapacitySpace struct {
	DataReduction float64 `json:"data_reduction"`
	Snapshots     uint64  `json:"snapshots"`
	TotalPhysical uint64  `json:"total_physical"`
	Unique        uint64  `json:"unique"`
	Virtual       uint64  `json:"virtual"`
}

ArrayCapacitySpace is a sub-object of ArrayCapacityMetricsResponse

type ArrayClient

type ArrayClient interface {
	GetAlerts() ([]*AlertResponse, error)
	GetArrayCapacityMetrics() (*ArrayCapacityMetricsResponse, error)
	GetArrayInfo() (*ArrayInfoResponse, error)
	GetArrayPerformanceMetrics() (*ArrayPerformanceMetricsResponse, error)
	GetFileSystemCapacityMetrics() ([]*FileSystemCapacityMetricsResponse, error)
	GetFileSystemCount() (uint32, error)
	GetFileSystemPerformanceMetrics(window int64) ([]*FileSystemPerformanceMetricsResponse, error)
	GetFileSystemSnapshotCount() (uint32, error)
	GetFileSystemSnapshots() ([]*FileSystemSnapshotResponse, error)
}

ArrayClient is the interface for the FlashBlade client

func NewClient

func NewClient(displayName string, managementEndpoint string, apiToken string) (ArrayClient, error)

NewClient creates a new FlashBlade client and initializes it by getting the API version, refreshing a new session, and getting the array metadata

type ArrayInfoGenericResponse

type ArrayInfoGenericResponse struct {
	Items []*ArrayInfoResponse `json:"items"`
}

ArrayInfoGenericResponse is from /arrays

type ArrayInfoResponse

type ArrayInfoResponse struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Version string `json:"version"`
}

ArrayInfoResponse is a sub-object from /arrays

type ArrayMetricsResponseBundle

type ArrayMetricsResponseBundle struct {
	CapacityMetricsResponse    *ArrayCapacityMetricsResponse
	PerformanceMetricsResponse *ArrayPerformanceMetricsResponse
}

ArrayMetricsResponseBundle is used to return all array metric responses together

type ArrayPerformanceMetricsGenericResponse

type ArrayPerformanceMetricsGenericResponse struct {
	Items []*ArrayPerformanceMetricsResponse `json:"items"`
}

ArrayPerformanceMetricsGenericResponse is from /arrays/performance

type ArrayPerformanceMetricsResponse

type ArrayPerformanceMetricsResponse struct {
	BytesPerOp     float64 `json:"bytes_per_op"`
	BytesPerRead   float64 `json:"bytes_per_read"`
	BytesPerWrite  float64 `json:"bytes_per_write"`
	InputPerSec    float64 `json:"input_per_sec"`
	Name           string  `json:"name"`
	OthersPerSec   float64 `json:"others_per_sec"`
	OutputPerSec   float64 `json:"output_per_sec"`
	ReadsPerSec    float64 `json:"reads_per_sec"`
	Time           uint64  `json:"time"`
	UsecPerOtherOp float64 `json:"usec_per_other_op"`
	UsecPerReadOp  float64 `json:"usec_per_read_op"`
	UsecPerWriteOp float64 `json:"usec_per_write_op"`
	WritesPerSec   float64 `json:"writes_per_sec"`
}

ArrayPerformanceMetricsResponse is a sub-object of /arrays/performance

type Client

type Client struct {
	APIToken     string
	APIVersion   string
	AuthToken    string
	DisplayName  string
	ManagementIP net.IP
}

Client is a FlashBlade client that handles specific REST API requests

func (*Client) GetAlerts

func (client *Client) GetAlerts() ([]*AlertResponse, error)

GetAlerts returns all alerts from the array

func (*Client) GetArrayCapacityMetrics

func (client *Client) GetArrayCapacityMetrics() (*ArrayCapacityMetricsResponse, error)

GetArrayCapacityMetrics returns the capacity metrics from the array

func (*Client) GetArrayInfo

func (client *Client) GetArrayInfo() (*ArrayInfoResponse, error)

GetArrayInfo returns the array metadata

func (*Client) GetArrayPerformanceMetrics

func (client *Client) GetArrayPerformanceMetrics() (*ArrayPerformanceMetricsResponse, error)

GetArrayPerformanceMetrics returns the performance metrics from the array

func (*Client) GetFileSystemCapacityMetrics

func (client *Client) GetFileSystemCapacityMetrics() ([]*FileSystemCapacityMetricsResponse, error)

GetFileSystemCapacityMetrics returns the capacity metrics for the file systems

func (*Client) GetFileSystemCount

func (client *Client) GetFileSystemCount() (uint32, error)

GetFileSystemCount returns the count of file systems

func (*Client) GetFileSystemPerformanceMetrics

func (client *Client) GetFileSystemPerformanceMetrics(window int64) ([]*FileSystemPerformanceMetricsResponse, error)

GetFileSystemPerformanceMetrics returns the performance metrics for the file systems

func (*Client) GetFileSystemSnapshotCount

func (client *Client) GetFileSystemSnapshotCount() (uint32, error)

GetFileSystemSnapshotCount returns the count of file system snapshots

func (*Client) GetFileSystemSnapshots

func (client *Client) GetFileSystemSnapshots() ([]*FileSystemSnapshotResponse, error)

GetFileSystemSnapshots returns all file system snapshots

type Collector

type Collector struct {
	ArrayID      string
	ArrayType    string
	Client       ArrayClient
	DisplayName  string
	MgmtEndpoint string
	// contains filtered or unexported fields
}

Collector is a FlashBlade collector that uses the client to make requests

func (*Collector) GetAllArrayData

func (collector *Collector) GetAllArrayData() (*metrics.AllArrayData, error)

GetAllArrayData makes multiple underlying requests to get metric data for alerts and the array

func (*Collector) GetAllVolumeData

func (collector *Collector) GetAllVolumeData(timeWindow int64) (*metrics.AllVolumeData, error)

GetAllVolumeData makes multiple underlying requests to get metric data for all volumes (file systems)

func (*Collector) GetArrayID

func (collector *Collector) GetArrayID() string

GetArrayID returns the ID of the array

func (*Collector) GetArrayModel

func (collector *Collector) GetArrayModel() (string, error)

GetArrayModel returns the model of the array (always "FlashBlade")

func (*Collector) GetArrayName

func (collector *Collector) GetArrayName() (string, error)

GetArrayName returns the name of the array

func (*Collector) GetArrayTags

func (collector *Collector) GetArrayTags() (map[string]string, error)

GetArrayTags returns the tags of the array from the API server

func (*Collector) GetArrayType

func (collector *Collector) GetArrayType() string

GetArrayType returns the type of array

func (*Collector) GetArrayVersion

func (collector *Collector) GetArrayVersion() (string, error)

GetArrayVersion returns the version of the array

func (*Collector) GetDisplayName

func (collector *Collector) GetDisplayName() string

GetDisplayName returns the display name for the array

type FileSystemCapacityMetricsGenericResponse

type FileSystemCapacityMetricsGenericResponse struct {
	Items          []*FileSystemCapacityMetricsResponse `json:"items"`
	PaginationInfo PaginationResponse                   `json:"pagination_info"`
}

FileSystemCapacityMetricsGenericResponse is from /file-systems

type FileSystemCapacityMetricsResponse

type FileSystemCapacityMetricsResponse struct {
	Name        string                  `json:"name"`
	Provisioned uint64                  `json:"provisioned"`
	Space       FileSystemCapacitySpace `json:"space"`
}

FileSystemCapacityMetricsResponse is a sub-object from /file-systems

type FileSystemCapacitySpace

type FileSystemCapacitySpace struct {
	DataReduction float64 `json:"data_reduction"`
	Snapshots     uint64  `json:"snapshots"`
	TotalPhysical uint64  `json:"total_physical"`
	Unique        uint64  `json:"unique"`
	Virtual       uint64  `json:"virtual"`
}

FileSystemCapacitySpace is a sub-object of FileSystemCapacityResponse

type FileSystemPerformanceMetricsGenericResponse

type FileSystemPerformanceMetricsGenericResponse struct {
	Items          []*FileSystemPerformanceMetricsResponse `json:"items"`
	PaginationInfo PaginationResponse                      `json:"pagination_info"`
}

FileSystemPerformanceMetricsGenericResponse is from /file-systems/performance

type FileSystemPerformanceMetricsResponse

type FileSystemPerformanceMetricsResponse struct {
	BytesPerOp       float64 `json:"bytes_per_op"`
	BytesPerRead     float64 `json:"bytes_per_read"`
	BytesPerWrite    float64 `json:"bytes_per_write"`
	Name             string  `json:"name"`
	OthersPerSec     float64 `json:"others_per_sec"`
	ReadBytesPerSec  float64 `json:"read_bytes_per_sec"`
	ReadsPerSec      float64 `json:"reads_per_sec"`
	Time             uint64  `json:"time"`
	UsecPerOtherOp   float64 `json:"usec_per_other_op"`
	UsecPerReadOp    float64 `json:"usec_per_read_op"`
	UsecPerWriteOp   float64 `json:"usec_per_write_op"`
	WriteBytesPerSec float64 `json:"write_bytes_per_sec"`
	WritesPerSec     float64 `json:"writes_per_sec"`
}

FileSystemPerformanceMetricsResponse is a sub-object of /file-systems/performance

type FileSystemSnapshotGenericResponse

type FileSystemSnapshotGenericResponse struct {
	Items          []*FileSystemSnapshotResponse `json:"items"`
	PaginationInfo PaginationResponse            `json:"pagination_info"`
}

FileSystemSnapshotGenericResponse is from /file-system-snapshots

type FileSystemSnapshotResponse

type FileSystemSnapshotResponse struct {
	Source string `json:"source"`
}

FileSystemSnapshotResponse is a sub-object of /file-system-snapshots

type ObjectCountResponseBundle

type ObjectCountResponseBundle struct {
	FileSystemCount uint32
	SnapshotCount   uint32
}

ObjectCountResponseBundle is used to return all object count responses together

type PaginationResponse

type PaginationResponse struct {
	TotalItemCount    uint32 `json:"total_item_count"`
	ContinuationToken string `json:"continuation_token"`
}

PaginationResponse is a part of responses from all endpoints

Jump to

Keyboard shortcuts

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