-
Notifications
You must be signed in to change notification settings - Fork 27
/
example-service.yaml
150 lines (150 loc) · 3.84 KB
/
example-service.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
openapi: "3.0.0"
info:
version: 1.0.0
title: Example service
x-alternate-name: ExampleService
license:
name: MIT
x-codegen-config:
java:
apiPackage: 'com.ibm.cloud.mysdk'
go:
apiPackage: 'github.com/ibm/mysdk'
python:
apiPackage: 'mysdk'
servers:
- url: http://cloud.ibm.com/mysdk/v1
tags:
- name: resources
description: Access resources
paths:
/resources:
get:
summary: List all resources
operationId: list_resources
tags:
- resources
parameters:
- name: limit
in: query
description: How many items to return at one time (max 100)
required: false
schema:
type: integer
format: int32
responses:
'200':
description: A paginated list of resources
content:
application/json:
schema:
$ref: "#/components/schemas/Resources"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
post:
summary: Create a resource
operationId: create_resource
tags:
- resources
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Resource'
required: true
responses:
'201':
description: Resource was created
content:
application/json:
schema:
$ref: "#/components/schemas/Resource"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/resources/{resource_id}:
get:
summary: Info for a specific resource
operationId: get_resource
tags:
- resources
parameters:
- name: resource_id
in: path
required: true
description: The id of the resource to retrieve
schema:
type: string
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
$ref: "#/components/schemas/Resource"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
components:
schemas:
Resource:
description: A resource
type: object
required:
- resource_id
- name
properties:
resource_id:
type: string
description: The id of the resource
name:
type: string
description: The name of the resource
tag:
type: string
description: A tag value for the resource
read_only:
type: string
description: This is a read only string
readOnly: true
Resources:
description: List of resources
type: object
properties:
offset:
type: integer
format: int32
description: Offset value for this portion of the resource list
limit:
type: integer
format: int32
description: Limit value specified or defaulted in the list_resources request
resources:
description: A list of resources
type: array
items:
$ref: "#/components/schemas/Resource"
ErrorResponse:
description: Error response
type: object
required:
- code
- message
properties:
code:
type: integer
format: int32
description: The error code
message:
type: string
description: A description of the error