Documentation
¶
Overview ¶
Package registry defines the shared interfaces and types used by all product command packages (pro, protect, etc.) and the root command.
Index ¶
- func AcceptFromContext(ctx context.Context) string
- func ContentTypeFromContext(ctx context.Context) string
- func WithAccept(ctx context.Context, accept string) context.Context
- func WithContentType(ctx context.Context, ct string) context.Context
- type CLIContext
- type FileUploader
- type HTTPClient
- type OutputFormatter
- type PlatformClient
- type ProtectClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptFromContext ¶
AcceptFromContext returns the Accept header override from the context, or "" if not set.
func ContentTypeFromContext ¶
ContentTypeFromContext returns the Content-Type override from the context, or "" if not set.
func WithAccept ¶
WithAccept returns a new context that overrides the HTTP Accept header for the request. Use this for binary/non-JSON endpoints where the default "application/json" causes a 406.
Types ¶
type CLIContext ¶
type CLIContext struct {
Client HTTPClient
Output OutputFormatter
ProtectClient ProtectClient
PlatformClient PlatformClient
Uploader FileUploader // non-nil for Pro commands; supports streaming uploads
ProfileName string // resolved profile name; empty when using env-var auth
DestructiveCooldown *time.Duration // nil = use default (10s); 0 = disabled
}
CLIContext holds the shared client and output formatter for all commands. It is populated in PersistentPreRunE after token/URL resolution.
type FileUploader ¶
type FileUploader interface {
Upload(ctx context.Context, path string, body io.Reader, contentType string, contentLength int64) (*http.Response, error)
}
FileUploader interface for streaming file uploads with custom Content-Type.
type HTTPClient ¶
type HTTPClient interface {
Do(ctx context.Context, method, path string, body io.Reader) (*http.Response, error)
}
HTTPClient interface for making API requests.
type OutputFormatter ¶
type OutputFormatter interface {
PrintResponse(resp *http.Response) error
PrintRaw(data []byte) error
// PrintBytes writes raw bytes without any conversion or formatting.
// Used by Classic API commands to emit raw XML.
PrintBytes(data []byte) error
// Format returns the current output format string (e.g. "json", "xml", "table").
Format() string
}
OutputFormatter interface for formatting output.
type PlatformClient ¶
type PlatformClient interface {
// Blueprints
ListBlueprints(ctx context.Context, sort []string, search string) ([]jamfplatform.BlueprintOverviewV1, error)
GetBlueprint(ctx context.Context, id string) (*jamfplatform.BlueprintDetailV1, error)
GetBlueprintByName(ctx context.Context, name string) (*jamfplatform.BlueprintDetailV1, error)
CreateBlueprint(ctx context.Context, request *jamfplatform.BlueprintCreateRequestV1) (*jamfplatform.BlueprintCreateResponseV1, error)
UpdateBlueprint(ctx context.Context, id string, request *jamfplatform.BlueprintUpdateRequestV1) error
DeleteBlueprint(ctx context.Context, id string) error
DeployBlueprint(ctx context.Context, id string) error
UndeployBlueprint(ctx context.Context, id string) error
GetBlueprintReport(ctx context.Context, id string) (*jamfplatform.BlueprintStatusDetailV1, error)
ListBlueprintComponents(ctx context.Context) ([]jamfplatform.BlueprintComponentDescriptionV1, error)
GetBlueprintComponent(ctx context.Context, id string) (*jamfplatform.BlueprintComponentDescriptionV1, error)
// Compliance Benchmarks
ListBaselines(ctx context.Context) (*jamfplatform.CBEngineBaselinesResponseV1, error)
ListBenchmarks(ctx context.Context) (*jamfplatform.CBEngineBenchmarksResponseV2, error)
GetBenchmark(ctx context.Context, id string) (*jamfplatform.CBEngineBenchmarkResponseV2, error)
GetBenchmarkByTitle(ctx context.Context, title string) (*jamfplatform.CBEngineBenchmarkResponseV2, error)
CreateBenchmark(ctx context.Context, request *jamfplatform.CBEngineBenchmarkRequestV2) (*jamfplatform.CBEngineBenchmarkResponseV2, error)
DeleteBenchmark(ctx context.Context, id string) error
GetBaselineRules(ctx context.Context, baselineID string) (*jamfplatform.CBEngineSourcedRulesV1, error)
ListBenchmarkRulesStats(ctx context.Context, benchmarkID string, sort string, ruleSearch string) ([]jamfplatform.CBEngineRuleResultV1, error)
ListBenchmarkRuleDevices(ctx context.Context, benchmarkID string, ruleID string, sort string, deviceSearch string, ruleResult string) ([]jamfplatform.CBEngineDeviceRuleResultV1, error)
GetBenchmarkCompliancePercentage(ctx context.Context, benchmarkID string) (*jamfplatform.CBEngineCompliancePercentageV1, error)
// Devices
ListDevices(ctx context.Context, sort []string, filter string) ([]jamfplatform.DeviceListReadRepresentationV1, error)
GetDevice(ctx context.Context, id string) (*jamfplatform.DeviceReadRepresentationV1, error)
GetDeviceBySerialNumber(ctx context.Context, serialNumber string) (*jamfplatform.DeviceReadRepresentationV1, error)
UpdateDevice(ctx context.Context, id string, payload *jamfplatform.DeviceUpdateRepresentationV1) error
DeleteDevice(ctx context.Context, id string) error
ListDeviceApplications(ctx context.Context, deviceID string, sort []string, filter string) ([]jamfplatform.DeviceInstalledApplicationReadRepresentationV1, error)
ListDevicesForUser(ctx context.Context, userID string, sort []string, filter string) ([]jamfplatform.DeviceListReadRepresentationV1, error)
// Device Groups
ListDeviceGroups(ctx context.Context, sort []string, filter string) ([]jamfplatform.DeviceGroupListReadRepresentationV1, error)
GetDeviceGroup(ctx context.Context, id string) (*jamfplatform.DeviceGroupReadRepresentationV1, error)
CreateDeviceGroup(ctx context.Context, request *jamfplatform.DeviceGroupCreateRepresentationV1) (*jamfplatform.DeviceGroupCreateResponseV1, error)
UpdateDeviceGroup(ctx context.Context, id string, request *jamfplatform.DeviceGroupUpdateRepresentationV1) error
DeleteDeviceGroup(ctx context.Context, id string) error
ListDeviceGroupMembers(ctx context.Context, id string) ([]string, error)
UpdateDeviceGroupMembers(ctx context.Context, id string, patch *jamfplatform.DeviceGroupMemberPatchRepresentationV1) error
ListDeviceGroupsForDevice(ctx context.Context, deviceID string) ([]jamfplatform.DeviceGroupMemberOfRepresentationV1, error)
// Device Actions
CheckInDevice(ctx context.Context, id string) error
EraseDevice(ctx context.Context, id string, request *jamfplatform.EraseDeviceRequestV1) ([]jamfplatform.DeviceCommandResponseV1, error)
RestartDevice(ctx context.Context, id string) ([]jamfplatform.DeviceCommandResponseV1, error)
ShutdownDevice(ctx context.Context, id string) ([]jamfplatform.DeviceCommandResponseV1, error)
UnmanageDevice(ctx context.Context, id string) ([]jamfplatform.DeviceCommandResponseV1, error)
// DDM Declaration Reports
GetDeviceDeclarationReport(ctx context.Context, deviceID string) (*jamfplatform.DeviceReportV1, error)
ListDeclarationReportClients(ctx context.Context, declarationIdentifier string, sort []string) ([]jamfplatform.DeclarationReportClientV1, error)
// Client metadata
ValidateCredentials(ctx context.Context) error
BaseURL() string
}
PlatformClient defines the interface for Jamf Platform API operations. The SDK's *jamfplatform.Client satisfies this interface directly.
type ProtectClient ¶
type ProtectClient interface {
// Plans
ListPlans(ctx context.Context) ([]jamfprotect.Plan, error)
GetPlan(ctx context.Context, id string) (*jamfprotect.Plan, error)
CreatePlan(ctx context.Context, input jamfprotect.PlanInput) (jamfprotect.Plan, error)
UpdatePlan(ctx context.Context, id string, input jamfprotect.PlanInput) (jamfprotect.Plan, error)
DeletePlan(ctx context.Context, id string) error
GetPlansConfigProfile(ctx context.Context, id string, input *jamfprotect.PlanConfigProfileOptionsInput) (string, error)
// Computers
ListComputers(ctx context.Context) ([]jamfprotect.Computer, error)
GetComputer(ctx context.Context, uuid string) (*jamfprotect.Computer, error)
// Analytics
ListAnalytics(ctx context.Context) ([]jamfprotect.Analytic, error)
GetAnalytic(ctx context.Context, uuid string) (*jamfprotect.Analytic, error)
CreateAnalytic(ctx context.Context, input jamfprotect.AnalyticInput) (jamfprotect.Analytic, error)
UpdateAnalytic(ctx context.Context, uuid string, input jamfprotect.AnalyticInput) (jamfprotect.Analytic, error)
DeleteAnalytic(ctx context.Context, uuid string) error
// Analytic Sets
ListAnalyticSets(ctx context.Context) ([]jamfprotect.AnalyticSet, error)
GetAnalyticSet(ctx context.Context, uuid string) (*jamfprotect.AnalyticSet, error)
CreateAnalyticSet(ctx context.Context, input jamfprotect.AnalyticSetInput) (jamfprotect.AnalyticSet, error)
UpdateAnalyticSet(ctx context.Context, uuid string, input jamfprotect.AnalyticSetInput) (jamfprotect.AnalyticSet, error)
DeleteAnalyticSet(ctx context.Context, uuid string) error
// Exception Sets
ListExceptionSets(ctx context.Context) ([]jamfprotect.ExceptionSetListItem, error)
GetExceptionSet(ctx context.Context, uuid string) (*jamfprotect.ExceptionSet, error)
CreateExceptionSet(ctx context.Context, input jamfprotect.ExceptionSetInput) (jamfprotect.ExceptionSet, error)
UpdateExceptionSet(ctx context.Context, uuid string, input jamfprotect.ExceptionSetInput) (jamfprotect.ExceptionSet, error)
DeleteExceptionSet(ctx context.Context, uuid string) error
// Removable Storage Control Sets
ListRemovableStorageControlSets(ctx context.Context) ([]jamfprotect.RemovableStorageControlSet, error)
GetRemovableStorageControlSet(ctx context.Context, id string) (*jamfprotect.RemovableStorageControlSet, error)
CreateRemovableStorageControlSet(ctx context.Context, input jamfprotect.RemovableStorageControlSetInput) (jamfprotect.RemovableStorageControlSet, error)
UpdateRemovableStorageControlSet(ctx context.Context, id string, input jamfprotect.RemovableStorageControlSetInput) (jamfprotect.RemovableStorageControlSet, error)
DeleteRemovableStorageControlSet(ctx context.Context, id string) error
// Action Configs
ListActionConfigs(ctx context.Context) ([]jamfprotect.ActionConfigListItem, error)
GetActionConfig(ctx context.Context, id string) (*jamfprotect.ActionConfig, error)
CreateActionConfig(ctx context.Context, input jamfprotect.ActionConfigInput) (jamfprotect.ActionConfig, error)
UpdateActionConfig(ctx context.Context, id string, input jamfprotect.ActionConfigInput) (jamfprotect.ActionConfig, error)
DeleteActionConfig(ctx context.Context, id string) error
// Telemetry V2
ListTelemetriesV2(ctx context.Context) ([]jamfprotect.TelemetryV2, error)
GetTelemetryV2(ctx context.Context, id string) (*jamfprotect.TelemetryV2, error)
CreateTelemetryV2(ctx context.Context, input jamfprotect.TelemetryV2Input) (jamfprotect.TelemetryV2, error)
UpdateTelemetryV2(ctx context.Context, id string, input jamfprotect.TelemetryV2Input) (jamfprotect.TelemetryV2, error)
DeleteTelemetryV2(ctx context.Context, id string) error
// Custom Prevent Lists
ListCustomPreventLists(ctx context.Context) ([]jamfprotect.CustomPreventList, error)
GetCustomPreventList(ctx context.Context, id string) (*jamfprotect.CustomPreventList, error)
CreateCustomPreventList(ctx context.Context, input jamfprotect.CustomPreventListInput) (jamfprotect.CustomPreventList, error)
UpdateCustomPreventList(ctx context.Context, id string, input jamfprotect.CustomPreventListInput) (jamfprotect.CustomPreventList, error)
DeleteCustomPreventList(ctx context.Context, id string) error
// Unified Logging Filters
ListUnifiedLoggingFilters(ctx context.Context) ([]jamfprotect.UnifiedLoggingFilter, error)
GetUnifiedLoggingFilter(ctx context.Context, uuid string) (*jamfprotect.UnifiedLoggingFilter, error)
CreateUnifiedLoggingFilter(ctx context.Context, input jamfprotect.UnifiedLoggingFilterInput) (jamfprotect.UnifiedLoggingFilter, error)
UpdateUnifiedLoggingFilter(ctx context.Context, uuid string, input jamfprotect.UnifiedLoggingFilterInput) (jamfprotect.UnifiedLoggingFilter, error)
DeleteUnifiedLoggingFilter(ctx context.Context, uuid string) error
// Roles
ListRoles(ctx context.Context) ([]jamfprotect.Role, error)
GetRole(ctx context.Context, id string) (*jamfprotect.Role, error)
CreateRole(ctx context.Context, input jamfprotect.RoleInput) (jamfprotect.Role, error)
UpdateRole(ctx context.Context, id string, input jamfprotect.RoleInput) (jamfprotect.Role, error)
DeleteRole(ctx context.Context, id string) error
// Users
ListUsers(ctx context.Context) ([]jamfprotect.User, error)
GetUser(ctx context.Context, id string) (*jamfprotect.User, error)
CreateUser(ctx context.Context, input jamfprotect.UserInput) (jamfprotect.User, error)
UpdateUser(ctx context.Context, id string, input jamfprotect.UserInput) (jamfprotect.User, error)
DeleteUser(ctx context.Context, id string) error
// Groups
ListGroups(ctx context.Context) ([]jamfprotect.Group, error)
GetGroup(ctx context.Context, id string) (*jamfprotect.Group, error)
CreateGroup(ctx context.Context, input jamfprotect.GroupInput) (jamfprotect.Group, error)
UpdateGroup(ctx context.Context, id string, input jamfprotect.GroupInput) (jamfprotect.Group, error)
DeleteGroup(ctx context.Context, id string) error
// API Clients
ListApiClients(ctx context.Context) ([]jamfprotect.ApiClient, error)
GetApiClient(ctx context.Context, clientID string) (*jamfprotect.ApiClient, error)
CreateApiClient(ctx context.Context, input jamfprotect.ApiClientInput) (jamfprotect.ApiClient, error)
UpdateApiClient(ctx context.Context, clientID string, input jamfprotect.ApiClientInput) (jamfprotect.ApiClient, error)
DeleteApiClient(ctx context.Context, clientID string) error
// Organization
GetDataForwarding(ctx context.Context) (jamfprotect.DataForwardingResult, error)
UpdateDataForwarding(ctx context.Context, input jamfprotect.DataForwardingInput) (jamfprotect.DataForwardingResult, error)
GetDataRetention(ctx context.Context) (jamfprotect.DataRetentionSettings, error)
UpdateDataRetention(ctx context.Context, input jamfprotect.DataRetentionInput) (jamfprotect.DataRetentionSettings, error)
GetOrganizationDownloads(ctx context.Context) (jamfprotect.OrganizationDownloads, error)
GetConfigFreeze(ctx context.Context) (jamfprotect.ChangeManagementConfig, error)
UpdateOrganizationConfigFreeze(ctx context.Context, configFreeze bool) (jamfprotect.ChangeManagementConfig, error)
ListConnections(ctx context.Context) ([]jamfprotect.Connection, error)
// Client metadata
BaseURL() string
AccessToken(ctx context.Context) (*jamfprotect.Token, error)
}
ProtectClient defines the interface for Jamf Protect API operations. The SDK's *jamfprotect.Client satisfies this interface directly.