class HybridAnalysis::Clients::FileCollection
Public Instance Methods
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 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
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
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
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
search the database using the search terms
@param [String, nil] collection_name Collection Name @param [String, nil] tag Hashtag e.g. ransomware
@return [Hash]
# File lib/hybridanalysis/clients/file_collection.rb, line 48 def search(collection_name: nil, tag: nil) params = { collection_name: collection_name, tag: tag }.compact _post("/file-collection/search", params) { |json| json } end