class HybridAnalysis::Clients::FileCollection

Public Instance Methods

add(id:, file: ) click to toggle source

add file to collection

@param [String] id File collection id @param [String] file File to add

@return [Hash]

# File lib/hybridanalysis/clients/file_collection.rb, line 84
def add(id:, file: )
  params = { file: file }.compact
  _post("/file-collection/#{id}/files/add", params) { |json| json }
end
create(collection_name: nil, comment: nil, no_share_third_party: nil, allow_community_access: nil) click to toggle source

create file collection

@param [String, nil] collection_name Optional collection name @param [String, nil] comment Optional comment text that may be associated with the file collection (Note: you can use tags here) @param [Boolean, nil] no_share_third_party When set to 'true', samples within collection will never be shared with any third party. Default: true @param [Boolean, nil] allow_community_access When set to 'true', samples within collection will be available for the community. Default: true

@return [Hash]

# File lib/hybridanalysis/clients/file_collection.rb, line 66
def create(collection_name: nil, comment: nil, no_share_third_party: nil, allow_community_access: nil)
  params = {
    collection_name: collection_name,
    comment: comment,
    no_share_third_party: no_share_third_party,
    allow_community_access: allow_community_access
  }.compact
  _post("/file-collection/create", params) { |json| json }
end
delete(id:, hash: ) click to toggle source

remove file within collection without hard removal from system

@param [String] id File collection id @param [String] hash SHA256 of file to remove

@return [Hash]

# File lib/hybridanalysis/clients/file_collection.rb, line 14
def delete(id:, hash: )
  _delete("/file-collection/#{id}/files/#{hash}") { |json| json }
end
download(id) click to toggle source

return an archive with all collection samples

@param [String] id File collection id

@return [Hash]

# File lib/hybridanalysis/clients/file_collection.rb, line 36
def download(id)
  _get("/file-collection/#{id}/files/download") { |json| json }
end
get(id) click to toggle source

return a summary of file collection

@param [String] id File collection id

@return [Hash]

# File lib/hybridanalysis/clients/file_collection.rb, line 25
def get(id)
  _get("/file-collection/#{id}") { |json| json }
end