Class: TableauServerClient::Resources::Schedule
- Defined in:
- lib/tableau_server_client/resources/schedule.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#frequency ⇒ Object
readonly
Returns the value of attribute frequency.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#next_run_at ⇒ Object
readonly
Returns the value of attribute next_run_at.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Resource
attr_reader, attributes, #attributes, #delete!, extract_attributes, extract_site_path, #initialize, location, #location, #path, plural_resource_name, resource_name, #server_url, #site_id, #site_path
Methods included from TableauServerClient::RequestBuilder
Constructor Details
This class inherits a constructor from TableauServerClient::Resources::Resource
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
8 9 10 |
# File 'lib/tableau_server_client/resources/schedule.rb', line 8 def created_at @created_at end |
#frequency ⇒ Object (readonly)
Returns the value of attribute frequency.
8 9 10 |
# File 'lib/tableau_server_client/resources/schedule.rb', line 8 def frequency @frequency end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/tableau_server_client/resources/schedule.rb', line 8 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/tableau_server_client/resources/schedule.rb', line 8 def name @name end |
#next_run_at ⇒ Object (readonly)
Returns the value of attribute next_run_at.
8 9 10 |
# File 'lib/tableau_server_client/resources/schedule.rb', line 8 def next_run_at @next_run_at end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
8 9 10 |
# File 'lib/tableau_server_client/resources/schedule.rb', line 8 def priority @priority end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
8 9 10 |
# File 'lib/tableau_server_client/resources/schedule.rb', line 8 def state @state end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/tableau_server_client/resources/schedule.rb', line 8 def type @type end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
8 9 10 |
# File 'lib/tableau_server_client/resources/schedule.rb', line 8 def updated_at @updated_at end |
Class Method Details
.from_collection_response(client, path, xml) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/tableau_server_client/resources/schedule.rb', line 15 def self.from_collection_response(client, path, xml) xml.xpath("//xmlns:schedules/xmlns:schedule").each do |s| id = s.xpath("@id").first.value yield from_response(client, "#{path}/#{id}", s) end end |
.from_response(client, path, xml) ⇒ Object
10 11 12 13 |
# File 'lib/tableau_server_client/resources/schedule.rb', line 10 def self.from_response(client, path, xml) attrs = extract_attributes(xml) new(client, path, attrs) end |
Instance Method Details
#run_now(site) ⇒ Object
26 27 28 |
# File 'lib/tableau_server_client/resources/schedule.rb', line 26 def run_now(site) tasks(site).map {|t| t.run_now } end |
#tasks(site) ⇒ Object
22 23 24 |
# File 'lib/tableau_server_client/resources/schedule.rb', line 22 def tasks(site) site.extract_refreshes.select {|t| t.schedule_id == id } end |