Documentation
¶
Index ¶
- Constants
- func NewCollector(arrayID string, displayName string, managementEndpoint string, apiToken string, ...) (resources.ArrayCollector, error)
- type APIVersionResponse
- type AlertResponse
- type AlertResponseBundle
- type ArrayCapacityMetricsResponse
- type ArrayClient
- type ArrayControllersResponse
- type ArrayInfoResponse
- type ArrayMetricsResponseBundle
- type ArrayPerformanceMetricsResponse
- type Client
- func (client *Client) GetAlertsFlagged() ([]*AlertResponse, error)
- func (client *Client) GetAlertsTimeline() ([]*AlertResponse, error)
- func (client *Client) GetArrayCapacityMetrics() (*ArrayCapacityMetricsResponse, error)
- func (client *Client) GetArrayInfo() (*ArrayInfoResponse, error)
- func (client *Client) GetArrayPerformanceMetrics() (*ArrayPerformanceMetricsResponse, error)
- func (client *Client) GetHostCount() (uint32, error)
- func (client *Client) GetModel() (string, error)
- func (client *Client) GetVolumeCapacityMetrics() ([]*VolumeCapacityMetricsResponse, error)
- func (client *Client) GetVolumeCount() (uint32, error)
- func (client *Client) GetVolumePendingEradicationCount() (uint32, error)
- func (client *Client) GetVolumePerformanceMetrics() ([]*VolumePerformanceMetricsResponse, error)
- func (client *Client) GetVolumeSnapshotCount() (uint32, error)
- func (client *Client) GetVolumeSnapshots() ([]*VolumeSnapshotResponse, error)
- type Collector
- func (collector *Collector) GetAllArrayData() (*metrics.AllArrayData, error)
- func (collector *Collector) GetAllVolumeData(timeWindow int64) (*metrics.AllVolumeData, error)
- func (collector *Collector) GetArrayID() string
- func (collector *Collector) GetArrayModel() (string, error)
- func (collector *Collector) GetArrayName() (string, error)
- func (collector *Collector) GetArrayTags() (map[string]string, error)
- func (collector *Collector) GetArrayType() string
- func (collector *Collector) GetArrayVersion() (string, error)
- func (collector *Collector) GetDisplayName() string
- type EmptyResponse
- type ObjectCountResponseBundle
- type VolumeCapacityMetricsResponse
- type VolumePerformanceMetricsResponse
- type VolumeSnapshotResponse
Constants ¶
const ( APIPrefix = "/api" APIVersionEndpoint = "/api/api_version" ArrayEndpoint = "/array" ArrayCapacityMetricsEndpoint = "/array?space=true" ArrayControllersEndpoint = "/array?controllers=true" ArrayPerformanceMetricsEndpoint = "/array?action=monitor&size=true" HostCountEndpoint = "/host?start=0&limit=1" MessageFlaggedEndpoint = "/message?flagged=true" MessageTimelineEndpoint = "/message?timeline=true" SessionEndpoint = "/auth/session" VolumeCapacityMetricsEndpoint = "/volume?space=true" VolumeCountEndpoint = "/volume?start=0&limit=1" VolumePerformanceMetricsEndpoint = "/volume?action=monitor" VolumePendingEradicationCountEndpoint = "/volume?pending_only=true&start=0&limit=1" VolumeSnapshotCountEndpoint = "/volume?snap=true&start=0&limit=1" VolumeSnapshotsEndpoint = "/volume?snap=true" )
These are endpoint constants
const ( PreferredAPIVersion = "1.7" RequestAttemptCount = 3 TotalItemCountHeader = "x-total-item-count" UserAgent = "Pure1 Unplugged FlashArray Client v1.0" UserAgentHeader = "User-Agent" )
These are 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:"version"`
}
APIVersionResponse is from /api/api_versions
type AlertResponse ¶
type AlertResponse struct {
Actual string `json:"actual"`
Category string `json:"category"`
Closed string `json:"closed"`
Code uint16 `json:"code"`
ComponentName string `json:"component_name"`
ComponentType string `json:"component_type"`
CurrentSeverity string `json:"current_severity"`
Details string `json:"details"`
Event string `json:"event"`
Expected string `json:"expected"`
ID uint64 `json:"id"`
Opened string `json:"opened"`
}
AlertResponse is from /message regardless of parameters
type AlertResponseBundle ¶
type AlertResponseBundle struct {
FlaggedResponse []*AlertResponse
TimelineResponse []*AlertResponse
}
AlertResponseBundle is used to return all alerts responses together
type ArrayCapacityMetricsResponse ¶
type ArrayCapacityMetricsResponse struct {
Capacity uint64 `json:"capacity"`
DataReduction float64 `json:"data_reduction"`
Snapshots uint64 `json:"snapshots"`
SystemSpace uint64 `json:"system"`
TotalReduction float64 `json:"total_reduction"`
TotalSpace uint64 `json:"total"`
VolumeSpace uint64 `json:"volumes"`
}
ArrayCapacityMetricsResponse is from /array with parameters space=true
type ArrayClient ¶
type ArrayClient interface {
GetAlertsFlagged() ([]*AlertResponse, error)
GetAlertsTimeline() ([]*AlertResponse, error)
GetArrayCapacityMetrics() (*ArrayCapacityMetricsResponse, error)
GetArrayInfo() (*ArrayInfoResponse, error)
GetArrayPerformanceMetrics() (*ArrayPerformanceMetricsResponse, error)
GetHostCount() (uint32, error)
GetModel() (string, error)
GetVolumeCapacityMetrics() ([]*VolumeCapacityMetricsResponse, error)
GetVolumeCount() (uint32, error)
GetVolumePerformanceMetrics() ([]*VolumePerformanceMetricsResponse, error)
GetVolumePendingEradicationCount() (uint32, error)
GetVolumeSnapshotCount() (uint32, error)
GetVolumeSnapshots() ([]*VolumeSnapshotResponse, error)
}
ArrayClient is the interface for the FlashArray client
type ArrayControllersResponse ¶
ArrayControllersResponse is from /array with parameters controllers=true
type ArrayInfoResponse ¶
type ArrayInfoResponse struct {
ArrayName string `json:"array_name"`
ID string `json:"id"`
Version string `json:"version"`
}
ArrayInfoResponse is from /array with no parameters
type ArrayMetricsResponseBundle ¶
type ArrayMetricsResponseBundle struct {
CapacityMetricsResponse *ArrayCapacityMetricsResponse
PerformanceMetricsResponse *ArrayPerformanceMetricsResponse
}
ArrayMetricsResponseBundle is used to return all array metric responses together
type ArrayPerformanceMetricsResponse ¶
type ArrayPerformanceMetricsResponse struct {
BytesPerRead uint64 `json:"bytes_per_read"`
BytesPerWrite uint64 `json:"bytes_per_write"`
BytesPerOp uint64 `json:"bytes_per_op"`
InputPerSec uint64 `json:"input_per_sec"`
OutputPerSec uint64 `json:"output_per_sec"`
QueueDepth uint16 `json:"queue_depth"`
ReadLatency uint64 `json:"usec_per_read_op"`
ReadsPerSec uint64 `json:"reads_per_sec"`
WriteLatency uint64 `json:"usec_per_write_op"`
WritesPerSec uint64 `json:"writes_per_sec"`
}
ArrayPerformanceMetricsResponse is from /array with parameters action=monitor, size=true
type Client ¶
Client is a FlashArray client that handles specific REST API requests
func (*Client) GetAlertsFlagged ¶
func (client *Client) GetAlertsFlagged() ([]*AlertResponse, error)
GetAlertsFlagged returns only flagged alert messages from the array
func (*Client) GetAlertsTimeline ¶ added in v1.0.1
func (client *Client) GetAlertsTimeline() ([]*AlertResponse, error)
GetAlertsTimeline returns all alert messages from the array with a "closed" response field
func (*Client) GetArrayCapacityMetrics ¶
func (client *Client) GetArrayCapacityMetrics() (*ArrayCapacityMetricsResponse, error)
GetArrayCapacityMetrics returns all capacity metrics for the array
func (*Client) GetArrayInfo ¶
func (client *Client) GetArrayInfo() (*ArrayInfoResponse, error)
GetArrayInfo returns the basic array metadata
func (*Client) GetArrayPerformanceMetrics ¶
func (client *Client) GetArrayPerformanceMetrics() (*ArrayPerformanceMetricsResponse, error)
GetArrayPerformanceMetrics returns all capacity metrics for the array
func (*Client) GetHostCount ¶
GetHostCount returns the count of hosts on the array
func (*Client) GetVolumeCapacityMetrics ¶
func (client *Client) GetVolumeCapacityMetrics() ([]*VolumeCapacityMetricsResponse, error)
GetVolumeCapacityMetrics returns the capacity metrics for all volumes
func (*Client) GetVolumeCount ¶
GetVolumeCount returns the count of volumes on the array (without getting all of the volumes)
func (*Client) GetVolumePendingEradicationCount ¶
GetVolumePendingEradicationCount returns the count of volumes that are pending eradication
func (*Client) GetVolumePerformanceMetrics ¶
func (client *Client) GetVolumePerformanceMetrics() ([]*VolumePerformanceMetricsResponse, error)
GetVolumePerformanceMetrics returns the performance metrics for all volumes
func (*Client) GetVolumeSnapshotCount ¶
GetVolumeSnapshotCount returns the count of volume snapshots on the array (without getting all of the snapshots)
func (*Client) GetVolumeSnapshots ¶
func (client *Client) GetVolumeSnapshots() ([]*VolumeSnapshotResponse, error)
GetVolumeSnapshots returns volume snapshots
type Collector ¶
type Collector struct {
ArrayID string
ArrayType string
Client ArrayClient
DisplayName string
MgmtEndpoint string
// contains filtered or unexported fields
}
Collector is a FlashArray 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 volumes Note that timeWindow is ignored for FlashArray, and only gets the latest data
func (*Collector) GetArrayID ¶
GetArrayID returns the ID of the array
func (*Collector) GetArrayModel ¶
GetArrayModel returns the model of the array
func (*Collector) GetArrayName ¶
GetArrayName returns the name of the array
func (*Collector) GetArrayTags ¶
GetArrayTags returns the tags of the array from the API server
func (*Collector) GetArrayType ¶
GetArrayType returns the type of array
func (*Collector) GetArrayVersion ¶
GetArrayVersion returns the version of the array
func (*Collector) GetDisplayName ¶
GetDisplayName returns the display name for the array
type EmptyResponse ¶
type EmptyResponse struct{}
EmptyResponse is from any endpoint where we only read the headers
type ObjectCountResponseBundle ¶
type ObjectCountResponseBundle struct {
HostCount uint32
SnapshotCount uint32
VolumeCount uint32
VolumePendingEradicationCount uint32
}
ObjectCountResponseBundle is used to return all object count responses together
type VolumeCapacityMetricsResponse ¶
type VolumeCapacityMetricsResponse struct {
DataReduction float64 `json:"data_reduction"`
Name string `json:"name"`
Size uint64 `json:"size"`
TotalReduction float64 `json:"total_reduction"`
}
VolumeCapacityMetricsResponse is from /volume with parameters space=true
type VolumePerformanceMetricsResponse ¶
type VolumePerformanceMetricsResponse struct {
InputPerSec uint64 `json:"input_per_sec"`
OutputPerSec uint64 `json:"output_per_sec"`
Name string `json:"name"`
ReadLatency uint64 `json:"usec_per_read_op"`
ReadsPerSec uint64 `json:"reads_per_sec"`
WriteLatency uint64 `json:"usec_per_write_op"`
WritesPerSec uint64 `json:"writes_per_sec"`
}
VolumePerformanceMetricsResponse is from /volume with parameters action=monitor
type VolumeSnapshotResponse ¶
type VolumeSnapshotResponse struct {
Source string `json:"source"`
}
VolumeSnapshotResponse is from /volume with parameters snap=true