ruby-jss 0.10.1 → 0.10.2a4
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.
Potentially problematic release.
This version of ruby-jss might be problematic. Click here for more details.
- checksums.yaml +4 -4
 - data/lib/jss/api_connection.rb +38 -19
 - data/lib/jss/api_object/advanced_search.rb +5 -1
 - data/lib/jss/api_object/computer.rb +315 -291
 - data/lib/jss/api_object/computer_invitation.rb +5 -3
 - data/lib/jss/api_object/ebook.rb +5 -0
 - data/lib/jss/api_object/group/computer_group.rb +4 -0
 - data/lib/jss/api_object/group/mobile_device_group.rb +4 -1
 - data/lib/jss/api_object/group.rb +6 -1
 - data/lib/jss/api_object/mac_application.rb +5 -0
 - data/lib/jss/api_object/mdm.rb +1268 -0
 - data/lib/jss/api_object/mobile_device.rb +56 -335
 - data/lib/jss/api_object/mobile_device_application.rb +6 -0
 - data/lib/jss/api_object/mobile_device_configuration_profile.rb +36 -0
 - data/lib/jss/api_object/osx_configuration_profile.rb +115 -151
 - data/lib/jss/api_object/patch.rb +38 -0
 - data/lib/jss/api_object/patch_policy.rb +38 -0
 - data/lib/jss/api_object/peripheral.rb +5 -7
 - data/lib/jss/api_object/policy.rb +5 -0
 - data/lib/jss/api_object/restricted_software.rb +5 -0
 - data/lib/jss/api_object/scopable/scope.rb +367 -411
 - data/lib/jss/api_object/self_servable.rb +15 -4
 - data/lib/jss/api_object/sitable.rb +197 -0
 - data/lib/jss/api_object/site.rb +45 -76
 - data/lib/jss/api_object/user.rb +6 -2
 - data/lib/jss/api_object.rb +74 -4
 - data/lib/jss/utility.rb +21 -0
 - data/lib/jss/version.rb +1 -1
 - data/lib/jss.rb +4 -0
 - metadata +8 -4
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: f25ffb3a1553a71ea08f5bf89c6309c5d063f8f0
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 946e930c5a5bafa01cda0e5e49239dd5ebd859e3
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 053fe33b81de846bfa1336bf9dd3dcf95eb03d5c92045374187e28eae6d453e5f781a89dfd75c927b699d60685c78e6959d922b9730893fc46dc7b4b759075d0
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: fe286d6719bc538bf119c0d6c291d5733d4146e86f91c4f9b7b205f5d774d49a656fa24e2e2359b49c2e96252075f16dc4b94b6a42b55e7bd3416346e8adbf71
         
     | 
    
        data/lib/jss/api_connection.rb
    CHANGED
    
    | 
         @@ -237,11 +237,13 @@ module JSS 
     | 
|
| 
       237 
237 
     | 
    
         
             
              #   prod2_victim_md = production_api2.fetch :MobileDevice, id: 832
         
     | 
| 
       238 
238 
     | 
    
         
             
              #
         
     | 
| 
       239 
239 
     | 
    
         
             
              # Here are the API calls you can make directly from an APIConnection object.
         
     | 
| 
       240 
     | 
    
         
            -
              #  
     | 
| 
      
 240 
     | 
    
         
            +
              # They behave practically identically to the same methods in the APIObject
         
     | 
| 
      
 241 
     | 
    
         
            +
              # subclasses, since they just call those methods, passing themselves in as the
         
     | 
| 
      
 242 
     | 
    
         
            +
              # APIConnection to use.
         
     | 
| 
       241 
243 
     | 
    
         
             
              #
         
     | 
| 
       242 
244 
     | 
    
         
             
              # - {#all}  The 'list' methods of the various APIObject classes. Use the 'only:'
         
     | 
| 
       243 
245 
     | 
    
         
             
              #   parameter to specify one of the sub-list-methods, like #all_ids or
         
     | 
