Class: TableauServerClient::Resources::Site

Inherits:
Resource
  • Object
show all
Defined in:
lib/tableau_server_client/resources/site.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

attr_reader, attributes, #attributes, #delete!, extract_attributes, extract_site_path, #initialize, location, #path, resource_name, #site_path

Methods included from TableauServerClient::RequestBuilder

#build_request

Constructor Details

This class inherits a constructor from TableauServerClient::Resources::Resource

Instance Attribute Details

#admin_modeObject (readonly)

Returns the value of attribute admin_mode.



12
13
14
# File 'lib/tableau_server_client/resources/site.rb', line 12

def admin_mode
  @admin_mode
end

#content_urlObject (readonly)

Returns the value of attribute content_url.



12
13
14
# File 'lib/tableau_server_client/resources/site.rb', line 12

def content_url
  @content_url
end

#idObject (readonly)

Returns the value of attribute id.



12
13
14
# File 'lib/tableau_server_client/resources/site.rb', line 12

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



12
13
14
# File 'lib/tableau_server_client/resources/site.rb', line 12

def name
  @name
end

#stateObject (readonly)

Returns the value of attribute state.



12
13
14
# File 'lib/tableau_server_client/resources/site.rb', line 12

def state
  @state
end

#storage_quotaObject (readonly)

Returns the value of attribute storage_quota.



12
13
14
# File 'lib/tableau_server_client/resources/site.rb', line 12

def storage_quota
  @storage_quota
end

Class Method Details

.from_collection_response(client, path, xml) ⇒ Object



19
20
21
22
23
24
# File 'lib/tableau_server_client/resources/site.rb', line 19

def self.from_collection_response(client, path, xml)
  xml.xpath("//xmlns:sites/xmlns:site").each do |s|
    id = s['id']
    yield from_response(client, "#{path}/#{id}", s)
  end
end

.from_response(client, path, xml) ⇒ Object



14
15
16
17
# File 'lib/tableau_server_client/resources/site.rb', line 14

def self.from_response(client, path, xml)
  attrs = extract_attributes(xml)
  new(client, path, attrs)
end

Instance Method Details

#datasource(id) ⇒ Object



30
31
32
# File 'lib/tableau_server_client/resources/site.rb', line 30

def datasource(id)
  @client.get Datasource.location(path, id)
end

#datasources(filter: []) ⇒ Object



26
27
28
# File 'lib/tableau_server_client/resources/site.rb', line 26

def datasources(filter: [])
  @client.get_collection Datasource.location(path, filter: filter)
end

#project(id) ⇒ Object



54
55
56
# File 'lib/tableau_server_client/resources/site.rb', line 54

def project(id)
  projects.find { |p| p.id == id }
end

#projects(filter: []) ⇒ Object



50
51
52
# File 'lib/tableau_server_client/resources/site.rb', line 50

def projects(filter: [])
  @client.get_collection Project.location(path, filter: filter)
end

#subscription(id) ⇒ Object



62
63
64
# File 'lib/tableau_server_client/resources/site.rb', line 62

def subscription(id)
  subscriptions.find {|s| s.id = id }
end

#subscriptionsObject



58
59
60
# File 'lib/tableau_server_client/resources/site.rb', line 58

def subscriptions
  @client.get_collection Subscription.location(path)
end

#user(id) ⇒ Object



46
47
48
# File 'lib/tableau_server_client/resources/site.rb', line 46

def user(id)
  @client.get User.location(path, id)
end

#users(filter: []) ⇒ Object



42
43
44
# File 'lib/tableau_server_client/resources/site.rb', line 42

def users(filter: [])
  @client.get_collection User.location(path, filter: filter)
end

#workbook(id) ⇒ Object



38
39
40
# File 'lib/tableau_server_client/resources/site.rb', line 38

def workbook(id)
  @client.get Workbook.location(path, id)
end

#workbooks(filter: []) ⇒ Object



34
35
36
# File 'lib/tableau_server_client/resources/site.rb', line 34

def workbooks(filter: [])
  @client.get_collection Workbook.location(path, filter: filter)
end