fleetintelligence

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package fleetintelligence provides a Go SDK for the Fleet Intelligence customer API.

Index

Constants

View Source
const (
	AlertSeverityCritical AlertSeverity = "Critical"
	AlertSeverityWarning  AlertSeverity = "Warning"

	AlertStateDetected  AlertState = "Detected"
	AlertStateTriggered AlertState = "Triggered"
	AlertStateResolved  AlertState = "Resolved"
)
View Source
const (
	NodeViewDetail NodeView = "detail"
	NodeViewBasic  NodeView = "basic"

	NodeHealthHealthy   NodeHealthStatus = "Healthy"
	NodeHealthDegraded  NodeHealthStatus = "Degraded"
	NodeHealthUnhealthy NodeHealthStatus = "Unhealthy"
	NodeHealthUnknown   NodeHealthStatus = "Unknown"

	NodeIntegrityVerified    NodeIntegrityCheck = "Verified"
	NodeIntegrityUnverified  NodeIntegrityCheck = "Unverified"
	NodeIntegrityDegraded    NodeIntegrityCheck = "Degraded"
	NodeIntegrityPending     NodeIntegrityCheck = "Pending"
	NodeIntegrityUnsupported NodeIntegrityCheck = "Unsupported"
	NodeIntegrityUnknown     NodeIntegrityCheck = "Unknown"
	// Deprecated: use NodeIntegrityVerified
	NodeIntegrityPassed NodeIntegrityCheck = NodeIntegrityVerified
	// Deprecated: use NodeIntegrityUnverified
	NodeIntegrityFailed NodeIntegrityCheck = NodeIntegrityUnverified

	NodeFirmwarePassed  NodeFirmwareCheck = "Passed"
	NodeFirmwareFailed  NodeFirmwareCheck = "Failed"
	NodeFirmwareUnknown NodeFirmwareCheck = "Unknown"

	NodeAgentOnline  NodeAgentStatus = "Online"
	NodeAgentOffline NodeAgentStatus = "Offline"
	NodeAgentUnknown NodeAgentStatus = "Unknown"

	NodeSortByHostname       NodeSortBy = "hostname"
	NodeSortByUUID           NodeSortBy = "nodeUUID"
	NodeSortByHealthStatus   NodeSortBy = "healthStatus"
	NodeSortByNodeGroup      NodeSortBy = "nodegroup"
	NodeSortByComputeZone    NodeSortBy = "computezone"
	NodeSortByGPUType        NodeSortBy = "gpuType"
	NodeSortByGPUCount       NodeSortBy = "gpuCount"
	NodeSortByIntegrityCheck NodeSortBy = "integrityCheck"
	NodeSortByAgentStatus    NodeSortBy = "agentStatus"

	NodeOrderAsc  NodeSortOrder = "asc"
	NodeOrderDesc NodeSortOrder = "desc"
)
View Source
const (
	NodeGroupViewDetail NodeGroupView = "detail"
	NodeGroupViewBasic  NodeGroupView = "basic"

	NodeGroupHealthHealthy   NodeGroupHealthStatus = "Healthy"
	NodeGroupHealthDegraded  NodeGroupHealthStatus = "Degraded"
	NodeGroupHealthUnhealthy NodeGroupHealthStatus = "Unhealthy"
	NodeGroupHealthUnknown   NodeGroupHealthStatus = "Unknown"

	NodeGroupSortByHealth  NodeGroupSortBy = "health"
	NodeGroupSortByGPUUtil NodeGroupSortBy = "gpuUtil"
	NodeGroupSortByNodes   NodeGroupSortBy = "nodes"

	NodeGroupOrderAsc  NodeGroupSortOrder = "asc"
	NodeGroupOrderDesc NodeGroupSortOrder = "desc"
)
View Source
const (
	ReportFormatJSON ReportFormat = "json"
	ReportFormatCSV  ReportFormat = "csv"

	ErrorReportViewList     ErrorReportView = "list"
	ErrorReportViewGraph    ErrorReportView = "graph"
	ErrorReportViewOverview ErrorReportView = "overview"

	ErrorReportGroupByError ErrorReportGroupBy = "error"
	ErrorReportGroupByNode  ErrorReportGroupBy = "node"

	ErrorReportTimeModeAbsolute ErrorReportTimeMode = "absolute"
	ErrorReportTimeModeRelative ErrorReportTimeMode = "relative"

	InventoryReportSortByHostname       InventoryReportSortBy = "hostname"
	InventoryReportSortByNodeUUID       InventoryReportSortBy = "nodeUUID"
	InventoryReportSortByNodeGroup      InventoryReportSortBy = "nodegroup"
	InventoryReportSortByComputeZone    InventoryReportSortBy = "computezone"
	InventoryReportSortByGPUType        InventoryReportSortBy = "gpuType"
	InventoryReportSortByGPUCount       InventoryReportSortBy = "gpuCount"
	InventoryReportSortByPublicIP       InventoryReportSortBy = "publicIP"
	InventoryReportSortByPrivateIP      InventoryReportSortBy = "privateIP"
	InventoryReportSortByIntegrityCheck InventoryReportSortBy = "integrityCheck"
	InventoryReportSortByGeoLocation    InventoryReportSortBy = "geoLocation"

	InventoryReportOrderAsc  InventoryReportSortOrder = "asc"
	InventoryReportOrderDesc InventoryReportSortOrder = "desc"
)
View Source
const DefaultTimeout = 2 * time.Minute

