Module: Jamf::FileVault::ClassMethods
- Defined in:
- lib/jamf/api/jamf_pro/mixins/filevault.rb
Overview
Class Methods
Class Method Summary collapse
-
.extended(extender) ⇒ Object
when this module is included, also extend our Class Methods.
Instance Method Summary collapse
-
#filevault_info(computer, paged: false, page_size: Jamf::Pager::DEFAULT_PAGE_SIZE, cnx: Jamf.cnx) ⇒ Jamf::OAPISchemas::ComputerInventoryFileVault, ...
Get the filevault info for one or all computers, or Jamf::Pager for getting all of them paged in groups.
Class Method Details
Instance Method Details
#filevault_info(computer, paged: false, page_size: Jamf::Pager::DEFAULT_PAGE_SIZE, cnx: Jamf.cnx) ⇒ Jamf::OAPISchemas::ComputerInventoryFileVault, ...
Get the filevault info for one or all computers, or Jamf::Pager for getting all of them paged in groups.
WARNING: This data will include the plaintext FileVault personal recovery keys. The
'View Disk Encryption Recovery Key' privilege is required.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/jamf/api/jamf_pro/mixins/filevault.rb', line 72 def filevault_info(computer, paged: false, page_size: Jamf::Pager::DEFAULT_PAGE_SIZE, cnx: Jamf.cnx) return all_computers(paged: paged, page_size: page_size, cnx: cnx) if computer == :all id = Jamf::Computer.valid_id computer raise Jamf::NoSuchItemError, "No computer matches identifier '#{computer}'" unless id data = cnx.jp_get "#{Jamf::Computer::JPAPI_INVENTORY_RSRC}/#{id}/#{FILEVAULT_RSRC_SUFFIX}" Jamf::OAPISchemas::ComputerInventoryFileVault.new data # if we get a 404 NOT FOUND error, this given computer has no FV data, so just return nil rescue Jamf::Connection::JamfProAPIError => e raise unless e.http_status == 404 nil end |