classic

package
v0.0.0-...-5cee9b2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateJSONLogger

func CreateJSONLogger() *logrus.Logger

CreateJSONLogger returns a new logger configured for JSON output

func CreateTextLogger

func CreateTextLogger() *logrus.Logger

CreateTextLogger returns a new logger configured for text output

func EndpointBuilder

func EndpointBuilder(endpoint string, context string, identifier interface{}) (string, error)

EndpointBuilder can be utilized to query a specific API context via either name or ID

func JSONPrettyPrint

func JSONPrettyPrint(input []byte) string

JSONPrettyPrint can be used to pretty print JSON API responses

func ValidateComputerExtensionAttribute

func ValidateComputerExtensionAttribute(ce *ComputerExtensionAttribute) error

ValidateComputerExtensionAttribute orchestrates computer extension content validation

Types

type Account

type Account struct {
	Size    int            `json:"size"`
	Details AccountDetails `json:"account"`
}

Account represents an account set up in Jamf

type AccountDetails

type AccountDetails struct {
	Action             string `json:"action"`
	Username           string `json:"username"`
	Realname           string `json:"realname"`
	Password           string `json:"password"`
	ArchiveHomDir      bool   `json:"archive_home_directory"`
	ArchiveHomeDirPath string `json:"archive_home_directory_to"`
	Home               string `json:"home"`
	Picture            string `json:"picture"`
	Admin              bool   `json:"admin"`
	FileVaultEnabled   bool   `json:"filevault_enabled"`
}

AccountDetails holds the specific account details

type ApplicationInformation

type ApplicationInformation struct {
	Name    string `json:"name"`
	Path    string `json:"path"`
	Version string `json:"version"`
}

ApplicationInformation holds information about the applications on a device

type BasicComputerInfo

type BasicComputerInfo struct {
	GeneralInformation
}

BasicComputerInfo represents the information returned in a list of all computers from Jamf

type BasicMobileDeviceInfo

type BasicMobileDeviceInfo struct {
	GeneralDeviceInformation
	Username string `json:"username,omitempty" xml:"username,omitempty"`
}

BasicComputerInfo represents the information returned in a list of all computers from Jamf

type BasicPolicyInformation

type BasicPolicyInformation struct {
	XMLName xml.Name `json:"-" xml:"policy,omitempty"`
	ID      int      `json:"id,omitempty" xml:"id,omitempty"`
	Name    string   `json:"name" xml:"name,omitempty"`
}

BasicPolicyInformation holds the basic information for all policies in Jamf

type BasicScriptInfo

type BasicScriptInfo struct {
	ID   int    `json:"id,omitempty" xml:"id,omitempty"`
	Name string `json:"name"`
}

BasicScriptInfo holds the most basic information about the scripts available in Jamf

type Building

type Building struct {
	ID   int    `json:"id,omitempty"`
	Name string `json:"name"`
}

Building represents a building configured in Jamf that a setting can be scoped to

type CertificateInformation

type CertificateInformation struct {
	CommonName string `json:"common_name"`
	Identity   bool   `json:"identity"`
	ExpiresUTC string `json:"expires_utc"`
	Name       string `json:"name"`
}

CertificateInformation holds information about certs intalled on the device

type Class

type Class struct {
	XMLName       xml.Name                `json:"-" xml:"class,omitempty"`
	ID            int                     `json:"id,omitempty" xml:"id,omitempty"`
	Source        string                  `json:"source,omitempty" xml:"source,omitempty"`
	Name          string                  `json:"name" xml:"name,omitempty"`
	Description   string                  `json:"description,omitempty" xml:"description,omitempty"`
	Site          Site                    `json:"site,omitempty" xml:"site,omitempty"`
	Students      []string                `json:"students,omitempty" xml:"students>student,omitempty"`
	Teachers      []string                `json:"teachers,omitempty" xml:"teachers>teacher,omitempty"`
	MobileDevices []BasicMobileDeviceInfo `json:"mobile_devices,omitempty" xml:"mobile_devices,omitempty"`
	MeetingTimes  []MeetingTime           `json:"meeting_times,omitempty" xml:"meeting_times,omitempty"`
}

Class represents an individual mobile device class in Jamf with all its associated information

type ClassDetails

type ClassDetails struct {
	Details *Class `json:"class"`
}

ClassDetails holds the details for a single mobile device class

type Classes

type Classes struct {
	List  []Class `json:"classes" xml:"classes>class,omitempty"`
	Count int     `json:"-" xml:"size"`
}

Classes represents a list of mobile device classes in Jamf

type Client

type Client struct {
	Domain   string
	Username string
	Password string
	Endpoint string
	// contains filtered or unexported fields
}

Client represents the interface used to communicate with the Jamf API via an HTTP client

func NewClient

func NewClient(domain string, username string, password string, client *http.Client) (*Client, error)

NewClient returns a new Jamf HTTP client to be used for API requests

func (*Client) ClassDetails

func (j *Client) ClassDetails(identifier interface{}) (*ClassDetails, error)

ClassDetails returns the details for a specific mobile device class given its ID or Name