DefaultTimeout is the per-request timeout applied when none is configured.

Variables

View Source
var (
	ErrMissingBaseURL    = errors.New("base URL is required")
	ErrMissingServiceKey = errors.New("service key is required")
)
View Source
var (
	// ErrInvalidKey means the supplied data is not a PEM-encoded public key.
	ErrInvalidKey = errors.New("invalid public key: expected a PEM-encoded public key")
	// ErrInvalidBundle means the supplied data is not a Sigstore .sig.bundle.
	ErrInvalidBundle = errors.New("invalid signature bundle: expected a Sigstore .sig.bundle file")
	// ErrVerificationFailed means the report does not match the signature.
	ErrVerificationFailed = errors.New("signature verification failed: the report does not match the signature")
)

Errors returned by VerifySignedReport. They are sentinels so callers can distinguish the failure mode (e.g. with errors.Is) and present their own messages instead of the underlying sigstore/proto details.

Functions

func VerifySignedReport

func VerifySignedReport(csv, bundleJSON, publicKeyPEM []byte) error

VerifySignedReport verifies that csv was signed with the public key in publicKeyPEM, using the Sigstore bundle in bundleJSON. It mirrors `cosign verify-blob --key <key> --bundle <bundle> --insecure-ignore-tlog <csv>`: the signature is checked against an out-of-band public key while the transparency log and observer timestamps are intentionally not required. It returns nil when verification succeeds and a descriptive error otherwise.

Types

type APIError

type APIError struct {
	StatusCode int
	Status     string
	Message    string
	Details    string
}

Represents a non-success API response

func (*APIError) Error

func (e *APIError) Error() string

Formats API failures with status and response details

type Alert

type Alert struct {
	UUID                 string `json:"alertUUID"`
	NodeUUID             string `json:"nodeUUID,omitempty"`
	Component            string `json:"component,omitempty"`
	ComponentDisplayName string `json:"componentDisplayName,omitempty"`
	Severity             string `json:"severity,omitempty"`
	State                string `json:"state,omitempty"`
	Message              string `json:"message,omitempty"`
	Error                string `json:"error,omitempty"`
	DetectedAt           string `json:"detectedAt,omitempty"`
	TriggeredAt          string `json:"triggeredAt,omitempty"`
	EventTimestamp       string `json:"eventTimestamp,omitempty"`
	LastUpdated          string `json:"lastUpdated,omitempty"`
	FiredAt              string `json:"firedAt,omitempty"`
}

Represents an alert

type AlertSeverity

type AlertSeverity string

Represents supported alert severity filters

func (AlertSeverity) Valid

func (severity AlertSeverity) Valid() bool

Reports whether the alert severity is accepted by the API

type AlertState

type AlertState string

Represents supported alert state filters

func (AlertState) Valid

func (state AlertState) Valid() bool

Reports whether the alert state is accepted by the API

type AlertTimelineDetails

type AlertTimelineDetails struct {
	AlertUUID            string               `json:"alertUuid"`
	NodeUUID             string               `json:"nodeUuid,omitempty"`
	Component            string               `json:"component,omitempty"`
	ComponentDisplayName string               `json:"componentDisplayName,omitempty"`
	Timeline             []AlertTimelineEvent `json:"timeline"`
	RawJSON              []byte               `json:"-"`
}

