ruby-jss 1.6.4 → 2.0.0b1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/CHANGES.md +40 -4
- data/README-2.0.0.md +337 -0
- data/README.md +48 -34
- data/bin/cgrouper +3 -3
- data/bin/jamfHelperBackgrounder +2 -2
- data/bin/netseg-update +3 -3
- data/data/ruby-jss.conf.example +1 -1
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/account.rb +29 -22
- data/lib/{jss/api_object/advanced_search → jamf/api/classic/api_objects}/advanced_computer_search.rb +6 -6
- data/lib/{jss/api_object/advanced_search → jamf/api/classic/api_objects}/advanced_mobile_device_search.rb +6 -6
- data/lib/{jss/api_object/advanced_search → jamf/api/classic/api_objects}/advanced_user_search.rb +6 -6
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/building.rb +6 -6
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/categorizable.rb +10 -10
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/category.rb +17 -15
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/computer.rb +222 -120
- data/lib/{jss/api_object/extension_attribute → jamf/api/classic/api_objects}/computer_extension_attribute.rb +19 -19
- data/lib/{jss/api_object/group → jamf/api/classic/api_objects}/computer_group.rb +9 -8
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/computer_invitation.rb +8 -8
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/creatable.rb +22 -24
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/criteriable/criteria.rb +24 -24
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/criteriable/criterion.rb +15 -15
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/criteriable.rb +25 -28
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/department.rb +7 -7
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding.rb +40 -40
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/active_directory.rb +47 -47
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/admitmac.rb +56 -56
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/centrify.rb +15 -15
- data/lib/{jss/api_object → jamf/api/classic/api_objects/directory_binding_type}/directory_binding_type.rb +2 -25
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/open_directory.rb +19 -19
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/powerbroker_identity_services.rb +1 -1
- data/lib/jamf/api/classic/api_objects/directory_binding_type.rb +47 -0
- data/lib/{jss/api_object/disk_encryption_configurations.rb → jamf/api/classic/api_objects/disk_encryption_configuration.rb} +14 -14
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/distribution_point.rb +41 -35
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/dock_item.rb +12 -12
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/ebook.rb +3 -3
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/extendable.rb +23 -23
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/ibeacon.rb +15 -15
- data/lib/{jss/api_object/self_servable → jamf/api/classic/api_objects}/icon.rb +8 -8
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/ldap_server.rb +45 -34
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/locatable.rb +6 -6
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/mac_application.rb +18 -18
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/audit_event.rb +4 -4
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/casper_imaging_log.rb +4 -5
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/casper_remote_log.rb +4 -4
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/computer_usage_log.rb +4 -4
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/ebook.rb +7 -7
- data/lib/{jss/api_object/management_history/hashlike.rb → jamf/api/classic/api_objects/management_history/hash_like.rb} +3 -3
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/mac_app_store_app.rb +4 -4
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/mdm_command.rb +9 -9
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/mobile_device_app.rb +4 -4
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/policy_log.rb +5 -5
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/screen_sharing_log.rb +4 -4
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/user_location_change.rb +4 -4
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history.rb +226 -189
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/matchable.rb +9 -6
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/mdm.rb +288 -167
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/mobile_device.rb +63 -51
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/mobile_device_application.rb +77 -35
- data/lib/{jss/api_object/configuration_profile → jamf/api/classic/api_objects}/mobile_device_configuration_profile.rb +7 -10
- data/lib/{jss/api_object/extension_attribute → jamf/api/classic/api_objects}/mobile_device_extension_attribute.rb +19 -19
- data/lib/{jss/api_object/group → jamf/api/classic/api_objects}/mobile_device_group.rb +8 -8
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/netboot_server.rb +6 -6
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/network_segment.rb +75 -61
- data/lib/{jss/api_object/configuration_profile → jamf/api/classic/api_objects}/osx_configuration_profile.rb +7 -7
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/package.rb +83 -74
- data/lib/{jss/api_object/patch_source → jamf/api/classic/api_objects}/patch_external_source.rb +9 -9
- data/lib/{jss/api_object/patch_source → jamf/api/classic/api_objects}/patch_internal_source.rb +5 -5
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/patch_policy.rb +70 -68
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/patch_title/version.rb +15 -15
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/patch_title.rb +76 -64
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/peripheral.rb +24 -24
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/peripheral_type.rb +20 -20
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/policy.rb +121 -129
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/printer.rb +52 -52
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/purchasable.rb +6 -6
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/removable_macaddr.rb +7 -7
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/restricted_software.rb +21 -21
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/scopable/scope.rb +69 -64
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/scopable.rb +11 -13
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/script.rb +22 -22
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/self_servable.rb +49 -47
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/sitable.rb +8 -8
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/site.rb +6 -6
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/software_update_server.rb +5 -5
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/updatable.rb +13 -13
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/uploadable.rb +71 -29
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/user.rb +18 -18
- data/lib/{jss/api_object/extension_attribute → jamf/api/classic/api_objects}/user_extension_attribute.rb +12 -12
- data/lib/{jss/api_object/group → jamf/api/classic/api_objects}/user_group.rb +7 -7
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/vpp_account.rb +15 -15
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/vppable.rb +5 -5
- data/lib/{jss/api_object/webhook.rb → jamf/api/classic/api_objects/web_hook.rb} +15 -15
- data/lib/{jss/api_object → jamf/api/classic/base_classes}/advanced_search.rb +36 -40
- data/lib/{jss → jamf/api/classic/base_classes}/api_object.rb +320 -280
- data/lib/{jss/api_object → jamf/api/classic/base_classes}/configuration_profile.rb +13 -16
- data/lib/{jss/api_object → jamf/api/classic/base_classes}/extension_attribute.rb +55 -59
- data/lib/{jss/api_object → jamf/api/classic/base_classes}/group.rb +97 -78
- data/lib/{jss/api_object → jamf/api/classic/base_classes}/patch_source.rb +107 -87
- data/lib/{jss → jamf/api/classic}/xml_workaround.rb +12 -12
- data/lib/jamf/api/connection/attributes.rb +224 -0
- data/lib/jamf/api/connection/cache.rb +148 -0
- data/lib/jamf/api/connection/classic_api.rb +288 -0
- data/lib/jamf/api/connection/connect.rb +538 -0
- data/lib/jamf/api/connection/constants.rb +112 -0
- data/lib/jamf/api/connection/default_connection.rb +103 -0
- data/lib/jamf/api/connection/jamf_pro_api.rb +174 -0
- data/lib/jamf/api/connection/jamf_pro_api_error.rb +109 -0
- data/lib/jamf/api/connection/token.rb +295 -99
- data/lib/jamf/api/connection.rb +189 -818
- data/lib/jamf/api/jamf_pro/api_objects/computer_prestage.rb +82 -0
- data/lib/jamf/api/jamf_pro/api_objects/device_enrollment.rb +358 -0
- data/lib/jamf/api/jamf_pro/api_objects/inventory_preload_record.rb +172 -0
- data/lib/jamf/api/jamf_pro/api_objects/jp_building.rb +116 -0
- data/lib/jamf/api/jamf_pro/api_objects/mobile_device_prestage.rb +87 -0
- data/lib/jamf/api/jamf_pro/base_classes/oapi_object.rb +614 -0
- data/lib/jamf/api/{mixins → jamf_pro/mixins}/bulk_deletable.rb +2 -1
- data/lib/jamf/api/jamf_pro/mixins/change_log.rb +246 -0
- data/lib/jamf/api/jamf_pro/mixins/collection_resource.rb +762 -0
- data/lib/jamf/api/{mixins → jamf_pro/mixins}/filterable.rb +21 -14
- data/lib/jamf/api/{mixins → jamf_pro/mixins}/immutable.rb +6 -8
- data/lib/jamf/api/jamf_pro/mixins/jpapi_resource.rb +167 -0
- data/lib/jamf/api/{mixins → jamf_pro/mixins}/lockable.rb +29 -3
- data/lib/jamf/api/jamf_pro/mixins/macos_managed_updates.rb +168 -0
- data/lib/jamf/api/jamf_pro/mixins/prestage.rb +356 -0
- data/lib/jamf/api/{mixins → jamf_pro/mixins}/sortable.rb +7 -17
- data/lib/jamf/api/{mixins → jamf_pro/mixins}/uncreatable.rb +2 -2
- data/lib/jamf/api/{mixins → jamf_pro/mixins}/undeletable.rb +2 -2
- data/lib/jamf/api/jamf_pro/oapi_schemas/access_groups_preview_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/access_groups_v2_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/account.rb +159 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/account_driven_user_enrollment_session_token_settings.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/account_group.rb +123 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/account_preferences.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/account_preferences_v1.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/account_preferences_v4.rb +117 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/active_patch_history.rb +160 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/active_patch_history_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/active_patch_summary.rb +131 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/admin_account.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_search.rb +116 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_search_criteria_choices.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_search_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_user_content_search.rb +116 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_user_content_search_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/android_details.rb +162 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/api_error.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/api_error_cause.rb +106 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/app_analytics_setting.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/app_dynamics_config.rb +133 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/app_path.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/app_request_form_input_field.rb +114 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/app_request_form_input_field_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/app_request_settings.rb +104 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/apple_tv_details.rb +132 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/application_attributes.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/application_configuration.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/assign_remove_profile_response_sync_state.rb +112 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/attributes.rb +100 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/auth_account.rb +158 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/auth_account_v1.rb +158 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/auth_token.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/auth_token_v1.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/authorization.rb +116 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/authorization_v1.rb +116 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/available_updates.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_ad_migration_report_process_status.rb +115 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_ad_migration_report_request.rb +102 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_configuration.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_configuration_request.rb +92 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_configuration_update.rb +92 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_mappings.rb +157 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_server_configuration.rb +146 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_server_configuration_request.rb +145 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_server_configuration_update.rb +131 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/branding_image_url.rb +86 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/building.rb +137 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/building_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cache_settings.rb +149 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/categories_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/category.rb +103 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/certificate_details.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/certificate_identity_v2.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/certificate_key.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/certificate_record.rb +146 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/classic_ldap_mappings.rb +168 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/client_check_in_v2.rb +164 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/client_check_in_v3.rb +134 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_id_p_common.rb +108 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_id_p_common_request.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_id_p_common_response.rb +108 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_connection_pool_statistics.rb +170 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_connection_status.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_keystore.rb +102 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_keystore_file.rb +103 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_mappings_request.rb +101 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_mappings_response.rb +101 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_server_request.rb +151 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_server_response.rb +148 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_server_update.rb +148 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_application.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_attachment.rb +102 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_certificate.rb +151 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_configuration_profile.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching.rb +372 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_alert.rb +120 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_cache_detail.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_data_migration_error.rb +98 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_data_migration_error_user_info.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent.rb +131 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_alert.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_capabilities.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_details.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_local_network.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_disk.rb +143 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_disk_encryption.rb +120 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_extension_attribute.rb +175 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_font.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_general.rb +230 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_general_update.rb +112 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_group.rb +96 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_hardware.rb +264 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_hardware_update.rb +106 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_ibeacon.rb +81 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory.rb +275 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_collection_preferences.rb +165 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_collection_settings.rb +108 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_recovery_lock_password_response.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_update_request.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_licensed_software.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_local_user_account.rb +189 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_location.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_mdm_capability.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_operating_system.rb +132 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_operating_system_update.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_overview.rb +179 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_package_receipts.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_partition.rb +145 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_partition_encryption.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_partition_file_vault2_state.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_plugin.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_prestage.rb +106 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_prestage_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_prestage_search_results_v2.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_prestage_v2.rb +129 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_printer.rb +99 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_purchase.rb +158 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_remote_management.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_section.rb +109 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_security.rb +179 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_service.rb +81 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_software_update.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_storage.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_user_and_location.rb +131 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computers_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/configuration_profile.rb +102 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/configuration_search_results.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/connection_configuration_candidate_request.rb +123 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/connection_configuration_response.rb +122 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/connection_configuration_status_response.rb +85 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/connection_configuration_update_request.rb +109 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/country.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/country_codes.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/create_path.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/csa_token.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/current_account.rb +159 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/current_authorization.rb +108 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/data_roaming_setting.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/database_password.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/day_of_week.rb +92 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/delete_user_command.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/department.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/departments_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/deployment_task.rb +129 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/deployment_task_search_results.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_communication_settings.rb +128 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_compliance_information.rb +117 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_device.rb +162 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_device_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_disown_body.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_disown_response.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_instance.rb +163 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_instance_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_instance_sync_status.rb +98 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_prestage.rb +215 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_prestage_v2.rb +234 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_token.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/diagnostic_submission_setting.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ebook.rb +152 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ebook_exclusions.rb +137 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ebook_limitations.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ebook_scope.rb +170 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ebook_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enable_lost_mode_command.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/engage.rb +84 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_access_group_preview.rb +141 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_access_group_v2.rb +132 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization.rb +106 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_branding_settings.rb +111 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_dependencies.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_dependency.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_ldap_group_access.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel_ldap_auth.rb +121 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel_list.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel_sso_auth.rb +113 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel_text.rb +112 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_search_results_v2.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_v2.rb +116 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_method.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_process_text_object.rb +346 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_settings_v2.rb +273 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/export_field.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/export_parameters.rb +121 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/extension_attribute.rb +115 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/extension_attribute_v2.rb +116 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/external_recipient.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/file_attachment.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/file_attachment_delete.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/file_attachment_v2.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/filter.rb +104 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/font_path.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_computer_prestage.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_computer_prestage_v2.rb +104 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization_panel.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization_panel_ldap_auth.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization_panel_sso_auth.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization_panel_text.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_mobile_device_prestage.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_mobile_device_prestage_v2.rb +103 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/group_mappings.rb +138 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/group_membership.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/group_test_search.rb +106 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/group_test_search_request.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/group_test_search_response.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/history_search_results.rb +137 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/history_search_results_v1.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/href_response.rb +168 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/icon_response.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/id_and_name.rb +92 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/id_and_name_v2.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ids.rb +99 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/initialize.rb +133 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/initialize_v1.rb +133 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/install_package.rb +103 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/integer_wrapper.rb +84 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/internal_recipient.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_information.rb +113 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_csv_error.rb +123 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_csv_validation_error.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_csv_validation_error_cause.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_csv_validation_success.rb +86 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_extension_attribute.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_extension_attribute_column.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_extension_attribute_column_result.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_invalid_csv_response.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_record.rb +248 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_record_search_results.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_record_search_results_v2.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_record_v2.rb +263 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ios_branding_configuration.rb +129 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ios_branding_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ios_details.rb +255 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ios_details_v2.rb +255 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_application_response.rb +95 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_nation_credentials.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_package_response.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_pro_information.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_pro_information_v2.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_pro_server_url.rb +92 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_pro_version.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_protect_plan.rb +125 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/language_code.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_configuration_request.rb +99 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_configuration_response.rb +101 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_configuration_update.rb +99 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_group.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_group_search_results.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_server.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/linked_connect_profile.rb +126 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/linked_connect_profile_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/locale.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/location.rb +125 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/location_information.rb +146 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/location_information_v2.rb +146 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/location_v2.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mac_os_branding_configuration.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mac_os_branding_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mac_os_managed_software_update.rb +138 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mac_os_managed_software_update_response.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/markdown.rb +84 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_client_type.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command.rb +109 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command_client.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command_request.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command_state.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command_type.rb +172 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/membership_mappings.rb +84 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/membership_test_search_request.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/membership_test_search_response.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/memcached_endpoints.rb +113 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device.rb +153 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_application.rb +100 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_attachment.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_attachment_v2.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_certificate_v1.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_certificate_v2.rb +146 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_details.rb +235 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_details_get_v2.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_details_v2.rb +259 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_ebook.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_extension_attribute_results.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_group.rb +96 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage.rb +136 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_name.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_name_v2.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_names.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_names_v2.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_search_results_v2.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_v2.rb +175 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_search_params.rb +144 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_search_results_v2.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_v2.rb +158 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/network.rb +171 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/network_v2.rb +179 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/notification.rb +96 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/notification_type.rb +141 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/notification_v1.rb +96 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/object_history.rb +133 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/object_history_note.rb +133 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/object_history_v1.rb +106 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/order_by.rb +95 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/package_manifest.rb +148 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/parent_app.rb +131 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_ids_on_dashboard.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_attempt.rb +102 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_attempt_action.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_log.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_log_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_on_dashboard.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_summary.rb +146 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_version.rb +96 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/personal_hotspot_setting.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/plan_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/plugin_path.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/policy_properties.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/policy_properties_v1.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/post_computer_prestage_v2.rb +85 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_dependencies.rb +85 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_dependency.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_file_attachment.rb +95 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_file_attachment_v2.rb +95 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_purchasing_information.rb +174 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_purchasing_information_v2.rb +174 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope.rb +84 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_assignment.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_assignment_v2.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_response.rb +109 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_response_v2.rb +109 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_update.rb +113 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_v2.rb +84 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_sync_status.rb +98 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_sync_status_v2.rb +98 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/process_texts_search_results.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/protect_registration_request.rb +98 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/protect_settings_response.rb +141 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/protect_updatable_settings_request.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/provisioning_profile.rb +95 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/purchasing.rb +153 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/purchasing_v2.rb +153 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/put_computer_prestage.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/put_computer_prestage_v2.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/put_mobile_device_prestage.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/put_mobile_device_prestage_v2.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/recalculation_results.rb +92 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/recipient.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/recipients.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/redeploy_jamf_management_framework_response.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/reenrollment.rb +117 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/remote_administration_response.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/remote_administration_search_results.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/renew_mdm_profile_response.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/restart_device_command.rb +95 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/retry_patch_policy_params.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/safelisted_app.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/script.rb +192 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/scripts_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/search_active_patch_history_params.rb +121 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/search_patch_policy_log_params.rb +121 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/security.rb +130 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/security_v2.rb +129 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/self_service_install_settings.rb +92 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/self_service_interaction_settings.rb +122 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/self_service_login_settings.rb +113 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/self_service_settings.rb +100 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/session.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/session_candidate_request.rb +108 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/session_details.rb +175 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/session_details_search_results.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/session_status.rb +98 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/set_recovery_lock_command.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/settings_command.rb +167 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/shared_device_configuration.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/signature.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/site.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/smart_search_criterion.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/software_title_configuration.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/software_title_patch_policy_summaries.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/software_update_settings.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore.rb +128 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_cert_parse_response.rb +130 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_details.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_parse.rb +103 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_response.rb +120 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_response_with_details.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_with_details.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_metadata_url.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_settings.rb +240 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/startup_status.rb +185 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/static_user_group.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity_certificate_upload.rb +99 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity_create.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity_update.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/teacher_features.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/teacher_settings_request.rb +108 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/teacher_settings_response.rb +122 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/time_frame.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/time_zone.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/tv_os_details.rb +140 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/udids.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/update_apple_tv.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/update_ios.rb +81 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/update_ios_v2.rb +81 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/update_mobile_device.rb +122 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/update_mobile_device_v2.rb +137 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/update_tv_os.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/user_attributes.rb +117 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/user_mappings.rb +193 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/user_test_search.rb +112 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/user_test_search_request.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/user_test_search_response.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/v1_site.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/venafi_ca_record.rb +147 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/venafi_pki_payload_record.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/venafi_pki_payload_record_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/venafi_service_status.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/verbose_package_deployment_response.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/voice_roaming_setting.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_content.rb +153 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_location.rb +86 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_location_list_view.rb +171 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_location_patch.rb +111 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_location_post.rb +114 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_locations.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_subscription.rb +86 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_subscription_base.rb +127 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_subscriptions.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/vpp_admin_account.rb +119 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/vpp_token_subscription.rb +123 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/web_link.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas.rb +35 -0
- data/lib/jamf/api/jamf_pro/other_classes/change_log_entry.rb +37 -0
- data/lib/jamf/api/{attribute_classes → jamf_pro/other_classes}/ip_address.rb +2 -8
- data/lib/jamf/api/jamf_pro/other_classes/pager.rb +257 -0
- data/lib/jamf/api/{attribute_classes → jamf_pro/other_classes}/timestamp.rb +18 -14
- data/lib/jamf/{api/mixins/base_class.rb → base_class.rb} +8 -8
- data/lib/jamf/client/jamf_binary.rb +104 -99
- data/lib/jamf/client/jamf_helper.rb +274 -256
- data/lib/jamf/client/management_action.rb +84 -75
- data/lib/jamf/client.rb +15 -86
- data/lib/jamf/composer.rb +5 -5
- data/lib/jamf/configuration.rb +219 -196
- data/lib/jamf/{api/json_objects/prestage_sync_status.rb → constants.rb} +15 -32
- data/lib/{jss → jamf}/db_connection.rb +23 -31
- data/lib/{jpapi.rb → jamf/deprecations/deprecated_api_constant.rb} +5 -4
- data/lib/{jss/ruby_extensions/string.rb → jamf/deprecations/deprecated_config_constant.rb} +4 -12
- data/lib/jamf/exceptions.rb +14 -15
- data/lib/jamf/oapi_validate.rb +502 -0
- data/lib/jamf/ruby_extensions/array/predicates.rb +3 -1
- data/lib/jamf/ruby_extensions/array/utils.rb +2 -11
- data/lib/jamf/ruby_extensions/array.rb +1 -1
- data/lib/jamf/ruby_extensions/filetest/predicates.rb +2 -1
- data/lib/jamf/ruby_extensions/filetest.rb +1 -1
- data/lib/jamf/ruby_extensions/hash/{backports.rb → utils.rb} +53 -34
- data/lib/jamf/ruby_extensions/hash.rb +3 -3
- data/lib/jamf/ruby_extensions/ipaddr/utils.rb +7 -4
- data/lib/jamf/ruby_extensions/ipaddr.rb +2 -2
- data/lib/jamf/ruby_extensions/object/predicates.rb +3 -1
- data/lib/jamf/ruby_extensions/object.rb +1 -1
- data/lib/jamf/ruby_extensions/pathname/predicates.rb +3 -1
- data/lib/jamf/ruby_extensions/pathname/utils.rb +11 -5
- data/lib/jamf/ruby_extensions/pathname.rb +1 -1
- data/lib/jamf/ruby_extensions/string/conversions.rb +16 -1
- data/lib/jamf/ruby_extensions/string/predicates.rb +3 -1
- data/lib/jamf/ruby_extensions/string.rb +1 -3
- data/lib/{jss/ruby_extensions/time.rb → jamf/ruby_extensions/time/utils.rb} +40 -25
- data/lib/{jss/version.rb → jamf/ruby_extensions/time.rb} +7 -6
- data/lib/jamf/ruby_extensions.rb +9 -9
- data/lib/jamf/utility.rb +626 -410
- data/lib/jamf/validate.rb +86 -125
- data/lib/jamf/version.rb +3 -3
- data/lib/jamf.rb +76 -131
- data/lib/jss-api.rb +2 -2
- data/lib/jss.rb +3 -215
- data/lib/ruby-jss.rb +2 -2
- data/lib/zeitwerk_config.rb +163 -0
- data/test/README-TEST.md +65 -0
- data/test/bin/runtests +97 -130
- data/test/lib/jamf_test/APITest.rb +106 -0
- data/{lib/jss/ruby_extensions/filetest.rb → test/lib/jamf_test/advanced_search.rb} +16 -20
- data/test/lib/jamf_test/auth.rb +267 -0
- data/test/lib/jamf_test/collection_tests.rb +388 -0
- data/test/lib/jamf_test/prestage_tests.rb +135 -0
- data/test/lib/{testhelper.rb → jamf_test.rb} +15 -12
- data/{lib/jss/ruby_extensions.rb → test/tests/advanced_computer_search.rb} +11 -12
- data/test/tests/advanced_mobile_device_search.rb +36 -0
- data/test/tests/advanced_user_search.rb +36 -0
- data/test/tests/building.rb +41 -0
- data/test/tests/category.rb +41 -0
- data/test/tests/computer.rb +41 -0
- data/test/tests/computer_group.rb +132 -0
- data/test/tests/computer_prestage.rb +36 -0
- data/test/tests/department.rb +41 -0
- data/test/tests/device_enrollment.rb +101 -0
- data/test/tests/inventory_preload_record.rb +131 -0
- data/test/tests/jp_building.rb +41 -0
- data/test/tests/mobile_device.rb +41 -0
- data/test/tests/mobile_device_prestage.rb +37 -0
- data/test/tests/policy.rb +151 -0
- metadata +654 -213
- data/lib/jamf/api/base_classes/collection_resource.rb +0 -612
- data/lib/jamf/api/base_classes/json_object.rb +0 -1103
- data/lib/jamf/api/base_classes/prestage.rb +0 -503
- data/lib/jamf/api/base_classes/resource.rb +0 -259
- data/lib/jamf/api/base_classes/singleton_resource.rb +0 -88
- data/lib/jamf/api/connection/api_error.rb +0 -111
- data/lib/jamf/api/connection/api_error_styleguide.rb +0 -96
- data/lib/jamf/api/json_objects/change_log_entry.rb +0 -77
- data/lib/jamf/api/json_objects/country.rb +0 -51
- data/lib/jamf/api/json_objects/device_enrollment_device.rb +0 -165
- data/lib/jamf/api/json_objects/device_enrollment_device_sync_state.rb +0 -81
- data/lib/jamf/api/json_objects/device_enrollment_sync_status.rb +0 -71
- data/lib/jamf/api/json_objects/inventory_preload_extension_attribute.rb +0 -57
- data/lib/jamf/api/json_objects/locale.rb +0 -59
- data/lib/jamf/api/json_objects/md_prestage_name.rb +0 -57
- data/lib/jamf/api/json_objects/md_prestage_names.rb +0 -82
- data/lib/jamf/api/json_objects/md_prestage_skip_setup_items.rb +0 -214
- data/lib/jamf/api/json_objects/prestage_assignment.rb +0 -76
- data/lib/jamf/api/json_objects/prestage_location.rb +0 -104
- data/lib/jamf/api/json_objects/prestage_purchasing_data.rb +0 -132
- data/lib/jamf/api/json_objects/prestage_scope.rb +0 -57
- data/lib/jamf/api/json_objects/time_zone.rb +0 -105
- data/lib/jamf/api/mixins/change_log.rb +0 -288
- data/lib/jamf/api/mixins/extendable.rb +0 -75
- data/lib/jamf/api/mixins/pageable.rb +0 -208
- data/lib/jamf/api/mixins/searchable.rb +0 -202
- data/lib/jamf/api/resources/collection_resources/building.rb +0 -121
- data/lib/jamf/api/resources/collection_resources/category.rb +0 -83
- data/lib/jamf/api/resources/collection_resources/computer_prestage.rb +0 -89
- data/lib/jamf/api/resources/collection_resources/department.rb +0 -78
- data/lib/jamf/api/resources/collection_resources/device_enrollment.rb +0 -384
- data/lib/jamf/api/resources/collection_resources/inventory_preload_record.rb +0 -289
- data/lib/jamf/api/resources/collection_resources/mobile_device_prestage.rb +0 -143
- data/lib/jamf/api/resources/collection_resources/script.rb +0 -226
- data/lib/jamf/api/resources/singleton_resources/app_store_country_codes.rb +0 -141
- data/lib/jamf/api/resources/singleton_resources/locales.rb +0 -155
- data/lib/jamf/api/resources/singleton_resources/time_zones.rb +0 -213
- data/lib/jamf/compatibility.rb +0 -88
- data/lib/jamf/ruby_extensions/dig.rb +0 -52
- data/lib/jamf/ruby_extensions/string/backports.rb +0 -66
- data/lib/jss/api_connection.rb +0 -1029
- data/lib/jss/api_object/app_store_country_codes.rb +0 -298
- data/lib/jss/api_object/computer/application_installs.rb +0 -118
- data/lib/jss/client/jamf_binary.rb +0 -132
- data/lib/jss/client/jamf_helper.rb +0 -298
- data/lib/jss/client/management_action.rb +0 -113
- data/lib/jss/client.rb +0 -301
- data/lib/jss/compatibility.rb +0 -88
- data/lib/jss/composer.rb +0 -190
- data/lib/jss/configuration.rb +0 -319
- data/lib/jss/exceptions.rb +0 -115
- data/lib/jss/ruby_extensions/array.rb +0 -52
- data/lib/jss/ruby_extensions/hash.rb +0 -140
- data/lib/jss/ruby_extensions/ipaddr.rb +0 -92
- data/lib/jss/ruby_extensions/object.rb +0 -19
- data/lib/jss/ruby_extensions/pathname.rb +0 -78
- data/lib/jss/ruby_extensions/string/backports.rb +0 -68
- data/lib/jss/ruby_extensions/string/conversions.rb +0 -69
- data/lib/jss/ruby_extensions/string/predicates.rb +0 -57
- data/lib/jss/server.rb +0 -146
- data/lib/jss/utility.rb +0 -672
- data/lib/jss/validate.rb +0 -248
- data/test/README.md +0 -147
- data/test/lib/testhelper/auth.rb +0 -275
- data/test/lib/testhelper/patch_mgmt.rb +0 -123
- data/test/specs/api_connection_spec.rb +0 -57
- data/test/specs/patch01_source_spec.rb +0 -54
- data/test/specs/patch02_internal_source_spec.rb +0 -88
- data/test/specs/patch03_external_source_spec.rb +0 -120
- data/test/specs/patch04_titles_spec.rb +0 -207
- data/test/specs/patch05_policies_spec.rb +0 -119
- data/test/specs/patch06_cleanup_spec.rb +0 -52
- data/test/specs/policy_spec.rb +0 -112
data/lib/jamf/api/connection.rb
CHANGED
|
@@ -1,525 +1,212 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
### Copyright 2022 Pixar
|
|
2
|
+
###
|
|
3
|
+
### Licensed under the Apache License, Version 2.0 (the "Apache License")
|
|
4
|
+
### with the following modification; you may not use this file except in
|
|
5
|
+
### compliance with the Apache License and the following modification to it:
|
|
6
|
+
### Section 6. Trademarks. is deleted and replaced with:
|
|
7
|
+
###
|
|
8
|
+
### 6. Trademarks. This License does not grant permission to use the trade
|
|
9
|
+
### names, trademarks, service marks, or product names of the Licensor
|
|
10
|
+
### and its affiliates, except as required to comply with Section 4(c) of
|
|
11
|
+
### the License and to reproduce the content of the NOTICE file.
|
|
12
|
+
###
|
|
13
|
+
### You may obtain a copy of the Apache License at
|
|
14
|
+
###
|
|
15
|
+
### http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
###
|
|
17
|
+
### Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
### distributed under the Apache License with the above modification is
|
|
19
|
+
### distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
20
|
+
### KIND, either express or implied. See the Apache License for the specific
|
|
21
|
+
### language governing permissions and limitations under the Apache License.
|
|
22
|
+
###
|
|
23
|
+
###
|
|
23
24
|
|
|
24
25
|
require 'faraday' # >= 0.17.0
|
|
25
26
|
require 'faraday_middleware' # >= 0.13.0
|
|
26
27
|
|
|
27
|
-
# The module
|
|
28
|
+
# The main module
|
|
28
29
|
module Jamf
|
|
29
30
|
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
#
|
|
31
|
+
# Instances of this class represent a connection to a Jamf Pro server, using
|
|
32
|
+
# both the Classic and Jamf Pro APIs.
|
|
33
|
+
#
|
|
34
|
+
# For most cases, a single connection to a single JSS is all you need, and
|
|
35
|
+
# ruby-jss automatically creates and uses a default connection. See
|
|
36
|
+
# {JSS.connect}
|
|
37
|
+
#
|
|
38
|
+
# If needed, multiple connection objects can be made and used sequentially or
|
|
39
|
+
# simultaneously.
|
|
40
|
+
#
|
|
41
|
+
# NOTE: Individual connection instances are not thread-safe and should not be
|
|
42
|
+
# shared by multple simultaneous threads (such as with a multi-threaded http
|
|
43
|
+
# server like 'thin') or used for concurrent API access. In those cases, do not
|
|
44
|
+
# use the default connection, but be sure to design your application to create
|
|
45
|
+
# different API connections for each thread, and pass them into method calls as
|
|
46
|
+
# needed
|
|
47
|
+
#
|
|
48
|
+
# == Using the default connection
|
|
49
|
+
#
|
|
50
|
+
# When ruby-jss is loaded, a not-yet-connected default instance of
|
|
51
|
+
# Jamf::Connection is created and available using {JSS.cnx}.
|
|
52
|
+
#
|
|
53
|
+
# This connection is used as the initial default connection so all methods
|
|
54
|
+
# that make API calls will use it by default.
|
|
55
|
+
# For most uses where you're only going to be working with one connection to
|
|
56
|
+
# one JSS, the default connection is all you need.
|
|
57
|
+
#
|
|
58
|
+
# Before using it you must call its {#connect} method, passing in appropriate
|
|
59
|
+
# connection details and credentials.
|
|
60
|
+
#
|
|
61
|
+
# Example:
|
|
62
|
+
#
|
|
63
|
+
# require 'ruby-jss'
|
|
64
|
+
# JSS.cnx.connect host: 'server.address.edu', user: 'jss-api-user', pw: :prompt
|
|
65
|
+
# # (see {Jamf::Connection#connect} for all the connection options)
|
|
66
|
+
#
|
|
67
|
+
# a_phone = Jamf::MobileDevice.fetch id: 8743
|
|
68
|
+
#
|
|
69
|
+
# # the mobile device was fetched through the default connection
|
|
70
|
+
#
|
|
71
|
+
# If needed, you can re-login to the default connection by calling JSS.connect
|
|
72
|
+
# with new connection parameters. You can also call JSS.disconnect to close the
|
|
73
|
+
# connection
|
|
74
|
+
#
|
|
75
|
+
# == Using standalone Connections
|
|
76
|
+
#
|
|
77
|
+
# Sometimes you need to connect simultaneously to more than one JSS.
|
|
78
|
+
# or to the same JSS with different credentials, or you just need multiple
|
|
79
|
+
# concurrent connections for asyncronous, thread-safe use. ruby-jss allows you
|
|
80
|
+
# to create as many connections as needed, and pass them into the methods that
|
|
81
|
+
# communication with the API via the `cnx:` parameter (the older `api:`
|
|
82
|
+
# parameter is deprecated and will eventually not be recognized)
|
|
83
|
+
#
|
|
84
|
+
# Example:
|
|
85
|
+
# my_connection = Jamf::Connection.new(params: go, in: here)
|
|
86
|
+
# a_computer = Jamf::Computer.fetch id: 1234, cnx: my_connection
|
|
87
|
+
#
|
|
88
|
+
# # the Jamf::Computer with id 1234 is fetched from the connection
|
|
89
|
+
# # stored in the variable 'my_connection'. The computer is
|
|
90
|
+
# # then stored in the variable 'a_computer'
|
|
91
|
+
#
|
|
92
|
+
# NOTE:
|
|
93
|
+
# When an obbject is retrieved or created it stores an internal
|
|
94
|
+
# reference to the Connection object that it usdd, and uses that when making
|
|
95
|
+
# future API calls.
|
|
96
|
+
# So in the example above, when saving any changes to a_computer, the Connection
|
|
97
|
+
# object 'my_connection' will (and must) be used.
|
|
98
|
+
#
|
|
99
|
+
# Similiarly, each Connection object maintains its own caches for the data
|
|
100
|
+
# used by the `list` methods (e.g. Jamf::Computer.all, .all_names, and so on)
|
|
101
|
+
#
|
|
102
|
+
# == Making new APIConnection instances
|
|
103
|
+
#
|
|
104
|
+
# New connections can be created using the standard ruby 'new' method.
|
|
105
|
+
#
|
|
106
|
+
# If you provide connection details when calling 'new', they will be passed
|
|
107
|
+
# to the {#connect} method immediately. Otherwise you can call {#connect} later.
|
|
108
|
+
#
|
|
109
|
+
# production_api = Jamf::Connection.new(
|
|
110
|
+
# 'https://produser@prodserver.address.org:8443/'
|
|
111
|
+
# name: 'prod',
|
|
112
|
+
# pw: :prompt
|
|
113
|
+
# )
|
|
114
|
+
#
|
|
115
|
+
# # the new connection is now stored in the variable 'production_api'.
|
|
116
|
+
#
|
|
117
|
+
# == Passing an APIConnection object to API-related methods
|
|
118
|
+
#
|
|
119
|
+
# All methods that use the API can take an 'cnx:' parameter which
|
|
120
|
+
# takes a Connection object. When provided, that connection is
|
|
121
|
+
# used rather than the active connection. The older, deprecated synonym 'api:'
|
|
122
|
+
# will eventually be removed.
|
|
123
|
+
#
|
|
124
|
+
# For example:
|
|
125
|
+
#
|
|
126
|
+
# prod2_computer_sns = Jamf::Computer.all_serial_numbers, cnx: production_api2
|
|
127
|
+
#
|
|
128
|
+
# # the list of all computer serial numbers is read from the connection in
|
|
129
|
+
# # the variable 'production_api2' and stored in 'prod2_computer_sns'
|
|
130
|
+
#
|
|
131
|
+
# prod2_victim_md = Jamf::MobileDevice.fetch id: 832, cnx: production_api2
|
|
132
|
+
#
|
|
133
|
+
# # the variable 'prod2_victim_md' now contains a Jamf::MobileDevice queried
|
|
134
|
+
# # through the connection 'production_api2'.
|
|
135
|
+
#
|
|
136
|
+
# == Low-level use of Connection instances.
|
|
137
|
+
#
|
|
138
|
+
# For most cases, using Connection instances as mentioned above
|
|
139
|
+
# is all you'll need. However to access API resources that aren't yet
|
|
140
|
+
# implemented in other parts of ruby-jss, you can use the methods
|
|
141
|
+
# {#c_get}, {#c_put}, {#c_post}, {#c_delete} for accessing the Classic API
|
|
142
|
+
# and {#jp_get}, {#jp_post}, {#jp_put}, {#jp_patch}, {#jp_delete} for
|
|
143
|
+
# accessing the Jamf Pro API
|
|
144
|
+
#
|
|
145
|
+
# For even lower-level work, you can access the underlying Faraday::Connection
|
|
146
|
+
# objects via the connection's {#c_cnx} and {#jp_cnx}
|
|
147
|
+
# attributes.
|
|
148
|
+
#
|
|
38
149
|
#
|
|
39
150
|
class Connection
|
|
40
151
|
|
|
41
|
-
#
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
HTTPS_SCHEME = 'https'.freeze
|
|
51
|
-
|
|
52
|
-
# The https default SSL port, default for Jamf Cloud servers
|
|
53
|
-
HTTPS_SSL_PORT = 443
|
|
54
|
-
|
|
55
|
-
# The Jamf default SSL port, default for on-prem servers
|
|
56
|
-
ON_PREM_SSL_PORT = 8443
|
|
57
|
-
|
|
58
|
-
# if either of these is specified, we'll default to SSL
|
|
59
|
-
SSL_PORTS = [ON_PREM_SSL_PORT, HTTPS_SSL_PORT].freeze
|
|
60
|
-
|
|
61
|
-
# Recognize Jamf Cloud servers
|
|
62
|
-
JAMFCLOUD_DOMAIN = '.jamfcloud.com'.freeze
|
|
63
|
-
|
|
64
|
-
# JamfCloud connections default to 443, not 8443
|
|
65
|
-
JAMFCLOUD_PORT = HTTPS_SSL_PORT
|
|
66
|
-
|
|
67
|
-
# Default open-connection timeout in seconds
|
|
68
|
-
DFT_OPEN_TIMEOUT = 60
|
|
69
|
-
|
|
70
|
-
# Default response timeout in seconds
|
|
71
|
-
DFT_TIMEOUT = 60
|
|
72
|
-
|
|
73
|
-
# The Default SSL Version
|
|
74
|
-
DFT_SSL_VERSION = 'TLSv1_2'.freeze
|
|
75
|
-
|
|
76
|
-
# refresh token if less than this many seconds until
|
|
77
|
-
# expiration. Default is 5 minutes if not specified
|
|
78
|
-
DFT_TOKEN_REFRESH = 300
|
|
79
|
-
|
|
80
|
-
# pre-existing tokens must have this many seconds before
|
|
81
|
-
# before they expire
|
|
82
|
-
TOKEN_REUSE_MIN_LIFE = 60
|
|
83
|
-
|
|
84
|
-
HTTP_ACCEPT_HEADER = 'Accept'.freeze
|
|
85
|
-
|
|
86
|
-
HTTP_CONTENT_TYPE_HEADER = 'Content-Type'.freeze
|
|
87
|
-
|
|
88
|
-
MIME_JSON = 'application/json'.freeze
|
|
89
|
-
|
|
90
|
-
SLASH = '/'.freeze
|
|
91
|
-
|
|
92
|
-
VALID_URL_REGEX = /\A#{URI.regexp(%w[https])}\z/.freeze
|
|
93
|
-
|
|
94
|
-
NOT_CONNECTED = 'Not Connected'.freeze
|
|
95
|
-
|
|
96
|
-
# Only these variables are displayed with PrettyPrint
|
|
97
|
-
# This avoids, especially, the caches, which are available
|
|
98
|
-
# as attr_readers
|
|
99
|
-
PP_VARS = %i[
|
|
100
|
-
@name
|
|
101
|
-
@connected
|
|
102
|
-
@host
|
|
103
|
-
@port
|
|
104
|
-
@user
|
|
105
|
-
@base_url
|
|
106
|
-
@ssl_options
|
|
107
|
-
@open_timeout
|
|
108
|
-
@timeout
|
|
109
|
-
@login_time
|
|
110
|
-
@keep_alive
|
|
111
|
-
@token_refresh
|
|
112
|
-
@pw_fallback
|
|
113
|
-
].freeze
|
|
114
|
-
|
|
115
|
-
# Attributes
|
|
116
|
-
#####################################
|
|
117
|
-
|
|
118
|
-
# @return [String, nil]
|
|
119
|
-
attr_reader :name
|
|
120
|
-
|
|
121
|
-
# @return [String, nil]
|
|
122
|
-
attr_reader :host
|
|
123
|
-
|
|
124
|
-
# @return [Integer, nil]
|
|
125
|
-
attr_reader :port
|
|
126
|
-
|
|
127
|
-
# @return [String, nil]
|
|
128
|
-
attr_reader :user
|
|
129
|
-
|
|
130
|
-
# @return [Integer, nil]
|
|
131
|
-
attr_reader :timeout
|
|
132
|
-
|
|
133
|
-
# @return [Jamf::Connection::Token, nil]
|
|
134
|
-
attr_reader :token
|
|
135
|
-
|
|
136
|
-
# @return [Integer] Refresh the token this many seconds before it expires
|
|
137
|
-
attr_reader :token_refresh
|
|
138
|
-
|
|
139
|
-
# @return [String, nil]
|
|
140
|
-
attr_reader :base_url
|
|
141
|
-
|
|
142
|
-
# @return [Boolean] if token refresh/keepaliave fails, try to get a new one
|
|
143
|
-
# with the passwd used with .connect. Defaults to true
|
|
144
|
-
attr_reader :pw_fallback
|
|
145
|
-
|
|
146
|
-
# @return [Boolean]
|
|
147
|
-
attr_reader :connected
|
|
148
|
-
alias connected? connected
|
|
149
|
-
|
|
150
|
-
# @return [RestClient::Resource] the underlying rest resource
|
|
151
|
-
attr_reader :rest_cnx
|
|
152
|
-
|
|
153
|
-
# when was this connection logged in?
|
|
154
|
-
attr_reader :login_time
|
|
155
|
-
|
|
156
|
-
# @return [Hash]
|
|
157
|
-
# This Hash holds the most recently fetched instance of a SingletonResource
|
|
158
|
-
# subclass, keyed by the subclass itself.
|
|
159
|
-
#
|
|
160
|
-
# SingletonResource.fetch will return the instance from here, if it exists,
|
|
161
|
-
# unless the first parameter is truthy.
|
|
162
|
-
attr_reader :singleton_cache
|
|
163
|
-
|
|
164
|
-
# @return [Hash]
|
|
165
|
-
# This Hash holds the most recent API data (an Array of Hashes) for the list
|
|
166
|
-
# of all items in a CollectionResource subclass, keyed by the subclass itself.
|
|
167
|
-
#
|
|
168
|
-
# CollectionResource.all return the appropriate data from here, if it exists,
|
|
169
|
-
#
|
|
170
|
-
# See the CollectionResource.all class method.
|
|
171
|
-
attr_reader :collection_cache
|
|
172
|
-
|
|
173
|
-
# @return [Hash]
|
|
174
|
-
# This hash holds ExtensionAttribute instances, which are used
|
|
175
|
-
# for validating values passed to Extendable.set_ext_attr.
|
|
176
|
-
attr_reader :ext_attr_cache
|
|
177
|
-
|
|
178
|
-
# @return [Faraday::Response] The response object from the last API access.
|
|
179
|
-
attr_reader :last_http_response
|
|
152
|
+
# the code for this class is broken into multiple files
|
|
153
|
+
# as modules, to play will with the zeitwerk loader
|
|
154
|
+
include Jamf::Connection::Constants
|
|
155
|
+
include Jamf::Connection::Attributes
|
|
156
|
+
include Jamf::Connection::Cache
|
|
157
|
+
include Jamf::Connection::Connect
|
|
158
|
+
include Jamf::Connection::ClassicAPI
|
|
159
|
+
include Jamf::Connection::JamfProAPI
|
|
180
160
|
|
|
181
161
|
# Constructor
|
|
182
162
|
#####################################
|
|
183
163
|
|
|
184
|
-
#
|
|
185
|
-
def initialize(url = nil, **params)
|
|
186
|
-
@name = params.delete :name
|
|
187
|
-
@name ||= NOT_CONNECTED
|
|
188
|
-
|
|
189
|
-
@singleton_cache = {}
|
|
190
|
-
@collection_cache = {}
|
|
191
|
-
@ext_attr_cache = {}
|
|
192
|
-
|
|
193
|
-
connect(url, params) unless params[:do_not_connect]
|
|
194
|
-
end
|
|
195
|
-
|
|
196
|
-
# Public Instance Methods
|
|
197
|
-
#####################################
|
|
198
|
-
|
|
199
|
-
# Connect this Connection object to an Jamf Pro API
|
|
200
|
-
#
|
|
201
|
-
# The first parameter may be a URL (must be https) from which
|
|
202
|
-
# the host & port will be used, and if present, the user and password
|
|
203
|
-
# E.g.
|
|
204
|
-
# connect 'https://myuser:pass@host.domain.edu:8443'
|
|
205
|
-
#
|
|
206
|
-
# which is the same as:
|
|
207
|
-
# connect host: 'host.domain.edu', port: 8443, user: 'myuser', pw: 'pass'
|
|
208
|
-
#
|
|
209
|
-
# When using a URL, other parameters below may be specified, however
|
|
210
|
-
# host: and port: parameters will be ignored, since they came from the URL,
|
|
211
|
-
# as will user: and :pw, if they are present in the URL. If the URL doesn't
|
|
212
|
-
# contain user and pw, they can be provided via the parameters, or left
|
|
213
|
-
# to default values.
|
|
214
|
-
#
|
|
215
|
-
# ### Passwords
|
|
216
|
-
# The pw: parameter also accepts the symbols :prompt, and :stdin[X]
|
|
217
|
-
#
|
|
218
|
-
# If :prompt, the user is promted on the commandline to enter the password
|
|
219
|
-
# for the :user.
|
|
220
|
-
#
|
|
221
|
-
# If :stdin the password is read from the first line of stdin
|
|
222
|
-
#
|
|
223
|
-
# If :stdinX (where X is an integer) the password is read from the Xth
|
|
224
|
-
# line of stdin.see {Jamf.stdin}
|
|
225
|
-
#
|
|
226
|
-
# If omitted, and running from an interactive terminal, the user is
|
|
227
|
-
# prompted as with :prompt
|
|
228
|
-
#
|
|
229
|
-
# ### Tokens
|
|
230
|
-
# Instead of a user and password, you may specify a valid 'token:', either:
|
|
231
|
-
#
|
|
232
|
-
# A Jamf::Connection::Token object, which can be extracted from an active
|
|
233
|
-
# Jamf::Connection via its #token method
|
|
234
|
-
#
|
|
235
|
-
# or
|
|
236
|
-
#
|
|
237
|
-
# A token string e.g. "eyJhdXR...6EKoo" from any source can also be used.
|
|
238
|
-
#
|
|
239
|
-
# Any values available via Jamf.config will be used if they are not provided
|
|
240
|
-
# in the parameters.
|
|
241
|
-
#
|
|
242
|
-
# @param host: [String] The API server hostname. The param 'server:' is a
|
|
243
|
-
# synonym
|
|
244
|
-
#
|
|
245
|
-
# @param port: [Integer] The API server port. If omitted, the value from
|
|
246
|
-
# Jamf.config will be used. If no config value, defaults to 443 if the
|
|
247
|
-
# host ends with 'jamfcloud.com' or 8443 otherwise
|
|
248
|
-
#
|
|
249
|
-
# @param user: [String] The username for the API connection
|
|
250
|
-
#
|
|
251
|
-
# @param pw: [String, Symbol] The password for the user, :prompt, or :stdin[X]
|
|
164
|
+
# Instantiate a connection object.
|
|
252
165
|
#
|
|
253
|
-
#
|
|
254
|
-
# When used, there's no need to provide user: or pw:.
|
|
255
|
-
# NOTE if using pw_fallback:true (the default) while providing a token
|
|
256
|
-
# you will also need to provide the password for the token user in the pw:
|
|
257
|
-
# parameter, or be prompted for it. If you don't have the pw for the
|
|
258
|
-
# token user, be sure to set pw_fallback to false.
|
|
166
|
+
# If name: is provided it will be stored as the Connection's name attribute.
|
|
259
167
|
#
|
|
260
|
-
#
|
|
261
|
-
#
|
|
168
|
+
# if no url is provided and params are empty, or contains only
|
|
169
|
+
# a :name key, then you must call #connect with all the connection
|
|
170
|
+
# parameters before accessing a server.
|
|
262
171
|
#
|
|
263
|
-
#
|
|
264
|
-
# to refresh the token if regular refresh doesn't work (e.g. token is expired).
|
|
265
|
-
# NOTE: This causes the password to be kept in memory. If you don't want
|
|
266
|
-
# this, explicitly set pw_fallback to false, however long-running processes
|
|
267
|
-
# may lose connection if token refresh fails for any reason.
|
|
172
|
+
# See {#connect} for the parameters
|
|
268
173
|
#
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
#
|
|
272
|
-
# @param timeout: [Integer] The number of seconds for a full response from
|
|
273
|
-
# the host.
|
|
274
|
-
#
|
|
275
|
-
# @param ssl_version: [Symbol] The SSL version, e.g. :TLSv1_2
|
|
276
|
-
#
|
|
277
|
-
# @param verify_cert: [Boolean] Should the SSL certificate be verified?
|
|
278
|
-
# Default is true, should only be set to false if using a on-prem
|
|
279
|
-
# server with a self-signed certificate, which is rare
|
|
280
|
-
#
|
|
281
|
-
def connect(url = nil, **params)
|
|
282
|
-
# This sets all the instance vars to nil, and flushes/creates the caches
|
|
283
|
-
disconnect
|
|
284
|
-
|
|
285
|
-
# If there's a Token object in :token, this sets @token,
|
|
286
|
-
# and adds host, port, user from that token
|
|
287
|
-
parse_token params
|
|
288
|
-
|
|
289
|
-
# Get host, port, user and pw from a URL, add to params if needed
|
|
290
|
-
parse_url url, params
|
|
291
|
-
|
|
292
|
-
# apply defaults from config, client, and then this class.
|
|
293
|
-
apply_connection_defaults params
|
|
294
|
-
|
|
295
|
-
# Once we're here, all params have been parsed & defaulted into the
|
|
296
|
-
# params hash, so
|
|
297
|
-
# make sure we have the minimum needed params for a connection
|
|
298
|
-
verify_basic_params params
|
|
299
|
-
|
|
300
|
-
# turn the params into instance vars
|
|
301
|
-
parse_connect_params params
|
|
302
|
-
|
|
303
|
-
# if no @token already, get one from from
|
|
304
|
-
# either a token string or a pw
|
|
305
|
-
unless @token
|
|
306
|
-
if params[:token].is_a? String
|
|
307
|
-
@token = token_from :token_string, params[:token]
|
|
308
|
-
# get the user from the token
|
|
309
|
-
@user = @toke.user
|
|
310
|
-
# if @pw_fallback, the pw must be acquired, since it isn't in
|
|
311
|
-
# the token
|
|
312
|
-
@pw = acquire_password(params[:pw]) if @pw_fallback
|
|
313
|
-
else
|
|
314
|
-
pw = acquire_password(params[:pw])
|
|
315
|
-
@token = token_from :pw, pw
|
|
316
|
-
@pw = pw if @pw_fallback
|
|
317
|
-
end
|
|
318
|
-
end
|
|
319
|
-
|
|
320
|
-
# Now get some values from our token
|
|
321
|
-
@base_url = @token.base_url
|
|
322
|
-
@login_time = @token.login_time
|
|
323
|
-
|
|
324
|
-
# and make our actual connection
|
|
325
|
-
@rest_cnx = create_connection
|
|
326
|
-
|
|
327
|
-
# make sure versions are good
|
|
328
|
-
validate_jamf_version
|
|
329
|
-
|
|
330
|
-
@connected = true
|
|
331
|
-
|
|
332
|
-
# start keepalive if needed
|
|
333
|
-
start_keep_alive if @keep_alive
|
|
334
|
-
|
|
335
|
-
# return our string output
|
|
336
|
-
to_s
|
|
337
|
-
end # connect
|
|
338
|
-
|
|
339
|
-
# reset all values to nil or empty
|
|
340
|
-
def disconnect
|
|
174
|
+
def initialize(url = nil, **params)
|
|
175
|
+
@name = params.delete :name
|
|
341
176
|
@connected = false
|
|
342
|
-
@name = NOT_CONNECTED
|
|
343
|
-
@login_time = nil
|
|
344
|
-
|
|
345
|
-
stop_keep_alive
|
|
346
|
-
|
|
347
|
-
@host = nil
|
|
348
|
-
@port = nil
|
|
349
|
-
@user = nil
|
|
350
|
-
@timeout = nil
|
|
351
|
-
@open_timeout = nil
|
|
352
|
-
@base_url = nil
|
|
353
|
-
@token = nil
|
|
354
|
-
@rest_cnx = nil
|
|
355
|
-
@ssl_options = {}
|
|
356
|
-
@keep_alive = nil
|
|
357
|
-
@token_refresh = nil
|
|
358
|
-
@pw_fallback = nil
|
|
359
|
-
@pw = nil
|
|
360
|
-
|
|
361
|
-
flushcache
|
|
362
|
-
end
|
|
363
|
-
|
|
364
|
-
# Same as disconnect, but invalidates the token on the server first
|
|
365
|
-
def logout
|
|
366
|
-
@token.destroy
|
|
367
|
-
disconnect
|
|
368
|
-
end
|
|
369
|
-
|
|
370
|
-
# Get a resource
|
|
371
|
-
def get(rsrc)
|
|
372
|
-
validate_connected
|
|
373
|
-
resp = @rest_cnx.get rsrc
|
|
374
|
-
@last_http_response = resp
|
|
375
|
-
return resp.body if resp.success?
|
|
376
|
-
|
|
377
|
-
raise Jamf::Connection::APIError, resp
|
|
378
|
-
end
|
|
379
|
-
|
|
380
|
-
# GET a rsrc without doing any JSON parsing, using
|
|
381
|
-
# a temporary Faraday connection object
|
|
382
|
-
def download(rsrc)
|
|
383
|
-
temp_cnx = create_connection(false)
|
|
384
|
-
resp = temp_cnx.get rsrc
|
|
385
|
-
@last_http_response = resp
|
|
386
|
-
return resp.body if resp.success?
|
|
387
|
-
|
|
388
|
-
raise Jamf::Connection::APIError, resp
|
|
389
|
-
end
|
|
390
|
-
|
|
391
|
-
def post(rsrc, data)
|
|
392
|
-
validate_connected
|
|
393
|
-
resp = @rest_cnx.post(rsrc) do |req|
|
|
394
|
-
req.body = data
|
|
395
|
-
end
|
|
396
|
-
@last_http_response = resp
|
|
397
|
-
return resp.body if resp.success?
|
|
398
177
|
|
|
399
|
-
|
|
400
|
-
|
|
178
|
+
# initialize the data caches
|
|
179
|
+
# see cache.rb
|
|
180
|
+
@c_object_list_cache = {}
|
|
181
|
+
@c_ext_attr_definition_cache = {}
|
|
182
|
+
# @jp_singleton_cache = {}
|
|
183
|
+
# @jp_collection_cache = {}
|
|
184
|
+
# @jp_ext_attr_cache = {}
|
|
401
185
|
|
|
402
|
-
|
|
403
|
-
validate_connected
|
|
404
|
-
resp = @rest_cnx.put(rsrc) do |req|
|
|
405
|
-
req.body = data
|
|
406
|
-
end
|
|
407
|
-
@last_http_response = resp
|
|
408
|
-
return resp.body if resp.success?
|
|
409
|
-
|
|
410
|
-
raise Jamf::Connection::APIError, resp
|
|
411
|
-
end
|
|
412
|
-
|
|
413
|
-
def patch(rsrc, data)
|
|
414
|
-
validate_connected
|
|
415
|
-
resp = @rest_cnx.patch(rsrc) do |req|
|
|
416
|
-
req.body = data
|
|
417
|
-
end
|
|
418
|
-
@last_http_response = resp
|
|
419
|
-
return resp.body if resp.success?
|
|
420
|
-
|
|
421
|
-
raise Jamf::Connection::APIError, resp
|
|
422
|
-
end
|
|
186
|
+
return if url.nil? && params.empty?
|
|
423
187
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
resp = @rest_cnx.delete rsrc
|
|
427
|
-
@last_http_response = resp
|
|
428
|
-
return resp.body if resp.success?
|
|
188
|
+
connect url, **params
|
|
189
|
+
end # init
|
|
429
190
|
|
|
430
|
-
|
|
431
|
-
|
|
191
|
+
# Instance methods
|
|
192
|
+
#####################################
|
|
432
193
|
|
|
433
194
|
# A useful string about this connection
|
|
434
195
|
#
|
|
435
196
|
# @return [String]
|
|
436
197
|
#
|
|
437
198
|
def to_s
|
|
438
|
-
|
|
439
|
-
if connected?
|
|
440
|
-
"#{@base_url}, Token expires: #{@token ? @token.expires : '<token missing>'}"
|
|
441
|
-
else
|
|
442
|
-
NOT_CONNECTED
|
|
443
|
-
end
|
|
444
|
-
"Jamf::Connection '#{@name == NOT_CONNECTED ? object_id : @name}': #{str}"
|
|
445
|
-
end
|
|
446
|
-
|
|
447
|
-
# Reset the name
|
|
448
|
-
def name=(new_name)
|
|
449
|
-
@name = new_name.to_s
|
|
450
|
-
end
|
|
451
|
-
|
|
452
|
-
# Are we keeping the connection alive?
|
|
453
|
-
def keep_alive?
|
|
454
|
-
return false unless @keep_alive_thread
|
|
455
|
-
|
|
456
|
-
@keep_alive_thread.alive?
|
|
457
|
-
end
|
|
458
|
-
|
|
459
|
-
# @return [Jamf::Timestamp, nil]
|
|
460
|
-
def next_refresh
|
|
461
|
-
return unless keep_alive?
|
|
462
|
-
|
|
463
|
-
@token.expires - @token_refresh
|
|
464
|
-
end
|
|
465
|
-
|
|
466
|
-
# @return [Float, nil]
|
|
467
|
-
def secs_to_refresh
|
|
468
|
-
return unless keep_alive?
|
|
469
|
-
|
|
470
|
-
next_refresh - Time.now
|
|
471
|
-
end
|
|
472
|
-
|
|
473
|
-
# @return [String, nil] e.g. "1 week 6 days 23 hours 49 minutes 56 seconds"
|
|
474
|
-
def time_to_refresh
|
|
475
|
-
return unless keep_alive?
|
|
476
|
-
return 0 if secs_to_refresh.negative?
|
|
477
|
-
|
|
478
|
-
Jamf.humanize_secs secs_to_refresh
|
|
479
|
-
end
|
|
480
|
-
|
|
481
|
-
# Turn keepalive on or offs
|
|
482
|
-
def keep_alive=(bool)
|
|
483
|
-
bool ? start_keep_alive : stop_keep_alive
|
|
484
|
-
end
|
|
485
|
-
|
|
486
|
-
# This should take effect even if we're already running the keep_alive thread
|
|
487
|
-
#
|
|
488
|
-
def token_refresh=(secs)
|
|
489
|
-
raise ArgumentError, 'Value must be an Integer number of seconds' unless secs.is_a? Integer
|
|
490
|
-
|
|
491
|
-
@token_refresh = secs
|
|
492
|
-
end
|
|
493
|
-
|
|
494
|
-
def jamf_version
|
|
495
|
-
@token.jamf_version
|
|
496
|
-
end
|
|
497
|
-
|
|
498
|
-
def jamf_build
|
|
499
|
-
@token.jamf_build
|
|
500
|
-
end
|
|
199
|
+
return 'not connected' unless connected?
|
|
501
200
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
# @param klass[Class] the class of cache to flush
|
|
505
|
-
#
|
|
506
|
-
# @return [void]
|
|
507
|
-
#
|
|
508
|
-
def flushcache(klass = nil)
|
|
509
|
-
if klass
|
|
510
|
-
@collection_cache.delete klass
|
|
511
|
-
@singleton_cache.delete klass
|
|
512
|
-
@ext_attr_cache.delete klass
|
|
201
|
+
if name.to_s.start_with? "#{user}@"
|
|
202
|
+
name
|
|
513
203
|
else
|
|
514
|
-
|
|
515
|
-
@singleton_cache = {}
|
|
516
|
-
@ext_attr_cache = {}
|
|
204
|
+
"#{user}@#{host}:#{port}, name: #{name}"
|
|
517
205
|
end
|
|
518
206
|
end
|
|
519
207
|
|
|
520
|
-
#
|
|
521
|
-
#
|
|
522
|
-
# pretty-print (pp) output.
|
|
208
|
+
# Only selected items are displayed with prettyprint
|
|
209
|
+
# otherwise its too much data in irb.
|
|
523
210
|
#
|
|
524
211
|
# @return [Array] the desired instance_variables
|
|
525
212
|
#
|
|
@@ -527,341 +214,25 @@ module Jamf
|
|
|
527
214
|
PP_VARS
|
|
528
215
|
end
|
|
529
216
|
|
|
530
|
-
#
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
# raise exception if not connected
|
|
535
|
-
def validate_connected
|
|
536
|
-
raise Jamf::InvalidConnectionError, 'Not Connected. Use .connect first.' unless connected?
|
|
537
|
-
end
|
|
538
|
-
|
|
539
|
-
# raise exception if API version is too low.
|
|
540
|
-
def validate_jamf_version
|
|
541
|
-
vers = jamf_version
|
|
542
|
-
return if Gem::Version.new(vers) >= MIN_JAMF_VERSION
|
|
543
|
-
|
|
544
|
-
raise Jamf::InvalidConnectionError, "API version '#{vers}' too low, must be >= '#{MIN_JAMF_VERSION}'"
|
|
545
|
-
end
|
|
546
|
-
|
|
547
|
-
##### Parse Params
|
|
548
|
-
###################################
|
|
549
|
-
|
|
550
|
-
# Get host, port, & user from a Token object
|
|
551
|
-
# or just the user from a token string.
|
|
552
|
-
def parse_token(params)
|
|
553
|
-
return unless params[:token].is_a? self.class::Token
|
|
554
|
-
|
|
555
|
-
verify_token params[:token]
|
|
556
|
-
@token = params[:token]
|
|
557
|
-
params[:host] = @token.host
|
|
558
|
-
params[:port] = @token.port
|
|
559
|
-
params[:user] = @token.user
|
|
560
|
-
end
|
|
561
|
-
|
|
562
|
-
# Raise execeptions if we were given an unusable token object
|
|
563
|
-
#
|
|
564
|
-
# @param params[Hash] The params for #connect
|
|
565
|
-
#
|
|
566
|
-
# @return [void]
|
|
567
|
-
#
|
|
568
|
-
def verify_token(token)
|
|
569
|
-
raise 'Cannot use token: it has expired' if token.expired?
|
|
570
|
-
raise 'Cannot use token: it is invalid' unless token.valid?
|
|
571
|
-
raise "Cannot use token: it expires in less than #{TOKEN_REUSE_MIN_LIFE} seconds" if token.secs_remaining < TOKEN_REUSE_MIN_LIFE
|
|
572
|
-
end
|
|
573
|
-
|
|
574
|
-
# Get host, port, user and pw from a URL, overriding any already in the params
|
|
575
|
-
#
|
|
576
|
-
# @return [String, nil] the pw if present
|
|
577
|
-
#
|
|
578
|
-
def parse_url(url, params)
|
|
579
|
-
return unless url
|
|
580
|
-
|
|
581
|
-
url = URI.parse url.to_s
|
|
582
|
-
raise ArgumentError, 'Invalid url, scheme must be https' unless url.scheme == HTTPS_SCHEME
|
|
583
|
-
|
|
584
|
-
params[:host] = url.host
|
|
585
|
-
params[:port] = url.port
|
|
586
|
-
params[:user] = url.user if url.user
|
|
587
|
-
params[:pw] = url.password if url.password
|
|
588
|
-
end
|
|
589
|
-
|
|
590
|
-
# Apply defaults to the unset params for the #connect method
|
|
591
|
-
# First apply them from from the Jamf.config,
|
|
592
|
-
# then from the Jamf::Client (read from the jamf binary config),
|
|
593
|
-
# then from the Jamf module defaults
|
|
594
|
-
#
|
|
595
|
-
# @param params[Hash] The params for #connect
|
|
596
|
-
#
|
|
597
|
-
# @return [Hash] The params with defaults applied
|
|
598
|
-
#
|
|
599
|
-
def apply_connection_defaults(params)
|
|
600
|
-
# must have a host, but accept legacy :server as well as :host
|
|
601
|
-
params[:host] ||= params[:server]
|
|
602
|
-
|
|
603
|
-
# if we have no port set by this point, set to cloud port
|
|
604
|
-
# if host is a cloud host. But leave port nil for other hosts
|
|
605
|
-
# (will be set via client defaults or module defaults)
|
|
606
|
-
params[:port] ||= JAMFCLOUD_PORT if params[:host].to_s.end_with?(JAMFCLOUD_DOMAIN)
|
|
607
|
-
|
|
608
|
-
apply_defaults_from_config(params)
|
|
609
|
-
|
|
610
|
-
# TODO: when clients are moved over to Jamf module
|
|
611
|
-
# apply_defaults_from_client(params)
|
|
612
|
-
|
|
613
|
-
apply_module_defaults(params)
|
|
614
|
-
end
|
|
615
|
-
|
|
616
|
-
# Apply defaults from the Jamf.config
|
|
617
|
-
# to the params for the #connect method
|
|
618
|
-
#
|
|
619
|
-
# @param params[Hash] The params for #connect
|
|
620
|
-
#
|
|
621
|
-
# @return [Hash] The params with defaults applied
|
|
622
|
-
#
|
|
623
|
-
def apply_defaults_from_config(params)
|
|
624
|
-
# settings from config if they aren't in the params
|
|
625
|
-
params[:host] ||= Jamf.config.api_server_name
|
|
626
|
-
params[:port] ||= Jamf.config.api_server_port
|
|
627
|
-
params[:user] ||= Jamf.config.api_username
|
|
628
|
-
params[:timeout] ||= Jamf.config.api_timeout
|
|
629
|
-
params[:open_timeout] ||= Jamf.config.api_timeout_open
|
|
630
|
-
params[:ssl_version] ||= Jamf.config.api_ssl_version
|
|
631
|
-
|
|
632
|
-
# if verify cert was not in the params, get it from the prefs.
|
|
633
|
-
# We can't use ||= because the desired value might be 'false'
|
|
634
|
-
params[:verify_cert] = Jamf.config.api_verify_cert if params[:verify_cert].nil?
|
|
635
|
-
end # apply_defaults_from_config
|
|
636
|
-
|
|
637
|
-
# Apply defaults from the Jamf::Client
|
|
638
|
-
# to the params for the #connect method
|
|
639
|
-
#
|
|
640
|
-
# @param params[Hash] The params for #connect
|
|
641
|
-
#
|
|
642
|
-
# @return [Hash] The params with defaults applied
|
|
643
|
-
#
|
|
644
|
-
def apply_defaults_from_client(params)
|
|
645
|
-
return unless Jamf::Client.installed?
|
|
646
|
-
|
|
647
|
-
# these settings can come from the jamf binary config,
|
|
648
|
-
# if this machine is a Jamf client.
|
|
649
|
-
params[:host] ||= Jamf::Client.jss_server
|
|
650
|
-
params[:port] ||= Jamf::Client.jss_port.to_i
|
|
651
|
-
end
|
|
652
|
-
|
|
653
|
-
# Apply the module defaults to the params for the #connect method
|
|
654
|
-
#
|
|
655
|
-
# @param params[Hash] The params for #connect
|
|
656
|
-
#
|
|
657
|
-
# @return [Hash] The params with defaults applied
|
|
658
|
-
#
|
|
659
|
-
def apply_module_defaults(params)
|
|
660
|
-
# if we have no port set by this point, assume on-prem.
|
|
661
|
-
params[:port] ||= ON_PREM_SSL_PORT
|
|
662
|
-
params[:timeout] ||= DFT_TIMEOUT
|
|
663
|
-
params[:open_timeout] ||= DFT_OPEN_TIMEOUT
|
|
664
|
-
params[:ssl_version] ||= DFT_SSL_VERSION
|
|
665
|
-
params[:token_refresh] ||= DFT_TOKEN_REFRESH
|
|
666
|
-
# if we have a TTY, pw defaults to :prompt
|
|
667
|
-
params[:pw] ||= :prompt if STDIN.tty?
|
|
668
|
-
end
|
|
669
|
-
|
|
670
|
-
# Raise execeptions if we don't have essential data for a new connection
|
|
671
|
-
# namely a host, user, and pw
|
|
672
|
-
# @param params[Hash] The params for #connect
|
|
673
|
-
#
|
|
674
|
-
# @return [void]
|
|
675
|
-
#
|
|
676
|
-
def verify_basic_params(params)
|
|
677
|
-
# if given a Token object, it has host, port, user, and base_url
|
|
678
|
-
# and is already parsed
|
|
679
|
-
return if @token
|
|
680
|
-
|
|
681
|
-
# must have a host
|
|
682
|
-
raise Jamf::MissingDataError, 'No Jamf :host specified, or in configuration.' unless params[:host]
|
|
683
|
-
|
|
684
|
-
# no need for user or pass if using a token string
|
|
685
|
-
return if params[:token].is_a? String
|
|
686
|
-
|
|
687
|
-
# must have user and pw
|
|
688
|
-
raise Jamf::MissingDataError, 'No Jamf :user specified, or in configuration.' unless params[:user]
|
|
689
|
-
raise Jamf::MissingDataError, "No :pw specified for user '#{params[:user]}'" unless params[:pw]
|
|
690
|
-
end
|
|
691
|
-
|
|
692
|
-
# Turn the connection parameters into instance vars
|
|
693
|
-
def parse_connect_params(params)
|
|
694
|
-
@host = params[:host]
|
|
695
|
-
@port = params[:port]
|
|
696
|
-
@user = params[:user]
|
|
697
|
-
|
|
698
|
-
@keep_alive = params[:keep_alive].nil? ? false : params[:keep_alive]
|
|
699
|
-
@pw_fallback = params[:pw_fallback].nil? ? true : params[:pw_fallback]
|
|
700
|
-
@token_refresh = params[:token_refresh].to_i
|
|
701
|
-
|
|
702
|
-
@timeout = params[:timeout]
|
|
703
|
-
@open_timeout = params[:open_timeout]
|
|
704
|
-
|
|
705
|
-
# TEMPORARY ? the tryitout host still uses `uapi` rather than the
|
|
706
|
-
# new `api` for regular servers
|
|
707
|
-
rsrc_base = @host == Token::JAMF_TRYITOUT_HOST ? 'uapi' : RSRC_BASE
|
|
708
|
-
@base_url = URI.parse "https://#{@host}:#{@port}/#{rsrc_base}"
|
|
709
|
-
|
|
710
|
-
# ssl opts for faraday
|
|
711
|
-
# TODO: implement all of faraday's options
|
|
712
|
-
@ssl_options = {
|
|
713
|
-
verify: params[:verify_cert],
|
|
714
|
-
version: params[:ssl_version]
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
@name = "#{@user}@#{@host}:#{@port}" if @name == NOT_CONNECTED
|
|
718
|
-
end
|
|
719
|
-
|
|
720
|
-
# given a token string or a password, get a valid token
|
|
721
|
-
# Token.new will raise an exception if the token string or
|
|
722
|
-
# credentials are invalid
|
|
723
|
-
def token_from(type, data)
|
|
724
|
-
token_params = {
|
|
725
|
-
user: @user,
|
|
726
|
-
base_url: @base_url,
|
|
727
|
-
timeout: @timeout,
|
|
728
|
-
ssl_options: @ssl_options
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
case type
|
|
732
|
-
when :token_string
|
|
733
|
-
token_params[:token_string] = data
|
|
734
|
-
when :pw
|
|
735
|
-
token_params[:pw] = data
|
|
736
|
-
end
|
|
737
|
-
self.class::Token.new token_params
|
|
738
|
-
end
|
|
739
|
-
|
|
740
|
-
# From whatever was given in params[:pw], figure out the password to use
|
|
741
|
-
#
|
|
742
|
-
# @param params[Hash] The params for #connect
|
|
743
|
-
#
|
|
744
|
-
# @return [String] The password for the connection
|
|
745
|
-
#
|
|
746
|
-
def acquire_password(param_pw)
|
|
747
|
-
pw =
|
|
748
|
-
if param_pw == :prompt
|
|
749
|
-
Jamf.prompt_for_password "Enter the password for Jamf user #{@user}@#{@host}:"
|
|
750
|
-
elsif param_pw.is_a?(Symbol) && param_pw.to_s.start_with?('stdin')
|
|
751
|
-
param_pw.to_s =~ /^stdin(\d+)$/
|
|
752
|
-
line = Regexp.last_match(1)
|
|
753
|
-
line ||= 1
|
|
754
|
-
Jamf.stdin line
|
|
755
|
-
else
|
|
756
|
-
param_pw
|
|
757
|
-
end # if
|
|
758
|
-
pw
|
|
759
|
-
end # acquire pw
|
|
760
|
-
|
|
761
|
-
# create the faraday connection object
|
|
762
|
-
def create_connection(parse_json = true)
|
|
763
|
-
Faraday.new(@base_url, ssl: @ssl_options) do |cnx|
|
|
764
|
-
cnx.headers[HTTP_ACCEPT_HEADER] = MIME_JSON
|
|
765
|
-
cnx.headers[:authorization] = @token.auth_token
|
|
766
|
-
cnx.request :json if parse_json
|
|
767
|
-
cnx.response :json, parser_options: { symbolize_names: true } if parse_json
|
|
768
|
-
cnx.options[:timeout] = @timeout
|
|
769
|
-
cnx.options[:open_timeout] = @open_timeout
|
|
770
|
-
cnx.adapter Faraday::Adapter::NetHttp
|
|
771
|
-
end
|
|
217
|
+
# @deprecated, use .token.next_refresh
|
|
218
|
+
def next_refresh
|
|
219
|
+
@token.next_refresh
|
|
772
220
|
end
|
|
773
221
|
|
|
774
|
-
#
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
#
|
|
778
|
-
# If so, the token is refreshed, and we keep looping and sleeping.
|
|
779
|
-
#
|
|
780
|
-
# Sets @keep_alive_thread to the Thread object
|
|
781
|
-
#
|
|
782
|
-
# @return [void]
|
|
783
|
-
#
|
|
784
|
-
def start_keep_alive
|
|
785
|
-
return if @keep_alive_thread
|
|
786
|
-
raise 'Token expired' if @token.expired?
|
|
787
|
-
|
|
788
|
-
@keep_alive_thread =
|
|
789
|
-
Thread.new do
|
|
790
|
-
loop do
|
|
791
|
-
sleep 60
|
|
792
|
-
begin
|
|
793
|
-
next if @token.secs_remaining > @token_refresh
|
|
794
|
-
|
|
795
|
-
@token.refresh @pw
|
|
796
|
-
# make sure faraday uses the new token
|
|
797
|
-
@rest_cnx.headers[:authorization] = @token.auth_token
|
|
798
|
-
rescue
|
|
799
|
-
# TODO: Some kind of error reporting
|
|
800
|
-
next
|
|
801
|
-
end
|
|
802
|
-
end # loop
|
|
803
|
-
end # thread
|
|
222
|
+
# @deprecated, use .token.secs_to_refresh
|
|
223
|
+
def secs_to_refresh
|
|
224
|
+
@token.secs_to_refresh
|
|
804
225
|
end
|
|
805
226
|
|
|
806
|
-
#
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
# @return [void]
|
|
810
|
-
#
|
|
811
|
-
def stop_keep_alive
|
|
812
|
-
return unless @keep_alive_thread
|
|
813
|
-
|
|
814
|
-
@keep_alive_thread.kill if @keep_alive_thread.alive?
|
|
815
|
-
@keep_alive_thread = nil
|
|
227
|
+
# @deprecated, use .token.time_to_refresh
|
|
228
|
+
def time_to_refresh
|
|
229
|
+
@token.time_to_refresh
|
|
816
230
|
end
|
|
817
231
|
|
|
818
232
|
end # class Connection
|
|
819
233
|
|
|
820
|
-
#
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
# @return [Jamf::Connection] the active connection
|
|
824
|
-
#
|
|
825
|
-
def self.cnx
|
|
826
|
-
@active_connection ||= Connection.new do_not_connect: true
|
|
827
|
-
end
|
|
828
|
-
|
|
829
|
-
# Create a new Connection object and use it as the active_connection,
|
|
830
|
-
# replacing the current active_connection. If connection options are provided,
|
|
831
|
-
# they are passed to the connect method immediately, otherwise
|
|
832
|
-
# Jamf.cnx.connect must be called before attemting to use the
|
|
833
|
-
# connection.
|
|
834
|
-
#
|
|
835
|
-
# @param (See Jamf::Connection#connect)
|
|
836
|
-
#
|
|
837
|
-
# @return [APIConnection] the new, active connection
|
|
838
|
-
#
|
|
839
|
-
def self.connect(url = nil, **params)
|
|
840
|
-
@active_connection = Connection.new url, params
|
|
841
|
-
@active_connection.to_s
|
|
842
|
-
end
|
|
843
|
-
|
|
844
|
-
# Switch the connection used for all API interactions to the
|
|
845
|
-
# one provided. See {Jamf::APIConnection} for details and examples
|
|
846
|
-
# of using multiple connections
|
|
847
|
-
#
|
|
848
|
-
# @param connection [APIConnection] The APIConnection to use for future
|
|
849
|
-
# API calls. If omitted, use the default connection created when ruby-jss
|
|
850
|
-
# was loaded (which may or may not yet be connected)
|
|
851
|
-
#
|
|
852
|
-
# @return [APIConnection] The connection now being used.
|
|
853
|
-
#
|
|
854
|
-
def self.cnx=(connection)
|
|
855
|
-
raise 'API connections must be instances of Jamf::Connection' unless connection.is_a? Jamf::Connection
|
|
856
|
-
|
|
857
|
-
@active_connection = connection
|
|
858
|
-
end
|
|
859
|
-
|
|
860
|
-
def self.disconnect
|
|
861
|
-
@active_connection.disconnect if @active_connection
|
|
862
|
-
end
|
|
863
|
-
|
|
864
|
-
end # module Jamf
|
|
234
|
+
# Some backward compatibility
|
|
235
|
+
# @deprecated
|
|
236
|
+
APIConnection = Connection
|
|
865
237
|
|
|
866
|
-
|
|
867
|
-
require 'jamf/api/connection/api_error'
|
|
238
|
+
end # module
|