Documentation
¶
Overview ¶
Package client provides an HTTP client for interacting with the txlog server API.
Index ¶
- type Asset
- type Client
- func (c *Client) GetAssetByHostname(hostname string) (*Asset, error)
- func (c *Client) GetAssetsRequiringRestart() ([]Asset, error)
- func (c *Client) GetExecutions(machineID string, limit int) ([]Execution, error)
- func (c *Client) GetMonthlyReport(month, year int) (*MonthlyReportResponse, error)
- func (c *Client) GetServerVersion() (string, error)
- func (c *Client) GetTransactionItems(transactionID int) ([]TransactionItem, error)
- func (c *Client) GetTransactions(machineID string, limit int) ([]Transaction, error)
- func (c *Client) ListAssets() ([]Asset, error)
- func (c *Client) SearchPackageAssets(name, version, release string) ([]Asset, error)
- type Execution
- type MonthlyReportPackage
- type MonthlyReportResponse
- type PackageInfo
- type Transaction
- type TransactionItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct {
MachineID string `json:"machine_id"`
Hostname string `json:"hostname"`
OS string `json:"os"`
AgentVersion string `json:"agent_version"`
NeedsRestarting bool `json:"needs_restarting"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
Asset represents a server/machine registered in the txlog system.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the HTTP client for the txlog server API.
func (*Client) GetAssetByHostname ¶
GetAssetByHostname finds an asset by its hostname.
func (*Client) GetAssetsRequiringRestart ¶
GetAssetsRequiringRestart retrieves assets that need to be restarted.
func (*Client) GetExecutions ¶
GetExecutions retrieves execution history for a machine.
func (*Client) GetMonthlyReport ¶
func (c *Client) GetMonthlyReport(month, year int) (*MonthlyReportResponse, error)
GetMonthlyReport retrieves the monthly package update report for a specific month/year.
func (*Client) GetServerVersion ¶
GetServerVersion retrieves the server version.
func (*Client) GetTransactionItems ¶
func (c *Client) GetTransactionItems(transactionID int) ([]TransactionItem, error)
GetTransactionItems retrieves items for a specific transaction.
func (*Client) GetTransactions ¶
func (c *Client) GetTransactions(machineID string, limit int) ([]Transaction, error)
GetTransactions retrieves transactions for a specific machine.
func (*Client) ListAssets ¶
ListAssets retrieves all assets from the server.
type Execution ¶
type Execution struct {
ID int `json:"id"`
MachineID string `json:"machine_id"`
Hostname string `json:"hostname"`
OS string `json:"os"`
AgentVersion string `json:"agent_version"`
NeedsRestarting bool `json:"needs_restarting"`
ExecutedAt string `json:"executed_at"`
}
Execution represents an agent execution record.
type MonthlyReportPackage ¶
type MonthlyReportPackage struct {
OSVersion string `json:"os_version"`
PackageRPM string `json:"package_rpm"`
AssetsAffected int `json:"assets_affected"`
}
MonthlyReportPackage represents a package update in the monthly report.
type MonthlyReportResponse ¶
type MonthlyReportResponse struct {
AssetCount int `json:"asset_count"`
Month int `json:"month"`
Year int `json:"year"`
Packages []MonthlyReportPackage `json:"packages"`
}
MonthlyReportResponse represents the response from the monthly report endpoint.
type PackageInfo ¶
type PackageInfo struct {
Name string `json:"name"`
Version string `json:"version"`
Release string `json:"release"`
Arch string `json:"arch"`
Count int `json:"count"`
}
PackageInfo represents package information across assets.
type Transaction ¶
type Transaction struct {
ID int `json:"id"`
ExternalID int `json:"external_id"`
MachineID string `json:"machine_id"`
Username string `json:"username"`
Cmdline string `json:"cmdline"`
ExecutedAt string `json:"executed_at"`
ItemsCount int `json:"items_count"`
}
Transaction represents a package transaction on an asset.
type TransactionItem ¶
type TransactionItem struct {
ID int `json:"id"`
TransactionID int `json:"transaction_id"`
Action string `json:"action"`
Package string `json:"package"`
Version string `json:"version"`
Release string `json:"release"`
Epoch string `json:"epoch"`
Arch string `json:"arch"`
}
TransactionItem represents an individual package change within a transaction.