Represents the full timeline for one alert

type AlertTimelineEvent

type AlertTimelineEvent struct {
	EventType      string            `json:"eventType,omitempty"`
	AlertStatus    string            `json:"alertStatus,omitempty"`
	EventTimestamp string            `json:"eventTimestamp,omitempty"`
	Message        string            `json:"message,omitempty"`
	Error          string            `json:"error,omitempty"`
	ExtraInfo      map[string]any    `json:"extraInfo,omitempty"`
	Actions        []SuggestedAction `json:"suggestedActions,omitempty"`
}

Represents one event in an alert timeline

type AlertTimelineNode

type AlertTimelineNode struct {
	NodeUUID      string `json:"nodeUuid"`
	Hostname      string `json:"hostname,omitempty"`
	HostStatus    string `json:"hostStatus,omitempty"`
	LastAlertTime string `json:"lastAlertTime,omitempty"`
}

Represents a node that has alert timeline history

type AlertTimelineNodeAlert

type AlertTimelineNodeAlert struct {
	AlertUUID            string `json:"alertUuid"`
	Component            string `json:"component,omitempty"`
	ComponentDisplayName string `json:"componentDisplayName,omitempty"`
	AlertStatus          string `json:"alertStatus,omitempty"`
	LastEventTime        string `json:"lastEventTime,omitempty"`
}

Represents one alert in a node's timeline history

type AlertTimelineNodesPage

type AlertTimelineNodesPage struct {
	Nodes    []AlertTimelineNode `json:"nodes"`
	HasMore  bool                `json:"hasMore"`
	Page     int                 `json:"page"`
	PageSize int                 `json:"pageSize"`
	Total    int                 `json:"total"`
	RawJSON  []byte              `json:"-"`
}

Represents a paginated alert timeline node response

type AlertsPage

type AlertsPage struct {
	Alerts         []Alert `json:"alerts"`
	Page           int     `json:"page"`
	PageSize       int     `json:"pageSize"`
	Total          int     `json:"total"`
	PageCursorNext string  `json:"pageCursorNext,omitempty"`
	RawJSON        []byte  `json:"-"`
}

Represents a paginated alert response with the raw backend payload

type BlockDevice

type BlockDevice struct {
	FSType     string   `json:"fsType,omitempty"`
	MountPoint string   `json:"mountPoint,omitempty"`
	Name       string   `json:"name,omitempty"`
	Parents    []string `json:"parents,omitempty"`
	PartUUID   string   `json:"partUUID,omitempty"`
	Size       *int     `json:"size,omitempty"`
	Type       string   `json:"type,omitempty"`
	Used       *int     `json:"used,omitempty"`
	WWN        string   `json:"wwn,omitempty"`
}

Represents a node disk block device

type CPUInfo

type CPUInfo struct {
	Architecture string `json:"architecture,omitempty"`
	LogicalCores string `json:"logicalCores,omitempty"`
	Manufacturer string `json:"manufacturer,omitempty"`
	Type         string `json:"type,omitempty"`
}

Represents CPU metadata for a node

type Client

type Client struct {
	// contains filtered or unexported fields
}

Calls the Fleet Intelligence customer API

func NewClient

func NewClient(baseURL, serviceKey string, opts ...Option) (*Client, error)

Creates a Fleet Intelligence API client

func (*Client) BaseURL

func (c *Client) BaseURL() string

Returns the configured API base URL

func (*Client) DescribeAlertTimeline

func (c *Client) DescribeAlertTimeline(ctx context.Context, nodeUUID, alertUUID string) (AlertTimelineDetails, error)

Retrieves the full event timeline for one alert

func (*Client) DescribeNode

func (c *Client) DescribeNode(ctx context.Context, nodeUUID string) (NodeDetails, error)

Retrieves detail for a single node using the configured API client

func (*Client) FetchSigningKey

func (c *Client) FetchSigningKey(ctx context.Context) ([]byte, error)

FetchSigningKey downloads the PEM-encoded public key used to sign inventory reports from the configured API's well-known endpoint. It is used by `report verify` when no local key is supplied.

func (*Client) GetErrorReport

