Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add return_url #22

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 66 additions & 39 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ paths:
get:
responses:
'200':
description: OK
$ref: '#/components/responses/200'
'400':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/400'

/locations:
get:
description: Lists all the visible locations to the caller.
parameters:
- name: asn
in: query
description: List available locations for peering with the given ASN
description: List available locations for peering with the given peer ASN
required: true
schema:
type: integer
Expand Down Expand Up @@ -72,11 +72,11 @@ paths:
content:
application/json:
schema:
$ref: '#/components/responses/ListLocationsResponse'
$ref: '#/components/schemas/ListLocationsResponse'
'400':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/400'
'403':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/403'

/sessions:
post:
Expand All @@ -86,19 +86,21 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/SessionArray'
$ref: '#/components/schemas/CreateSessionsRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/responses/CreateSessionsResponse'
$ref: '#/components/schemas/CreateSessionsResponse'
'400':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/400'
'403':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/403'
'422':
$ref: '#/components/responses/422'

get:
description: Lists a set of sessions visible to the caller. Each session in the set contains a summary of its current status.
Expand Down Expand Up @@ -130,11 +132,11 @@ paths:
content:
application/json:
schema:
$ref: '#/components/responses/ListSessionsResponse'
$ref: '#/components/schemas/ListSessionsResponse'
'400':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/400'
'403':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/403'

delete:
description: Requests to turn the session down and delete it from the server.
Expand All @@ -151,11 +153,11 @@ paths:
content:
application/json:
schema:
$ref: '#/components/responses/DeleteSessionsResponse'
$ref: '#/components/schemas/DeleteSessionsResponse'
'400':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/400'
'403':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/403'

/sessions/{session_id}:
get:
Expand All @@ -175,16 +177,15 @@ paths:
schema:
$ref: '#/components/schemas/Session'
'400':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/400'
'403':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/403'
'404':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/404'

delete:
description: Requests to turn the session down and delete it from the server.
parameters:
parameters:
- name: session_id
in: path
description: Server-generated stable identifier for the session.
Expand All @@ -199,11 +200,11 @@ paths:
schema:
$ref: '#/components/schemas/Session'
'400':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/400'
'403':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/403'
'404':
$ref: '#/components/responses/ErrorResponse'
$ref: '#/components/responses/404'

components:
schemas:
Expand Down Expand Up @@ -301,7 +302,7 @@ components:
title: BGP Session References
description: Array of BGP Session References
type: array
sessions:
items:
$ref: '#/components/schemas/SessionReference'

SessionReference:
Expand Down Expand Up @@ -346,20 +347,25 @@ components:
items:
type: string
readOnly: true
example:
name: peer_asn
messages:
- asn not available at that location
required:
- name
- errors

requests:
CreateSessionsRequest:
title: CreateSessionsRequest
description: Response to a request to create sessions
type: object
properties:
sessions:
$ref: '#/components/schemas/SessionRequestArray'
return_url:
description: URL to requestor's endpoint to negotiate the session creation
type: string

responses:
ListLocationsResponse:
title: ListLocationsResponse
description: Response to a list for locations
Expand Down Expand Up @@ -402,19 +408,40 @@ components:

ErrorResponse:
description: API Error response
type: object
properties:
errors:
$ref: '#/components/schemas/Error'
required:
- errors
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Human intervention required
content:
application/json:
schema:
type: object
properties:
errors:
$ref: '#/components/schemas/Error'
required:
- errors
examples:
error-example:
value:
errors:
- name: peer_asn
messages:
- asn not available at that location
$ref: '#/components/schemas/ErrorResponse'
Loading