Class: Superset::Request
- Inherits:
-
Object
- Object
- Superset::Request
- Includes:
- Display
- Defined in:
- lib/superset/request.rb
Direct Known Subclasses
Chart::BulkDelete, Chart::Delete, Chart::Get, Chart::List, Chart::UpdateDataset, Dashboard::BulkDelete, Dashboard::Charts::List, Dashboard::Copy, Dashboard::Datasets::List, Dashboard::Delete, Dashboard::Embedded::Get, Dashboard::Embedded::Put, Dashboard::Export, Dashboard::Get, Dashboard::Info, Dashboard::List, Dashboard::Put, Dashboard::WarmUpCache, Database::Get, Database::GetSchemas, Database::List, Dataset::BulkDelete, Dataset::Create, Dataset::Delete, Dataset::Duplicate, Dataset::Get, Dataset::List, Dataset::UpdateQuery, Dataset::UpdateSchema, Dataset::WarmUpCache, RouteInfo, Security::PermissionsResources::List, Security::Role::Create, Security::Role::Get, Security::Role::List, Security::Role::Permission::Create, Security::Role::Permission::Get, Security::User::Create, Security::User::Get, Security::User::List, Services::DuplicateDashboard, Sqllab::Execute, Tag::AddToObject, Tag::Get, Tag::List
Defined Under Namespace
Classes: InvalidParameterError, ValidationError
Constant Summary collapse
- PAGE_SIZE =
100
Instance Attribute Summary collapse
-
#page_num ⇒ Object
Returns the value of attribute page_num.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(page_num: 0) ⇒ Request
constructor
A new instance of Request.
- #query_params ⇒ Object
- #response ⇒ Object
- #result ⇒ Object
- #superset_host ⇒ Object
Methods included from Display
#display_headers, #headings, #list, #list_attributes, #rows, #table, #title
Constructor Details
#initialize(page_num: 0) ⇒ Request
Returns a new instance of Request.
13 14 15 |
# File 'lib/superset/request.rb', line 13 def initialize(page_num: 0) @page_num = page_num end |
Instance Attribute Details
#page_num ⇒ Object
Returns the value of attribute page_num.
11 12 13 |
# File 'lib/superset/request.rb', line 11 def page_num @page_num end |
Class Method Details
.call ⇒ Object
17 18 19 |
# File 'lib/superset/request.rb', line 17 def self.call self.new.response end |
Instance Method Details
#query_params ⇒ Object
36 37 38 |
# File 'lib/superset/request.rb', line 36 def query_params [filters, pagination].join end |
#response ⇒ Object
21 22 23 24 25 26 |
# File 'lib/superset/request.rb', line 21 def response @response ||= client.get(route) rescue => e logger.error("#{e.}") raise e end |
#result ⇒ Object
28 29 30 |
# File 'lib/superset/request.rb', line 28 def result response['result'] end |
#superset_host ⇒ Object
32 33 34 |
# File 'lib/superset/request.rb', line 32 def superset_host client.superset_host end |