func (c *Client) GetErrorReport(ctx context.Context, opts ErrorReportOptions) (ErrorReport, error)

Retrieves an error report using the configured API client

func (*Client) GetInventoryReport

func (c *Client) GetInventoryReport(ctx context.Context, opts InventoryReportOptions) (InventoryReport, error)

Retrieves an inventory report using the configured API client

func (*Client) ListAlertTimelineNodes

func (c *Client) ListAlertTimelineNodes(ctx context.Context, opts ListAlertTimelineNodesOptions) (AlertTimelineNodesPage, error)

Lists nodes with alert timeline history

func (*Client) ListAlerts

func (c *Client) ListAlerts(ctx context.Context, opts ListAlertsOptions) (AlertsPage, error)

Lists alerts using the configured API client

func (*Client) ListComputeZones

func (c *Client) ListComputeZones(ctx context.Context, opts ListComputeZonesOptions) (ComputeZonesPage, error)

Lists compute zones using the configured API client

func (*Client) ListNodeAlertTimeline

func (c *Client) ListNodeAlertTimeline(ctx context.Context, opts ListNodeAlertTimelineOptions) (NodeAlertTimelinePage, error)

Lists alert timeline history for a specific node

func (*Client) ListNodeGroups

func (c *Client) ListNodeGroups(ctx context.Context, opts ListNodeGroupsOptions) (NodeGroupsPage, error)

Lists node groups using the configured API client

func (*Client) ListNodes

func (c *Client) ListNodes(ctx context.Context, opts ListNodesOptions) (NodesPage, error)

Lists nodes using the configured API client

func (*Client) ServiceKeyConfigured

func (c *Client) ServiceKeyConfigured() bool

Reports whether a non-empty service key is configured

type ComputeZone

type ComputeZone struct {
	ID          string       `json:"id"`
	Name        string       `json:"name"`
	Type        string       `json:"type,omitempty"`
	GeoLocation *GeoLocation `json:"geoLocation,omitempty"`
	NodeCount   *int         `json:"nodeCount,omitempty"`
}

Represents a compute zone

type ComputeZoneView

type ComputeZoneView string

Represents supported response shapes for listing compute zones

const (
	ComputeZoneViewDetail ComputeZoneView = "detail"
	ComputeZoneViewBasic  ComputeZoneView = "basic"
)

func (ComputeZoneView) Valid

func (view ComputeZoneView) Valid() bool

Reports whether the view is accepted by the API

type ComputeZonesPage

type ComputeZonesPage struct {
	ComputeZones []ComputeZone `json:"computezones"`
	HasMore      bool          `json:"hasMore"`
	Page         int           `json:"page"`
	PageSize     int           `json:"pageSize"`
	Total        int           `json:"total"`
	RawJSON      []byte        `json:"-"`
}

Represents a paginated compute zone response with the raw backend payload

type DiskInfo

type DiskInfo struct {
	BlockDevices      []BlockDevice `json:"blockDevices,omitempty"`
	ContainerRootDisk string        `json:"containerRootDisk,omitempty"`
}

Represents disk metadata for a node

type ErrorReport

type ErrorReport struct {
	View     ErrorReportView      `json:"view"`
	GroupBy  ErrorReportGroupBy   `json:"groupBy,omitempty"`
	Errors   []ErrorReportError   `json:"errors,omitempty"`
	Nodes    []ErrorReportNode    `json:"nodes,omitempty"`
	Overview *ErrorReportOverview `json:"overview,omitempty"`
	Graph    *ErrorReportGraph    `json:"graph,omitempty"`
	HasMore  bool                 `json:"hasMore"`
	Page     int                  `json:"page"`
	PageSize int                  `json:"pageSize"`
	Total    int                  `json:"total"`
	RawJSON  []byte               `json:"-"`
	RawCSV   []byte               `json:"-"`
}

Represents an error report response

type ErrorReportError

type ErrorReportError struct {
	Name            string           `json:"name,omitempty"`
	Count           *int             `json:"count,omitempty"`
	NodeCount       *int             `json:"nodeCount,omitempty"`
	SuggestedAction *SuggestedAction `json:"suggestedAction,omitempty"`
}

Represents one error grouping row in an error list report

type ErrorReportGraph

type ErrorReportGraph struct {
	Result    []ErrorTimeSeries `json:"result,omitempty"`
	TimeRange *TimeRange        `json:"timeRange,omitempty"`
}

