Files
mostlymatter/api/v4/source/remoteclusters.yaml
Miguel de la Cruz f8202309ce Adds logical deletes to shared channel remotes and remote clusters (#28159)
* Adds logical deletes to shared channel remotes and remote clusters

Instead of physically deleting the shared channel remote and remote
clusters records when a channel is unshared, a remote uninvited or a
remote cluster is deleted, now those have a logical `DeleteAt` field
that is set.

This allows us to safely restore shared channels between two remote
clusters (as of now resetting the cursor without backfilling their
contents) and to know which connections were established in the past
and now are severed.

* Delete the index in remoteclusters before adding the new column

* Fix bad error check
2024-09-12 13:55:11 +02:00

298 строки
8.7 KiB
YAML

"/api/v4/remotecluster":
get:
tags:
- remote clusters
summary: Get a list of remote clusters.
description: |
Get a list of remote clusters.
##### Permissions
`manage_secure_connections`
operationId: GetRemoteClusters
parameters:
- name: page
in: query
description: The page to select
schema:
type: integer
- name: per_page
in: query
description: The number of remote clusters per page
schema:
type: integer
- name: exclude_offline
in: query
description: Exclude offline remote clusters
schema:
type: boolean
- name: in_channel
in: query
description: Select remote clusters in channel
schema:
type: string
- name: not_in_channel
in: query
description: Select remote clusters not in this channel
schema:
type: string
- name: only_confirmed
in: query
description: Select only remote clusters already confirmed
schema:
type: boolean
- name: only_plugins
in: query
description: Select only remote clusters that belong to a plugin
schema:
type: boolean
- name: exclude_plugins
in: query
description: Select only remote clusters that don't belong to a plugin
schema:
type: boolean
- name: include_deleted
in: query
description: Include those remote clusters that have been deleted
schema:
type: boolean
responses:
"200":
description: Remote clusters fetch successful. Result might be empty.
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/RemoteCluster"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
post:
tags:
- remote clusters
summary: Create a new remote cluster.
description: |
Create a new remote cluster and generate an invite code.
##### Permissions
`manage_secure_connections`
operationId: CreateRemoteCluster
requestBody:
content:
application/json:
schema:
type: object
required:
- name
properties:
name:
type: string
display_name:
type: string
password:
type: string
description: |
The password to use in the invite code. If empty,
the server will generate one and it will be part
of the response
responses:
"201":
description: Remote cluster creation successful
content:
application/json:
schema:
type: object
properties:
remote_cluster:
$ref: "#/components/schemas/RemoteCluster"
invite:
type: string
description: The encrypted invite for the newly created remote cluster
password:
type: string
description: |
The password generated by the server if none was
sent on the create request
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/remotecluster/{remote_id}":
get:
tags:
- remote clusters
summary: Get a remote cluster.
description: |
Get the Remote Cluster details from the provided id string.
##### Permissions
`manage_secure_connections`
operationId: GetRemoteCluster
parameters:
- name: remote_id
in: path
description: Remote Cluster GUID
required: true
schema:
type: string
responses:
"200":
description: Remote Cluster retrieval successful
content:
application/json:
schema:
$ref: "#/components/schemas/RemoteCluster"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
patch:
tags:
- remote clusters
summary: Patch a remote cluster.
description: |
Partially update a Remote Cluster by providing only the fields you want to update. Ommited fields will not be updated.
##### Permissions
`manage_secure_connections`
operationId: PatchRemoteCluster
parameters:
- name: remote_id
in: path
description: Remote Cluster GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
display_name:
type: string
default_team_id:
type: string
description: The team where channels from invites are created
responses:
"200":
description: Remote Cluster patch successful
content:
application/json:
schema:
$ref: "#/components/schemas/RemoteCluster"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
delete:
tags:
- remote clusters
summary: Delete a remote cluster.
description: |
Deletes a Remote Cluster.
##### Permissions
`manage_secure_connections`
operationId: DeleteRemoteCluster
parameters:
- name: remote_id
in: path
description: Remote Cluster GUID
required: true
schema:
type: string
responses:
"204":
description: Remote Cluster deletion successful
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/remotecluster/{remote_id}/generate_invite":
post:
tags:
- remote clusters
summary: Generate invite code.
description: |
Generates an invite code for a given remote cluster.
##### Permissions
`manage_secure_connections`
operationId: GenerateRemoteClusterInvite
requestBody:
content:
application/json:
schema:
type: object
required:
- password
properties:
password:
type: string
description: The password to encrypt the invite code with.
responses:
"201":
description: Invite code generated
content:
application/json:
schema:
type: string
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/remotecluster/accept_invite":
post:
tags:
- remote clusters
summary: Accept a remote cluster invite code.
description: |
Accepts a remote cluster invite code.
##### Permissions
`manage_secure_connections`
operationId: AcceptRemoteClusterInvite
requestBody:
content:
application/json:
schema:
type: object
required:
- invite
- name
- password
properties:
invite:
type: string
name:
type: string
display_name:
type: string
password:
type: string
description: The password to decrypt the invite code.
responses:
"201":
description: Invite successfully accepted
content:
application/json:
schema:
type: object
$ref: "#/components/schemas/RemoteCluster"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"