Class: HybridAnalysis::Clients::FileCollection
- Defined in:
- lib/hybridanalysis/clients/file_collection.rb
Constant Summary
Constants inherited from Client
Client::BASE_URL, Client::DEFAULT_UA, Client::HOST, Client::VERSION
Instance Attribute Summary
Attributes inherited from Client
Instance Method Summary collapse
-
#add(id:, file:) ⇒ Hash
add file to collection.
-
#create(collection_name: nil, comment: nil, no_share_third_party: nil, allow_community_access: nil) ⇒ Hash
create file collection.
-
#delete(id:, hash:) ⇒ Hash
remove file within collection without hard removal from system.
-
#download(id) ⇒ Hash
return an archive with all collection samples.
-
#get(id) ⇒ Hash
return a summary of file collection.
-
#search(collection_name: nil, tag: nil) ⇒ Hash
search the database using the search terms.
Methods inherited from Client
Constructor Details
This class inherits a constructor from HybridAnalysis::Clients::Client
Instance Method Details
#add(id:, file:) ⇒ Hash
add file to collection
84 85 86 87 |
# 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) ⇒ Hash
create file collection
66 67 68 69 70 71 72 73 74 |
# 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:) ⇒ Hash
remove file within collection without hard removal from system
14 15 16 |
# File 'lib/hybridanalysis/clients/file_collection.rb', line 14 def delete(id:, hash: ) _delete("/file-collection/#{id}/files/#{hash}") { |json| json } end |
#download(id) ⇒ Hash
return an archive with all collection samples
36 37 38 |
# File 'lib/hybridanalysis/clients/file_collection.rb', line 36 def download(id) _get("/file-collection/#{id}/files/download") { |json| json } end |
#get(id) ⇒ Hash
return a summary of file collection
25 26 27 |
# File 'lib/hybridanalysis/clients/file_collection.rb', line 25 def get(id) _get("/file-collection/#{id}") { |json| json } end |
#search(collection_name: nil, tag: nil) ⇒ Hash
search the database using the search terms
48 49 50 51 52 53 54 |
# 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 |