Represents time-series error report data

type ErrorReportGroupBy

type ErrorReportGroupBy string

Represents supported groupings for error list reports

func (ErrorReportGroupBy) Valid

func (groupBy ErrorReportGroupBy) Valid() bool

Reports whether the error report grouping is accepted by the API

type ErrorReportNode

type ErrorReportNode struct {
	NodeUUID string   `json:"nodeUUID,omitempty"`
	Hostname string   `json:"hostname,omitempty"`
	Errors   []string `json:"errors,omitempty"`
}

Represents one node grouping row in an error list report

type ErrorReportOptions

type ErrorReportOptions struct {
	View           ErrorReportView
	GroupBy        ErrorReportGroupBy
	Format         ReportFormat
	Page           *int
	PageSize       *int
	Step           string
	ComputeZoneIDs []string
	NodeGroupIDs   []string
	Tags           []string
	Errors         []string
	TimeMode       ErrorReportTimeMode
	Window         string
	StartTime      string
	EndTime        string
}

Represents request options for error reports

type ErrorReportOverview

type ErrorReportOverview struct {
	TotalErrorNodes *int `json:"totalErrorNodes,omitempty"`
	TotalErrorTypes *int `json:"totalErrorTypes,omitempty"`
	TotalErrors     *int `json:"totalErrors,omitempty"`
}

Represents aggregate error report statistics

type ErrorReportTimeMode

type ErrorReportTimeMode string

Represents supported time filter modes for error reports

func (ErrorReportTimeMode) Valid

func (mode ErrorReportTimeMode) Valid() bool

Reports whether the error report time mode is accepted by the API

type ErrorReportView

type ErrorReportView string

Represents supported error report views

func (ErrorReportView) Valid

func (view ErrorReportView) Valid() bool

Reports whether the error report view is accepted by the API

type ErrorTimeSeries

type ErrorTimeSeries struct {
	Error  string `json:"error,omitempty"`
	Values string `json:"values,omitempty"`
}

Represents one error time-series result

type GPUDevice

type GPUDevice struct {
	BoardID      *int   `json:"boardID,omitempty"`
	BusID        string `json:"busID,omitempty"`
	ChassisSN    string `json:"chassisSN,omitempty"`
	GPUIndex     string `json:"gpuIndex,omitempty"`
	MinorID      string `json:"minorID,omitempty"`
	SerialNumber string `json:"sn,omitempty"`
	UUID         string `json:"uuid,omitempty"`
	VBIOSVersion string `json:"vbiosVersion,omitempty"`
}

Represents a GPU device on a node

type GPUInfo

type GPUInfo struct {
	Architecture string      `json:"architecture,omitempty"`
	GPUs         []GPUDevice `json:"gpus,omitempty"`
	Manufacturer string      `json:"manufacturer,omitempty"`
	Memory       string      `json:"memory,omitempty"`
	Product      string      `json:"product,omitempty"`
}

Represents GPU metadata for a node

type GeoLocation

type GeoLocation struct {
	City      string   `json:"city,omitempty"`
	Country   string   `json:"country,omitempty"`
	Region    string   `json:"region,omitempty"`
	Latitude  *float32 `json:"latitude,omitempty"`
	Longitude *float32 `json:"longitude,omitempty"`
}

Represents physical location metadata for a fleet resource

type InventoryNode

type InventoryNode struct {
	NodeUUID               string       `json:"nodeUUID"`
	Hostname               string       `json:"hostname,omitempty"`
	ComputeZone            string       `json:"computeZone,omitempty"`
	NodeGroup              string       `json:"nodeGroup,omitempty"`
	GPUType                string       `json:"gpuType,omitempty"`
	GPUCount               *int         `json:"gpuCount,omitempty"`
	PublicIP               string       `json:"publicIP,omitempty"`
	PrivateIP              string       `json:"privateIP,omitempty"`
	IntegrityCheck         string       `json:"integrityCheck,omitempty"`
	IntegrityCheckReason   string       `json:"integrityCheckReason,omitempty"`
	LastIntegrityCheckTime string       `json:"lastIntegrityCheckTS,omitempty"`
	FirmwareCheck          string       `json:"firmwareCheck,omitempty"`
	LastUpdatedTime        string       `json:"lastUpdatedTS,omitempty"`
	GeoLocation            *GeoLocation `json:"geoLocation,omitempty"`
	SerialNumbers          []string     `json:"serialNumbers,omitempty"`
}

