Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/metabase/endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
require 'metabase/endpoint/public'
require 'metabase/endpoint/pulse'
require 'metabase/endpoint/revision'
require 'metabase/endpoint/search'
require 'metabase/endpoint/segment'
require 'metabase/endpoint/session'
require 'metabase/endpoint/setting'
Expand All @@ -37,6 +38,7 @@ module Endpoint
include Public
include Pulse
include Revision
include Search
include Segment
include Session
include Setting
Expand Down
10 changes: 10 additions & 0 deletions lib/metabase/endpoint/card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ def query_card_with_metadata(card_id, **params)
def query_card(card_id, format: :json, **params)
post("/api/card/#{card_id}/query/#{format}", **params)
end

# Update a card.
#
# @param card_id [Integer, String] Card ID
# @param params [Hash] Request body
# @return [Array<Hash>, String] Query results
# @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#post-apicardcard-idqueryexport-format
def update_card(card_id, **params)
put("/api/card/#{card_id}", **params)
end
end
end
end
4 changes: 4 additions & 0 deletions lib/metabase/endpoint/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ module Database
def databases(**params)
get('/api/database', **params)
end

def sync_schema(database_id, **params)
post("/api/database/#{database_id}/sync_schema", **params)
end
end
end
end
15 changes: 15 additions & 0 deletions lib/metabase/endpoint/search.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Metabase
module Endpoint
module Search
def search(**params)
get('/api/search', **params)
end

def search_models(**params)
get('/api/search/models', **params)
end
end
end
end
4 changes: 4 additions & 0 deletions lib/metabase/endpoint/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ module Table
def tables(**params)
get('/api/table', **params)
end

def update_table(table_id, **params)
put("/api/table/#{table_id}", **params)
end
end
end
end