Module: Jamf::DataDependency::ClassMethods

Defined in:
lib/jamf/api/jamf_pro/mixins/data_dependency.rb

Overview

Class Methods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(extender) ⇒ Object



41
42
43
# File 'lib/jamf/api/jamf_pro/mixins/data_dependency.rb', line 41

def self.extended(extender)
  Jamf.load_msg "--> #{extender} is extending Jamf::DataDependency::ClassMethods"
end

Instance Method Details

#data_dependency(ident, cnx: Jamf.cnx) ⇒ Array<Hash>

Get the dependencies for the specified id. This is a list of objects that use this object and would prevent if from being deleted

Parameters:

  • ident (String, Integer)

    The name, id or other identifier to get dependencies for.

  • cnx (Jamf::Connection) (defaults to: Jamf.cnx)

    The connection to use, default: Jamf.cnx

Returns:

  • (Array<Hash>)

    Info about any objects that would prevent deletion of the specified object(s).



54
55
56
57
# File 'lib/jamf/api/jamf_pro/mixins/data_dependency.rb', line 54

def data_dependency(ident, cnx: Jamf.cnx)
  id = valid_id(ident)
  cnx.jp_get("#{self::LIST_PATH}/#{id}/#{DATA_DEPENDENCY_ENDPOINT}")[:results]
end