parameters: (item_type, item_id)
return_statement: return response
docstring: Get a minimal amount of data for the passed item.
      Used by the clipboard to provide selected item information.
  
      :param item_type: Item type (Domain, Indicator, etc...)
      :type item_type: str
      :param item_id: Item database ID (_id)
      :type item_id: str
      :returns: dict -- Contains the item data
docstring_summary: Get a minimal amount of data for the passed item.
      Used by the clipboard to provide selected item information.
docstring_tokens: Get a minimal amount of data for the passed item . Used by the clipboard to provide selected item information .
function: def get_data_for_item(item_type, item_id):
      """
      Get a minimal amount of data for the passed item.
      Used by the clipboard to provide selected item information.
  
      :param item_type: Item type (Domain, Indicator, etc...)
      :type item_type: str
      :param item_id: Item database ID (_id)
      :type item_id: str
      :returns: dict -- Contains the item data
      """
  
      type_to_fields = {
          'Actor': ['name', ],
          'Backdoor': ['name', ],
          'Campaign': ['name', ],
          'Certificate': ['filename', ],
          'Domain': ['domain', ],
          'Email': ['from_address', 'date', ],
          'Event': ['title', 'event_type', ],
          'Exploit': ['name', 'cve', ],
          'Indicator': ['value', 'ind_type', ],
          'IP': ['ip', 'type', ],
          'PCAP': ['filename', ],
          'RawData': ['title', ],
          'Sample': ['filename', ],
          'Signature': ['title', ],
          'Target': ['email_address', ],
      }
      response = {'OK': 0, 'Msg': ''}
      if not item_id or not item_type:
          response['Msg'] = "No item data provided"
          return response
      if not item_type in type_to_fields:
          response['Msg'] = "Invalid item type: %s" % item_type
          return response
  
      doc = class_from_id(item_type, item_id)
      if not doc:
          response['Msg'] = "Item not found"
          return response
      response['OK'] = 1
      response['data'] = {}
      for field in type_to_fields[item_type]:
          if field in doc:
              value = doc[field]
              if len(value) > 30:
                  saved = value
                  value = saved[:15]
                  value += '...'
                  value += saved[-15:]
              response['data'][field.title()] = value
      return response
function_tokens: def get_data_for_item ( item_type , item_id ) : type_to_fields = { 'Actor' : [ 'name' , ] , 'Backdoor' : [ 'name' , ] , 'Campaign' : [ 'name' , ] , 'Certificate' : [ 'filename' , ] , 'Domain' : [ 'domain' , ] , 'Email' : [ 'from_address' , 'date' , ] , 'Event' : [ 'title' , 'event_type' , ] , 'Exploit' : [ 'name' , 'cve' , ] , 'Indicator' : [ 'value' , 'ind_type' , ] , 'IP' : [ 'ip' , 'type' , ] , 'PCAP' : [ 'filename' , ] , 'RawData' : [ 'title' , ] , 'Sample' : [ 'filename' , ] , 'Signature' : [ 'title' , ] , 'Target' : [ 'email_address' , ] , } response = { 'OK' : 0 , 'Msg' : '' } if not item_id or not item_type : response [ 'Msg' ] = "No item data provided" return response if not item_type in type_to_fields : response [ 'Msg' ] = "Invalid item type: %s" % item_type return response doc = class_from_id ( item_type , item_id ) if not doc : response [ 'Msg' ] = "Item not found" return response response [ 'OK' ] = 1 response [ 'data' ] = { } for field in type_to_fields [ item_type ] : if field in doc : value = doc [ field ] if len ( value ) > 30 : saved = value value = saved [ : 15 ] value += '...' value += saved [ - 15 : ] response [ 'data' ] [ field . title ( ) ] = value return response