func (*Client) Classes

func (j *Client) Classes() ([]Class, error)

Classes returns all mobile device classes

func (*Client) ComputerDetails

func (j *Client) ComputerDetails(identifier interface{}) (*Computer, error)

ComputerDetails returns the details for a specific computer given its ID

func (*Client) ComputerExtensionAttrExists

func (j *Client) ComputerExtensionAttrExists(identifier interface{}) bool

ComputerExtensionAttrExists is a helper function to check if an extension attribute exists without having to parse the response. Note: If an error occurs that doesn't include a not found message ... we log the error and return false

func (*Client) ComputerExtensionAttributeDetails

func (j *Client) ComputerExtensionAttributeDetails(identifier interface{}) (*ComputerExtensionAttributeDetails, error)

ComputerExtensionAttributeDetails returns the details for a specific computer extension attribute given its ID or Name

func (*Client) ComputerExtensionAttributes

func (j *Client) ComputerExtensionAttributes() ([]ComputerExtensionAttribute, error)

ComputerExtensionAttributes returns all computer extension attributes

func (*Client) Computers

func (j *Client) Computers() ([]BasicComputerInfo, error)

Computers returns all enrolled computer devices

func (*Client) CreateClass

func (j *Client) CreateClass(content *Class) (*Class, error)

CreateClass will create a new mobile device class in Jamf

func (*Client) CreateComputerExtensionAttribute

func (j *Client) CreateComputerExtensionAttribute(content *ComputerExtensionAttribute) (*ComputerExtensionAttribute, error)

CreateComputerExtensionAttribute will create a computer extension attribute in Jamf

func (*Client) CreatePolicy

func (j *Client) CreatePolicy(content *PolicyContents) (*PolicyContents, error)

CreatePolicy will create a policy in Jamf

func (*Client) CreateScript

func (j *Client) CreateScript(content *ScriptContents) (*ScriptContents, error)

CreateScript will create a script in Jamf

func (*Client) DeleteClass

func (j *Client) DeleteClass(identifier interface{}) (*Class, error)

DeleteClass will delete a mobile device class by either ID or Name

func (*Client) DeleteComputerExtensionAttribute

func (j *Client) DeleteComputerExtensionAttribute(identifier interface{}) (*ComputerExtensionAttribute, error)

DeleteComputerExtensionAttribute will delete a computer extension attribute by either ID or Name

func (*Client) DeletePolicy

func (j *Client) DeletePolicy(identifier interface{}) (*PolicyGeneral, error)

DeletePolicy will delete a policy by either ID or Name

func (*Client) DeleteScript

func (j *Client) DeleteScript(identifier interface{}) (*ScriptContents, error)

DeleteScript will delete a script by either ID or Name

func (*Client) GetComputer

func (j *Client) GetComputer(identifier *ComputerIdentifier) (*Computer, error)

GetComputer takes in a search option and returns the details for a specific computer

func (*Client) MockAPIRequest

func (j *Client) MockAPIRequest(r *http.Request, v interface{}) (*http.Request, error)

MockAPIRequest is used for testing the API client

func (*Client) Policies

func (j *Client) Policies() ([]BasicPolicyInformation, error)

Policies returns a list of policies available in the jamf client

func (*Client) PolicyDetails

func (j *Client) PolicyDetails(identifier interface{}) (*Policy, error)

PolicyDetails returns the details for a specific policy given its ID or Name

func (*Client) ScriptDetails

func (j *Client) ScriptDetails(identifier interface{}) (*Script, error)

ScriptDetails returns the details for a specific script given its ID or Name

func (*Client) Scripts

func (j *Client) Scripts() ([]BasicScriptInfo, error)

Scripts returns a list of scripts available in the jamf client

func (*Client) UpdateClass

func (j *Client) UpdateClass(identifier interface{}, content *Class) (*Class, error)

UpdateClass will update a mobile device class in Jamf by either ID or Name

func (*Client) UpdateComputer

func (j *Client) UpdateComputer(identifier *ComputerIdentifier, updates *ComputerDetails) (*ComputerDetails, error)

UpdateComputer takes in an identifier and updated content and updates the device on the server

func (*Client) UpdateComputerExtensionAttribue

func (j *Client) UpdateComputerExtensionAttribue(identifier interface{}, content *ComputerExtensionAttribute) (*ComputerExtensionAttribute, error)

UpdateComputerExtensionAttribue will update a computer extension attribute in Jamf by either ID or Name

func (*Client) UpdatePolicy

func (j *Client) UpdatePolicy(identifier interface{}, policy *PolicyContents) (*PolicyContents, error)

UpdatePolicy will update a policy in Jamf by either ID or Name

func (*Client) UpdateScript

func (j *Client) UpdateScript(identifier interface{}, script *ScriptContents) (*ScriptContents, error)

UpdateScript will update a script in Jamf by either ID or Name

type Computer

type Computer struct {
	Info ComputerDetails `json:"computer" xml:"computer,omitempty"`
}

Computer represents an individual computer enrolled in Jamf with all its associated information

type ComputerDetails

