Class: Roseflow::Pinecone::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/roseflow/pinecone/index.rb,
lib/roseflow/pinecone/structs.rb

Defined Under Namespace

Classes: Description, Status

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Index

Returns a new instance of Index.



9
10
11
# File 'lib/roseflow/pinecone/index.rb', line 9

def initialize(connection)
  @connection = connection
end

Instance Method Details

#create(name, options = {}) ⇒ Object



27
28
29
30
31
32
# File 'lib/roseflow/pinecone/index.rb', line 27

def create(name, options = {})
  IndexResponse.new(
    method: :create,
    response: connection.post("/databases", create_payload(name, options))
  )
end

#delete(name) ⇒ Object



34
35
36
37
38
39
# File 'lib/roseflow/pinecone/index.rb', line 34

def delete(name)
  IndexResponse.new(
    method: :delete,
    response: connection.delete("/databases/#{name}")
  )
end

#describe(name) ⇒ Object



20
21
22
23
24
25
# File 'lib/roseflow/pinecone/index.rb', line 20

def describe(name)
  IndexResponse.new(
    method: :describe,
    response: connection.get("/databases/#{name}")
  )
end

#listObject



13
14
15
16
17
18
# File 'lib/roseflow/pinecone/index.rb', line 13

def list
  IndexResponse.new(
    method: :list,
    response: connection.get("/databases")
  )
end