| 
       244 
     | 
    
         
            -
              #   #all_laptops
         
     | 
| 
      
 246 
     | 
    
         
            +
              #   #all_laptops, e.g. `my_connection.all :computers, only: :id`
         
     | 
| 
       245 
247 
     | 
    
         
             
              # - {#map_all_ids} the equivalent of #map_all_ids_to in the APIObject classes
         
     | 
| 
       246 
248 
     | 
    
         
             
              # - {#valid_id} given a class and an identifier (like macaddress or udid)
         
     | 
| 
       247 
249 
     | 
    
         
             
              #   return a valid id or nil
         
     | 
| 
         @@ -254,6 +256,9 @@ module JSS 
     | 
|
| 
       254 
256 
     | 
    
         
             
              # - {#send_computer_mdm_command} same as {Computer.send_mdm_command}
         
     | 
| 
       255 
257 
     | 
    
         
             
              # - {#computer_checkin_settings} same as {Computer.checkin_settings}
         
     | 
| 
       256 
258 
     | 
    
         
             
              # - {#computer_inventory_collection_settings} same as {Computer.inventory_collection_settings}
         
     | 
| 
      
 259 
     | 
    
         
            +
              # - {#computer_application_usage} same as {Computer.application_usage}
         
     | 
| 
      
 260 
     | 
    
         
            +
              # - {#computer_management_data} same as {Computer.management_data}
         
     | 
| 
      
 261 
     | 
    
         
            +
              # - {#computer_history} same as {Computer.history}
         
     | 
| 
       257 
262 
     | 
    
         
             
              # - {#send_mobiledevice_mdm_command} same as {MobileDevice.send_mdm_command}
         
     | 
| 
       258 
263 
     | 
    
         
             
              # - {#master_distribution_point} same as {DistributionPoint.master_distribution_point}
         
     | 
| 
       259 
264 
     | 
    
         
             
              # - {#my_distribution_point} same as {DistributionPoint.my_distribution_point}
         
     | 
| 
         @@ -739,25 +744,48 @@ module JSS 
     | 
|
| 
       739 
744 
     | 
    
         
             
                  the_class.make args
         
     | 
| 
       740 
745 
     | 
    
         
             
                end
         
     | 
| 
       741 
746 
     | 
    
         | 
| 
       742 
     | 
    
         
            -
                # Call {JSS::Computer.checkin_settings} passing this API
         
     | 
| 
      
 747 
     | 
    
         
            +
                # Call {JSS::Computer.checkin_settings} q.v.,  passing this API
         
     | 
| 
       743 
748 
     | 
    
         
             
                # connection
         
     | 
| 
       744 
749 
     | 
    
         
             
                #
         
     | 
| 
       745 
     | 
    
         
            -
                # @return (see JSS::Computer.checkin_settings)
         
     | 
| 
       746 
     | 
    
         
            -
                #
         
     | 
| 
       747 
750 
     | 
    
         
             
                def computer_checkin_settings
         
     | 
| 
       748 
751 
     | 
    
         
             
                  JSS::Computer.checkin_settings api: self
         
     | 
| 
       749 
752 
     | 
    
         
             
                end
         
     | 
| 
       750 
753 
     | 
    
         | 
| 
       751 
     | 
    
         
            -
             
     | 
| 
       752 
     | 
    
         
            -
                # Call {JSS::Computer.inventory_collection_settings} passing this API
         
     | 
| 
      
 754 
     | 
    
         
            +
                # Call {JSS::Computer.inventory_collection_settings} q.v., passing this API
         
     | 
| 
       753 
755 
     | 
    
         
             
                # connection
         
     | 
| 
       754 
756 
     | 
    
         
             
                #
         
     | 
| 
       755 
     | 
    
         
            -
                # @return (see JSS::Computer.checkin_settings)
         
     | 
| 
       756 
     | 
    
         
            -
                #
         
     | 
| 
       757 