type ComputerDetails struct {
	XMLName             xml.Name                 `json:"-" xml:"computer,omitempty"`
	ID                  int                      `json:"id,omitempty" xml:"id,omitempty"`
	General             GeneralInformation       `json:"general" xml:"general,omitempty"`
	UserLocation        LocationInformation      `json:"location" xml:"location,omitempty"`
	Hardware            HardwareInformation      `json:"hardware" xml:"-"`
	Certificates        []CertificateInformation `json:"certificates" xml:"-"`
	Software            SoftwareInformation      `json:"software" xml:"-"`
	ExtensionAttributes []ExtensionAttribute     `json:"extension_attributes" xml:"extension_attributes>extension_attribute,omitempty"`
	Groups              GroupInformation         `json:"groups_accounts" xml:"-"`
	ConfigProfiles      []ConfigProfile          `json:"configuration_profiles" xml:"configuration_profiles,omitempty"`
}

type ComputerExtensionAttrInputType

type ComputerExtensionAttrInputType struct {
	Type     string `json:"type,omitempty" xml:"type,omitempty"`
	Platform string `json:"platform,omitempty" xml:"platform,omitempty"`
	Script   string `json:"script,omitempty" xml:"script,omitempty"`
}

ComputerExtensionAttrInputType represents an input type for a computer extension attribute in Jamf

func (*ComputerExtensionAttrInputType) ValidateInputType

func (it *ComputerExtensionAttrInputType) ValidateInputType() error

ValidateInputType will validate that a computer extension attribute's input type is valid

type ComputerExtensionAttribute

type ComputerExtensionAttribute struct {
	XMLName          xml.Name                        `json:"-" xml:"computer_extension_attribute,omitempty"`
	ID               int                             `json:"id" xml:"id,omitempty"`
	Name             string                          `json:"name" xml:"name,omitempty"`
	Enabled          bool                            `json:"enabled" xml:"enabled"` // we don't omit since false values are omitted if needed this can be changed to a *bool
	Description      string                          `json:"description,omitempty" xml:"description,omitempty"`
	DataType         string                          `json:"data_type,omitempty" xml:"data_type,omitempty"`
	InputType        *ComputerExtensionAttrInputType `json:"input_type,omitempty" xml:"input_type,omitempty"`
	InventoryDisplay string                          `json:"inventory_display,omitempty" xml:"inventory_display,omitempty"`
	ReconDisplay     string                          `json:"recon_display,omitempty" xml:"recon_display,omitempty"`
}

ComputerExtensionAttribute represents an extension attribute in Jamf

func (*ComputerExtensionAttribute) ValidateDataType

func (ce *ComputerExtensionAttribute) ValidateDataType() error

ValidateDataType will validate that a computer extension attribute's data type is valid

func (*ComputerExtensionAttribute) ValidateInventoryDisplay

func (ce *ComputerExtensionAttribute) ValidateInventoryDisplay() error

ValidateInventoryDisplay will validate that a computer extension attribute's data type is valid

func (*ComputerExtensionAttribute) ValidateReconDisplay

func (ce *ComputerExtensionAttribute) ValidateReconDisplay() error

ValidateReconDisplay will validate that a computer extension attribute's data type is valid

type ComputerExtensionAttributeDetails

type ComputerExtensionAttributeDetails struct {
	Details *ComputerExtensionAttribute `json:"computer_extension_attribute"`
}

ComputerExtensionAttributeDetails holds the details for a single extension attribute

type ComputerExtensionAttributes

type ComputerExtensionAttributes struct {
	List []ComputerExtensionAttribute `json:"computer_extension_attributes"`
}

ComputerExtensionAttributes represents all attributes that exist in Jamf

type ComputerGroup

type ComputerGroup struct {
	ID      int    `json:"id,omitempty" xml:"id,omitempty"`
	Name    string `json:"name" xml:"name"`
	IsSmart bool   `json:"is_smart" xml:"is_smart,omitempty"`
}

ComputerGroup represents a group a device is a member of in Jamf

type ComputerIdentifier

type ComputerIdentifier struct {
	ID           string
	Name         string
	SerialNumber string
}

ComputerIdentifier include the searchable computer identifiers

type Computers

type Computers struct {
	List []BasicComputerInfo `json:"computers"`
}

Computers represents a list of computers enrolled in Jamf

type ConfigProfile

type ConfigProfile struct {
	ID        int    `json:"id,omitempty"`
	Name      string `json:"name"`
	UUID      string `json:"uuid"`
	Removable bool   `json:"is_removable"`
}

ConfigProfile represents an active configuration profile in Jamf

type Department

type Department struct {
	ID   int    `json:"id,omitempty"`
	Name string `json:"name"`
}

Department represents a department configured in Jamf that a setting can be scoped to

type DockItem

type DockItem struct {
	Size    int              `json:"size"`
	Details *DockItemDetails `json:"dock_item"`
}

DockItem represents a dock item configured in Jamf typically part of a policy

type DockItemDetails

type DockItemDetails struct {
	ID     int    `json:"id,omitempty"`
	Name   string `json:"name"`
	Action string `json:"action"`
}

