jamf_pro_go

package module
v0.0.0-...-ba54371 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: MIT Imports: 12 Imported by: 0

README

jamf-pro-go

Jamf Pro API Client

Usage

export JAMF_BASE_URL=https://<your tenant>.jamfcloud.com
export JAMF_USER=<Jamf Pro Username>
export JAMF_USER_PASSWORD=<Jamf Pro User Password>

exapmple code

package main

import (
	"fmt"
	"os"

	"https://github.com/pirox07/jamf-pro-go"
)


func main() {
	url := os.Getenv("JAMF_BASE_URL")
	userName := os.Getenv("JAMF_USER")
	password := os.Getenv("JAMF_USER_PASSWORD")
	conf, err := jamf.NewConfig(url, userName, password)
	if err !=nil{
		fmt.Println(err.Error())
	}
	client := jamf.NewClient(conf)
	
	...
}

References

APIs

  • Policies

    • GET /policies: Finds all policies
    • GET /policies/id/{id}: Finds policies by ID
    • POST /policies/id/{id}: Creates a new policy by ID
    • PUT /policies/id/{id}: Updates an existing policy by ID
    • DELETE /policies/id/{id}: Deletes a policy by ID
  • Scrips

    • GET /v1/scripts: Search for sorted and paged Scripts
    • GET /v1/scripts/{id}: Retrieve a full script object
    • POST /v1/scripts/{id}: Creates a script
    • PUT /v1/scripts/{id}: Replace the script at the id with the supplied information
    • DELETE /v1/scripts/{id}: Delete a Script at the specified id

Documentation

Index

Constants

View Source
const (
	APIPathClassic = "/JSSResource/"
	APIPathV1      = "/uapi/"
)
View Source
const (
	APIVersionPolicies = "classic"
	APIPathPolices     = "policies"
)
View Source
const (
	APIVersionScripts = "v1"
	APIPathScripts    = "scripts"
)
View Source
const (
	XXXXXXXXXX = "[error message]"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *Config) *Client

func (*Client) CreatePolicy

func (c *Client) CreatePolicy(params *CreatePolicyParams) (*CreatePolicyResult, error)

func (*Client) CreateScript

func (c *Client) CreateScript(params ScriptParams) (*CreateScriptResult, error)

func (*Client) DeletePolicy

func (c *Client) DeletePolicy(policyID uint32) error

func (*Client) DeleteScript

func (c *Client) DeleteScript(scriptID uint32) error

func (*Client) GetPolicies

func (c *Client) GetPolicies() (*GetPoliciesResult, error)

func (*Client) GetPolicy

func (c *Client) GetPolicy(policyID uint32) (*Policy, error)

func (*Client) GetScript

func (c *Client) GetScript(scriptID uint32) (*Script, error)

func (*Client) GetScripts

func (c *Client) GetScripts(opts GetScriptsOpts) (*Scripts, error)

func (*Client) UpdatePolicy

func (c *Client) UpdatePolicy(policyID uint32, params *UpdatePolicyParams) (*UpdatePolicyResult, error)

func (*Client) UpdateScript

func (c *Client) UpdateScript(scriptID uint32, params ScriptParams) (*Script, error)

type Config

