Class: TableauServerClient::Server
- Inherits:
-
Object
- Object
- TableauServerClient::Server
- Defined in:
- lib/tableau_server_client/server.rb
Instance Attribute Summary collapse
-
#api_version ⇒ Object
readonly
Returns the value of attribute api_version.
-
#content_url ⇒ Object
readonly
Returns the value of attribute content_url.
-
#impersonation_username ⇒ Object
readonly
Returns the value of attribute impersonation_username.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#server_url ⇒ Object
readonly
Returns the value of attribute server_url.
-
#token_lifetime ⇒ Object
readonly
Returns the value of attribute token_lifetime.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #full_site(id) ⇒ Object
-
#initialize(server_url, username, password, content_url: "", api_version: "3.1", token_lifetime: 240, log_level: :info, impersonation_username: nil) ⇒ Server
constructor
Implement for_token def for_token(token).
- #path ⇒ Object
- #schedules ⇒ Object
- #site(id) ⇒ Object
- #site_by_name(site_name) ⇒ Object
- #sites ⇒ Object
Constructor Details
#initialize(server_url, username, password, content_url: "", api_version: "3.1", token_lifetime: 240, log_level: :info, impersonation_username: nil) ⇒ Server
Implement for_token def for_token(token)
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/tableau_server_client/server.rb', line 13 def initialize(server_url, username, password, content_url: "", api_version: "3.1", token_lifetime: 240, log_level: :info, impersonation_username: nil) @server_url = server_url @username = username @password = password @content_url = content_url @api_version = api_version @token_lifetime = token_lifetime @logger = ::Logger.new(STDOUT) @logger.level = ::Logger.const_get(log_level.upcase.to_sym) @impersonation_username = impersonation_username end |
Instance Attribute Details
#api_version ⇒ Object (readonly)
Returns the value of attribute api_version.
27 28 29 |
# File 'lib/tableau_server_client/server.rb', line 27 def api_version @api_version end |
#content_url ⇒ Object (readonly)
Returns the value of attribute content_url.
27 28 29 |
# File 'lib/tableau_server_client/server.rb', line 27 def content_url @content_url end |
#impersonation_username ⇒ Object (readonly)
Returns the value of attribute impersonation_username.
27 28 29 |
# File 'lib/tableau_server_client/server.rb', line 27 def impersonation_username @impersonation_username end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
27 28 29 |
# File 'lib/tableau_server_client/server.rb', line 27 def logger @logger end |
#server_url ⇒ Object (readonly)
Returns the value of attribute server_url.
27 28 29 |
# File 'lib/tableau_server_client/server.rb', line 27 def server_url @server_url end |
#token_lifetime ⇒ Object (readonly)
Returns the value of attribute token_lifetime.
27 28 29 |
# File 'lib/tableau_server_client/server.rb', line 27 def token_lifetime @token_lifetime end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
27 28 29 |
# File 'lib/tableau_server_client/server.rb', line 27 def username @username end |
Instance Method Details
#full_site(id) ⇒ Object
43 44 45 |
# File 'lib/tableau_server_client/server.rb', line 43 def full_site(id) client_for_site(client.get(Resources::Site.location(path, id)).content_url).get Resources::Site.location(path, id) end |
#path ⇒ Object
51 52 53 |
# File 'lib/tableau_server_client/server.rb', line 51 def path nil end |
#schedules ⇒ Object
47 48 49 |
# File 'lib/tableau_server_client/server.rb', line 47 def schedules client.get_collection Resources::Schedule.location(path) end |
#site(id) ⇒ Object
35 36 37 |
# File 'lib/tableau_server_client/server.rb', line 35 def site(id) sites.select { |s| s.id == id }.first end |
#site_by_name(site_name) ⇒ Object
39 40 41 |
# File 'lib/tableau_server_client/server.rb', line 39 def site_by_name(site_name) sites.select { |s| s.name == site_name }.first end |