mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 12:37:46 +00:00
132 lines
9.0 KiB
Markdown
132 lines
9.0 KiB
Markdown
# Updater
|
|
(*Updater*)
|
|
|
|
## Overview
|
|
|
|
This describes the API for searching and applying updates to the Plex Media Server.
|
|
Updates to the status can be observed via the Event API.
|
|
|
|
|
|
### Available Operations
|
|
|
|
* [GetUpdateStatus](#getupdatestatus) - Querying status of updates
|
|
* [CheckForUpdates](#checkforupdates) - Checking for updates
|
|
* [ApplyUpdates](#applyupdates) - Apply Updates
|
|
|
|
## GetUpdateStatus
|
|
|
|
Querying status of updates
|
|
|
|
### Example Usage
|
|
|
|
```csharp
|
|
using LukeHagar.PlexAPI.SDK;
|
|
using LukeHagar.PlexAPI.SDK.Models.Components;
|
|
|
|
var sdk = new PlexAPI(
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
|
|
);
|
|
|
|
var res = await sdk.Updater.GetUpdateStatusAsync();
|
|
|
|
// handle response
|
|
```
|
|
|
|
### Response
|
|
|
|
**[GetUpdateStatusResponse](../../Models/Requests/GetUpdateStatusResponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Object | Status Code | Content Type |
|
|
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
|
|
| LukeHagar.PlexAPI.SDK.Models.Errors.GetUpdateStatusBadRequest | 400 | application/json |
|
|
| LukeHagar.PlexAPI.SDK.Models.Errors.GetUpdateStatusUnauthorized | 401 | application/json |
|
|
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
|
|
|
|
|
|
## CheckForUpdates
|
|
|
|
Checking for updates
|
|
|
|
### Example Usage
|
|
|
|
```csharp
|
|
using LukeHagar.PlexAPI.SDK;
|
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
|
using LukeHagar.PlexAPI.SDK.Models.Components;
|
|
|
|
var sdk = new PlexAPI(
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
|
|
);
|
|
|
|
var res = await sdk.Updater.CheckForUpdatesAsync(download: LukeHagar.PlexAPI.SDK.Models.Requests.Download.One);
|
|
|
|
// handle response
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description | Example |
|
|
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
|
|
| `Download` | [Download](../../Models/Requests/Download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | 1 |
|
|
|
|
### Response
|
|
|
|
**[CheckForUpdatesResponse](../../Models/Requests/CheckForUpdatesResponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Object | Status Code | Content Type |
|
|
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
|
|
| LukeHagar.PlexAPI.SDK.Models.Errors.CheckForUpdatesBadRequest | 400 | application/json |
|
|
| LukeHagar.PlexAPI.SDK.Models.Errors.CheckForUpdatesUnauthorized | 401 | application/json |
|
|
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
|
|
|
|
|
|
## ApplyUpdates
|
|
|
|
Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
|
|
|
|
|
|
### Example Usage
|
|
|
|
```csharp
|
|
using LukeHagar.PlexAPI.SDK;
|
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
|
using LukeHagar.PlexAPI.SDK.Models.Components;
|
|
|
|
var sdk = new PlexAPI(
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
|
|
);
|
|
|
|
var res = await sdk.Updater.ApplyUpdatesAsync(
|
|
tonight: LukeHagar.PlexAPI.SDK.Models.Requests.Tonight.One,
|
|
skip: LukeHagar.PlexAPI.SDK.Models.Requests.Skip.One
|
|
);
|
|
|
|
// handle response
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description | Example |
|
|
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
| `Tonight` | [Tonight](../../Models/Requests/Tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | 1 |
|
|
| `Skip` | [Skip](../../Models/Requests/Skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. | 1 |
|
|
|
|
### Response
|
|
|
|
**[ApplyUpdatesResponse](../../Models/Requests/ApplyUpdatesResponse.md)**
|
|
|
|
### Errors
|
|
|
|
| Error Object | Status Code | Content Type |
|
|
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
|
|
| LukeHagar.PlexAPI.SDK.Models.Errors.ApplyUpdatesBadRequest | 400 | application/json |
|
|
| LukeHagar.PlexAPI.SDK.Models.Errors.ApplyUpdatesUnauthorized | 401 | application/json |
|
|
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
|