-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yml
executable file
·201 lines (196 loc) · 5.82 KB
/
swagger.yml
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
swagger: "2.0"
info:
title: AWS RDS Monitoring Tool (ARMT)
description: ARMT provides rest endpoints to help clients to get monitoring data from RDS instances in AWS cluster.
version: "1.0.0"
basePath: /api/armt
schemes:
- http
paths:
/v1/rdss:
get:
summary: Gets all rds statistics running in the AWS cluster
tags:
- aws-rds-monitoring-tool
produces:
- application/json
consumes:
- application/json
parameters:
- in: query
name: region
type: string
required: false
description: Pass an aws region for which RDS instance status is required to be monitored. If region is not passed, then the default AWS region passed in env is taken.
description: |
For example:
```
GET /api/armt/v1/rdss?region=us-east-1b
```
Returns list of rds instances:
```
[
{
"availabilityZone": "ap-south-1b",
"clusterIdentifier": null,
"dbInstanceClass": "db.t2.micro",
"dbName": sanjitdb,
"engine": "mysql",
"engineVersion": "8.0.16",
"instanceIdentifier": "sanjit-database-1",
"resourceId": "db-PX346I7MRIQVANIZ5XE6UB5YQY",
"status": "available"
},
{
"availabilityZone": "ap-east-1b",
"clusterIdentifier": null,
"dbInstanceClass": "db.t3.micro",
"dbName": "sanjitdb2",
"engine": "mysql",
"engineVersion": "8.0.19",
"instanceIdentifier": "sanjit-database-2",
"resourceId": "db-Z5SH5B7G6MF3STWPY75S6RWGY4",
"status": "creating"
},
...
]
```
responses:
'200':
description: Fetching of all pod status is successful.
schema:
$ref: "#/definitions/RDSS"
'500':
description: Internal server error
schema:
$ref: "#/definitions/Error"
/v1/rds/queries:
post:
summary: Execute a set of queries on a RDS instance
tags:
- aws-rds-monitoring-tool
produces:
- application/json
consumes:
- application/json
parameters:
- in: body
name: RdsQueriesExecAttr
description: RDS query parameter.
schema:
$ref: '#/definitions/RdsQueriesExecAttr'
description: |
For example:
```
POST /api/armt/v1/rds/queries
```
Sample request body will be:
```
{
"queries": [
{
"query": "show tables;"
}
],
"dbName": "sanjitdb2",
"dbEndpoint": "sanjit-database-2.rds.amazonaws.com"
}
```
responses:
'200':
description: RDS queries execution successfull.
schema:
$ref: '#/definitions/RdsQueriesExecAttr'
'400':
description: Bad Request, Unable to execute RDS queries.
schema:
$ref: '#/definitions/Error'
'500':
description: Internal server error.
schema:
$ref: '#/definitions/Error'
definitions:
RDS:
type: object
description: An RDS instance
required:
- resourceId
- clusterIdentifier
- instanceIdentifier
- availabilityZone
- dbInstanceClass
- dbName
- engine
- engineVersion
- status
properties:
resourceId:
type: string
description: The AWS Region-unique, immutable identifier for the DB instance.
clusterIdentifier:
type: string
description: If the DB instance is a member of a DB cluster, contains the name of the DB cluster that the DB instance is a member of.
instanceIdentifier:
type: string
description: Contains a user-supplied database identifier. This identifier is the unique key that identifies a DB instance.
availabilityZone:
type: string
description: Specifies the name of the Availability Zone the DB instance is located in.
dbInstanceClass:
type: string
description: Contains the name of the compute and memory capacity class of the DB instance.
dbName:
type: string
description: Contains the name of the initial database of this instance that was provided at the time of create.
engine:
type: string
description: Provides the name of the database engine to be used for this DB instance.
engineVersion:
type: string
description: Indicates the database engine version.
status:
type: string
description: The status of a DB instance indicates the health of the DB instance. More refer here - https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Status.html
RDSS:
type: array
description: Array of RDS items
items:
$ref: "#/definitions/RDS"
RdsQueriesExecAttr:
type: object
description: Attributes required for RDS queries executions.
required:
- dbName
- dbEndpoint
- queries
properties:
queries:
type: array
description: Array of query
items:
$ref: "#/definitions/RDSQuery"
dbName:
type: string
description: DB Name
dbEndpoint:
type: string
description: DB endpoint
RDSQuery:
type: object
description: An RDS query
required:
- query
properties:
query:
type: string
description: An RDS query
Error:
type: object
required:
- code
- message
properties:
code:
type: integer
message:
type: string