Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) CreatePolicy(params *CreatePolicyParams) (*CreatePolicyResult, error)
- func (c *Client) CreateScript(params ScriptParams) (*CreateScriptResult, error)
- func (c *Client) DeletePolicy(policyID uint32) error
- func (c *Client) DeleteScript(scriptID uint32) error
- func (c *Client) GetPolicies() (*GetPoliciesResult, error)
- func (c *Client) GetPolicy(policyID uint32) (*Policy, error)
- func (c *Client) GetScript(scriptID uint32) (*Script, error)
- func (c *Client) GetScripts(opts GetScriptsOpts) (*Scripts, error)
- func (c *Client) UpdatePolicy(policyID uint32, params *UpdatePolicyParams) (*UpdatePolicyResult, error)
- func (c *Client) UpdateScript(scriptID uint32, params ScriptParams) (*Script, error)
- type Config
- type CreatePolicyParams
- type CreatePolicyResult
- type CreateScriptResult
- type Error
- type GetPoliciesResult
- type GetScriptsOpts
- type Logger
- type Policy
- type PolicyAccount
- type PolicyAccountMaintenance
- type PolicyAccounts
- type PolicyCategory
- type PolicyDateTimeLimitations
- type PolicyDirectoryBinding
- type PolicyDirectoryBindings
- type PolicyDiskEncryption
- type PolicyDockItem
- type PolicyDockItems
- type PolicyFilesProcesses
- type PolicyGeneral
- type PolicyMaintenance
- type PolicyManagementAccount
- type PolicyNetworkLimitations
- type PolicyOpenFirmwareEfiPassword
- type PolicyOverrides
- type PolicyOverview
- type PolicyPackage
- type PolicyPackageConfiguration
- type PolicyPackages
- type PolicyPrinter
- type PolicyPrinters
- type PolicyRebootSettings
- type PolicyScope
- type PolicyScopeBuilding
- type PolicyScopeBuildings
- type PolicyScopeComputer
- type PolicyScopeComputerGroup
- type PolicyScopeComputerGroups
- type PolicyScopeComputers
- type PolicyScopeDepartment
- type PolicyScopeDepartments
- type PolicyScopeExclusions
- type PolicyScopeIbeacons
- type PolicyScopeIbeaconsIbeacon
- type PolicyScopeLimitToUsers
- type PolicyScopeLimitUserGroup
- type PolicyScopeLimitUserGroups
- type PolicyScopeLimitations
- type PolicyScopeNetworkSegments
- type PolicyScopeNetworkSegmentsNetworkSegment
- type PolicyScopeUserGroups
- type PolicyScopeUserGroupsUserGroup
- type PolicyScopeUsers
- type PolicyScopeUsersUser
- type PolicyScript
- type PolicyScripts
- type PolicySelfService
- type PolicySelfServiceCategories
- type PolicySelfServiceCategory
- type PolicySelfServiceIcon
- type PolicySite
- type PolicyUserInteraction
- type Script
- type ScriptParams
- type Scripts
- type UnauthorizedError
- type UpdatePolicyParams
- type UpdatePolicyResult
- type V1Token
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 (*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 (*Client) DeleteScript ¶
func (*Client) GetPolicies ¶
func (c *Client) GetPolicies() (*GetPoliciesResult, 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 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 CreateScriptResult ¶
type GetPoliciesResult ¶
type GetPoliciesResult struct { Size uint32 `xml:"size,omitempty"` Policy []PolicyOverview `xml:"policy,omitempty"` }
type GetScriptsOpts ¶
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 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 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 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 PolicyOverrides ¶
type PolicyOverview ¶
type PolicyPackage ¶
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 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 PolicyScopeBuildings ¶
type PolicyScopeBuildings struct {
Building []*PolicyScopeBuilding `xml:"id,omitempty"`
}
type PolicyScopeComputer ¶
type PolicyScopeComputerGroups ¶
type PolicyScopeComputerGroups struct {
ComputerGroup []*PolicyScopeComputerGroup `xml:"computer_group,omitempty"`
}
type PolicyScopeComputers ¶
type PolicyScopeComputers struct {
Computer []*PolicyScopeComputer `xml:"computer,omitempty"`
}
type PolicyScopeDepartment ¶
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 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 PolicyScopeUserGroups ¶
type PolicyScopeUserGroups struct {
UserGroup []*PolicyScopeUserGroupsUserGroup `xml:"user_group,omitempty"`
}
type PolicyScopeUsers ¶
type PolicyScopeUsers struct {
User []*PolicyScopeUsersUser `xml:"user,omitempty"`
}
type PolicyScopeUsersUser ¶
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 PolicySelfServiceIcon ¶
type PolicySite ¶
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 UnauthorizedError ¶
type UnauthorizedError struct {}
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 ¶
Click to show internal directories.
Click to hide internal directories.