resolve

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package resolve provides device identifier resolution for Jamf Pro. It translates serial numbers, device names, and numeric IDs into the full set of identifiers (ID, managementId, UDID) required by various API endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapeRSQL

func EscapeRSQL(s string) string

EscapeRSQL escapes double quotes in a value for use in RSQL filter expressions.

func FormatDeviceDesc

func FormatDeviceDesc(d *DeviceIdentifiers) string

FormatDeviceDesc returns a human-readable device description for confirmation messages. Example: "Neil's MacBook" (serial: C02X1234, id: 42)

func ResolveClassicComputerGroupID

func ResolveClassicComputerGroupID(ctx context.Context, client registry.HTTPClient, groupName string) (string, error)

ResolveClassicComputerGroupID resolves a computer group name to its Classic API numeric ID. Works for both smart and static computer groups.

func ResolveClassicMobileGroupID

func ResolveClassicMobileGroupID(ctx context.Context, client registry.HTTPClient, groupName string) (string, error)

ResolveClassicMobileGroupID resolves a mobile device group name to its Classic API numeric ID. Works for both smart and static mobile device groups.

Types

type DeviceIdentifiers

type DeviceIdentifiers struct {
	ID           string // numeric ID (string form, e.g. "42")
	ManagementID string // UUID for blank-push, ddm-sync
	UDID         string // device UDID for renew-mdm
	Name         string // display name for confirmation messages
	SerialNumber string // serial number for confirmation messages
}

DeviceIdentifiers holds all ID forms needed by different action endpoints.

func ResolveComputer

func ResolveComputer(ctx context.Context, client registry.HTTPClient, serial, name, id string) (*DeviceIdentifiers, error)

ResolveComputer looks up a computer by serial, name, or ID using the v3 computers-inventory API and returns all identifier forms. Exactly one of serial, name, or id must be non-empty.

func ResolveComputerGroup

func ResolveComputerGroup(ctx context.Context, client registry.HTTPClient, groupName string) ([]*DeviceIdentifiers, error)

ResolveComputerGroup resolves all members of a computer group by name. Uses the Classic API to list group members, then batch-resolves each via the v3 inventory API to get managementId/UDID.

func ResolveComputersFromFile

func ResolveComputersFromFile(ctx context.Context, client registry.HTTPClient, path string) ([]*DeviceIdentifiers, error)

ResolveComputersFromFile reads serials or IDs from a file (one per line) and resolves each to full identifiers. Blank lines and #-comments are skipped.

func ResolveMobileDevice

func ResolveMobileDevice(ctx context.Context, client registry.HTTPClient, serial, name, id string) (*DeviceIdentifiers, error)

ResolveMobileDevice looks up a mobile device by serial, name, or ID using the v2 mobile-devices API and returns all identifier forms.

func ResolveMobileDeviceGroup

func ResolveMobileDeviceGroup(ctx context.Context, client registry.HTTPClient, groupName string) ([]*DeviceIdentifiers, error)

ResolveMobileDeviceGroup resolves all members of a mobile device group by name.

func ResolveMobileDevicesFromFile

func ResolveMobileDevicesFromFile(ctx context.Context, client registry.HTTPClient, path string) ([]*DeviceIdentifiers, error)

ResolveMobileDevicesFromFile reads serials or IDs from a file and resolves each.

Jump to

Keyboard shortcuts

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