Skip to content

Commit 90189a4

Browse files
authored
Salambashir/addDFSv2Swagger (#24289)
* Add inital swagger files for DFSv2 * add descriptions and fix alignment * fixes and remove comments * Code style and description updates * fix missing x-ms-enum check. * fix MISSING_APIS_IN_DEFAULT_TAG * remove id, type and name from pu examples body * fix missing responses in Put example. * "resource" -> "storage account" in descriptions * descriptions
1 parent e0ec410 commit 90189a4

File tree

4 files changed

+374
-0
lines changed

4 files changed

+374
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "Security Center",
5+
"description": "API spec for Microsoft.Security (Azure Security Center) resource provider",
6+
"version": "2022-12-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+
"/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}": {
38+
"get": {
39+
"x-ms-examples": {
40+
"Gets the Defender for Storage settings for the specified resource.": {
41+
"$ref": "./examples/DefenderForStorage/GetDefenderForStorageSettings_example.json"
42+
}
43+
},
44+
"tags": [
45+
"DefenderForStorage"
46+
],
47+
"description": "Gets the Defender for Storage settings for the specified storage account.",
48+
"operationId": "DefenderForStorage_Get",
49+
"parameters": [
50+
{
51+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
52+
},
53+
{
54+
"$ref": "../../../common/v1/types.json#/parameters/ResourceId"
55+
},
56+
{
57+
"$ref": "#/parameters/DefenderForStorageSettingName"
58+
}
59+
],
60+
"responses": {
61+
"200": {
62+
"description": "Successful request to get Defender for Storage settings.",
63+
"schema": {
64+
"$ref": "#/definitions/DefenderForStorageSetting"
65+
}
66+
},
67+
"default": {
68+
"description": "Error response describing why the operation failed.",
69+
"schema": {
70+
"$ref": "../../../common/v1/types.json#/definitions/CloudError"
71+
}
72+
}
73+
}
74+
},
75+
"put": {
76+
"x-ms-examples": {
77+
"Creates or updates the Defender for Storage settings on a specified resource.": {
78+
"$ref": "./examples/DefenderForStorage/PutDefenderForStorageSettings_example.json"
79+
}
80+
},
81+
"tags": [
82+
"DefenderForStorage"
83+
],
84+
"description": "Creates or updates the Defender for Storage settings on a specified storage account.",
85+
"operationId": "DefenderForStorage_Create",
86+
"parameters": [
87+
{
88+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
89+
},
90+
{
91+
"$ref": "../../../common/v1/types.json#/parameters/ResourceId"
92+
},
93+
{
94+
"$ref": "#/parameters/DefenderForStorageSettingName"
95+
},
96+
{
97+
"$ref": "#/parameters/DefenderForStorageSetting"
98+
}
99+
],
100+
"responses": {
101+
"200": {
102+
"description": "Successful request to create or update Defender for Storage settings.",
103+
"schema": {
104+
"$ref": "#/definitions/DefenderForStorageSetting"
105+
}
106+
},
107+
"201": {
108+
"description": "Request to create or update Defender for Storage settings partially succeeded.",
109+
"schema": {
110+
"$ref": "#/definitions/DefenderForStorageSetting"
111+
}
112+
},
113+
"default": {
114+
"description": "Error response describing why the operation failed.",
115+
"schema": {
116+
"$ref": "../../../common/v1/types.json#/definitions/CloudError"
117+
}
118+
}
119+
}
120+
}
121+
}
122+
},
123+
"definitions": {
124+
"DefenderForStorageSetting": {
125+
"type": "object",
126+
"allOf": [
127+
{
128+
"$ref": "../../../common/v1/types.json#/definitions/Resource"
129+
}
130+
],
131+
"properties": {
132+
"properties": {
133+
"x-ms-client-flatten": true,
134+
"$ref": "#/definitions/DefenderForStorageSettingProperties"
135+
}
136+
},
137+
"description": "The Defender for Storage resource."
138+
},
139+
"DefenderForStorageSettingProperties": {
140+
"type": "object",
141+
"properties": {
142+
"isEnabled": {
143+
"type": "boolean",
144+
"description": "Indicates whether Defender for Storage is enabled on this storage account."
145+
},
146+
"malwareScanning": {
147+
"x-ms-client-flatten": true,
148+
"$ref": "#/definitions/MalwareScanningProperties"
149+
},
150+
"sensitiveDataDiscovery": {
151+
"x-ms-client-flatten": true,
152+
"$ref": "#/definitions/SensitiveDataDiscoveryProperties"
153+
},
154+
"overrideSubscriptionLevelSettings": {
155+
"type": "boolean",
156+
"description": "Indicates whether the settings defined for this storage account should override the settings defined for the subscription."
157+
}
158+
},
159+
"description": "Defender for Storage resource properties."
160+
},
161+
"MalwareScanningProperties": {
162+
"type": "object",
163+
"properties": {
164+
"onUpload": {
165+
"x-ms-client-flatten": true,
166+
"$ref": "#/definitions/OnUploadProperties"
167+
},
168+
"operationStatus": {
169+
"type": "object",
170+
"$ref": "#/definitions/OperationStatus",
171+
"readOnly": true,
172+
"description": "Upon failure or partial success. Additional data describing Malware Scanning enable/disable operation."
173+
}
174+
},
175+
"description": "Properties of Malware Scanning."
176+
},
177+
"OnUploadProperties": {
178+
"type": "object",
179+
"properties": {
180+
"isEnabled": {
181+
"type": "boolean",
182+
"description": "Indicates whether On Upload malware scanning should be enabled."
183+
},
184+
"capGBPerMonth": {
185+
"type": "integer",
186+
"format": "int32",
187+
"description": "Defines the max GB to be scanned per Month. Set to -1 if no capping is needed."
188+
}
189+
},
190+
"description": "Properties of On Upload malware scanning."
191+
},
192+
"SensitiveDataDiscoveryProperties": {
193+
"type": "object",
194+
"properties": {
195+
"isEnabled": {
196+
"type": "boolean",
197+
"description": "Indicates whether Sensitive Data Discovery should be enabled."
198+
},
199+
"operationStatus": {
200+
"type": "object",
201+
"$ref": "#/definitions/OperationStatus",
202+
"readOnly": true,
203+
"description": "Upon failure or partial success. Additional data describing Sensitive Data Discovery enable/disable operation."
204+
}
205+
},
206+
"description": "Properties of Sensitive Data Discovery."
207+
},
208+
"OperationStatus": {
209+
"type": "object",
210+
"description": "A status describing the success/failure of the enablement/disablement operation.",
211+
"properties": {
212+
"code": {
213+
"type": "string",
214+
"description": "The operation status code."
215+
},
216+
"message": {
217+
"type": "string",
218+
"description": "Additional information regarding the success/failure of the operation."
219+
}
220+
}
221+
}
222+
},
223+
"parameters": {
224+
"DefenderForStorageSettingName": {
225+
"name": "settingName",
226+
"in": "path",
227+
"required": true,
228+
"type": "string",
229+
"pattern": "^[a-z][a-z0-9]*$",
230+
"enum": [
231+
"current"
232+
],
233+
"x-ms-enum": {
234+
"name": "settingName",
235+
"modelAsString": true,
236+
"values": [
237+
{
238+
"value": "current",
239+
"description": "Name of the Defender for Storage Settings name."
240+
}
241+
]
242+
},
243+
"description": "Defender for Storage setting name.",
244+
"x-ms-parameter-location": "method"
245+
},
246+
"DefenderForStorageSetting": {
247+
"name": "defenderForStorageSetting",
248+
"in": "body",
249+
"required": true,
250+
"description": "Defender for Storage Settings",
251+
"schema": {
252+
"$ref": "#/definitions/DefenderForStorageSetting"
253+
},
254+
"x-ms-parameter-location": "method"
255+
}
256+
}
257+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"parameters": {
3+
"api-version": "2022-12-01-preview",
4+
"resourceId": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount",
5+
"settingName": "current"
6+
},
7+
"responses": {
8+
"200": {
9+
"body": {
10+
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/defenderForStorageSettings/current",
11+
"name": "current",
12+
"type": "Microsoft.Security/defenderForStorageSettings",
13+
"properties": {
14+
"isEnabled": true,
15+
"malwareScanning": {
16+
"onUpload": {
17+
"isEnabled": false,
18+
"capGBPerMonth": -1
19+
}
20+
},
21+
"sensitiveDataDiscovery": {
22+
"isEnabled": false
23+
},
24+
"overrideSubscriptionLevelSettings": true
25+
}
26+
}
27+
}
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"parameters": {
3+
"api-version": "2022-12-01-preview",
4+
"resourceId": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount",
5+
"settingName": "current",
6+
"defenderForStorageSetting": {
7+
"properties": {
8+
"isEnabled": true,
9+
"malwareScanning": {
10+
"onUpload": {
11+
"isEnabled": true,
12+
"capGBPerMonth": -1
13+
}
14+
},
15+
"sensitiveDataDiscovery": {
16+
"isEnabled": true
17+
},
18+
"overrideSubscriptionLevelSettings": true
19+
}
20+
}
21+
},
22+
"responses": {
23+
"200": {
24+
"body": {
25+
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/defenderForStorageSettings/current",
26+
"type": "Microsoft.Security/defenderForStorageSettings",
27+
"name": "current",
28+
"properties": {
29+
"isEnabled": true,
30+
"malwareScanning": {
31+
"onUpload": {
32+
"isEnabled": true,
33+
"capGBPerMonth": -1
34+
},
35+
"operationStatus": {
36+
"code": "Succeeded"
37+
}
38+
},
39+
"sensitiveDataDiscovery": {
40+
"isEnabled": true,
41+
"operationStatus": {
42+
"code": "Succeeded"
43+
}
44+
},
45+
"overrideSubscriptionLevelSettings": true
46+
}
47+
}
48+
},
49+
"201": {
50+
"body": {
51+
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/defenderForStorageSettings/current",
52+
"type": "Microsoft.Security/defenderForStorageSettings",
53+
"name": "current",
54+
"properties": {
55+
"isEnabled": true,
56+
"malwareScanning": {
57+
"onUpload": {
58+
"isEnabled": false,
59+
"capGBPerMonth": -1
60+
},
61+
"operationStatus": {
62+
"code": "UnknownError",
63+
"message": "Failed to setup data scanner."
64+
}
65+
},
66+
"sensitiveDataDiscovery": {
67+
"isEnabled": false,
68+
"operationStatus": {
69+
"code": "UnknownError",
70+
"message": "Failed to setup data scanner."
71+
}
72+
},
73+
"overrideSubscriptionLevelSettings": true
74+
}
75+
}
76+
}
77+
}
78+
}

specification/security/resource-manager/readme.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@ input-file:
145145
- Microsoft.Security/preview/2023-02-01-preview/healthReports.json
146146
- Microsoft.Security/preview/2023-02-15-preview/sensitivitySettings.json
147147
```
148+
### Tag: package-preview-2022-12
149+
150+
These settings apply only when `--tag=package-preview-2022-12` is specified on the command line.
151+
152+
``` yaml $(tag) == 'package-preview-2022-12'
153+
input-file:
154+
- Microsoft.Security/preview/2022-12-01-preview/defenderForStorageSettings.json
155+
```
156+
148157

149158
### Tag: package-preview-2022-11
150159

@@ -394,6 +403,7 @@ input-file:
394403
- Microsoft.Security/preview/2023-01-01-preview/securityOperators.json
395404
- Microsoft.Security/stable/2023-05-01/ServerVulnerabilityAssessmentsSettings.json
396405
- Microsoft.Security/preview/2023-05-01-preview/healthReports.json
406+
- Microsoft.Security/preview/2022-12-01-preview/defenderForStorageSettings.json
397407
398408
399409
# Needed when there is more than one input file

0 commit comments

Comments
 (0)