Skip to content

Commit ef7ffaa

Browse files
authored
refactoring EntityQueries - extracting common to EntityDefinitions (#14659)
* refactoring EntityQueries - extracting common to EntityDefinitions * fix bug with reference * fix reference
1 parent a33ba1f commit ef7ffaa

File tree

2 files changed

+185
-145
lines changed

2 files changed

+185
-145
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "Security Insights",
5+
"description": "API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider",
6+
"version": "2021-03-01-preview"
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"consumes": [
13+
"application/json"
14+
],
15+
"produces": [
16+
"application/json"
17+
],
18+
"security": [
19+
{
20+
"azure_auth": [
21+
"user_impersonation"
22+
]
23+
}
24+
],
25+
"securityDefinitions": {
26+
"azure_auth": {
27+
"type": "oauth2",
28+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
29+
"flow": "implicit",
30+
"description": "Azure Active Directory OAuth2 Flow",
31+
"scopes": {
32+
"user_impersonation": "impersonate your user account"
33+
}
34+
}
35+
},
36+
"paths": {},
37+
"definitions": {
38+
"EntityInnerType": {
39+
"description": "The type of the entity",
40+
"enum": [
41+
"Account",
42+
"Host",
43+
"File",
44+
"AzureResource",
45+
"CloudApplication",
46+
"DNS",
47+
"FileHash",
48+
"IP",
49+
"Malware",
50+
"Process",
51+
"RegistryKey",
52+
"RegistryValue",
53+
"SecurityGroup",
54+
"URL",
55+
"IoTDevice",
56+
"SecurityAlert",
57+
"HuntingBookmark",
58+
"MailCluster",
59+
"MailMessage",
60+
"Mailbox",
61+
"SubmissionMail"
62+
],
63+
"type": "string",
64+
"x-ms-enum": {
65+
"modelAsString": true,
66+
"name": "EntityType",
67+
"values": [
68+
{
69+
"description": "Entity represents account in the system.",
70+
"value": "Account"
71+
},
72+
{
73+
"description": "Entity represents host in the system.",
74+
"value": "Host"
75+
},
76+
{
77+
"description": "Entity represents file in the system.",
78+
"value": "File"
79+
},
80+
{
81+
"description": "Entity represents azure resource in the system.",
82+
"value": "AzureResource"
83+
},
84+
{
85+
"description": "Entity represents cloud application in the system.",
86+
"value": "CloudApplication"
87+
},
88+
{
89+
"description": "Entity represents dns in the system.",
90+
"value": "DNS"
91+
},
92+
{
93+
"description": "Entity represents file hash in the system.",
94+
"value": "FileHash"
95+
},
96+
{
97+
"description": "Entity represents ip in the system.",
98+
"value": "IP"
99+
},
100+
{
101+
"description": "Entity represents malware in the system.",
102+
"value": "Malware"
103+
},
104+
{
105+
"description": "Entity represents process in the system.",
106+
"value": "Process"
107+
},
108+
{
109+
"description": "Entity represents registry key in the system.",
110+
"value": "RegistryKey"
111+
},
112+
{
113+
"description": "Entity represents registry value in the system.",
114+
"value": "RegistryValue"
115+
},
116+
{
117+
"description": "Entity represents security group in the system.",
118+
"value": "SecurityGroup"
119+
},
120+
{
121+
"description": "Entity represents url in the system.",
122+
"value": "URL"
123+
},
124+
{
125+
"description": "Entity represents IoT device in the system.",
126+
"value": "IoTDevice"
127+
},
128+
{
129+
"description": "Entity represents security alert in the system.",
130+
"value": "SecurityAlert"
131+
},
132+
{
133+
"description": "Entity represents HuntingBookmark in the system.",
134+
"value": "HuntingBookmark"
135+
},
136+
{
137+
"description": "Entity represents mail cluster in the system.",
138+
"value": "MailCluster"
139+
},
140+
{
141+
"description": "Entity represents mail message in the system.",
142+
"value": "MailMessage"
143+
},
144+
{
145+
"description": "Entity represents mailbox in the system.",
146+
"value": "Mailbox"
147+
},
148+
{
149+
"description": "Entity represents submission mail in the system.",
150+
"value": "SubmissionMail"
151+
}
152+
]
153+
}
154+
},
155+
"EntityQueryKind": {
156+
"description": "The kind of the entity query",
157+
"enum": [
158+
"Expansion",
159+
"Insight",
160+
"Activity"
161+
],
162+
"type": "string",
163+
"x-ms-enum": {
164+
"modelAsString": true,
165+
"name": "EntityQueryKind",
166+
"values": [
167+
{
168+
"value": "Expansion"
169+
},
170+
{
171+
"value": "Insight"
172+
},
173+
{
174+
"value": "Activity"
175+
}
176+
]
177+
}
178+
}
179+
},
180+
"parameters": {}
181+
}

specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-03-01-preview/EntityQueries.json

