Skip to content

Commit c7ce424

Browse files
committed
new: Added region endpoints, authentication schemes
* GET /regions * GET /regions/{regionId} This is the initial commit - a minimum viable OpenAPI 3.0.1 schema for the Linode API. This schema describes _only_ the Regions endpoints, but also details authentication schemes and other boilerplate to make the schema workable.
0 parents  commit c7ce424

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

swagger.yaml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
openapi: 3.0.1
2+
info:
3+
version: 4.0.0
4+
title: Linode API V4
5+
description: Linode API Description goes here
6+
contact:
7+
name: Linode
8+
9+
url: 'https://linode.com'
10+
servers:
11+
- url: 'https://api.linode.com/v4'
12+
paths:
13+
/regions:
14+
get:
15+
description: |
16+
List the regions available for Linode services. Not all services are
17+
guaranteed to be available in all regions.
18+
operationId: getRegions
19+
responses:
20+
'200':
21+
description: Returns a list of Regions
22+
content:
23+
application/json:
24+
schema:
25+
allOf:
26+
- $ref: '#/components/schemas/PaginationEnvelope'
27+
properties:
28+
data:
29+
type: array
30+
items:
31+
$ref: '#/components/schemas/Region'
32+
'/regions/{regionId}':
33+
parameters:
34+
- name: regionId
35+
in: path
36+
description: ID of the Region to look at
37+
required: true
38+
schema:
39+
type: string
40+
get:
41+
description: |
42+
Get information about a single Region.
43+
operationId: getRegion
44+
security:
45+
- personalAccessToken: []
46+
responses:
47+
'200':
48+
description: A single Region object
49+
content:
50+
application/json:
51+
schema:
52+
$ref: '#/components/schemas/Region'
53+
components:
54+
securitySchemes:
55+
personalAccessToken:
56+
type: apiKey
57+
name: Authorization
58+
in: header
59+
oauth:
60+
type: oauth2
61+
flows:
62+
implicit:
63+
authorizationUrl: 'https://login.linode.com/oauth/authoirze'
64+
scopes:
65+
'linodes:view': GET endpoints for Linodes
66+
schemas:
67+
PaginationEnvelope:
68+
required:
69+
- pages
70+
- page
71+
- results
72+
- data
73+
properties:
74+
data:
75+
type: array
76+
pages:
77+
type: integer
78+
page:
79+
type: integer
80+
results:
81+
type: integer
82+
Region:
83+
required:
84+
- id
85+
- country
86+
properties:
87+
id:
88+
type: string
89+
country:
90+
type: string

0 commit comments

Comments
 (0)