Represents one inventory row in an inventory report

type InventoryReport

type InventoryReport struct {
	Nodes    []InventoryNode `json:"nodes"`
	HasMore  bool            `json:"hasMore"`
	Page     int             `json:"page"`
	PageSize int             `json:"pageSize"`
	Total    int             `json:"total"`
	RawJSON  []byte          `json:"-"`
	RawCSV   []byte          `json:"-"`

	// RawSigned holds the signed CSV bundle (a zip) when Signed is requested.
	RawSigned []byte `json:"-"`
	// Filename is the server-suggested filename for a signed bundle download.
	Filename string `json:"-"`
}

Represents an inventory report response

type InventoryReportOptions

type InventoryReportOptions struct {
	Format         ReportFormat
	Signed         bool
	ComputeZoneIDs []string
	NodeGroupIDs   []string
	Tags           []string
	StartTime      string
	EndTime        string
	SortBy         InventoryReportSortBy
	Order          InventoryReportSortOrder
	Page           *int
	PageSize       *int
}

Represents request options for inventory reports

type InventoryReportSortBy

type InventoryReportSortBy string

Represents supported inventory report sort fields

func (InventoryReportSortBy) Valid

func (sortBy InventoryReportSortBy) Valid() bool

Reports whether the inventory report sort field is accepted by the API

type InventoryReportSortOrder

type InventoryReportSortOrder string

Represents supported inventory report sort orders

func (InventoryReportSortOrder) Valid

func (order InventoryReportSortOrder) Valid() bool

Reports whether the inventory report sort order is accepted by the API

type ListAlertTimelineNodesOptions

type ListAlertTimelineNodesOptions struct {
	Active   bool
	Page     *int
	PageSize *int
}

Represents request options for listing alert timeline nodes

type ListAlertsOptions

type ListAlertsOptions struct {
	NodeUUID  string
	Component string
	State     AlertState
	Severity  AlertSeverity
	Page      *int
	PageSize  *int
}

Represents request options for listing alerts

type ListComputeZonesOptions

type ListComputeZonesOptions struct {
	View     ComputeZoneView
	ZoneIDs  []string
	Page     *int
	PageSize *int
}

Represents request options for listing compute zones

type ListNodeAlertTimelineOptions

type ListNodeAlertTimelineOptions struct {
	NodeUUID string
	Active   bool
	Page     *int
	PageSize *int
}

Represents request options for listing alert history for one node

type ListNodeGroupsOptions

type ListNodeGroupsOptions struct {
	View           NodeGroupView
	NodeGroupIDs   []string
	HealthStatuses []NodeGroupHealthStatus
	GPUTypes       []string
	SortBy         NodeGroupSortBy
	Order          NodeGroupSortOrder
	Page           *int
	PageSize       *int
}

Represents request options for listing node groups

type ListNodesOptions

type ListNodesOptions struct {
	View            NodeView
	NodeUUIDs       []string
	HealthStatuses  []NodeHealthStatus
	Hostname        string
	AgentStatuses   []NodeAgentStatus
	IntegrityChecks []NodeIntegrityCheck
	FirmwareChecks  []NodeFirmwareCheck
	SortBy          NodeSortBy
	Order           NodeSortOrder
	Page            *int
	PageSize        *int
}

Represents request options for listing nodes

type MemoryInfo

type MemoryInfo struct {
	TotalBytes string `json:"totalBytes,omitempty"`
}

Represents memory metadata for a node

type NICInfo

type NICInfo struct {
	PrivateIPInterfaces []NICInterface `json:"privateIPInterfaces,omitempty"`
}

Represents network interface metadata for a node

type NICInterface

type NICInterface struct {
	Interface string `json:"interface,omitempty"`
	IP        string `json:"ip,omitempty"`
	MAC       string `json:"mac,omitempty"`
}

Represents private network interface metadata for a node

type Node

type Node struct {
	UUID                   string `json:"nodeUUID"`
	Hostname               string `json:"hostname"`
	ComputeZone            string `json:"computeZone,omitempty"`
	NodeGroup              string `json:"nodeGroup,omitempty"`
	Health                 string `json:"healthStatus,omitempty"`
	GPUType                string `json:"gpuType,omitempty"`
	GPUCount               *int   `json:"gpuCount,omitempty"`
	AgentStatus            string `json:"agentStatus,omitempty"`
	IntegrityCheck         string `json:"integrityCheck,omitempty"`
	IntegrityCheckReason   string `json:"integrityCheckReason,omitempty"`
	FirmwareCheck          string `json:"firmwareCheck,omitempty"`
	PublicIP               string `json:"publicIP,omitempty"`
	PrivateIP              string `json:"privateIP,omitempty"`
	LastIntegrityCheckTime string `json:"lastIntegrityCheckTS,omitempty"`
	LastUpdatedTime        string `json:"lastUpdatedTS,omitempty"`
}

Represents a node

type NodeAgentStatus

type NodeAgentStatus string

Represents supported agent status filters for listing nodes

func (NodeAgentStatus) Valid

func (status NodeAgentStatus) Valid() bool

Reports whether the agent status is accepted by the API

type NodeAlertTimelinePage

type NodeAlertTimelinePage struct {
	NodeUUID string                   `json:"nodeUuid"`
	Hostname string                   `json:"hostname,omitempty"`
	Alerts   []AlertTimelineNodeAlert `json:"alerts"`
	HasMore  bool                     `json:"hasMore"`
	Page     int                      `json:"page"`
	PageSize int                      `json:"pageSize"`
	Total    int                      `json:"total"`
	RawJSON  []byte                   `json:"-"`
}

Represents a paginated alert history response for one node

type NodeDetails

type NodeDetails struct {
	Node
	ComputeZoneID           string         `json:"computeZoneId,omitempty"`
	NodeGroupID             string         `json:"nodeGroupId,omitempty"`
	EnrolledAt              string         `json:"enrolledAt,omitempty"`
	GeoLocation             *GeoLocation   `json:"geoLocation,omitempty"`
	HealthyComponentCount   *int           `json:"healthyComponentCount,omitempty"`
	DegradedComponentCount  *int           `json:"degradedComponentCount,omitempty"`
	UnhealthyComponentCount *int           `json:"unhealthyComponentCount,omitempty"`
	Resources               *NodeResources `json:"resources,omitempty"`
	SystemInfo              *SystemInfo    `json:"systemInfo,omitempty"`
	Tags                    []string       `json:"tags,omitempty"`
	RawJSON                 []byte         `json:"-"`
}

Represents detailed node metadata

type NodeFirmwareCheck

type NodeFirmwareCheck string

Represents supported firmware check filters for listing nodes

func (NodeFirmwareCheck) Valid

func (check NodeFirmwareCheck) Valid() bool

Reports whether the firmware check status is accepted by the API

type NodeGroup

type NodeGroup struct {
	ID               string   `json:"id"`
	Name             string   `json:"name"`
	ComputeZoneID    string   `json:"computeZoneId,omitempty"`
	ComputeZoneName  string   `json:"computeZoneName,omitempty"`
	Health           string   `json:"health,omitempty"`
	HealthPercentage *float32 `json:"healthPercentage,omitempty"`
	NodeCount        *int     `json:"nodeCount,omitempty"`
}

Represents a node group

type NodeGroupHealthStatus

type NodeGroupHealthStatus string

Represents supported health filters for listing node groups

func (NodeGroupHealthStatus) Valid

func (status NodeGroupHealthStatus) Valid() bool

Reports whether the health status is accepted by the API

type NodeGroupSortBy

type NodeGroupSortBy string

Represents supported sort fields for listing node groups

func (NodeGroupSortBy) Valid

func (sortBy NodeGroupSortBy) Valid() bool

Reports whether the sort field is accepted by the API

type NodeGroupSortOrder

type NodeGroupSortOrder string

Represents supported sort orders for listing node groups

func (NodeGroupSortOrder) Valid

func (order NodeGroupSortOrder) Valid() bool

Reports whether the sort order is accepted by the API

type NodeGroupView

type NodeGroupView string

Represents supported response shapes for listing node groups

func (NodeGroupView) Valid

func (view NodeGroupView) Valid() bool

Reports whether the view is accepted by the API

type NodeGroupsPage

type NodeGroupsPage struct {
	NodeGroups []NodeGroup `json:"nodeGroups"`
	HasMore    bool        `json:"hasMore"`
	Page       int         `json:"page"`
	PageSize   int         `json:"pageSize"`
	Total      int         `json:"total"`
	RawJSON    []byte      `json:"-"`
}

Represents a paginated node group response with the raw backend payload

type NodeHealthStatus

type NodeHealthStatus string

Represents supported health filters for listing nodes

func (NodeHealthStatus) Valid

func (status NodeHealthStatus) Valid() bool

Reports whether the health status is accepted by the API

type NodeIntegrityCheck

type NodeIntegrityCheck string

Represents supported integrity check filters for listing nodes

func (NodeIntegrityCheck) Valid

func (check NodeIntegrityCheck) Valid() bool

Reports whether the integrity check status is accepted by the API

type NodeResources

type NodeResources struct {
	CPUInfo    *CPUInfo    `json:"cpuInfo,omitempty"`
	DiskInfo   *DiskInfo   `json:"diskInfo,omitempty"`
	GPUInfo    *GPUInfo    `json:"gpuInfo,omitempty"`
	MemoryInfo *MemoryInfo `json:"memoryInfo,omitempty"`
	NICInfo    *NICInfo    `json:"nicInfo,omitempty"`
}

Represents hardware and network resource metadata for a node

type NodeSortBy

type NodeSortBy string

Represents supported sort fields for listing nodes

func (NodeSortBy) Valid

func (sortBy NodeSortBy) Valid() bool

Reports whether the sort field is accepted by the API

type NodeSortOrder

type NodeSortOrder string

Represents supported sort orders for listing nodes

func (NodeSortOrder) Valid

func (order NodeSortOrder) Valid() bool

Reports whether the sort order is accepted by the API

type NodeView

type NodeView string

Represents supported response shapes for listing nodes

func (NodeView) Valid

func (view NodeView) Valid() bool

Reports whether the view is accepted by the API

type NodesPage

type NodesPage struct {
	Nodes    []Node `json:"nodes"`
	HasMore  bool   `json:"hasMore"`
	Page     int    `json:"page"`
	PageSize int    `json:"pageSize"`
	Total    int    `json:"total"`
	RawJSON  []byte `json:"-"`
}

Represents a paginated node response with the raw backend payload

type Option

type Option func(*Client)

Customizes client construction behavior

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

Configures the HTTP client used for API requests

func WithTimeout

func WithTimeout(timeout time.Duration) Option

Sets the per-request timeout applied to API calls. The timeout is enforced via the request context rather than the HTTP client, so it is unaffected by WithHTTPClient (which replaces the HTTP client) and never mutates an *http.Client that may be shared across clients. Non-positive values are ignored, leaving the existing timeout in place.

type ReportFormat

type ReportFormat string

Represents supported report response formats

func (ReportFormat) Valid

func (format ReportFormat) Valid() bool

Reports whether the report format is accepted by the API

type SuggestedAction

type SuggestedAction struct {
	Action  string `json:"action,omitempty"`
	Code    string `json:"code,omitempty"`
	Persona string `json:"persona,omitempty"`
	Type    string `json:"type,omitempty"`
}

Represents an operator action attached to an alert event

type SystemInfo

type SystemInfo struct {
	AgentVersion            string `json:"agentVersion,omitempty"`
	BootID                  string `json:"bootID,omitempty"`
	ContainerRuntimeVersion string `json:"containerRuntimeVersion,omitempty"`
	CUDAVersion             string `json:"cudaVersion,omitempty"`
	DCGMVersion             string `json:"dcgmVersion,omitempty"`
	GPUDriverVersion        string `json:"gpuDriverVersion,omitempty"`
	Hostname                string `json:"hostname,omitempty"`
	KernelVersion           string `json:"kernelVersion,omitempty"`
	OperatingSystem         string `json:"operatingSystem,omitempty"`
	OSImage                 string `json:"osImage,omitempty"`
	StartedAt               string `json:"startedAt,omitempty"`
	SystemUUID              string `json:"systemUUID,omitempty"`
}

Represents system metadata reported by the node agent

type TimeRange

type TimeRange struct {
	Start string `json:"start,omitempty"`
	End   string `json:"end,omitempty"`
}

Represents an inclusive report time range

Jump to

Keyboard shortcuts

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