type Config struct {
	BaseURL string
	Log     Logger
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(url, userName, password string) (*Config, error)

type CreatePolicyParams

type CreatePolicyParams struct {
	XMLName              xml.Name                    `xml:"policy,omitempty"`
	General              *PolicyGeneral              `xml:"general,omitempty"`
	Scope                *PolicyScope                `xml:"scope,omitempty"`
	SelfService          *PolicySelfService          `xml:"self_service,omitempty"`
	PackageConfiguration *PolicyPackageConfiguration `xml:"package_configuration,omitempty"`
	Scripts              *PolicyScripts              `xml:"scripts,omitempty"`
	Printers             *PolicyPrinters             `xml:"printers,omitempty"`
	DockItems            *PolicyDockItems            `xml:"dock_items,omitempty"`
	AccountMaintenance   *PolicyAccountMaintenance   `xml:"account_maintenance,omitempty"`
	RebootSettings       *PolicyRebootSettings       `xml:"reboot,omitempty"` // Current Startup Disk, Specify Local Startup Disk, Currently Selected Startup Disk (No Bless), NetBoot, macOS Installer
	Maintenance          *PolicyMaintenance          `xml:"maintenance,omitempty"`
	FilesProcesses       *PolicyFilesProcesses       `xml:"files_processes,omitempty"`
	UserInteraction      *PolicyUserInteraction      `xml:"user_interaction,omitempty"`
	DiskEncryption       *PolicyDiskEncryption       `xml:"disk_encryption,omitempty"`
}

type CreatePolicyResult

type CreatePolicyResult struct {
	XMLName xml.Name `xml:"policy,omitempty"`
	ID      uint32   `xml:"id,omitempty"`
}

type CreateScriptResult

type CreateScriptResult struct {
	ID   string `json:"id"`
	Href string `json:"href"`
}

type Error

type Error struct {
	StatusCode              int
	RawError                string
	IsAuthorizationRequired bool
}

func (*Error) Error

func (e *Error) Error() string

type GetPoliciesResult

type GetPoliciesResult struct {
	Size   uint32           `xml:"size,omitempty"`
	Policy []PolicyOverview `xml:"policy,omitempty"`
}

type GetScriptsOpts

type GetScriptsOpts struct {
	Page     uint32   `url:"page,omitempty"`
	PageSize uint32   `url:"page-size,omitempty"`
	Sort     []string `url:"sort,omitempty"`
	Filter   string   `url:"filter,omitempty"`
}

type Logger

type Logger interface {
	Printf(string, ...interface{})
}

Logger generic interface for logger

type Policy

type Policy struct {
	General              *PolicyGeneral              `xml:"general,omitempty"`
	Scope                *PolicyScope                `xml:"scope,omitempty"`
	SelfService          *PolicySelfService          `xml:"self_service,omitempty"`
	PackageConfiguration *PolicyPackageConfiguration `xml:"package_configuration,omitempty"`
	Scripts              *PolicyScripts              `xml:"scripts,omitempty"`
	Printers             *PolicyPrinters             `xml:"printers,omitempty"`
	DockItems            *PolicyDockItems            `xml:"dock_items,omitempty"`
	AccountMaintenance   *PolicyAccountMaintenance   `xml:"account_maintenance,omitempty"`
	RebootSettings       *PolicyRebootSettings       `xml:"reboot,omitempty"`
	Maintenance          *PolicyMaintenance          `xml:"maintenance,omitempty"`
	FilesProcesses       *PolicyFilesProcesses       `xml:"files_processes,omitempty"`
	UserInteraction      *PolicyUserInteraction      `xml:"user_interaction,omitempty"`
	DiskEncryption       *PolicyDiskEncryption       `xml:"disk_encryption,omitempty"`
}

type PolicyAccount

type PolicyAccount struct {
	Action                 string `xml:"action,omitempty"` // [ Create, Reset, Delete, DisableFileVault ]
	UserName               string `xml:"user_name,omitempty"`
	RealName               string `xml:"real_name,omitempty"`
	Password               string `xml:"password,omitempty"`
	ArchiveHomeDirectory   bool   `xml:"archive_home_directory,omitempty"`
	ArchiveHomeDirectoryTo string `xml:"archive_home_directory_to,omitempty"`
	Home                   string `xml:"home,omitempty"`
	Picture                string `xml:"picture,omitempty"`
	Admin                  bool   `xml:"admin,omitempty"`
	FileVaultEnabled       bool   `xml:"filevault_enabled,omitempty"`
}

type PolicyAccountMaintenance

type PolicyAccountMaintenance struct {
	Accounts                *PolicyAccounts                `xml:"accounts,omitempty"`
	DirectoryBindings       *PolicyDirectoryBindings       `xml:"directory_bindings,omitempty"`
	ManagementAccount       *PolicyManagementAccount       `xml:"management_account,omitempty"`
	OpenFirmwareEfiPassword *PolicyOpenFirmwareEfiPassword `xml:"open_firmware_efi_password,omitempty"`
}

type PolicyAccounts

type PolicyAccounts struct {
	Size    uint32           `xml:"size,omitempty"`
	Account []*PolicyAccount `xml:"account,omitempty"`
}

type PolicyCategory

type PolicyCategory struct {
	ID   int32  `xml:"id,omitempty"`   // default: -1
	Name string `xml:"name,omitempty"` // default: Unknown
}

type PolicyDateTimeLimitations

type PolicyDateTimeLimitations struct {
	ActivationDate      string `xml:"activation_date,omitempty"`
	ActivationDateEpoch uint64 `xml:"activation_date_epoch,omitempty"`
	ActivationDateUtc   string `xml:"activation_date_utc,omitempty"`
	ExpirationDate      string `xml:"expiration_date,omitempty"`
	ExpirationDateEpoch uint64 `xml:"expiration_date_epoch,omitempty"`
	ExpirationDateUtc   string `xml:"expiration_date_utc,omitempty"`
	NoExecuteOn         string `xml:"no_execute_on,omitempty"` // Enum: [ Sun, Mon, Tue, Wed, Thu, Fri, Sat ]
	NoExecuteStart      string `xml:"no_execute_start,omitempty"`
	NoExecuteEnd        string `xml:"no_execute_end,omitempty"`
}

type PolicyDirectoryBinding

type PolicyDirectoryBinding struct {
	ID   uint32 `xml:"id,omitempty"`
	Name string `xml:"name,omitempty"`
}

type PolicyDirectoryBindings

type PolicyDirectoryBindings struct {
	Size    uint32                    `xml:"size,omitempty"`
	Binding []*PolicyDirectoryBinding `xml:"binding,omitempty"`
}

type PolicyDiskEncryption

type PolicyDiskEncryption struct {
	Action                                 string `xml:"action,omitempty"` // [ apply, remediate ]
	DiskEncryptionConfigurationID          uint32 `xml:"disk_encryption_configuration_id,omitempty"`
	AuthRestart                            bool   `xml:"auth_restart,omitempty"` // [ Individual, Institutional, Individual And Institutional ]
	RemediateKeyType                       string `xml:"remediate_key_type,omitempty"`
	RemediateDiskEncryptionConfigurationID uint32 `xml:"remediate_disk_encryption_configuration_id,omitempty"`
}

type PolicyDockItem

type PolicyDockItem struct {
	ID     uint32 `xml:"id,omitempty"`
	Name   string `xml:"name,omitempty"`
	Action string `xml:"action,omitempty"` // [ Add To Beginning, Add To End, Remove ]
}

type PolicyDockItems

type PolicyDockItems struct {
	Size     uint32            `xml:"size,omitempty"`
	DockItem []*PolicyDockItem `xml:"dock_item,omitempty"`
}

type PolicyFilesProcesses

type PolicyFilesProcesses struct {
	SearchByPath         string `xml:"search_by_path,omitempty"`
	DeleteFile           bool   `xml:"delete_file,omitempty"`
	LocateFile           string `xml:"locate_file,omitempty"`
	UpdateLocateDatabase bool   `xml:"update_locate_database,omitempty"`
	SpotlightSearch      string `xml:"spotlight_search,omitempty"`
	SearchForProcess     string `xml:"search_for_process,omitempty"`
	KillProcess          bool   `xml:"kill_process,omitempty"`
	RunCommand           string `xml:"run_command,omitempty"`
}

type PolicyGeneral

type PolicyGeneral struct {
	ID                         uint32                     `xml:"id,omitempty"`
	Name                       string                     `xml:"name,omitempty"`
	Enabled                    bool                       `xml:"enabled,omitempty"`
	Trigger                    string                     `xml:"trigger,omitempty"`
	TriggerCheckin             bool                       `xml:"trigger_checkin,omitempty"`
	TriggerEnrollmentComplete  bool                       `xml:"trigger_enrollment_complete,omitempty"`
	TriggerLogin               bool                       `xml:"trigger_login,omitempty"`
	TriggerLogout              bool                       `xml:"trigger_logout,omitempty"`
	TriggerNetworkStateChanged bool                       `xml:"trigger_network_state_changed,omitempty"`
	TriggerStartup             bool                       `xml:"trigger_startup,omitempty"`
	TriggerOther               string                     `xml:"trigger_other,omitempty"`
	Frequency                  string                     `xml:"frequency,omitempty"`
	Offline                    bool                       `xml:"offline,omitempty"`
	RetryEvent                 string                     `xml:"retry_event,omitempty"`
	RetryAttempts              int32                      `xml:"retry_attempts,omitempty"`
	NotifyOnEachFailedRetry    bool                       `xml:"notify_on_each_failed_retry,omitempty"`
	LocationUserOnly           string                     `xml:"location_user_only,omitempty"`
	TargetDrive                string                     `xml:"target_drive,omitempty"`
	Category                   *PolicyCategory            `xml:"category,omitempty"`
	DateTimeLimitations        *PolicyDateTimeLimitations `xml:"date_time_limitations,omitempty"`
	NetworkLimitations         *PolicyNetworkLimitations  `xml:"network_limitations,omitempty"`
	OverrideDefaultSettings    *PolicyOverrides           `xml:"override_default_settings,omitempty"`
	NetworkRequirements        string                     `xml:"network_requirements,omitempty"`
	Site                       *PolicySite                `xml:"site,omitempty"`
}

type PolicyMaintenance

type PolicyMaintenance struct {
	Recon                    bool `xml:"recon,omitempty"`
	ResetName                bool `xml:"reset_name,omitempty"`
	InstallAllCachedPackages bool `xml:"install_all_cached_packages,omitempty"`
	Heal                     bool `xml:"heal,omitempty"`
	Prebindings              bool `xml:"prebindings,omitempty"`
	Permissions              bool `xml:"permissions,omitempty"`
	Byhost                   bool `xml:"byhost,omitempty"`
	SystemCache              bool `xml:"system_cache,omitempty"`
	UserCache                bool `xml:"user_cache,omitempty"`
	Verify                   bool `xml:"verify,omitempty"`
}

type PolicyManagementAccount

type PolicyManagementAccount struct {
	Action                string `xml:"action,omitempty"` // [ specified, random, reset, fileVaultEnable, fileVaultDisable ]
	ManagedPassword       string `xml:"managed_password,omitempty"`
	ManagedPasswordLength uint32 `xml:"managed_password_length,omitempty"`
}

type PolicyNetworkLimitations

type PolicyNetworkLimitations struct {
	MinimumNetworkConnection string `xml:"minimum_network_connection,omitempty"` // Enum: [ No Minimum, Ethernet ]
	AnyIPAddress             bool   `xml:"any_ip_address,omitempty"`
}

type PolicyOpenFirmwareEfiPassword

type PolicyOpenFirmwareEfiPassword struct {
	OfMode     string `xml:"of_mode,omitempty"` // [ command, none ]
	OfPassword string `xml:"of_password,omitempty"`
}

type PolicyOverrides

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

type PolicyOverview

type PolicyOverview struct {
	ID   uint32 `xml:"id,omitempty"`
	Name string `xml:"name,omitempty"`
}

type PolicyPackage

type PolicyPackage struct {
	ID            uint32 `xml:"id,omitempty"`
	Name          string `xml:"name,omitempty"`
	Action        string `xml:"action,omitempty"`
	Fut           bool   `xml:"fut,omitempty"`
	Feu           bool   `xml:"feu,omitempty"`
	UpdateAutorun bool   `xml:"update_autorun,omitempty"`
}

type PolicyPackageConfiguration

type PolicyPackageConfiguration struct {
	Packages *PolicyPackages `xml:"packages,omitempty"`
}

type PolicyPackages

type PolicyPackages struct {
	Size    uint32           `xml:"size,omitempty"`
	Package []*PolicyPackage `xml:"package,omitempty"`
}

type PolicyPrinter

type PolicyPrinter struct {
	ID          uint32 `xml:"id,omitempty"`
	Name        string `xml:"name,omitempty"`
	Action      string `xml:"action,omitempty"` // [ install, uninstall ]
	MakeDefault string `xml:"make_default,omitempty"`
}

type PolicyPrinters

type PolicyPrinters struct {
	Size                 uint32           `xml:"size,omitempty"`
	LeaveExistingDefault string           `xml:"leave_existing_default,omitempty"`
	Printer              []*PolicyPrinter `xml:"printer,omitempty"`
}

type PolicyRebootSettings

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

type PolicyScope

type PolicyScope struct {
	AllComputers   bool                       `xml:"all_computers,omitempty"` // default: false
	Computers      *PolicyScopeComputers      `xml:"computers,omitempty"`
	ComputerGroups *PolicyScopeComputerGroups `xml:"computer_groups,omitempty"`
	Buildings      *PolicyScopeBuildings      `xml:"buildings,omitempty"`
	Departments    *PolicyScopeDepartments    `xml:"departments,omitempty"`
	LimitToUsers   *PolicyScopeLimitToUsers   `xml:"limit_to_users,omitempty"`
	Limitations    *PolicyScopeLimitations    `xml:"limitations,omitempty"`
	Exclusions     *PolicyScopeExclusions     `xml:"exclusions,omitempty"`
}

type PolicyScopeBuilding

type PolicyScopeBuilding struct {
	ID   uint32 `xml:"id,omitempty"`
	Name string `xml:"name,omitempty"`
}

type PolicyScopeBuildings

type PolicyScopeBuildings struct {
	Building []*PolicyScopeBuilding `xml:"id,omitempty"`
}

type PolicyScopeComputer

type PolicyScopeComputer struct {
	ID   uint32 `xml:"id,omitempty"`
	Name string `xml:"name,omitempty"`
	UDID string `xml:"udid,omitempty"`
}

type PolicyScopeComputerGroup

type PolicyScopeComputerGroup struct {
	ID   uint32 `xml:"id,omitempty"`
	Name string `xml:"name,omitempty"`
}

type PolicyScopeComputerGroups

type PolicyScopeComputerGroups struct {
	ComputerGroup []*PolicyScopeComputerGroup `xml:"computer_group,omitempty"`
}

type PolicyScopeComputers

type PolicyScopeComputers struct {
	Computer []*PolicyScopeComputer `xml:"computer,omitempty"`
}

type PolicyScopeDepartment

type PolicyScopeDepartment struct {
	ID   uint32 `xml:"id,omitempty"`
	Name string `xml:"name,omitempty"`
}

type PolicyScopeDepartments

type PolicyScopeDepartments struct {
	Department []*PolicyScopeDepartment `xml:"department,omitempty"`
}

type PolicyScopeExclusions

type PolicyScopeExclusions struct {
	Computers       *PolicyScopeComputers       `xml:"computers,omitempty"`
	ComputerGroups  *PolicyScopeComputerGroups  `xml:"computer_groups,omitempty"`
	Buildings       *PolicyScopeBuildings       `xml:"buildings,omitempty"`
	Departments     *PolicyScopeDepartments     `xml:"departments,omitempty"`
	Users           *PolicyScopeUsers           `xml:"users,omitempty"`
	UserGroups      *PolicyScopeUserGroups      `xml:"user_groups,omitempty"`
	NetworkSegments *PolicyScopeNetworkSegments `xml:"network_segments,omitempty"`
	Ibeacons        *PolicyScopeIbeacons        `xml:"ibeacons,omitempty"`
}

type PolicyScopeIbeacons

type PolicyScopeIbeacons struct {
	Ibeacon []*PolicyScopeIbeaconsIbeacon `xml:"ibeacon,omitempty"`
}

type PolicyScopeIbeaconsIbeacon

type PolicyScopeIbeaconsIbeacon struct {
	ID   uint32 `xml:"id,omitempty"`
	Name string `xml:"name,omitempty"`
}

type PolicyScopeLimitToUsers

type PolicyScopeLimitToUsers struct {
	UserGroups *PolicyScopeLimitUserGroups `xml:"user_groups,omitempty"`
}

type PolicyScopeLimitUserGroup

type PolicyScopeLimitUserGroup struct {
	UserGroup string `xml:"user_group,omitempty"`
}

type PolicyScopeLimitUserGroups

type PolicyScopeLimitUserGroups struct {
	UsrGroups []*PolicyScopeLimitUserGroup `xml:"usr_groups,omitempty"`
}

type PolicyScopeLimitations

type PolicyScopeLimitations struct {
	Users           *PolicyScopeUsers           `xml:"users,omitempty"`
	UserGroups      *PolicyScopeUserGroups      `xml:"user_groups,omitempty"`
	NetworkSegments *PolicyScopeNetworkSegments `xml:"network_segments,omitempty"`
	Ibeacons        *PolicyScopeIbeacons        `xml:"ibeacons,omitempty"`
}

type PolicyScopeNetworkSegments

type PolicyScopeNetworkSegments struct {
	NetworkSegment []*PolicyScopeNetworkSegmentsNetworkSegment `xml:"network_segment,omitempty"`
}

type PolicyScopeNetworkSegmentsNetworkSegment

type PolicyScopeNetworkSegmentsNetworkSegment struct {
	ID   uint32 `xml:"id,omitempty"`
	Name string `xml:"name,omitempty"`
}

type PolicyScopeUserGroups

type PolicyScopeUserGroups struct {
	UserGroup []*PolicyScopeUserGroupsUserGroup `xml:"user_group,omitempty"`
}

type PolicyScopeUserGroupsUserGroup

type PolicyScopeUserGroupsUserGroup struct {
	ID   uint32 `xml:"id,omitempty"`
	Name string `xml:"name,omitempty"`
}

type PolicyScopeUsers

type PolicyScopeUsers struct {
	User []*PolicyScopeUsersUser `xml:"user,omitempty"`
}

type PolicyScopeUsersUser

type PolicyScopeUsersUser struct {
	ID   uint32 `xml:"id,omitempty"`
	Name string `xml:"name,omitempty"`
}

type PolicyScript

type PolicyScript struct {
	ID          uint32 `xml:"id,omitempty"`
	Name        string `xml:"name,omitempty"`
	Priority    string `xml:"priority,omitempty"` // [ Before, After ]
	Parameter4  string `xml:"parameter4,omitempty"`
	Parameter5  string `xml:"parameter5,omitempty"`
	Parameter6  string `xml:"parameter6,omitempty"`
	Parameter7  string `xml:"parameter7,omitempty"`
	Parameter8  string `xml:"parameter8,omitempty"`
	Parameter9  string `xml:"parameter9,omitempty"`
	Parameter10 string `xml:"parameter10,omitempty"`
	Parameter11 string `xml:"parameter11,omitempty"`
}

type PolicyScripts

type PolicyScripts struct {
	Size         uint32          `xml:"size,omitempty"`
	PolicyScript []*PolicyScript `xml:"script,omitempty"`
}

type PolicySelfService

type PolicySelfService struct {
	UseForSelfService           bool                         `xml:"use_for_self_service,omitempty"` // default: false
	SelfServiceDisplayName      string                       `xml:"self_service_display_name,omitempty"`
	InstallButtonText           string                       `xml:"install_button_text,omitempty"`
	ReinstallButtonText         string                       `xml:"reinstall_button_text,omitempty"`
	SelfServiceDescription      string                       `xml:"self_service_description,omitempty"`
	ForceUsersToViewDescription bool                         `xml:"force_users_to_view_description,omitempty"` // default: false
	SelfServiceIcon             *PolicySelfServiceIcon       `xml:"self_service_icon,omitempty"`
	FeatureOnMainPage           bool                         `xml:"feature_on_main_page,omitempty"` // default: false
	SelfServiceCategories       *PolicySelfServiceCategories `xml:"self_service_categories,omitempty"`
}

type PolicySelfServiceCategories

type PolicySelfServiceCategories struct {
	Category *PolicySelfServiceCategory `xml:"category,omitempty"`
}

type PolicySelfServiceCategory

type PolicySelfServiceCategory struct {
	ID        uint32 `xml:"id,omitempty"`
	Name      string `xml:"name,omitempty"`       // default: true
	DisplayIn bool   `xml:"display_in,omitempty"` // default: false
	FeatureIn bool   `xml:"feature_in,omitempty"`
}

type PolicySelfServiceIcon

type PolicySelfServiceIcon struct {
	ID   uint32 `xml:"id,omitempty"`
	Name string `xml:"name,omitempty"`
	Url  string `xml:"url,omitempty"`
}

type PolicySite

type PolicySite struct {
	ID   int32  `xml:"id,omitempty"` // default: -1
	Name string `xml:"name,omitempty"`
}

type PolicyUserInteraction

type PolicyUserInteraction struct {
	MessageStart          string `xml:"message_start,omitempty"`
	AllowUsersToDefer     bool   `xml:"allow_users_to_defer,omitempty"`
	AllowDeferralUntilUtc string `xml:"allow_deferral_until_utc,omitempty"`
	AllowDeferralMinutes  uint32 `xml:"allow_deferral_minutes,omitempty"`
	MessageFinish         string `xml:"message_finish,omitempty"`
}

type Script

type Script struct {
	ID             string `json:"id"`
	Name           string `json:"name"`
	Info           string `json:"info"`
	Notes          string `json:"notes"`
	Priority       string `json:"priority"` // [ BEFORE, AFTER, AT_REBOOT ] (default: BEFORE)
	CategoryID     string `json:"categoryId"`
	CategoryName   string `json:"categoryName"`
	Parameter4     string `json:"parameter4"`
	Parameter5     string `json:"parameter5"`
	Parameter6     string `json:"parameter6"`
	Parameter7     string `json:"parameter7"`
	Parameter8     string `json:"parameter8"`
	Parameter9     string `json:"parameter9"`
	Parameter10    string `json:"parameter10"`
	Parameter11    string `json:"parameter11"`
	OsRequirements string `json:"osRequirements"`
	ScriptContents string `json:"scriptContents"`
}

type ScriptParams

type ScriptParams struct {
	ID             string `json:"id,omitempty"`
	Name           string `json:"name"`
	Info           string `json:"info,omitempty"`
	Notes          string `json:"notes,omitempty"`
	Priority       string `json:"priority,omitempty"` // [ BEFORE, AFTER, AT_REBOOT ] (default: BEFORE)
	CategoryID     string `json:"categoryId"`
	CategoryName   string `json:"categoryName,omitempty"`
	Parameter4     string `json:"parameter4,omitempty"`
	Parameter5     string `json:"parameter5,omitempty"`
	Parameter6     string `json:"parameter6,omitempty"`
	Parameter7     string `json:"parameter7,omitempty"`
	Parameter8     string `json:"parameter8,omitempty"`
	Parameter9     string `json:"parameter9,omitempty"`
	Parameter10    string `json:"parameter10,omitempty"`
	Parameter11    string `json:"parameter11,omitempty"`
	OsRequirements string `json:"osRequirements,omitempty"`
	ScriptContents string `json:"scriptContents,omitempty"`
}

type Scripts

type Scripts struct {
	TotalCount uint32   `json:"totalCount"`
	Results    []Script `json:"results"`
}

type UnauthorizedError

type UnauthorizedError struct {
	Message string `json:"message"`
	Code    string `json:"code"`
}

type UpdatePolicyParams

type UpdatePolicyParams struct {
	XMLName              xml.Name                    `xml:"policy,omitempty"`
	General              *PolicyGeneral              `xml:"general,omitempty"`
	Scope                *PolicyScope                `xml:"scope,omitempty"`
	SelfService          *PolicySelfService          `xml:"self_service,omitempty"`
	PackageConfiguration *PolicyPackageConfiguration `xml:"package_configuration,omitempty"`
	Scripts              *PolicyScripts              `xml:"scripts,omitempty"`
	Printers             *PolicyPrinters             `xml:"printers,omitempty"`
	DockItems            *PolicyDockItems            `xml:"dock_items,omitempty"`
	AccountMaintenance   *PolicyAccountMaintenance   `xml:"account_maintenance,omitempty"`
	RebootSettings       *PolicyRebootSettings       `xml:"reboot,omitempty"`
	Maintenance          *PolicyMaintenance          `xml:"maintenance,omitempty"`
	FilesProcesses       *PolicyFilesProcesses       `xml:"files_processes,omitempty"`
	UserInteraction      *PolicyUserInteraction      `xml:"user_interaction,omitempty"`
	DiskEncryption       *PolicyDiskEncryption       `xml:"disk_encryption,omitempty"`
}

type UpdatePolicyResult

type UpdatePolicyResult struct {
	XMLName xml.Name `xml:"policy,omitempty"`
	ID      uint32   `xml:"id,omitempty"`
}

type V1Token

type V1Token struct {
	Token   string `json:"token"`
	Expires uint64 `json:"expires"`
}

V1Token is the response to the Jamf API Token request.

Jump to

Keyboard shortcuts

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