Documentation
¶
Index ¶
Constants ¶
const ( KindManagedInstall = "managed_install" KindManagedUninstall = "managed_uninstall" KindManagedUpdate = "managed_update" KindOptionalInstall = "optional_install" KindDefaultInstall = "default_install" KindUpdateFor = "update_for" )
Item kinds: where an item came from in the manifests.
const ( StatusInstalled = "installed" StatusPending = "pending" StatusFailed = "failed" StatusDeferred = "deferred" StatusRemoved = "removed" StatusAvailable = "available" )
Item statuses: what the run did, or would do, with an item.
const SchemaVersion = 1
SchemaVersion is the inventory schema version. Bump it on any change that renames, removes, or changes the meaning of a field.
Variables ¶
This section is empty.
Functions ¶
func WriteInventory ¶
WriteInventory writes inv as indented JSON to path (see writeProtected).
Types ¶
type DeferredItem ¶
DeferredItem records an item whose action was deferred (e.g. a blocking app was running) during this run
type FailedItem ¶
FailedItem records an item whose action failed during this run
type Inventory ¶
type Inventory struct {
SchemaVersion int `json:"schema_version"`
ConsoleUser string `json:"ConsoleUser"`
StartTime string `json:"StartTime"`
EndTime string `json:"EndTime"`
ManagedInstallVersion string `json:"ManagedInstallVersion"`
ManifestName string `json:"ManifestName"`
Errors []string `json:"Errors"`
Warnings []string `json:"Warnings"`
ProblemInstalls []InventoryItem `json:"ProblemInstalls"`
ManagedInstalls []InventoryItem `json:"ManagedInstalls"`
InstalledItems []string `json:"InstalledItems"`
RemovedItems []string `json:"RemovedItems"`
ItemsToInstall []InventoryItem `json:"ItemsToInstall"`
ItemsToRemove []InventoryItem `json:"ItemsToRemove"`
}
Inventory is the osquery-facing state of one managed run. It mirrors Munki's ManagedInstallReport keys so a sofcat_* table can reuse the macadmins munki table's structs with JSON in place of plist.
type InventoryItem ¶
type InventoryItem struct {
Name string `json:"name"`
DisplayName string `json:"display_name"`
Installed bool `json:"installed"`
InstalledVersion string `json:"installed_version"`
VersionToInstall string `json:"version_to_install"`
Kind string `json:"kind"`
Status string `json:"status"`
SelfService bool `json:"self_service"`
RequestedBy string `json:"requested_by,omitempty"`
DeferredReason string `json:"deferred_reason,omitempty"`
Error string `json:"error,omitempty"`
}
InventoryItem is one item in the inventory. The first five keys are Munki's; the rest are SofCat extras.
type NoActionItem ¶
NoActionItem records an item whose status check found nothing to do: an install or update already present, or an uninstall already absent
type Plan ¶
type Plan struct {
ConsoleUser string
ManifestName string
ManagedInstallVersion string
StartTime time.Time
EndTime time.Time
CheckOnly bool
Errors []string
Warnings []string
Items []PlanItem
}
Plan is the caller's view of the run: its metadata and every item it considered. Items are listed in order; the first entry for a name wins.
type PlanItem ¶
type PlanItem struct {
Name string
DisplayName string
Version string
Kind string
SelfService bool
// RequestedBy is the user whose self-service request this run carries out,
// "" for any other item.
RequestedBy string
// Installed is the caller's own status check. It is used only where the
// run's results can't tell: unselected optional installs, and
// managed_update items the run found nothing to do for (current or absent).
Installed bool
}
PlanItem is one item the run considered, as the caller resolved it from the manifests and catalogs.
type Report ¶
type Report struct {
// InstalledItems contains a list of items we successfully installed
InstalledItems []catalog.Item
// UninstalledItems contains a list of items we successfully uninstalled
UninstalledItems []catalog.Item
// FailedItems contains a list of items whose actions failed
FailedItems []FailedItem
// DeferredItems contains a list of items whose actions were deferred
DeferredItems []DeferredItem
// NoActionItems contains a list of items whose status check found nothing to do
NoActionItems []NoActionItem
}
Report holds the state of a single managed run (K7: no package globals)