DockItemDetails holds the details for a configured dock item

type Exclusions

type Exclusions struct {
	Computers       []*BasicComputerInfo `json:"computers"`
	ComputerGroups  []*ComputerGroup     `json:"computer_groups"`
	Buildings       []*Building          `json:"buildings"`
	Departments     []*Department        `json:"departments"`
	Users           []*User              `json:"users"`
	UserGroups      []*UserGroup         `json:"user_groups"`
	NetworkSegments []*NetworkSegment    `json:"network_segments"`
}

Exclusions represents any exclusions applied to the scoping of the Jamf setting in context

type ExtensionAttribute

type ExtensionAttribute struct {
	ID    int    `json:"id,omitempty" xml:"id,omitempty"`
	Name  string `json:"name" xml:"name"`
	Type  string `json:"type" xml:"type"`
	Value string `json:"value" xml:"value"`
}

ExtensionAttribute holds extension attribute information for a device

type GeneralDeviceInformation

type GeneralDeviceInformation struct {
	XMLName         xml.Name `json:"-" xml:"mobile_device,omitempty"`
	ID              int      `json:"id,omitempty" xml:"id,omitempty"`
	Name            string   `json:"name" xml:"name,omitempty"`
	DeviceName      string   `json:"device_name,omitempty" xml:"device_name,omitempty"`
	UDID            string   `json:"udid,omitempty" xml:"udid,omitempty"`
	SerialNumber    string   `json:"serial_number,omitempty" xml:"serial_number,omitempty"`
	PhoneNumber     string   `json:"phone_number,omitempty" xml:"phone_number,omitempty"`
	WifiMACAddress  string   `json:"wifi_mac_address,omitempty" xml:"wifi_mac_address,omitempty"`
	Supervised      bool     `json:"supervised,omitempty" xml:"supervised,omitempty"`
	Model           string   `json:"model,omitempty" xml:"model,omitempty"`
	ModelIdentifier string   `json:"model_identifier,omitempty" xml:"model_identifier,omitempty"`
	ModelDisplay    string   `json:"model_display,omitempty" xml:"model_display,omitempty"`
}

GeneralDeviceInformation holds basic information associated with Jamf mobile device

type GeneralInformation

type GeneralInformation struct {
	ID                  int    `json:"id,omitempty" xml:"id,omitempty"`
	Name                string `json:"name" xml:"name,omitempty"`
	MACAddress          string `json:"mac_address" xml:"mac_address,omitempty"`
	SerialNumber        string `json:"serial_number" xml:"serial_number,omitempty"`
	UDID                string `json:"udid" xml:"udid,omitempty"`
	JamfVersion         string `json:"jamf_version" xml:"jamf_version,omitempty"`
	Platform            string `json:"platform" xml:"platform,omitempty"`
	MDMCapable          bool   `json:"mdm_capable" xml:"mdm_capable,omitempty"`
	ReportDate          string `json:"report_date" xml:"report_date,omitempty"`
	IPAddress           string `json:"ip_address" xml:"ip_address,omitempty"`
	LastReportedIP      string `json:"last_reported_ip" xml:"last_reported_ip,omitempty"`
	LastEnrolledDateUTC string `json:"last_enrolled_date_utc" xml:"last_enrolled_date_utc,omitempty"`
}

GeneralInformation holds basic information associated with Jamf device

type GroupInformation

type GroupInformation struct {
	Memberships   []string `json:"computer_group_memberships"`
	LocalAccounts []struct {
		Name             string `json:"name"`
		RealName         string `json:"realname"`
		UID              string `json:"uid"`
		Administrator    bool   `json:"administrator"`
		FilevalutEnabled bool   `json:"filevault_enabled"`
	} `json:"local_accounts"`
}

GroupInformation holds the groups the device is a member of

type HardwareInformation

type HardwareInformation struct {
	Make             string   `json:"make" xml:"make,omitempty"`
	OSName           string   `json:"os_name" xml:"os_name,omitempty"`
	OSVersion        string   `json:"os_version" xml:"os_version,omitempty"`
	OSBuild          string   `json:"os_build" xml:"os_build,omitempty"`
	SIPStatus        string   `json:"sip_status" xml:"sip_status,omitempty"`
	GatekeeperStatus string   `json:"gatekeeper_status" xml:"gatekeeper_status,omitempty"`
	XProtectVersion  string   `json:"xprotect_version" xml:"xprotect_version,omitempty"`
	FilevaultUsers   []string `json:"filevault2_users" xml:"filevault2_users,omitempty"`
}

HardwareInformation holds the hardware specific device information

type Limitations

type Limitations struct {
	Users           []*User           `json:"users,omitempty"`
	UserGroups      []*UserGroup      `json:"user_groups,omitempty"`
	NetworkSegments []*NetworkSegment `json:"network_segments"`
}

Limitations represents any limitations related to the specific scope

type LocationInformation

type LocationInformation struct {
	Username     string `json:"username" xml:"username,omitempty"`
	RealName     string `json:"realname" xml:"realname,omitempty"`
	EmailAddress string `json:"email_address" xml:"email_address,omitempty"`
	Position     string `json:"position" xml:"position,omitempty"`
	Department   string `json:"department" xml:"department,omitempty"`
	Building     string `json:"building" xml:"building,omitempty"`
}