757 
     | 
    
         
             
                def computer_inventory_collection_settings
         
     | 
| 
       758 
758 
     | 
    
         
             
                  JSS::Computer.inventory_collection_settings api: self
         
     | 
| 
       759 
759 
     | 
    
         
             
                end
         
     | 
| 
       760 
760 
     | 
    
         | 
| 
      
 761 
     | 
    
         
            +
                # Call {JSS::Computer.application_usage} q.v., passing this API
         
     | 
| 
      
 762 
     | 
    
         
            +
                # connection
         
     | 
| 
      
 763 
     | 
    
         
            +
                #
         
     | 
| 
      
 764 
     | 
    
         
            +
                def computer_application_usage(ident, start_date, end_date = nil)
         
     | 
| 
      
 765 
     | 
    
         
            +
                  JSS::Computer.application_usage ident, start_date, end_date, api: self
         
     | 
| 
      
 766 
     | 
    
         
            +
                end
         
     | 
| 
      
 767 
     | 
    
         
            +
             
     | 
| 
      
 768 
     | 
    
         
            +
                # Call {JSS::Computer.management_data} q.v., passing this API
         
     | 
| 
      
 769 
     | 
    
         
            +
                # connection
         
     | 
| 
      
 770 
     | 
    
         
            +
                #
         
     | 
| 
      
 771 
     | 
    
         
            +
                def computer_management_data(ident, subset: nil, only: nil)
         
     | 
| 
      
 772 
     | 
    
         
            +
                  JSS::Computer.management_data ident, subset: subset, only: only, api: self
         
     | 
| 
      
 773 
     | 
    
         
            +
                end
         
     | 
| 
      
 774 
     | 
    
         
            +
             
     | 
| 
      
 775 
     | 
    
         
            +
                # Call {JSS::Computer.history} q.v., passing this API
         
     | 
| 
      
 776 
     | 
    
         
            +
                # connection
         
     | 
| 
      
 777 
     | 
    
         
            +
                #
         
     | 
| 
      
 778 
     | 
    
         
            +
                def computer_history(ident, subset: nil)
         
     | 
| 
      
 779 
     | 
    
         
            +
                  JSS::Computer.history ident, subset: subset, api: self
         
     | 
| 
      
 780 
     | 
    
         
            +
                end
         
     | 
| 
      
 781 
     | 
    
         
            +
             
     | 
| 
      
 782 
     | 
    
         
            +
                # Call {JSS::Computer.send_mdm_command} q.v.,  passing this API
         
     | 
| 
      
 783 
     | 
    
         
            +
                # connection
         
     | 
| 
      
 784 
     | 
    
         
            +
                #
         
     | 
| 
      
 785 
     | 
    
         
            +
                def send_computer_mdm_command(targets, command, passcode = nil)
         
     | 
| 
      
 786 
     | 
    
         
            +
                  JSS::Computer.send_mdm_command targets, command, passcode, api: self
         
     | 
| 
      
 787 
     | 
    
         
            +
                end
         
     | 
| 
      
 788 
     | 
    
         
            +
             
     | 
| 
       761 
789 
     | 
    
         
             
                # Get the DistributionPoint instance for the master
         
     | 
| 
       762 
790 
     | 
    
         
             
                # distribution point in the JSS. If there's only one
         
     | 
| 
       763 
791 
     | 
    
         
             
                # in the JSS, return it even if not marked as master.
         
     | 
| 
         @@ -834,7 +862,7 @@ module JSS 
     | 
|
| 
       834 
862 
     | 
    
         
             
                #
         
     | 
| 
       835 
863 
     | 
    
         
             
                # @return [Array<Integer>] the ids of the NetworkSegments containing the given ip
         
     | 
| 
       836 
864 
     | 
    
         
             
                #
         
     | 
