mirror of
https://github.com/LukeHagar/plex-sdk-docs.git
synced 2025-12-10 04:20:57 +00:00
Initial Commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import GetButlerTasks from "./get_butler_tasks/get_butler_tasks.mdx";
|
||||
import StartAllTasks from "./start_all_tasks/start_all_tasks.mdx";
|
||||
import StopAllTasks from "./stop_all_tasks/stop_all_tasks.mdx";
|
||||
import StartTask from "./start_task/start_task.mdx";
|
||||
import StopTask from "./stop_task/stop_task.mdx";
|
||||
|
||||
## Butler
|
||||
Butler is the task manager of the Plex Media Server Ecosystem.
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [Get Butler Tasks](/python/butler/get_butler_tasks) - Get Butler tasks
|
||||
* [Start All Tasks](/python/butler/start_all_tasks) - Start all Butler tasks
|
||||
* [Stop All Tasks](/python/butler/stop_all_tasks) - Stop all Butler tasks
|
||||
* [Start Task](/python/butler/start_task) - Start a single Butler task
|
||||
* [Stop Task](/python/butler/stop_task) - Stop a single Butler task
|
||||
|
||||
---
|
||||
<GetButlerTasks />
|
||||
|
||||
---
|
||||
<StartAllTasks />
|
||||
|
||||
---
|
||||
<StopAllTasks />
|
||||
|
||||
---
|
||||
<StartTask />
|
||||
|
||||
---
|
||||
<StopTask />
|
||||
@@ -0,0 +1,3 @@
|
||||
## Get Butler Tasks
|
||||
|
||||
Returns a list of butler tasks
|
||||
@@ -0,0 +1,2 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import GetButlerTasksResponse from "/content/types/models/operations/get_butler_tasks_response/python.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### *{`operations.GetButlerTasksResponse`}*
|
||||
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<GetButlerTasksResponse/>
|
||||
</Collapsible>
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
<CH.Code>
|
||||
```python GetButlerTasks.py
|
||||
import sdk
|
||||
|
||||
s = sdk.SDK(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
)
|
||||
|
||||
|
||||
res = s.butler.get_butler_tasks()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
```
|
||||
---
|
||||
|
||||
```json Example Response
|
||||
{
|
||||
"ButlerTasks": {
|
||||
"ButlerTask": [
|
||||
{
|
||||
"name": "BackupDatabase",
|
||||
"interval": 3,
|
||||
"scheduleRandomized": false,
|
||||
"enabled": false,
|
||||
"title": "Backup Database",
|
||||
"description": "Create a backup copy of the server's database in the configured backup directory"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
</CH.Code>
|
||||
@@ -0,0 +1,12 @@
|
||||
import CurlHeader from './_header.mdx';
|
||||
import SDKHeader from './_header.mdx';
|
||||
import OperationHeader from '/src/components/OperationHeader';
|
||||
|
||||
###### *Butler*
|
||||
|
||||
<OperationHeader
|
||||
sdkHeader={<SDKHeader />}
|
||||
curlHeader={<CurlHeader />}
|
||||
/>
|
||||
|
||||
{/* render operation */}
|
||||
@@ -0,0 +1,7 @@
|
||||
## Start All Tasks
|
||||
|
||||
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:
|
||||
1. Any tasks not scheduled to run on the current day will be skipped.
|
||||
2. 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.
|
||||
3. 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.
|
||||
4. If we are outside the configured window, the task will start immediately.
|
||||
@@ -0,0 +1,2 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import StartAllTasksResponse from "/content/types/models/operations/start_all_tasks_response/python.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### *{`operations.StartAllTasksResponse`}*
|
||||
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<StartAllTasksResponse/>
|
||||
</Collapsible>
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
<CH.Code>
|
||||
```python StartAllTasks.py
|
||||
import sdk
|
||||
|
||||
s = sdk.SDK(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
)
|
||||
|
||||
|
||||
res = s.butler.start_all_tasks()
|
||||
|
||||
if res.status_code == 200:
|
||||
# handle response
|
||||
pass
|
||||
```
|
||||
---
|
||||
|
||||
```json Example Response
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"code": 1001,
|
||||
"message": "User could not be authenticated",
|
||||
"status": 401
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CH.Code>
|
||||
@@ -0,0 +1,12 @@
|
||||
import CurlHeader from './_header.mdx';
|
||||
import SDKHeader from './_header.mdx';
|
||||
import OperationHeader from '/src/components/OperationHeader';
|
||||
|
||||
###### *Butler*
|
||||
|
||||
<OperationHeader
|
||||
sdkHeader={<SDKHeader />}
|
||||
curlHeader={<CurlHeader />}
|
||||
/>
|
||||
|
||||
{/* render operation */}
|
||||
@@ -0,0 +1,7 @@
|
||||
## Start Task
|
||||
|
||||
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:
|
||||
1. Any tasks not scheduled to run on the current day will be skipped.
|
||||
2. 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.
|
||||
3. 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.
|
||||
4. If we are outside the configured window, the task will start immediately.
|
||||
@@ -0,0 +1,12 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import TaskName from "/content/types/models/operations/task_name/python.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### `task_name` *{`operations.TaskName`}*
|
||||
the name of the task to be started.
|
||||
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<TaskName/>
|
||||
</Collapsible>
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import StartTaskResponse from "/content/types/models/operations/start_task_response/python.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### *{`operations.StartTaskResponse`}*
|
||||
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<StartTaskResponse/>
|
||||
</Collapsible>
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
<CH.Code>
|
||||
```python StartTask.py
|
||||
import sdk
|
||||
from sdk.models import operations
|
||||
|
||||
s = sdk.SDK(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
)
|
||||
|
||||
|
||||
res = s.butler.start_task(task_name=operations.TaskName.REFRESH_PERIODIC_METADATA)
|
||||
|
||||
if res.status_code == 200:
|
||||
# handle response
|
||||
pass
|
||||
```
|
||||
---
|
||||
|
||||
```json Example Response
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"code": 1001,
|
||||
"message": "User could not be authenticated",
|
||||
"status": 401
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CH.Code>
|
||||
@@ -0,0 +1,12 @@
|
||||
import CurlHeader from './_header.mdx';
|
||||
import SDKHeader from './_header.mdx';
|
||||
import OperationHeader from '/src/components/OperationHeader';
|
||||
|
||||
###### *Butler*
|
||||
|
||||
<OperationHeader
|
||||
sdkHeader={<SDKHeader />}
|
||||
curlHeader={<CurlHeader />}
|
||||
/>
|
||||
|
||||
{/* render operation */}
|
||||
@@ -0,0 +1,3 @@
|
||||
## Stop All Tasks
|
||||
|
||||
This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
|
||||
@@ -0,0 +1,2 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import StopAllTasksResponse from "/content/types/models/operations/stop_all_tasks_response/python.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### *{`operations.StopAllTasksResponse`}*
|
||||
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<StopAllTasksResponse/>
|
||||
</Collapsible>
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
<CH.Code>
|
||||
```python StopAllTasks.py
|
||||
import sdk
|
||||
|
||||
s = sdk.SDK(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
)
|
||||
|
||||
|
||||
res = s.butler.stop_all_tasks()
|
||||
|
||||
if res.status_code == 200:
|
||||
# handle response
|
||||
pass
|
||||
```
|
||||
---
|
||||
|
||||
```json Example Response
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"code": 1001,
|
||||
"message": "User could not be authenticated",
|
||||
"status": 401
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CH.Code>
|
||||
@@ -0,0 +1,12 @@
|
||||
import CurlHeader from './_header.mdx';
|
||||
import SDKHeader from './_header.mdx';
|
||||
import OperationHeader from '/src/components/OperationHeader';
|
||||
|
||||
###### *Butler*
|
||||
|
||||
<OperationHeader
|
||||
sdkHeader={<SDKHeader />}
|
||||
curlHeader={<CurlHeader />}
|
||||
/>
|
||||
|
||||
{/* render operation */}
|
||||
@@ -0,0 +1,3 @@
|
||||
## Stop Task
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,12 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import PathParamTaskName from "/content/types/models/operations/path_param_task_name/python.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### `task_name` *{`operations.PathParamTaskName`}*
|
||||
The name of the task to be started.
|
||||
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<PathParamTaskName/>
|
||||
</Collapsible>
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import StopTaskResponse from "/content/types/models/operations/stop_task_response/python.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### *{`operations.StopTaskResponse`}*
|
||||
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<StopTaskResponse/>
|
||||
</Collapsible>
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
<CH.Code>
|
||||
```python StopTask.py
|
||||
import sdk
|
||||
from sdk.models import operations
|
||||
|
||||
s = sdk.SDK(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
)
|
||||
|
||||
|
||||
res = s.butler.stop_task(task_name=operations.PathParamTaskName.GENERATE_CHAPTER_THUMBS)
|
||||
|
||||
if res.status_code == 200:
|
||||
# handle response
|
||||
pass
|
||||
```
|
||||
---
|
||||
|
||||
```json Example Response
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"code": 1001,
|
||||
"message": "User could not be authenticated",
|
||||
"status": 401
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CH.Code>
|
||||
@@ -0,0 +1,12 @@
|
||||
import CurlHeader from './_header.mdx';
|
||||
import SDKHeader from './_header.mdx';
|
||||
import OperationHeader from '/src/components/OperationHeader';
|
||||
|
||||
###### *Butler*
|
||||
|
||||
<OperationHeader
|
||||
sdkHeader={<SDKHeader />}
|
||||
curlHeader={<CurlHeader />}
|
||||
/>
|
||||
|
||||
{/* render operation */}
|
||||
Reference in New Issue
Block a user