(butler)
Butler is the task manager of the Plex Media Server Ecosystem.
- get_butler_tasks - Get Butler tasks
- start_all_tasks - Start all Butler tasks
- stop_all_tasks - Stop all Butler tasks
- start_task - Start a single Butler task
- stop_task - Stop a single Butler task
Returns a list of butler tasks
require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new(
client_id: "3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name: "Plex for Roku",
client_version: "2.4.1",
platform: "Roku",
device_nickname: "Roku 3",
)
s.config_security(
::PlexRubySDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.butler.get_butler_tasks()
if ! res.object.nil?
# handle response
end
T.nilable(::PlexRubySDK::Operations::GetButlerTasksResponse)
This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
- Any tasks not scheduled to run on the current day will be skipped.
- If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
- If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
- If we are outside the configured window, the task will start immediately.
require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new(
client_id: "3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name: "Plex for Roku",
client_version: "2.4.1",
platform: "Roku",
device_nickname: "Roku 3",
)
s.config_security(
::PlexRubySDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.butler.start_all_tasks()
if res.status_code == 200
# handle response
end
T.nilable(::PlexRubySDK::Operations::StartAllTasksResponse)
This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new(
client_id: "3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name: "Plex for Roku",
client_version: "2.4.1",
platform: "Roku",
device_nickname: "Roku 3",
)
s.config_security(
::PlexRubySDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.butler.stop_all_tasks()
if res.status_code == 200
# handle response
end
T.nilable(::PlexRubySDK::Operations::StopAllTasksResponse)
This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
- Any tasks not scheduled to run on the current day will be skipped.
- If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
- If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
- If we are outside the configured window, the task will start immediately.
require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new(
client_id: "3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name: "Plex for Roku",
client_version: "2.4.1",
platform: "Roku",
device_nickname: "Roku 3",
)
s.config_security(
::PlexRubySDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.butler.start_task(task_name=::PlexRubySDK::Operations::TaskName::CLEAN_OLD_BUNDLES)
if res.status_code == 200
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
task_name |
::PlexRubySDK::Operations::TaskName | ✔️ | the name of the task to be started. |
T.nilable(::PlexRubySDK::Operations::StartTaskResponse)
This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint.
require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new(
client_id: "3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name: "Plex for Roku",
client_version: "2.4.1",
platform: "Roku",
device_nickname: "Roku 3",
)
s.config_security(
::PlexRubySDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.butler.stop_task(task_name=::PlexRubySDK::Operations::PathParamTaskName::BACKUP_DATABASE)
if res.status_code == 200
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
task_name |
::PlexRubySDK::Operations::PathParamTaskName | ✔️ | The name of the task to be started. |