LocationInformation holds the information in the User & Locations section

type ManagementAccount

type ManagementAccount struct {
	Action                string `json:"action"`
	ManagedPassword       string `json:"managed_password"`
	ManagedPasswordLength string `json:"managed_password_length"`
}

ManagementAccount represents a management account type

type MeetingTime

type MeetingTime struct {
	Days      string `json:"days,omitempty" xml:"days,omitempty"`
	StartTime string `json:"start_time,omitempty" xml:"start_time,omitempty"`
	EndTime   string `json:"end_time,omitempty" xml:"end_time,omitempty"`
}

MeetingTime holds values for a mobile device class meeting time

type MobileDevice

type MobileDevice struct {
	Info struct {
		General GeneralDeviceInformation `json:"general"`
	}
}

MobileDevice represents an individual mobile device enrolled in Jamf with all its associated information

type MobileDevices

type MobileDevices struct {
	List  []MobileDevice `json:"mobile_devices" xml:"mobile_devices>mobile_device,omitempty"`
	Count int            `json:"-" xml:"size"`
}

MobileDevices represents a list of all mobile devices enrolled in Jamf

type NetworkSegment

type NetworkSegment struct {
	ID              int    `json:"id,omitempty"`
	Name            string `json:"name"`
	StartingAddress string `json:"starting_address"`
	EndingAddress   string `json:"ending_address"`
}

NetworkSegment represents a network segment configured in Jamf that a setting can be scoped to

type Package

type Package struct {
	XMLName       xml.Name `json:"-" xml:"package,omitempty"`
	ID            int      `json:"id,omitempty" xml:"id,omitempty"`
	Name          string   `json:"name" xml:"name,omitempty"`
	Action        string   `json:"action" xml:"action,omitempty"`
	FUT           bool     `json:"fut" xml:"fut,omitempty"`
	FEU           bool     `json:"feu" xml:"feu,omitempty"`
	UpdateAutorun bool     `json:"update_autorun" xml:"update_autorun,omitempty"`
}

Package holds the details of a package configured in Jamf

type Packages

type Packages struct {
	List []*Package `json:"packages" xml:"packages>package,omitempty"`
}

Packages holds a list of package details

type ParametersList

type ParametersList struct {
	Parameter4  string `json:"parameter4" xml:"parameter4"`
	Parameter5  string `json:"parameter5" xml:"parameter5"`
	Parameter6  string `json:"parameter6" xml:"parameter6"`
	Parameter7  string `json:"parameter7" xml:"parameter7"`
	Parameter8  string `json:"parameter8" xml:"parameter8"`
	Parameter9  string `json:"parameter9," xml:"parameter9"`
	Parameter10 string `json:"parameter10" xml:"parameter10"`
	Parameter11 string `json:"parameter11" xml:"parameter11"`
}

ParametersList holds the potential parameters that can be specified for a script in Jamf

type Policies

type Policies struct {
	List []BasicPolicyInformation `json:"policies"`
}

Policies holds all policies in the configured Jamf environment

type Policy

type Policy struct {
	Content *PolicyContents `json:"policy" xml:"policy"`
}

Policy represents a single policy construct in Jamf

type PolicyAccountMaintenance

type PolicyAccountMaintenance struct {
	Account                 []*Account         `json:"accounts"`
	DirectoryBindings       interface{}        `json:"directory_bindings"`
	ManagementAccount       *ManagementAccount `json:"management_account"`
	OpenFirmwareEFIPassword interface{}        `json:"open_firmware_efi_password"`
}

PolicyAccountMaintenance holds information about account changes controlled by this policy

type PolicyCategory

type PolicyCategory struct {
	ID   int    `json:"id,omitempty" xml:"id,omitempty"`
	Name string `json:"name" xml:"name"`
}

PolicyCategory is a policy category

type PolicyContents

type PolicyContents struct {
	XMLName              xml.Name                  `json:"-" xml:"policy,omitempty"`
	General              *PolicyGeneral            `json:"general" xml:"general,omitempty"`
	Scope                *Scope                    `json:"scope" xml:"scope,omitempty"`
	SelfServices         *SelfService              `json:"self_service" xml:"self_service,omitempty"`
	PackageConfiguration *Packages                 `json:"package_configuration" xml:"package_configuration,omitempty"`
	ScriptCount          int                       `json:"-"  xml:"scripts>size,omitempty"`
	Scripts              []*PolicyScriptAssignment `json:"scripts" xml:"scripts>script,omitempty"`
	Printers             interface{}               `json:"printers" xml:"printers,omitempty"`
	DockItems            []*DockItem               `json:"dock_items" xml:"dock_items,omitempty"`
	AccountMaintenance   *PolicyAccountMaintenance `json:"account_maintenance" xml:"account_maintenance,omitempty"`
	RebootSettings       *PolicyRebootSettings     `json:"reboot" xml:"reboot,omitempty"`
	Maintenance          *PolicyMaintenance        `json:"maintenance" xml:"maintenance,omitempty"`
	FilesProcesses       *PolicyFileProcesses      `json:"files_processes" xml:"files_processes,omitempty"`
	UserInteraction      *PolicyUserInteraction    `json:"user_interaction" xml:"user_interaction,omitempty"`
	DiskEncryption       *PolicyDiskEncryption     `json:"disk_encryption" xml:"disk_encryption,omitempty"`
}

