-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
resourcegraph.json
601 lines (601 loc) · 17.3 KB
/
resourcegraph.json
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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
{
"swagger": "2.0",
"info": {
"title": "Azure Resource Graph",
"description": "Azure Resource Graph API Reference",
"version": "2021-06-01-preview"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/providers/Microsoft.ResourceGraph/resources": {
"post": {
"tags": [
"Resources"
],
"operationId": "Resources",
"description": "Queries the resources managed by Azure Resource Manager for scopes specified in the request.",
"externalDocs": {
"description": "Learn more about the query syntax here",
"url": "https://aka.ms/resource-graph/learntoquery"
},
"parameters": [
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"name": "query",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/QueryRequest"
},
"description": "Request specifying query and its options."
}
],
"responses": {
"200": {
"description": "Result of the query operation",
"schema": {
"$ref": "#/definitions/QueryResponse"
}
},
"default": {
"description": "An error occurred while processing the request. See the error.code parameter to identify the specific error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"x-ms-examples": {
"Basic query": {
"$ref": "./examples/ResourcesBasicQuery.json"
},
"Basic tenant query": {
"$ref": "./examples/ResourcesTenantBasicQuery.json"
},
"Basic management group query": {
"$ref": "./examples/ResourcesMgBasicQuery.json"
},
"Filter resources": {
"$ref": "./examples/ResourcesFilterQuery.json"
},
"Summarize resources by location": {
"$ref": "./examples/ResourcesSummarizeQuery.json"
},
"Complex query": {
"$ref": "./examples/ResourcesComplexQuery.json"
},
"Access a properties field": {
"$ref": "./examples/ResourcesPropertiesQuery.json"
},
"Query with a facet request": {
"$ref": "./examples/ResourcesFacetQuery.json"
},
"First page query": {
"$ref": "./examples/ResourcesFirstPageQuery.json"
},
"Next page query": {
"$ref": "./examples/ResourcesNextPageQuery.json"
},
"Random page query": {
"$ref": "./examples/ResourcesRandomPageQuery.json"
}
}
}
},
"/providers/Microsoft.ResourceGraph/operations": {
"get": {
"tags": [
"Operations"
],
"description": "Lists all of the available REST API operations.",
"operationId": "Operations_List",
"x-ms-examples": {
"OperationsList": {
"$ref": "./examples/OperationsList.json"
}
},
"parameters": [
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK. The request has succeeded.",
"schema": {
"$ref": "#/definitions/OperationListResult"
}
},
"default": {
"description": "An error occurred while processing the request. See the error.code parameter to identify the specific error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"x-ms-pageable": {
"nextLinkName": null
}
}
}
},
"definitions": {
"QueryRequest": {
"description": "Describes a query to be executed.",
"type": "object",
"properties": {
"subscriptions": {
"description": "Azure subscriptions against which to execute the query.",
"type": "array",
"items": {
"type": "string",
"description": "Subscription Id."
}
},
"managementGroups": {
"description": "Azure management groups against which to execute the query. Example: [ 'mg1', 'mg2' ]",
"type": "array",
"items": {
"type": "string",
"description": "The name of Management group."
}
},
"query": {
"description": "The resources query.",
"type": "string"
},
"options": {
"description": "The query evaluation options",
"$ref": "#/definitions/QueryRequestOptions"
},
"facets": {
"description": "An array of facet requests to be computed against the query result.",
"type": "array",
"items": {
"$ref": "#/definitions/FacetRequest"
}
}
},
"required": [
"query"
]
},
"QueryRequestOptions": {
"description": "The options for query evaluation",
"properties": {
"$skipToken": {
"description": "Continuation token for pagination, capturing the next page size and offset, as well as the context of the query.",
"type": "string"
},
"$top": {
"description": "The maximum number of rows that the query should return. Overrides the page size when ```$skipToken``` property is present.",
"type": "integer",
"format": "int32",
"minimum": 1,
"maximum": 1000
},
"$skip": {
"description": "The number of rows to skip from the beginning of the results. Overrides the next page offset when ```$skipToken``` property is present.",
"type": "integer",
"format": "int32",
"minimum": 0
},
"resultFormat": {
"description": "Defines in which format query result returned.",
"type": "string",
"enum": [
"table",
"objectArray"
],
"default": "objectArray",
"x-ms-enum": {
"name": "ResultFormat",
"modelAsString": false
}
},
"allowPartialScopes": {
"description": "Only applicable for tenant and management group level queries to decide whether to allow partial scopes for result in case the number of subscriptions exceed allowed limits.",
"type": "boolean",
"default": false
},
"authorizationScopeFilter": {
"description": "Defines what level of authorization resources should be returned based on the which subscriptions and management groups are passed as scopes.",
"type": "string",
"enum": [
"AtScopeAndBelow",
"AtScopeAndAbove",
"AtScopeExact",
"AtScopeAboveAndBelow"
],
"default": "AtScopeAndBelow",
"x-ms-enum": {
"name": "AuthorizationScopeFilter",
"modelAsString": false
}
}
}
},
"FacetRequest": {
"description": "A request to compute additional statistics (facets) over the query results.",
"type": "object",
"properties": {
"expression": {
"description": "The column or list of columns to summarize by",
"type": "string"
},
"options": {
"description": "The options for facet evaluation",
"$ref": "#/definitions/FacetRequestOptions"
}
},
"required": [
"expression"
]
},
"FacetRequestOptions": {
"description": "The options for facet evaluation",
"properties": {
"sortBy": {
"description": "The column name or query expression to sort on. Defaults to count if not present.",
"type": "string"
},
"sortOrder": {
"description": "The sorting order by the selected column (count by default).",
"type": "string",
"default": "desc",
"enum": [
"asc",
"desc"
],
"x-ms-enum": {
"name": "FacetSortOrder",
"modelAsString": false
}
},
"filter": {
"description": "Specifies the filter condition for the 'where' clause which will be run on main query's result, just before the actual faceting.",
"type": "string"
},
"$top": {
"description": "The maximum number of facet rows that should be returned.",
"type": "integer",
"format": "int32",
"minimum": 1,
"maximum": 1000
}
}
},
"QueryResponse": {
"description": "Query result.",
"type": "object",
"properties": {
"totalRecords": {
"description": "Number of total records matching the query.",
"type": "integer",
"format": "int64"
},
"count": {
"description": "Number of records returned in the current response. In the case of paging, this is the number of records in the current page.",
"type": "integer",
"format": "int64"
},
"resultTruncated": {
"description": "Indicates whether the query results are truncated.",
"type": "string",
"enum": [
"true",
"false"
],
"x-ms-enum": {
"name": "ResultTruncated",
"modelAsString": false
}
},
"$skipToken": {
"description": "When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data.",
"type": "string"
},
"data": {
"description": "Query output in JObject array or Table format.",
"type": "object"
},
"facets": {
"description": "Query facets.",
"type": "array",
"items": {
"$ref": "#/definitions/Facet"
}
}
},
"required": [
"totalRecords",
"count",
"resultTruncated",
"data"
]
},
"Table": {
"description": "Query output in tabular format.",
"type": "object",
"properties": {
"columns": {
"description": "Query result column descriptors.",
"type": "array",
"items": {
"$ref": "#/definitions/Column",
"description": "Column descriptor."
}
},
"rows": {
"description": "Query result rows.",
"type": "array",
"items": {
"$ref": "#/definitions/Row",
"description": "Query result row."
}
}
},
"required": [
"columns",
"rows"
]
},
"Column": {
"description": "Query result column descriptor.",
"type": "object",
"properties": {
"name": {
"description": "Column name.",
"type": "string"
},
"type": {
"description": "Column data type.",
"$ref": "#/definitions/ColumnDataType"
}
},
"required": [
"name",
"type"
]
},
"ColumnDataType": {
"description": "Data type of a column in a table.",
"type": "string",
"enum": [
"string",
"integer",
"number",
"boolean",
"object"
],
"x-ms-enum": {
"name": "ColumnDataType",
"modelAsString": false
}
},
"Row": {
"description": "Query result row.",
"type": "array",
"items": {
"type": "object",
"description": "Cell value."
}
},
"Facet": {
"description": "A facet containing additional statistics on the response of a query. Can be either FacetResult or FacetError.",
"type": "object",
"properties": {
"expression": {
"description": "Facet expression, same as in the corresponding facet request.",
"type": "string"
},
"resultType": {
"description": "Result type",
"type": "string"
}
},
"required": [
"expression",
"resultType"
],
"discriminator": "resultType"
},
"FacetResult": {
"x-ms-discriminator-value": "FacetResult",
"description": "Successfully executed facet containing additional statistics on the response of a query.",
"type": "object",
"properties": {
"totalRecords": {
"description": "Number of total records in the facet results.",
"type": "integer",
"format": "int64"
},
"count": {
"description": "Number of records returned in the facet response.",
"type": "integer",
"format": "int32"
},
"data": {
"description": "A JObject array or Table containing the desired facets. Only present if the facet is valid.",
"type": "object"
}
},
"required": [
"totalRecords",
"count",
"data"
],
"allOf": [
{
"$ref": "#/definitions/Facet"
}
]
},
"FacetError": {
"x-ms-discriminator-value": "FacetError",
"description": "A facet whose execution resulted in an error.",
"type": "object",
"properties": {
"errors": {
"description": "An array containing detected facet errors with details.",
"type": "array",
"items": {
"$ref": "#/definitions/ErrorDetails"
}
}
},
"required": [
"errors"
],
"allOf": [
{
"$ref": "#/definitions/Facet"
}
]
},
"ErrorResponse": {
"title": "Error response.",
"type": "object",
"description": "An error response from the API.",
"properties": {
"error": {
"$ref": "#/definitions/Error",
"description": "Error information."
}
},
"required": [
"error"
]
},
"Error": {
"title": "Error info.",
"type": "object",
"description": "Error details.",
"properties": {
"code": {
"type": "string",
"description": "Error code identifying the specific error."
},
"message": {
"type": "string",
"description": "A human readable error message."
},
"details": {
"type": "array",
"description": "Error details",
"items": {
"$ref": "#/definitions/ErrorDetails"
}
}
},
"required": [
"code",
"message"
]
},
"ErrorDetails": {
"title": "Error details.",
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Error code identifying the specific error."
},
"message": {
"type": "string",
"description": "A human readable error message."
}
},
"additionalProperties": {
"type": "object"
},
"required": [
"code",
"message"
]
},
"OperationListResult": {
"description": "Result of the request to list Resource Graph operations. It contains a list of operations and a URL link to get the next set of results.",
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/Operation"
},
"description": "List of Resource Graph operations supported by the Resource Graph resource provider."
}
}
},
"Operation": {
"description": "Resource Graph REST API operation definition.",
"properties": {
"name": {
"description": "Operation name: {provider}/{resource}/{operation}",
"type": "string"
},
"display": {
"description": "Display metadata associated with the operation.",
"properties": {
"provider": {
"description": "Service provider: Microsoft Resource Graph.",
"type": "string"
},
"resource": {
"description": "Resource on which the operation is performed etc.",
"type": "string"
},
"operation": {
"description": "Type of operation: get, read, delete, etc.",
"type": "string"
},
"description": {
"description": "Description for the operation.",
"type": "string"
}
}
},
"origin": {
"type": "string",
"description": "The origin of operations."
}
}
}
},
"parameters": {
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"required": true,
"type": "string",
"description": "Api Version."
}
}
}