-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathapi.yaml
More file actions
330 lines (284 loc) · 20 KB
/
Copy pathapi.yaml
File metadata and controls
330 lines (284 loc) · 20 KB
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
openapi: 3.0.0
info:
title: Analytics Events Export API
description: Export raw analytics events captured by MuleSoft API gateways. Filter by date range, API, and version with up to 20,000 events per request and a one-month retention window.
version: 1.0.0
servers:
- url: https://anypoint.mulesoft.com/analytics/{version}/{organizationId}
variables:
version:
default: '1.0'
description: API version identifier.
organizationId:
default: YOUR_ORGANIZATION_ID
description: The organization ID for the Anypoint Platform account.
- url: https://{region}.anypoint.mulesoft.com/analytics/{version}/{organizationId}
variables:
region:
default: eu1
description: Region identifier for the service endpoint.
version:
default: '1.0'
description: API version identifier.
organizationId:
default: YOUR_ORGANIZATION_ID
description: The organization ID for the Anypoint Platform account.
- url: https://{region}.platform.mulesoft.com/analytics/{version}/{organizationId}
variables:
region:
default: ca1
description: Region identifier for the service endpoint.
version:
default: '1.0'
description: API version identifier.
organizationId:
default: YOUR_ORGANIZATION_ID
description: The organization ID for the Anypoint Platform account.
security:
- bearerAuth: []
- clientAuth: []
externalDocs:
url: http://
description: 'If the **Analytics Event Export API** is not working please contact the [MuleSoft Organization](https://support.mulesoft.com/s/login/) and provide information about this issue.
If possible, please provide the following information in order to have a better understanding of the situation -
1) The operation that is not working correctly and the associated request.
2) Steps to reproduce the issue.'
x-amf-title: Support
x-amf-userDocumentation:
- url: http://
content: "1) Get an access token for the Analytics Export Event API. The response will include an access_token field with your token. This should be used in every request to the Analytics Events Export API. The token should be sent on the Authorization header.\n\n```\ncurl -s \n https://anypoint.mulesoft.com/accounts/login -d \"username=<YOUR-USERNAME>&password=<YOUR-PASSWORD>\"\n```\n\nResponse : \n```\n{\n \"access_token\": \"54545454-5454-5454-5454-545454545454\",\n \"token_type\": \"Bearer\",\n \"redirectUrl\": \"/home\"\n}\n```\n\n2) Gets the events from the past 2 days that have occured on the API with ID 94713, and version ID 98174, in JSON format. It also queries for fields Status Code, User Agent Name, Violated Policy Name, Verb, Response Size, Response Time, Request Size, OS Family, Country, City, Application Name, Application Resource Path and Request Outcome.\n\n```\ncurl -X GET\n https://anypoint.mulesoft.com/analytics/1.0/d5acce41-ca54-4834-9a71-13882807556c/environments/766a0242-1d73-4e74-b113-3e7cb60890f3/events?format=json&apiIds=94713&apiVersionIds=98174&duration=2d&fields=Status%20Code.User%20Agent%20Name.Violated%20Policy%20Name.Verb.Response%20Size.Response%20Time.Request%20Size.OS%20Family.Country.City.Application%20Name.Application.Resource%20Path.Request%20Outcome\n -H 'Content-Type: application/json'\n -H 'Authorization:Bearer 54545454-5454-5454-5454-545454545454'\n```\nBe aware that the fields list must be URL encoded and separated by periods. The possible values are\n - Timestamp\n - API ID\n - API Version ID\n - Application\n - Message ID\n - Request Size\n - Response Size\n - Response Time\n - Browser\n - User Agent Name\n - User Agent Version\n - OS Family\n - OS Version\n - Hardware Platform\n - Timezone\n - OS Minor Version\n - OS Major Version\n - City\n - Client IP\n - Continent\n - Postal Code\n - Verb\n - Country\n - Resource Path\n - Status Code\n - Request Outcome\n - Violated Policy Name\n - API Name\n - API Version Name\n - Application Name\n\nResponse :\n\n```\n[\n {\n \"API ID\": \"94713\",\n \"API Name\": \"Payment API\",\n \"API Version ID\": \"98174\",\n \"API Version Name\": \"v1\",\n \"Application\": null,\n \"Application Name\": \"\",\n \"Timestamp\": \"2018-01-03T17:46:55.972Z\",\n \"Request Size\": null,\n \"Response Size\": null,\n \"Verb\": \"GET\",\n \"Resource Path\": \"/status\",\n \"Status Code\": 429,\n \"User Agent Name\": \"curl\",\n \"OS Family\": \"Other\",\n \"City\": \"City Bell\",\n \"Country\": \"Argentina\",\n \"Violated Policy Name\": \"Rate limiting\",\n \"Request Outcome\": \"BLOCKED\",\n \"Response Time\": 0\n },\n\n {\n \"API ID\": \"94713\",\n \"API Name\": \"Payment API\",\n \"API Version ID\": \"98174\",\n \"API Version Name\": \"v1\",\n \"Application\": null,\n \"Application Name\": \"\",\n \"Timestamp\": \"2018-01-02T23:08:42.387Z\",\n \"Request Size\": null,\n \"Response Size\": null,\n \"Verb\": \"GET\",\n \"Resource Path\": \"/status\",\n \"Status Code\": 200,\n \"User Agent Name\": \"Mozilla\",\n \"OS Family\": \"Mac OS X\",\n \"City\": \"Ashburn\",\n \"Country\": \"United States\",\n \"Violated Policy Name\": null,\n \"Request Outcome\": \"PROCESSED\",\n \"Response Time\": 73\n }\n]\n```\n\n3) Gets the events from the past 30 days that have occured on the API with ID 94713, and version ID 98174, in CSV format. It also queries for fields Status Code, User Agent Name, Violated Policy Name, Verb, Response Size, Response Time, Request Size, OS Family, Country, City, Application Name, Application Resource Path and Request Outcome.\n\n```\ncurl -X GET\n https://anypoint.mulesoft.com/analytics/1.0/d5acce41-ca54-4834-9a71-13882807556c/environments/766a0242-1d73-4e74-b113-3e7cb60890f3/events?format=csv&apiIds=94713&apiVersionIds=98174&duration=30d&fields=Status%20Code.User%20Agent%20Name.Violated%20Policy%20Name.Verb.Response%20Size.Response%20Time.Request%20Size.OS%20Family.Country.City.Application%20Name.Application.Resource%20Path.Request%20Outcome\n\
\ -H 'Content-Type: application/json'\n -H 'Authorization:Bearer 54545454-5454-5454-5454-545454545454'\n```\n\nResponse :\n\n```\n\"Status Code\",\"User Agent Name\",\"Violated Policy Name\",Verb,\"Response Size\",\"Response Time\",\"Request Size\",\"OS Family\",Country,City,\"Application Name\",Application,\"Resource Path\",\"Request Outcome\",Timestamp,\"API ID\",\"API Version ID\",\"API Name\",\"API Version Name\"\n404,Mozilla,,GET,18,2002,,\"Mac OS X\",\"United States\",,,,/favicon.ico,PROCESSED,2018-01-02T20:18:13.048Z,94713,98174,\"Payment API\",v1\n404,Mozilla,,GET,18,89,,\"Mac OS X\",\"United States\",,,,/,PROCESSED,2018-01-02T20:18:26.575Z,94713,98174,\"Payment API\",v1\n400,Mozilla,,GET,,2382,,\"Mac OS X\",\"United States\",,,,/status,PROCESSED,2018-01-02T20:18:34.827Z,94713,98174,\"Payment API\",v1\n400,Mozilla,,GET,,315,,\"Mac OS X\",\"United States\",,,,/status,PROCESSED,2018-01-02T20:19:29.765Z,94713,98174,\"Payment API\",v1\n404,Mozilla,,GET,18,77,,\"Mac OS X\",\"United States\",,,,/,PROCESSED,2018-01-02T20:05:00.337Z,94713,98174,\"Payment API\",v1\n200,Mozilla,,GET,,73,,\"Mac OS X\",\"United States\",Ashburn,,,/status,PROCESSED,2018-01-02T23:08:42.387Z,94713,98174,\"Payment API\",v1\n404,Mozilla,,GET,18,81,,\"Mac OS X\",\"United States\",,,,/,PROCESSED,2018-01-02T20:05:42.114Z,94713,98174,\"Payment API\",v1\n500,Mozilla,,GET,,808,,\"Mac OS X\",\"United States\",,,,/status,PROCESSED,2018-01-02T20:05:46.429Z,94713,98174,\"Payment API\",v1\n500,Mozilla,,GET,,7,,Windows,Canada,Markham,,,/,PROCESSED,2018-01-03T05:57:38.662Z,94713,98174,\"Payment API\",v1\n```"
title: Usage Examples
paths:
/events:
description: Use this endpoint to gain access to the API events that have occurred in all of your environments. Important`:` This endpoint is supported only on Pre-Crowd deployed APIs. It must be considered legacy endpoint and it's available only for backward compatibility purposes.
get:
description: Queries for API events that can be exported in either JSON or CSV format
parameters:
- name: apiIds
description: Comma-delimited list of API IDs that will be included as part of the query. Omit or specify 'all' or '*' to include all APIs.
required: false
in: query
schema:
type: string
- name: apiVersionIds
description: 'Comma-delimited list of API version IDs to include in query. Omit or specify ''all'' or ''*'' to include all API versions.
Ignored if no value was specified for API IDs.'
required: false
in: query
schema:
type: string
- name: fields
description: "The event fields to include in the export. Required for CSV export. For JSON export it will include all fields if omitted.\nFor a full list of fields, perform a GET request on the /events/fields endpoint, described on this API. \nA list that can be either comma- or period-delimited.\nTimestamp, API Name, API ID, API Version, API Version ID are always included as part of the response."
required: false
in: query
schema:
type: string
- name: format
description: Either csv or json. This determines the format in which the events will be exported from the API.
required: true
in: query
schema:
type: string
- name: maxResults
description: Maximum number of events to be included in the response. Default and maximum allowed value is 20000.
required: false
in: query
schema:
type: integer
- name: startDate
description: Date and time, as defined by the ISO 8601 standard
required: false
in: query
schema:
type: string
format: date-time
- name: endDate
description: Date and time, as defined by the ISO 8601 standard
required: false
in: query
schema:
type: string
format: date-time
- name: duration
description: 'The timespan that will be used to retrieve data. Consists of an integer number denoting quantity
and a single-letter suffix denoting units. Suffix is one of:
''d'': Days
''h'': Hours
''m'': Minutes
''s'': Seconds
To cover a duration of one week, use ''7d'' as the duration. To cover half a minute, use ''30s''.'
required: false
in: query
schema:
type: string
- name: pathPrefix
description: Filter results by event resource path, used when reporting against a particular REST resource root
required: false
in: query
schema:
type: string
responses:
'200':
description: Successful operation.
x-amf-mediaType: application/json
x-amf-responsePayloads:
- mediaType: text/csv
schema:
example: '"Status Code","User Agent Name","Violated Policy Name",Verb,"Response Size","Response Time","Request Size","OS Family",Country,City,"Application Name",Application,"Resource Path","Request Outcome",Timestamp,"API ID","API Version ID","API Name","API Version Name"
404,Mozilla,,GET,18,2002,,"Mac OS X","United States",,,,/favicon.ico,PROCESSED,2018-01-02T20:18:13.048Z,94713,98174,"Payment API",v1
404,Mozilla,,GET,18,89,,"Mac OS X","United States",,,,/,PROCESSED,2018-01-02T20:18:26.575Z,94713,98174,"Payment API",v1
400,Mozilla,,GET,,2382,,"Mac OS X","United States",,,,/status,PROCESSED,2018-01-02T20:18:34.827Z,94713,98174,"Payment API",v1
400,Mozilla,,GET,,315,,"Mac OS X","United States",,,,/status,PROCESSED,2018-01-02T20:19:29.765Z,94713,98174,"Payment API",v1
404,Mozilla,,GET,18,77,,"Mac OS X","United States",,,,/,PROCESSED,2018-01-02T20:05:00.337Z,94713,98174,"Payment API",v1
200,Mozilla,,GET,,73,,"Mac OS X","United States",Ashburn,,,/status,PROCESSED,2018-01-02T23:08:42.387Z,94713,98174,"Payment API",v1
404,Mozilla,,GET,18,81,,"Mac OS X","United States",,,,/,PROCESSED,2018-01-02T20:05:42.114Z,94713,98174,"Payment API",v1
500,Mozilla,,GET,,808,,"Mac OS X","United States",,,,/status,PROCESSED,2018-01-02T20:05:46.429Z,94713,98174,"Payment API",v1
500,Mozilla,,GET,,7,,Windows,Canada,Markham,,,/,PROCESSED,2018-01-03T05:57:38.662Z,94713,98174,"Payment API",v1
404,Mozilla,,GET,18,1485,,"Mac OS X","United States",,,,/,PROCESSED,2018-01-02T21:33:32.809Z,94713,98174,"Payment API",v1
404,Mozilla,,GET,18,83,,"Mac OS X","United States",,,,/favicon.ico,PROCESSED,2018-01-02T21:33:34.664Z,94713,98174,"Payment API",v1
200,Mozilla,,GET,,2150,,"Mac OS X","United States",,,,/status,PROCESSED,2018-01-02T21:33:37.293Z,94713,98174,"Payment API",v1
200,Mozilla,,GET,,191,,"Mac OS X","United States",,,,/status,PROCESSED,2018-01-02T21:34:33.631Z,94713,98174,"Payment API",v1'
content:
'*/*':
schema:
type: object
example:
- Status Code: 200
Verb: GET
Hardware Platform: Other
Application: 45b26463cc404eed80c3bbdf37abb522
OS Family: Other
Browser: Other
User Agent Version: '5.0'
API Name: '2804'
User Agent Name: Mozilla
Request Outcome: PROCESSED
Resource Path: /api/teams
API Version: '3100'
security: []
operationId: getEvents
/environments:
description: Execute operations on a resource that belongs to a specific environment.
/environments/{envId}:
description: This endpoint will allow you to make queries for a specific environment based on its ID.
parameters:
- $ref: '#/components/parameters/XOrigin_envId_Path'
/environments/{envId}/events:
description: Use this endpoint to gain access to the API events that have occurred in a specific environment.
get:
description: "Queries for HTTP events that cab be exported in either JSON or CSV format. \nThis query is performed against a specific environment whose ID is included as part of the URL.\n"
parameters:
- name: format
description: Either csv or json. This determines the format in which the events will be exported from the API.
required: true
in: query
schema:
type: string
- name: duration
description: 'The timespan that will be used to retrieve data. Consists of an integer number denoting quantity
and a single-letter suffix denoting units. Suffix is one of:
''d'': Days
''h'': Hours
''m'': Minutes
''s'': Seconds
To cover a duration of one week, use ''7d'' as the duration. To cover half a minute, use ''30s''.'
required: false
in: query
schema:
type: string
- name: apiVersionIds
description: 'Comma-delimited list of API version IDs to include in query. Omit or specify ''all'' or ''*'' to include all API versions.
Ignored if no value was specified for API IDs.'
required: false
in: query
schema:
type: string
- name: endDate
description: Date and time, as defined by the ISO 8601 standard
required: false
in: query
schema:
type: string
format: date-time
- name: maxResults
description: Maximum number of events to be included in the response. Default and maximum allowed value is 20000.
required: false
in: query
schema:
type: integer
- name: pathPrefix
description: Filter results by event resource path, used when reporting against a particular REST resource root
required: false
in: query
schema:
type: string
- name: fields
description: "The event fields to include in the export. Required for CSV export. For JSON export it will include all fields if omitted.\nFor a full list of fields, perform a GET request on the /events/fields endpoint, described on this API. \nA list that can be either comma- or period-delimited.\nTimestamp, API Name, API ID, API Version, API Version ID are always included as part of the response."
required: false
in: query
schema:
type: string
- name: apiIds
description: Comma-delimited list of API IDs that will be included as part of the query. Omit or specify 'all' or '*' to include all APIs.
required: false
in: query
schema:
type: string
- name: startDate
description: Date and time, as defined by the ISO 8601 standard
required: false
in: query
schema:
type: string
format: date-time
- $ref: '#/components/parameters/XOrigin_envId_Path'
responses:
'200':
description: Successful operation.
x-amf-mediaType: application/json
x-amf-responsePayloads:
- mediaType: text/csv
schema:
example: '"Status Code","User Agent Name","Violated Policy Name",Verb,"Response Size","Response Time","Request Size","OS Family",Country,City,"Application Name",Application,"Resource Path","Request Outcome",Timestamp,"API ID","API Version ID","API Name","API Version Name"
404,Mozilla,,GET,18,2002,,"Mac OS X","United States",,,,/favicon.ico,PROCESSED,2018-01-02T20:18:13.048Z,94713,98174,"Payment API",v1
404,Mozilla,,GET,18,89,,"Mac OS X","United States",,,,/,PROCESSED,2018-01-02T20:18:26.575Z,94713,98174,"Payment API",v1
400,Mozilla,,GET,,2382,,"Mac OS X","United States",,,,/status,PROCESSED,2018-01-02T20:18:34.827Z,94713,98174,"Payment API",v1
400,Mozilla,,GET,,315,,"Mac OS X","United States",,,,/status,PROCESSED,2018-01-02T20:19:29.765Z,94713,98174,"Payment API",v1
404,Mozilla,,GET,18,77,,"Mac OS X","United States",,,,/,PROCESSED,2018-01-02T20:05:00.337Z,94713,98174,"Payment API",v1
200,Mozilla,,GET,,73,,"Mac OS X","United States",Ashburn,,,/status,PROCESSED,2018-01-02T23:08:42.387Z,94713,98174,"Payment API",v1
404,Mozilla,,GET,18,81,,"Mac OS X","United States",,,,/,PROCESSED,2018-01-02T20:05:42.114Z,94713,98174,"Payment API",v1
500,Mozilla,,GET,,808,,"Mac OS X","United States",,,,/status,PROCESSED,2018-01-02T20:05:46.429Z,94713,98174,"Payment API",v1
500,Mozilla,,GET,,7,,Windows,Canada,Markham,,,/,PROCESSED,2018-01-03T05:57:38.662Z,94713,98174,"Payment API",v1
404,Mozilla,,GET,18,1485,,"Mac OS X","United States",,,,/,PROCESSED,2018-01-02T21:33:32.809Z,94713,98174,"Payment API",v1
404,Mozilla,,GET,18,83,,"Mac OS X","United States",,,,/favicon.ico,PROCESSED,2018-01-02T21:33:34.664Z,94713,98174,"Payment API",v1
200,Mozilla,,GET,,2150,,"Mac OS X","United States",,,,/status,PROCESSED,2018-01-02T21:33:37.293Z,94713,98174,"Payment API",v1
200,Mozilla,,GET,,191,,"Mac OS X","United States",,,,/status,PROCESSED,2018-01-02T21:34:33.631Z,94713,98174,"Payment API",v1'
content:
'*/*':
schema:
type: object
example:
- OS Family: Other
Request Outcome: PROCESSED
API Version: '3100'
Browser: Other
Status Code: 200
Application: 45b26463cc404eed80c3bbdf37abb522
Resource Path: /api/teams
API Name: '2804'
User Agent Version: '5.0'
Hardware Platform: Other
User Agent Name: Mozilla
Verb: GET
security: []
operationId: getEnvironmentsByEnvidEvents
components:
securitySchemes:
bearerAuth:
$ref: ../../fragments/anypoint_fragment.yaml#/components/securitySchemes/bearerAuth
clientAuth:
$ref: ../../fragments/anypoint_fragment.yaml#/components/securitySchemes/clientAuth
parameters:
XOrigin_envId_Path:
$ref: ../../fragments/anypoint_fragment.yaml#/components/parameters/envId_Path