Files
peernet/demo_server/openapi_server/openapi/openapi.yaml
2024-04-06 20:45:15 -07:00

659 lines
18 KiB
YAML

openapi: 3.0.3
info:
title: PeerNetService API
version: 0.0.1
servers:
- url: /
tags:
- name: PeerNetService
paths:
/v1/rooms/{room}:
get:
operationId: peer_net_service_get_room
parameters:
- description: The room id.
explode: false
in: path
name: room
required: true
schema:
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Room'
description: OK
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
description: Default error response
tags:
- PeerNetService
x-openapi-router-controller: openapi_server.controllers.peer_net_service_controller
/v1/servers:
post:
operationId: peer_net_service_create_server
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Server'
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Server'
description: OK
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
description: Default error response
tags:
- PeerNetService
x-openapi-router-controller: openapi_server.controllers.peer_net_service_controller
/v1/servers/*:
delete:
operationId: peer_net_service_delete_server
parameters:
- explode: true
in: query
name: name
required: false
schema:
type: string
style: form
responses:
"200":
content: {}
description: OK
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
description: Default error response
tags:
- PeerNetService
x-openapi-router-controller: openapi_server.controllers.peer_net_service_controller
/v1/servers/{server}/services:
post:
operationId: peer_net_service_create_service
parameters:
- description: The server id.
explode: false
in: path
name: server
required: true
schema:
type: string
style: simple
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Service'
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Service'
description: OK
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
description: Default error response
tags:
- PeerNetService
x-openapi-router-controller: openapi_server.controllers.peer_net_service_controller
/v1/servers/{server}/services/{service}:
delete:
operationId: peer_net_service_delete_service
parameters:
- description: The server id.
explode: false
in: path
name: server
required: true
schema:
type: string
style: simple
- description: The service id.
explode: false
in: path
name: service
required: true
schema:
type: string
style: simple
responses:
"200":
content: {}
description: OK
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
description: Default error response
tags:
- PeerNetService
x-openapi-router-controller: openapi_server.controllers.peer_net_service_controller
/v1/servers/{server}/services/{service}/knocks:
get:
operationId: peer_net_service_list_knocks
parameters:
- description: The server id.
explode: false
in: path
name: server
required: true
schema:
type: string
style: simple
- description: The service id.
explode: false
in: path
name: service
required: true
schema:
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/ListKnocksResponse'
description: OK
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
description: Default error response
tags:
- PeerNetService
x-openapi-router-controller: openapi_server.controllers.peer_net_service_controller
post:
description: |-
Creates a knock that will be answered by the peer; the signaler may
delete the knock, regardless of the state, when it ages.
operationId: peer_net_service_create_knock
parameters:
- description: The server id.
explode: false
in: path
name: server
required: true
schema:
type: string
style: simple
- description: The service id.
explode: false
in: path
name: service
required: true
schema:
type: string
style: simple
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Knock'
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Knock'
description: OK
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
description: Default error response
tags:
- PeerNetService
x-openapi-router-controller: openapi_server.controllers.peer_net_service_controller
/v1/servers/{server}/services/{service}/knocks/{knock}:
get:
operationId: peer_net_service_get_knock
parameters:
- description: The server id.
explode: false
in: path
name: server
required: true
schema:
type: string
style: simple
- description: The service id.
explode: false
in: path
name: service
required: true
schema:
type: string
style: simple
- description: The knock id.
explode: false
in: path
name: knock
required: true
schema:
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Knock'
description: OK
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
description: Default error response
tags:
- PeerNetService
x-openapi-router-controller: openapi_server.controllers.peer_net_service_controller
patch:
operationId: peer_net_service_update_knock
parameters:
- description: The server id.
explode: false
in: path
name: server
required: true
schema:
type: string
style: simple
- description: The service id.
explode: false
in: path
name: service
required: true
schema:
type: string
style: simple
- description: The knock id.
explode: false
in: path
name: knock
required: true
schema:
type: string
style: simple
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Knock'
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Knock'
description: OK
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
description: Default error response
tags:
- PeerNetService
x-openapi-router-controller: openapi_server.controllers.peer_net_service_controller
/v1/sessions/{session}/candidates:
post:
operationId: peer_net_service_create_ice_candidate
parameters:
- description: The session id.
explode: false
in: path
name: session
required: true
schema:
type: string
style: simple
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/IceCandidate'
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/IceCandidate'
description: OK
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
description: Default error response
tags:
- PeerNetService
x-openapi-router-controller: openapi_server.controllers.peer_net_service_controller
/v1/sessions/{session}/claim/candidates:
get:
description: Acts as both List and Delete atomically.
operationId: peer_net_service_claim_ice_candidates
parameters:
- description: The session id.
explode: false
in: path
name: session
required: true
schema:
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/ClaimIceCandidatesResponse'
description: OK
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
description: Default error response
tags:
- PeerNetService
x-openapi-router-controller: openapi_server.controllers.peer_net_service_controller
components:
schemas:
ClaimIceCandidatesResponse:
example:
iceCandidates:
- candidate: candidate
usernameFragment: usernameFragment
name: name
sdpMid: sdpMid
sdpLineIndex: 0
- candidate: candidate
usernameFragment: usernameFragment
name: name
sdpMid: sdpMid
sdpLineIndex: 0
properties:
iceCandidates:
items:
$ref: '#/components/schemas/IceCandidate'
title: iceCandidates
type: array
title: ClaimIceCandidatesResponse
type: object
GoogleProtobufAny:
additionalProperties: true
description: Contains an arbitrary serialized message along with a @type that
describes the type of the serialized message.
example:
'@type': '@type'
properties:
'@type':
description: The type of the serialized message.
type: string
title: GoogleProtobufAny
type: object
IceCandidate:
example:
candidate: candidate
usernameFragment: usernameFragment
name: name
sdpMid: sdpMid
sdpLineIndex: 0
properties:
name:
title: name
type: string
candidate:
title: candidate
type: string
sdpMid:
title: sdpMid
type: string
sdpLineIndex:
format: int32
title: sdpLineIndex
type: integer
usernameFragment:
title: usernameFragment
type: string
title: IceCandidate
type: object
IceSessionDescription:
example:
name: name
sdpType: sdpType
sdp: sdp
properties:
name:
description: |-
A unique identifier which can be used to send ICE candidates
Maps to the session name
title: name
type: string
sdpType:
description: Used to construct the remote description in WebRTC
title: sdpType
type: string
sdp:
title: sdp
type: string
title: IceSessionDescription
type: object
Knock:
example:
offer: ""
answer:
name: name
sdpType: sdpType
sdp: sdp
name: name
properties:
name:
title: name
type: string
offer:
allOf:
- $ref: '#/components/schemas/IceSessionDescription'
description: The service being connected too
title: offer
answer:
$ref: '#/components/schemas/IceSessionDescription'
title: Knock
type: object
ListKnocksResponse:
example:
knocks:
- offer: ""
answer:
name: name
sdpType: sdpType
sdp: sdp
name: name
- offer: ""
answer:
name: name
sdpType: sdpType
sdp: sdp
name: name
properties:
knocks:
items:
$ref: '#/components/schemas/Knock'
title: knocks
type: array
title: ListKnocksResponse
type: object
Room:
example:
servers:
- rooms:
- rooms
- rooms
displayName: displayName
authToken: authToken
name: name
services:
- protocol: protocol
name: name
version: version
- protocol: protocol
name: name
version: version
- rooms:
- rooms
- rooms
displayName: displayName
authToken: authToken
name: name
services:
- protocol: protocol
name: name
version: version
- protocol: protocol
name: name
version: version
displayName: displayName
name: name
properties:
name:
title: name
type: string
displayName:
title: displayName
type: string
servers:
items:
$ref: '#/components/schemas/Server'
title: servers
type: array
title: Room
type: object
Server:
example:
rooms:
- rooms
- rooms
displayName: displayName
authToken: authToken
name: name
services:
- protocol: protocol
name: name
version: version
- protocol: protocol
name: name
version: version
properties:
name:
title: name
type: string
rooms:
description: |-
Tracks which rooms the server should be listed in; this will not
be set when a room is listed to preserve privacy of servers.
items:
type: string
title: rooms
type: array
writeOnly: true
authToken:
description: |-
Used to authenticate requests which access knocks for this server
or attempt to update, delete or create services.
In future calls, add a header with the format:
Authorization: Bearer <auth_token>
title: authToken
type: string
writeOnly: true
displayName:
title: displayName
type: string
services:
items:
$ref: '#/components/schemas/Service'
title: services
type: array
title: Server
type: object
Service:
example:
protocol: protocol
name: name
version: version
properties:
name:
title: name
type: string
protocol:
title: protocol
type: string
version:
title: version
type: string
title: Service
type: object
Status:
description: "The `Status` type defines a logical error model that is suitable\
\ for different programming environments, including REST APIs and RPC APIs.\
\ It is used by [gRPC](https://github.com/grpc). Each `Status` message contains\
\ three pieces of data: error code, error message, and error details. You\
\ can find out more about this error model and how to work with it in the\
\ [API Design Guide](https://cloud.google.com/apis/design/errors)."
example:
code: 0
details:
- '@type': '@type'
- '@type': '@type'
message: message
properties:
code:
description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]."
format: int32
title: code
type: integer
message:
description: "A developer-facing error message, which should be in English.\
\ Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details]\
\ field, or localized by the client."
title: message
type: string
details:
description: A list of messages that carry the error details. There is
a common set of message types for APIs to use.
items:
$ref: '#/components/schemas/GoogleProtobufAny'
title: details
type: array
title: Status
type: object