PolicyContents represents the details associated with a given Jamf policy

type PolicyDateLimitations

type PolicyDateLimitations struct {
	ActivationDate      string `json:"activation_date" xml:"activation_date,omitempty"`
	ActivationDateEPOCH int    `json:"activation_date_epoch" xml:"activation_date_epoch,omitempty"`
	ActivationDateUTC   string `json:"activation_date_utc" xml:"activation_date_utc,omitempty"`
	ExpirationDate      string `json:"expiration_date" xml:"expiration_date,omitempty"`
	ExpirationDateEPOCH int    `json:"expiration_date_epoch" xml:"expiration_date_epoch,omitempty"`
	ExpirationDateUTC   string `json:"expiration_date_utc" xml:"expiration_date_utc,omitempty"`
	NoExecuteOn         struct {
		Day string `json:"day,omitempty" xml:"day,omitempty"`
	} `json:"no_execute_on" xml:"no_execute_on,omitempty"`
	NoExecuteStart string `json:"no_execute_start" xml:"no_execute_start,omitempty"`
	NoExecuteEnd   string `json:"no_execute_end" xml:"no_execute_end,omitempty"`
}

PolicyDateLimitations holds the date/time related config for the policy

type PolicyDiskEncryption

type PolicyDiskEncryption struct {
	Action                       string `json:"action"`
	DiskEncryptionConfigID       int    `json:"disk_encryption_configuration_id"`
	AuthRestart                  bool   `json:"auth_restart"`
	RemediateKeyType             string `json:"remediate_key_type"`
	RemediateDiskEncryptConfigID int    `json:"remediate_disk_encryption_configuration_id"`
}

PolicyDiskEncryption holds information about disk encryption settings when executed

type PolicyFileProcesses

type PolicyFileProcesses struct {
	SearchPatch      string `json:"search_by_path"`
	DeleteFile       bool   `json:"delete_file"`
	LocateFile       string `json:"locate_file"`
	UpdateLocateDB   bool   `json:"update_locate_database"`
	SpotlightSearch  string `json:"spotlight_search"`
	SearchFroProcess string `json:"search_for_process"`
	KillProcess      bool   `json:"kill_process"`
	RunCommand       string `json:"run_command"`
}

PolicyFileProcesses holds information about the files processed when this policy is executed

type PolicyGeneral

type PolicyGeneral struct {
	XMLName                   xml.Name                  `json:"-" xml:"general,omitempty"`
	ID                        int                       `json:"id,omitempty" xml:"id,omitempty"`
	Name                      string                    `json:"name" xml:"name,omitempty"`
	Enabled                   bool                      `json:"enabled" xml:"enabled,omitempty"`
	Trigger                   string                    `json:"trigger" xml:"trigger,omitempty"`
	TriggerCheckIn            bool                      `json:"trigger_checkin" xml:"trigger_checkin,omitempty"`
	TriggerEnrollmentComplete bool                      `json:"trigger_enrollment_comlete" xml:"trigger_enrollment_complete,omitempty"`
	TriggerLogin              bool                      `json:"trigger_login" xml:"trigger_login,omitempty"`
	TriggerLogout             bool                      `json:"trigger_logout" xml:"trigger_logout,omitempty"`
	TriggerNetworkStateChange bool                      `json:"trigger_network_state_changed" xml:"trigger_network_state_changed,omitempty"`
	TriggerStartup            bool                      `json:"trigger_startup" xml:"trigger_startup,omitempty"`
	TriggerOther              string                    `json:"trigger_other" xml:"trigger_other,omitempty"`
	Frequency                 string                    `json:"frequency" xml:"frequency,omitempty"`
	RetryEvent                string                    `json:"retry_event" xml:"retry_event,omitempty"`
	RetryAttempts             int                       `json:"retry_attempts" xml:"retry_attempts,omitempty"`
	NotifyOnFailedRetry       bool                      `json:"notify_on_each_failed_retry" xml:"notify_on_each_failed_retry,omitempty"`
	LocationUserOnly          bool                      `json:"location_user_only" xml:"location_user_only,omitempty"`
	TargetDrive               string                    `json:"target_drive" xml:"target_drive,omitempty"`
	Offline                   bool                      `json:"offline" xml:"offline,omitempty"`
	NetworkRequirements       string                    `json:"network_requirements" xml:"network_requirements,omitempty"`
	Category                  *PolicyCategory           `json:"category" xml:"category,omitempty"`
	DateTimeLimitations       *PolicyDateLimitations    `json:"date_time_limitations" xml:"date_time_limitations,omitempty"`
	NetworkLimitations        *PolicyNetworkLimitations `json:"network_limitations" xml:"network_limitations,omitempty"`
	OverrideDefaultSettings   *PolicyOverrides          `json:"override_default_settings" xml:"override_default_settings,omitempty"`
	Site                      *PolicySite               `json:"site" xml:"site,omitempty"`
}

