Class: Qdrant::Snapshots
Constant Summary collapse
- PATH =
"snapshots"
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#create ⇒ Object
Create new snapshot of the whole storage.
-
#delete(snapshot_name:) ⇒ Object
Delete snapshot of the whole storage.
-
#download(snapshot_name:, filepath:) ⇒ Object
Download specified snapshot of the whole storage as a file.
-
#list ⇒ Object
Get list of snapshots of the whole storage.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Qdrant::Base
Instance Method Details
#create ⇒ Object
Create new snapshot of the whole storage
14 15 16 17 |
# File 'lib/qdrant/snapshots.rb', line 14 def create response = client.connection.post(PATH) response.body end |
#delete(snapshot_name:) ⇒ Object
Delete snapshot of the whole storage
20 21 22 23 24 25 |
# File 'lib/qdrant/snapshots.rb', line 20 def delete( snapshot_name: ) response = client.connection.delete("#{PATH}/#{snapshot_name}") response.body end |
#download(snapshot_name:, filepath:) ⇒ Object
Download specified snapshot of the whole storage as a file
28 29 30 31 32 33 34 |
# File 'lib/qdrant/snapshots.rb', line 28 def download( snapshot_name:, filepath: ) response = client.connection.get("#{PATH}/#{snapshot_name}") File.open(File.(filepath), "wb+") { |fp| fp.write(response.body) } end |
#list ⇒ Object
Get list of snapshots of the whole storage
8 9 10 11 |
# File 'lib/qdrant/snapshots.rb', line 8 def list response = client.connection.get(PATH) response.body end |