mirror of
https://github.com/LukeHagar/plex-sdk-docs.git
synced 2025-12-09 04:20:52 +00:00
Initial Commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import GetServerActivities from "./get_server_activities/get_server_activities.mdx";
|
||||
import CancelServerActivities from "./cancel_server_activities/cancel_server_activities.mdx";
|
||||
|
||||
## Activities
|
||||
Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real\-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
|
||||
Activities are associated with HTTP replies via a special `X\-Plex\-Activity` header which contains the UUID of the activity.
|
||||
Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details:
|
||||
\- They can contain a `progress` (from 0 to 100) marking the percent completion of the activity.
|
||||
\- They must contain an `type` which is used by clients to distinguish the specific activity.
|
||||
\- They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.)
|
||||
\- The may contain a `Response` object which attributes which represent the result of the asynchronous operation.
|
||||
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [Get Server Activities](/python/activities/get_server_activities) - Get Server Activities
|
||||
* [Cancel Server Activities](/python/activities/cancel_server_activities) - Cancel Server Activities
|
||||
|
||||
---
|
||||
<GetServerActivities />
|
||||
|
||||
---
|
||||
<CancelServerActivities />
|
||||
@@ -0,0 +1,3 @@
|
||||
## Cancel Server Activities
|
||||
|
||||
Cancel Server Activities
|
||||
@@ -0,0 +1,5 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
##### `activity_uuid` *{`str`}*
|
||||
The UUID of the activity to cancel.
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import CancelServerActivitiesResponse from "/content/types/models/operations/cancel_server_activities_response/python.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### *{`operations.CancelServerActivitiesResponse`}*
|
||||
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<CancelServerActivitiesResponse/>
|
||||
</Collapsible>
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
<CH.Code>
|
||||
```python CancelServerActivities.py
|
||||
import sdk
|
||||
from sdk.models import operations
|
||||
|
||||
s = sdk.SDK(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
)
|
||||
|
||||
|
||||
res = s.activities.cancel_server_activities(activity_uuid='string')
|
||||
|
||||
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';
|
||||
|
||||
###### *Activities*
|
||||
|
||||
<OperationHeader
|
||||
sdkHeader={<SDKHeader />}
|
||||
curlHeader={<CurlHeader />}
|
||||
/>
|
||||
|
||||
{/* render operation */}
|
||||
@@ -0,0 +1,3 @@
|
||||
## Get Server Activities
|
||||
|
||||
Get Server Activities
|
||||
@@ -0,0 +1,2 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{/* Autogenerated DO NOT EDIT */}
|
||||
import GetServerActivitiesResponse from "/content/types/models/operations/get_server_activities_response/python.mdx"
|
||||
import Collapsible from "/src/components/Collapsible";
|
||||
import Labels from "/src/lib/labels";
|
||||
|
||||
##### *{`operations.GetServerActivitiesResponse`}*
|
||||
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
|
||||
<GetServerActivitiesResponse/>
|
||||
</Collapsible>
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
<CH.Code>
|
||||
```python GetServerActivities.py
|
||||
import sdk
|
||||
|
||||
s = sdk.SDK(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
)
|
||||
|
||||
|
||||
res = s.activities.get_server_activities()
|
||||
|
||||
if res.object is not None:
|
||||
# handle response
|
||||
pass
|
||||
```
|
||||
---
|
||||
|
||||
```json Example Response
|
||||
{
|
||||
"MediaContainer": {
|
||||
"size": 6235.64,
|
||||
"Activity": [
|
||||
{
|
||||
"uuid": "string",
|
||||
"type": "string",
|
||||
"cancellable": false,
|
||||
"userID": 6458.94,
|
||||
"title": "string",
|
||||
"subtitle": "string",
|
||||
"progress": 3843.82,
|
||||
"Context": {
|
||||
"librarySectionID": "string"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
</CH.Code>
|
||||
@@ -0,0 +1,12 @@
|
||||
import CurlHeader from './_header.mdx';
|
||||
import SDKHeader from './_header.mdx';
|
||||
import OperationHeader from '/src/components/OperationHeader';
|
||||
|
||||
###### *Activities*
|
||||
|
||||
<OperationHeader
|
||||
sdkHeader={<SDKHeader />}
|
||||
curlHeader={<CurlHeader />}
|
||||
/>
|
||||
|
||||
{/* render operation */}
|
||||
Reference in New Issue
Block a user