From d9eb97f62993f64ab40a256af27053494e36fb79 Mon Sep 17 00:00:00 2001 From: "jasonlandbridge@protonmail.com" Date: Wed, 21 Aug 2024 14:02:35 +0200 Subject: [PATCH] Added resources endpoint --- models/PlexDevice.yaml | 83 ++++++++++++++++++++++++++++++++++ paths/resources/resources.yaml | 48 ++++++++++++++++++++ pms-spec.yaml | 5 ++ 3 files changed, 136 insertions(+) create mode 100644 models/PlexDevice.yaml create mode 100644 paths/resources/resources.yaml diff --git a/models/PlexDevice.yaml b/models/PlexDevice.yaml new file mode 100644 index 00000000..453c2bdb --- /dev/null +++ b/models/PlexDevice.yaml @@ -0,0 +1,83 @@ +title: PlexDevice +type: object +required: + - name + - product + - productVersion + - platform + - platformVersion + - device + - clientIdentifier + - createdAt + - lastSeenAt + - provides +properties: + name: + type: string + product: + type: string + productVersion: + type: string + platform: + type: string + platformVersion: + type: string + device: + type: string + clientIdentifier: + type: string + createdAt: + type: string + format: date-time + lastSeenAt: + type: string + format: date-time + provides: + type: string + ownerId: + type: string + format: nullable + sourceTitle: + type: string + format: nullable + publicAddress: + type: string + accessToken: + type: string + owned: + type: boolean + home: + type: boolean + synced: + type: boolean + relay: + type: boolean + presence: + type: boolean + httpsRequired: + type: boolean + publicAddressMatches: + type: boolean + dnsRebindingProtection: + type: boolean + natLoopbackSupported: + type: boolean + connections: + type: array + items: + type: object + properties: + protocol: + type: string + address: + type: string + port: + type: number + uri: + type: string + local: + type: boolean + relay: + type: boolean + IPv6: + type: boolean diff --git a/paths/resources/resources.yaml b/paths/resources/resources.yaml new file mode 100644 index 00000000..4c14485e --- /dev/null +++ b/paths/resources/resources.yaml @@ -0,0 +1,48 @@ +get: + servers: + - url: 'https://plex.tv/api/v2' + security: [] + tags: + - Plex + summary: Get Devices + description: Get Devices + operationId: getDevices + parameters: + - $ref: "../../parameters/ClientIdentifier.yaml" + - name: includeHttps + in: query + description: Include Https entries in the results + schema: + type: integer + enum: + - 0 + - 1 + - name: includeRelay + in: query + description: Include Relay addresses in the results + schema: + type: integer + enum: + - 0 + - 1 + - name: includeIPv6 + in: query + description: Include IPv6 entries in the results + schema: + type: integer + enum: + - 0 + - 1 + responses: + '200': + description: List of Plex Devices. This includes Plex hosted servers and clients + content: + application/json: + schema: + type: array + items: + $ref: ../models/PlexDevice.yaml + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' diff --git a/pms-spec.yaml b/pms-spec.yaml index e8b59dc6..b53df367 100644 --- a/pms-spec.yaml +++ b/pms-spec.yaml @@ -132,6 +132,11 @@ paths: /library/onDeck: $ref: "./paths/library/ondeck.yaml" + # Resources + # Folder: pms/resources + /resources: + $ref: "./paths/resources/resources.yaml" + # Logs # Folder: pms/paths/logs /log: