This repository has been archived by the owner on Aug 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.yaml
240 lines (232 loc) · 7 KB
/
api.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
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
swagger: "2.0"
info:
version: "v1"
title: APID analytics API
host: playground.apistudio.io
basePath: /try/64e409ad-aebb-4bbc-977e-f0e0f22209d4
schemes:
- http
- https
consumes:
- application/json
produces:
- application/json
paths:
'/analytics':
x-swagger-router-controller: analytics
parameters:
- name: analytics_data
in: body
description: The analytics data you want to post
required: true
schema:
$ref: "#/definitions/analytics_data"
post:
responses:
"200":
description: Success
"400":
description: Bad Request
schema:
$ref: "#/definitions/errClientError"
"500":
description: Server error
schema:
$ref: "#/definitions/errServerError"
default:
description: Error
schema:
$ref: "#/definitions/errResponse"
'/analytics/{bundle_scope_uuid}':
x-swagger-router-controller: analytics
parameters:
- name: bundle_scope_uuid
in: path
required: true
description: bundle UUID that can be mapped to a scope by APID
type: string
- name: records
in: body
description: The analytics data you want to post
required: true
schema:
$ref: "#/definitions/records"
post:
responses:
"200":
description: Success
"400":
description: Bad Request
schema:
$ref: "#/definitions/errClientError"
"500":
description: Server error
schema:
$ref: "#/definitions/errServerError"
default:
description: Error
schema:
$ref: "#/definitions/errResponse"
definitions:
analytics_data:
type: object
required:
- organization
- environment
- records
properties:
organization:
type: string
environment:
type: string
records:
type: object
$ref: "#/definitions/records"
example: {
"organization":"orgname",
"environment":"envname",
"records":[{
"response_status_code": 400,
"client_received_start_timestamp": 1462850097576,
"client_received_end_timestamp": 1462850097580,
"client_id":"0GJKn7EQmNkKYcGL7x3gHaawWLs5gUPr"
},{
"response_status_code": 200,
"client_id":"2ngXgr6Rl2PXWiEmbt8zCkWY3Ptjb8ep",
"request_verb" : "GET",
"api_product":" test_product",
"access_token" : "fewGWG343LDV346345YCDS",
"apiproxy" : "OAuthProxy",
"apiproxy_revision" : "2",
"client_ip": "10.16.9.11",
"client_sent_end_timestamp": 1462850097894,
"client_received_start_timestamp": 1462850097576,
"client_received_end_timestamp": 1462850097580,
"client_sent_start_timestamp": 1462850097894,
"request_path" : "/oauth/oauthv2/auth_code/",
"request_uri": "/oauth/oauthv2/auth_code/?response_type=code&redirect_url=http%3A%2F%2Fexample.com&client_id=A1h6yYAVeADnEKji8M37zCSn6olcmQDB",
"useragent" : "Chrome",
"target" : "target_name",
"target_received_end_timestamp": 1462850097800,
"target_received_start_timestamp": 1462850097800,
"target_response_code" : 200,
"target_sent_end_timestamp" : 1462850097802,
"target_sent_start_timestamp" : 1462850097802
}]
}
records:
type: object
required:
- records
properties:
records:
type: array
minItems: 1
items:
$ref: "#/definitions/eachRecord"
example: {
"records":[{
"response_status_code": 400,
"client_received_start_timestamp": 1462850097576,
"client_received_end_timestamp": 1462850097580,
"client_id":"0GJKn7EQmNkKYcGL7x3gHaawWLs5gUPr"
},{
"response_status_code": 200,
"client_id":"2ngXgr6Rl2PXWiEmbt8zCkWY3Ptjb8ep",
"request_verb" : "GET",
"api_product":" test_product",
"access_token" : "fewGWG343LDV346345YCDS",
"apiproxy" : "OAuthProxy",
"apiproxy_revision" : "2",
"client_ip": "10.16.9.11",
"client_sent_end_timestamp": 1462850097894,
"client_received_start_timestamp": 1462850097576,
"client_received_end_timestamp": 1462850097580,
"client_sent_start_timestamp": 1462850097894,
"request_path" : "/oauth/oauthv2/auth_code/",
"request_uri": "/oauth/oauthv2/auth_code/?response_type=code&redirect_url=http%3A%2F%2Fexample.com&client_id=A1h6yYAVeADnEKji8M37zCSn6olcmQDB",
"useragent" : "Chrome",
"target" : "target_name",
"target_received_end_timestamp": 1462850097800,
"target_received_start_timestamp": 1462850097800,
"target_response_code" : 200,
"target_sent_end_timestamp" : 1462850097802,
"target_sent_start_timestamp" : 1462850097802
}]
}
eachRecord:
description: Each record is basically a map of key value pair. client_received_start_timestamp is a required property but more fields can be added
type: object
required:
- client_received_start_timestamp
- client_received_end_timestamp
properties:
client_received_start_timestamp:
type: integer
format: int64
client_received_end_timestamp:
type: integer
format: int64
example: {
"response_status_code":400,
"client_received_start_timestamp":1462850097576,
"client_received_end_timestamp": 1462850097580,
"client_id":"0GJKn7EQmNkKYcGL7x3gHaawWLs5gUPr"
}
errClientError:
required:
- errorCode
- reason
properties:
errorCode:
type: string
enum:
- UNKNOWN_SCOPE
- BAD_DATA
- UNSUPPORTED_CONTENT_TYPE
- UNSUPPORTED_CONTENT_ENCODING
- MISSING_FIELD
reason:
type: string
example: {
"errorCode":"UNKNOWN_SCOPE",
"reason":"No tenant found for this scopeuuid : UUID"
}
errServerError:
required:
- errorCode
- reason
properties:
errorCode:
type: string
enum:
- INTERNAL_SERVER_ERROR
- INTERNAL_SEARCH_ERROR
reason:
type: string
example: {
"errorCode":"INTERNAL_SERVER_ERROR",
"reason":"Service is not initialized completely"
}
errResponse:
required:
- errorCode
- reason
properties:
errorCode:
type: string
reason:
type: string