PolicyGeneral holds all the generic policy info

type PolicyMaintenance

type PolicyMaintenance struct {
	Recon                    bool `json:"recon"`
	ResetName                bool `json:"reset_name"`
	InstallAllCachedPackages bool `json:"install_all_cached_packages"`
	Heal                     bool `json:"heal"`
	PreBindings              bool `json:"prebindings"`
	Permissons               bool `json:"permissions"`
	ByHost                   bool `json:"byhost"`
	SystemCache              bool `json:"system_cache"`
	UserCache                bool `json:"user_cache"`
	Verify                   bool `json:"verify"`
}

PolicyMaintenance defines how jamf handles this policy long term

type PolicyNetworkLimitations

type PolicyNetworkLimitations struct {
	MinimumNetworkConnection string   `json:"minimum_network_connection" xml:"minimum_network_connection,omitempty"`
	AnyIPAddress             bool     `json:"any_ip_address" xml:"any_ip_address,omitempty"`
	NetworkSegments          []string `json:"network_segments" xml:"network_segments,omitempty"`
}

PolicyNetworkLimitations holds the network limitations associated with a policy

type PolicyOverrides

type PolicyOverrides struct {
	TargetDrive       string `json:"target_drive" xml:"target_drive,omitempty"`
	DistributionPoint string `json:"distribution_point" xml:"distribution_point,omitempty"`
	ForceAFPSMB       bool   `json:"force_afp_smb" xml:"force_afp_smb,omitempty"`
	SUS               string `json:"sus" xml:"sus,omitempty"`
	NetbootServer     string `json:"netboot_server" xml:"netboot_server,omitempty"`
}

PolicyOverrides contains overrides for the policy's default config

type PolicyRebootSettings

type PolicyRebootSettings struct {
	Message                     string `json:"message"`
	StartupDisk                 string `json:"startup_disk"`
	SpecifyStartup              string `json:"specify_startup"`
	NoUserLoggedIn              string `json:"no_user_logged_in"`
	UserLoggedIn                string `json:"user_logged_in"`
	MinutesUntilReboot          int    `json:"minutes_until_reboot"`
	StartRebootTimerImmediately bool   `json:"start_reboot_timer_immediately"`
	FileVaultReboot             bool   `json:"file_value_2_reboot"`
}

PolicyRebootSettings stores information about how this policy handles reboots

type PolicyScriptAssignment

type PolicyScriptAssignment struct {
	ID          int    `json:"id,omitempty" xml:"id,omitempty"`
	Name        string `json:"name" xml:"name,omitempty"`
	Priority    string `json:"priority" xml:"priority,omitempty"`
	Parameter4  string `json:"parameter4" xml:"parameter4,omitempty"`
	Parameter5  string `json:"parameter5" xml:"parameter5,omitempty"`
	Parameter6  string `json:"parameter6" xml:"parameter6,omitempty"`
	Parameter7  string `json:"parameter7" xml:"parameter7,omitempty"`
	Parameter8  string `json:"parameter8" xml:"parameter8,omitempty"`
	Parameter9  string `json:"parameter9" xml:"parameter9,omitempty"`
	Parameter10 string `json:"parameter10" xml:"parameter10,omitempty"`
	Parameter11 string `json:"parameter11" xml:"parameter11,omitempty"`
}

PolicyScriptAssignment holds the metadata related to a script assigned to a policy

type PolicySite

type PolicySite struct {
	ID   int    `json:"id,omitempty" xml:"id,omitempty"`
	Name string `json:"name" xml:"name"`
}

PolicySite holds the site configuration for a policy

type PolicyUserInteraction

type PolicyUserInteraction struct {
	MessageStart           string `json:"message_start"`
	MessageFinish          string `json:"message_finish"`
	AllowUserDefer         bool   `json:"allow_user_to_defer"`
	AllowUserDeferUntilUTC string `json:"allow_deferral_until_utc"`
	AllowUSerDeferMinutes  int    `json:"allow_deferral_minutes"`
}

PolicyUserInteraction holds the settings associated with user interaction when the policy runs

type PrinterDetails

type PrinterDetails struct {
	ID          int    `json:"id,omitempty"`
	Name        string `json:"name"`
	Action      string `json:"action"`
	MakeDefault bool   `json:"make_default"`
}

PrinterDetails holds the details to a printer configured in Jamf

type Scope

type Scope struct {
	AllComputers   bool                  `json:"all_computers" xml:"all_computers,omitempty"`
	Computers      []*BasicComputerInfo  `json:"computers" xml:"computers>computer,omitempty"`
	ComputerGroups []*ComputerGroup      `json:"computer_groups" xml:"computer_groups>computer_group,omitempty"`
	Buildings      []*Building           `json:"buildings" xml:"buildings,omitempty"`
	Departments    []*Department         `json:"departments" xml:"departments,omitempty"`
	LimitToUsers   *UserGroupLimitations `json:"limit_to_users" xml:"limit_to_users,omitempty"`
	Limitations    *Limitations          `json:"limitations" xml:"limitations,omitempty"`
	Exclusions     *Exclusions           `json:"exclusions" xml:"exclusions,omitempty"`
}

