-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yaml
122 lines (121 loc) · 2.92 KB
/
swagger.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
swagger: "2.0"
info:
description: "This is the API for Asset Store."
version: "1.0.0"
title: "Swagger for Asset Store API"
contact:
email: "[email protected]"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "127.0.0.1:8000"
basePath: "/api/v1/assets"
tags:
- name: "assets"
description: "Everything about assets"
externalDocs:
description: "Find out more"
url: "https://github.com/dhathris/asset_store"
schemes:
- "http"
paths:
/:
post:
tags:
- "assets"
summary: "Add one or more assets to the store"
description: ""
operationId: "addAssets"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "A list of assets to add"
required: true
schema:
$ref: "#/definitions/Assets"
responses:
400:
description: "Invalid input"
201:
description: "Created"
get:
tags:
- "assets"
summary: "Retrieve all assets in the store"
description: ""
operationId: "retriveAllAssets"
consumes:
- "application/json"
produces:
- "application/json"
responses:
200:
description: "OK"
schema:
$ref: "#/definitions/Assets"
/{asset_name}:
get:
tags:
- "asset"
summary: "Retrieve an asset by name"
description: "Returns a single asset"
operationId: "getAssetByName"
produces:
- "application/json"
parameters:
- name: "asset_name"
in: "path"
description: "Name of the asset to return"
required: true
type: "string"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/Asset"
400:
description: "Invalid name supplied"
404:
description: "Asset not found"
definitions:
Asset:
type: "object"
required:
- "asset_name"
- "asset_type"
- "asset_class"
properties:
asset_name:
type: "string"
description: "Alphanumeric ASCII, - and _ characters allowed in a string of length 4 to 64 characters"
example: "Dove1"
asset_type:
type: "string"
description: "Allowed values are (satellite, antenna)"
enum:
- "satellite"
- "antenna"
example: "satellite"
asset_class:
type: "string"
description: "Allowed values for asset type satellite are (dove, skysat, rapideye), for asset type antenna are (dish, yagi)"
enum:
- "dove"
- "skysat"
- "rapideye"
- "dish"
- "yagi"
example: "dove"
Assets:
type: "object"
required:
- "assets"
properties:
assets:
type: "array"
items:
$ref: "#/definitions/Asset"