Documentation ¶
Index ¶
- Constants
- func NewCollector(arrayID string, displayName string, managementEndpoint string, apiToken string, ...) (resources.ArrayCollector, error)
- type APIVersionResponse
- type AlertGenericResponse
- type AlertResponse
- type ArrayCapacityMetricsGenericResponse
- type ArrayCapacityMetricsResponse
- type ArrayCapacitySpace
- type ArrayClient
- type ArrayInfoGenericResponse
- type ArrayInfoResponse
- type ArrayMetricsResponseBundle
- type ArrayPerformanceMetricsGenericResponse
- type ArrayPerformanceMetricsResponse
- type Client
- func (client *Client) GetAlerts() ([]*AlertResponse, error)
- func (client *Client) GetArrayCapacityMetrics() (*ArrayCapacityMetricsResponse, error)
- func (client *Client) GetArrayInfo() (*ArrayInfoResponse, error)
- func (client *Client) GetArrayPerformanceMetrics() (*ArrayPerformanceMetricsResponse, error)
- func (client *Client) GetFileSystemCapacityMetrics() ([]*FileSystemCapacityMetricsResponse, error)
- func (client *Client) GetFileSystemCount() (uint32, error)
- func (client *Client) GetFileSystemPerformanceMetrics(window int64) ([]*FileSystemPerformanceMetricsResponse, error)
- func (client *Client) GetFileSystemSnapshotCount() (uint32, error)
- func (client *Client) GetFileSystemSnapshots() ([]*FileSystemSnapshotResponse, 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 FileSystemCapacityMetricsGenericResponse
- type FileSystemCapacityMetricsResponse
- type FileSystemCapacitySpace
- type FileSystemPerformanceMetricsGenericResponse
- type FileSystemPerformanceMetricsResponse
- type FileSystemSnapshotGenericResponse
- type FileSystemSnapshotResponse
- type ObjectCountResponseBundle
- type PaginationResponse
Constants ¶
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
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
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 ¶
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 ¶
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 ¶
GetArrayID returns the ID of the array
func (*Collector) GetArrayModel ¶
GetArrayModel returns the model of the array (always "FlashBlade")
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 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 ¶
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