Class: TableauServerClient::Resources::Schedule

Inherits:
Resource
  • Object
show all
Defined in:
lib/tableau_server_client/resources/schedule.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, #location, #path, plural_resource_name, resource_name, #server_url, #site_id, #site_path

Methods included from TableauServerClient::RequestBuilder

#build_request

Constructor Details

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

Instance Attribute Details

#created_atObject (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

#frequencyObject (readonly)

Returns the value of attribute frequency.



8
9
10
# File 'lib/tableau_server_client/resources/schedule.rb', line 8

def frequency
  @frequency
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/tableau_server_client/resources/schedule.rb', line 8

def id
  @id
end

#nameObject (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_atObject (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

#priorityObject (readonly)

Returns the value of attribute priority.



8
9
10
# File 'lib/tableau_server_client/resources/schedule.rb', line 8

def priority
  @priority
end

#stateObject (readonly)

Returns the value of attribute state.



8
9
10
# File 'lib/tableau_server_client/resources/schedule.rb', line 8

def state
  @state
end

#typeObject (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_atObject (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