Scope represents the scope of a related Jamf configuration setting or Policy

type Script

type Script struct {
	Content *ScriptContents `json:"script" xml:"script,omitempty"`
}

Script holds the details to a specific script queried by ID

type ScriptContents

type ScriptContents struct {
	XMLName         xml.Name    `json:"-" xml:"script,omitempty"`
	ID              int         `json:"id,omitempty" xml:"id,omitempty"`
	Name            string      `json:"name" xml:"name,omitempty"`
	Category        string      `json:"category" xml:"category,omitempty"`
	Filename        string      `json:"filename" xml:"filename,omitempty"`
	Info            string      `json:"info" xml:"info,omitempty"`
	Notes           string      `json:"notes" xml:"notes,omitempty"`
	Priority        string      `json:"priority" xml:"priority,omitempty"`
	Parameters      interface{} `json:"parameters" xml:"parameters,omitempty"`
	Requirements    string      `json:"os_requirements" xml:"os_requirements,omitempty"`
	Contents        string      `json:"script_contents" xml:"script_contents,omitempty"`
	EncodedContents string      `json:"script_contents_encoded" xml:"script_contents_encoded,omitempty"`
}

ScriptContents holds the inner content of a script in Jamf

type Scripts

type Scripts struct {
	List []BasicScriptInfo `json:"scripts"`
}

Scripts holds a list of all the scripts available in Jamf

type SelfService

type SelfService struct {
	Enabled              bool                   `json:"user_for_self_service"`
	DisplayName          string                 `json:"self_service_display_name"`
	InstallBtnText       string                 `json:"install_button_text"`
	ReInstallBtnText     string                 `json:"reinstall_button_text"`
	Description          string                 `json:"self_service_description"`
	ForceDescriptionView bool                   `json:"force_users_to_view_description"`
	Icon                 *SelfServiceIcon       `json:"self_service_icon"`
	MainPageFeature      bool                   `json:"feature_on_main_page"`
	Categories           []*SelfServiceCategory `json:"self_service_categories"`
	Notification         string                 `json:"notification"`
	NotificationSubject  string                 `json:"notification_subject"`
	NotificationMessage  string                 `json:"notification_message"`
}

SelfService represents a self service configuration in Jamf i.e policy self service config

type SelfServiceCategory

type SelfServiceCategory struct {
	Category struct {
		ID        int    `json:"id,omitempty"`
		Name      string `json:"name"`
		DisplayIn bool   `json:"display_in"`
		FeatureIn bool   `json:"feature_in"`
	} `json:"category"`
}

SelfServiceCategory holds the category associated with a policy

type SelfServiceIcon

type SelfServiceIcon struct {
	ID       int    `json:"id,omitempty"`
	Filename string `json:"filename"`
	URI      string `json:"uri"`
}

SelfServiceIcon holds the config for a self service icon associated with a policy

type Site

type Site struct {
	XMLName xml.Name `json:"-" xml:"site,omitempty"`
	ID      int      `json:"id,omitempty" xml:"id,omitempty"`
	Name    string   `json:"name" xml:"name,omitempty"`
}

Site holds the details of a site configured in Jamf

type Sites

type Sites struct {
	List  []Site `json:"sites" xml:"sites>site,omitempty"`
	Count int    `json:"-" xml:"size"`
}

Sites holds a list of sites configured in Jamf

type SoftwareInformation

type SoftwareInformation struct {
	UnixExecutables          []string                 `json:"unix_executables"`
	InstalledByCasper        []string                 `json:"installed_by_casper"`
	InstalledByInstaller     []string                 `json:"installed_by_installer_swu"`
	AvailableSoftwareUpdates []string                 `json:"available_software_updates"`
	RunningServices          []string                 `json:"running_services"`
	Applications             []ApplicationInformation `json:"applications"`
}

SoftwareInformation holds information about the software installed on a device

type User

type User struct {
	ID   int    `json:"id,omitempty"`
	Name string `json:"name"`
}

User represents a user configured in Jamf that a setting can be scoped to

type UserGroup

type UserGroup struct {
	Size int               `json:"size"`
	Info *UserGroupDetails `json:"user_group"`
}

UserGroup represents a user group configured in Jamf that a setting can be scoped to

type UserGroupDetails

type UserGroupDetails struct {
	ID             int    `json:"id,omitempty"`
	Name           string `json:"name"`
	IsSmart        bool   `json:"is_smart"`
	NotifyOnChange bool   `json:"is_notify_on_change"`
}

UserGroupDetails holds the specific details of a user group

type UserGroupLimitations

type UserGroupLimitations struct {
	UserGroups []*UserGroup `json:"user_groups"`
}

UserGroupLimitations represents the user groups to limit a scope to

Jump to

Keyboard shortcuts

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