| 
       837 
     | 
    
         
            -
                def network_segments_for_ip(ip 
     | 
| 
      
 865 
     | 
    
         
            +
                def network_segments_for_ip(ip)
         
     | 
| 
       838 
866 
     | 
    
         
             
                  ok_ip = IPAddr.new(ip)
         
     | 
| 
       839 
867 
     | 
    
         
             
                  matches = []
         
     | 
| 
       840 
868 
     | 
    
         
             
                  network_ranges.each { |id, subnet| matches << id if subnet.include?(ok_ip) }
         
     | 
| 
         @@ -849,15 +877,6 @@ module JSS 
     | 
|
| 
       849 
877 
     | 
    
         
             
                  network_segments_for_ip JSS::Client.my_ip_address
         
     | 
| 
       850 
878 
     | 
    
         
             
                end
         
     | 
| 
       851 
879 
     | 
    
         | 
| 
       852 
     | 
    
         
            -
                # Send an MDM command to one or more computers managed by
         
     | 
| 
       853 
     | 
    
         
            -
                # this JSS
         
     | 
| 
       854 
     | 
    
         
            -
                #
         
     | 
| 
       855 
     | 
    
         
            -
                # see {JSS::Computer.send_mdm_command}
         
     | 
| 
       856 
     | 
    
         
            -
                #
         
     | 
| 
       857 
     | 
    
         
            -
                def send_computer_mdm_command(targets, command, passcode = nil)
         
     | 
| 
       858 
     | 
    
         
            -
                  JSS::Computer.send_mdm_command(targets, command, passcode, api: self)
         
     | 
| 
       859 
     | 
    
         
            -
                end
         
     | 
| 
       860 
     | 
    
         
            -
             
     | 
| 
       861 
880 
     | 
    
         
             
                # Send an MDM command to one or more mobile devices managed by
         
     | 
| 
       862 
881 
     | 
    
         
             
                # this JSS
         
     | 
| 
       863 
882 
     | 
    
         
             
                #
         
     | 
| 
         @@ -60,12 +60,16 @@ module JSS 
     | 
|
| 
       60 
60 
     | 
    
         
             
                include JSS::Creatable
         
     | 
| 
       61 
61 
     | 
    
         
             
                include JSS::Updatable
         
     | 
| 
       62 
62 
     | 
    
         
             
                include JSS::Criteriable
         
     | 
| 
      
 63 
     | 
    
         
            +
                include JSS::Sitable
         
     | 
| 
       63 
64 
     | 
    
         | 
| 
       64 
65 
     | 
    
         
             
                # Class Constants
         
     | 
| 
       65 
66 
     | 
    
         
             
                #####################################
         
     | 
| 
       66 
67 
     | 
    
         | 
| 
       67 
68 
     | 
    
         
             
                EXPORT_FORMATS = [:csv, :tab, :xml].freeze
         
     | 
| 
       68 
69 
     | 
    
         | 
| 
      
 70 
     | 
    
         
            +
                # Where is site data located in the API JSON?
         
     | 
| 
      
 71 
     | 
    
         
            +
                SITE_SUBSET = :top
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
       69 
73 
     | 
    
         
             
                # Attributes
         
     | 
| 
       70 
74 
     | 
    
         
             
                #####################################
         
     | 
| 
       71 
75 
     | 
    
         | 
| 
         @@ -342,7 +346,7 @@ module JSS 
     | 
|
| 
       342 
346 
     | 
    
         | 
| 
       343 
347 
     | 
    
         
             
                  df = acs.add_element('display_fields')
         
     | 
| 
       344 
348 
     | 
    
         
             
                  @display_fields.each { |f| df.add_element('display_field').add_element('name').text = f }
         
     | 
| 
       345 
     | 
    
         
            -
             
     | 
| 
      
 349 
     | 
    
         
            +
                  add_site_to_xml(doc)
         
     | 
| 
       346 
350 
     | 
    
         
             
                  doc.to_s
         
     | 
| 
       347 
351 
     | 
    
         
             
                end # rest xml
         
     | 
| 
       348 
352 
     | 
    
         |