Class: Weaviate::Backups

Inherits:
Base
  • Object
show all
Defined in:
lib/weaviate/backups.rb

Constant Summary collapse

PATH =
"backups"

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Weaviate::Base

Instance Method Details

#create(backend:, id:, include: nil, exclude: nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/weaviate/backups.rb', line 7

def create(
  backend:,
  id:,
  include: nil,
  exclude: nil
)
  response = client.connection.post("#{PATH}/#{backend}") do |req|
    req.body = {}
    req.body["id"] = id
    req.body["include"] = include if include
    req.body["exclude"] = exclude if exclude
  end

  response.body
end

#get(backend:, id:) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/weaviate/backups.rb', line 23

def get(
  backend:,
  id:
)
  response = client.connection.get("#{PATH}/#{backend}/#{id}")
  response.body
end

#restore(backend:, id:, include: nil, exclude: nil) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/weaviate/backups.rb', line 31

def restore(
  backend:,
  id:,
  include: nil,
  exclude: nil
)
  response = client.connection.post("#{PATH}/#{backend}/#{id}/restore") do |req|
    req.body = {}
    req.body["include"] = include if include
    req.body["exclude"] = exclude if exclude
  end

  response.body
end

#restore_status(backend:, id:) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/weaviate/backups.rb', line 46

def restore_status(
  backend:,
  id:
)
  response = client.connection.get("#{PATH}/#{backend}/#{id}/restore")
  response.body
end