Lines changed: 4 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -239,147 +239,6 @@
239239
}
240240
},
241241
"definitions": {
242-
"EntityInnerType": {
243-
"description": "The type of the entity",
244-
"enum": [
245-
"Account",
246-
"Host",
247-
"File",
248-
"AzureResource",
249-
"CloudApplication",
250-
"DNS",
251-
"FileHash",
252-
"IP",
253-
"Malware",
254-
"Process",
255-
"RegistryKey",
256-
"RegistryValue",
257-
"SecurityGroup",
258-
"URL",
259-
"IoTDevice",
260-
"SecurityAlert",
261-
"HuntingBookmark",
262-
"MailCluster",
263-
"MailMessage",
264-
"Mailbox",
265-
"SubmissionMail"
266-
],
267-
"type": "string",
268-
"x-ms-enum": {
269-
"modelAsString": true,
270-
"name": "EntityType",
271-
"values": [
272-
{
273-
"description": "Entity represents account in the system.",
274-
"value": "Account"
275-
},
276-
{
277-
"description": "Entity represents host in the system.",
278-
"value": "Host"
279-
},
280-
{
281-
"description": "Entity represents file in the system.",
282-
"value": "File"
283-
},
284-
{
285-
"description": "Entity represents azure resource in the system.",
286-
"value": "AzureResource"
287-
},
288-
{
289-
"description": "Entity represents cloud application in the system.",
290-
"value": "CloudApplication"
291-
},
292-
{
293-
"description": "Entity represents dns in the system.",
294-
"value": "DNS"
295-
},
296-
{
297-
"description": "Entity represents file hash in the system.",
298-
"value": "FileHash"
299-
},
300-
{
301-
"description": "Entity represents ip in the system.",
302-
"value": "IP"
303-
},
304-
{
305-
"description": "Entity represents malware in the system.",
306-
"value": "Malware"
307-
},
308-
{
309-
"description": "Entity represents process in the system.",
310-
"value": "Process"
311-
},
312-
{
313-
"description": "Entity represents registry key in the system.",
314-
"value": "RegistryKey"
315-
},
316-
{
317-
"description": "Entity represents registry value in the system.",
318-
"value": "RegistryValue"
319-
},
320-
{
321-
"description": "Entity represents security group in the system.",
322-
"value": "SecurityGroup"
323-
},
324-
{
325-
"description": "Entity represents url in the system.",
326-
"value": "URL"
327-
},
328-
{
329-
"description": "Entity represents IoT device in the system.",
330-
"value": "IoTDevice"
331-
},
332-
{
333-
"description": "Entity represents security alert in the system.",
334-
"value": "SecurityAlert"
335-
},
336-
{
337-
"description": "Entity represents HuntingBookmark in the system.",
338-
"value": "HuntingBookmark"
339-
},
340-
{
341-
"description": "Entity represents mail cluster in the system.",
342-
"value": "MailCluster"
343-
},
344-
{
345-
"description": "Entity represents mail message in the system.",
346-
"value": "MailMessage"
347-
},
348-
{
349-
"description": "Entity represents mailbox in the system.",
350-
"value": "Mailbox"
351-
},
352-
{
353-
"description": "Entity represents submission mail in the system.",
354-
"value": "SubmissionMail"
355-
}
356-
]
357-
}
358-
},
359-
"EntityQueryKind": {
360-
"description": "The kind of the entity query",
361-
"enum": [
362-
"Expansion",
363-
"Insight",
364-
"Activity"
365-
],
366-
"type": "string",
367-
"x-ms-enum": {
368-
"modelAsString": true,
369-
"name": "EntityQueryKind",
370-
"values": [
371-
{
372-
"value": "Expansion"
373-
},
374-
{
375-
"value": "Insight"
376-
},
377-
{
378-
"value": "Activity"
379-
}
380-
]
381-
}
382-
},
383242
"CustomEntityQueryKind": {
384243
"description": "The kind of the entity query that supports put request.",
385244
"enum": [
@@ -426,7 +285,7 @@
426285
"discriminator": "kind",
427286
"properties": {
428287
"kind": {
429-
"$ref": "#/definitions/EntityQueryKind",
288+
"$ref": "EntityDefinitions.json#/definitions/EntityQueryKind",
430289
"description": "the entity query kind"
431290
}
432291
},
@@ -487,7 +346,7 @@
487346
"type": "string"
488347
},
489348
"inputEntityType": {
490-
"$ref": "#/definitions/EntityInnerType",
349+
"$ref": "EntityDefinitions.json#/definitions/EntityInnerType",
491350
"description": "The type of the query's source entity"
492351
},
493352
"inputFields": {
@@ -501,7 +360,7 @@
501360
"outputEntityTypes": {
502361
"description": "List of the desired output types to be constructed from the result",
503362
"items": {
504-
"$ref": "#/definitions/EntityInnerType",
363+
"$ref": "EntityDefinitions.json#/definitions/EntityInnerType",
505364
"description": "output entity type"
506365
},
507366
"type": "array"
@@ -573,7 +432,7 @@
573432
"type": "object"
574433
},
575434
"inputEntityType": {
576-
"$ref": "#/definitions/EntityInnerType",
435+
"$ref": "EntityDefinitions.json#/definitions/EntityInnerType",
577436
"description": "The type of the query's source entity"
578437
},
579438
"requiredInputFieldsSets": {

0 commit comments

Comments
 (0)