Skip to content

Commit f02941a

Browse files
galmoshegamosheGal Moshe
authored
Iot sites and sensor zones (#11296)
* iot-sites-and-zones * rename displayName and fix missing params * change caps mistake * prettier run changes * Delete Get.json * Delete Delete.json * Delete Put.json * Delete List.json * remove required tags * fix merge Co-authored-by: Gal Moshe <gamoshe@microsoft.com> Co-authored-by: Gal Moshe <gamoshe@gamoshe.local>
1 parent b4373d4 commit f02941a

File tree

10 files changed

+411
-13
lines changed

10 files changed

+411
-13
lines changed

specification/security/resource-manager/Microsoft.Security/preview/2020-08-06-preview/examples/IotSensors/Get.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
"name": "mySensor",
1111
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.Security/iotSensors/mySensor",
1212
"type": "Microsoft.Security/iotSensors",
13-
"properties": {}
13+
"properties": {
14+
"zone": "Zone Name"
15+
}
1416
}
1517
}
1618
}

specification/security/resource-manager/Microsoft.Security/preview/2020-08-06-preview/examples/IotSensors/List.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111
"name": "mySensor",
1212
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.Security/iotSensors/mySensor",
1313
"type": "Microsoft.Security/iotSensors",
14-
"properties": {}
14+
"properties": {
15+
"zone": "Zone Name"
16+
}
1517
},
1618
{
1719
"name": "otherSensor",
1820
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.Security/iotSensors/otherSensor",
1921
"type": "Microsoft.Security/iotSensors",
20-
"properties": {}
22+
"properties": {
23+
"zone": "Zone Name"
24+
}
2125
}
2226
]
2327
}

specification/security/resource-manager/Microsoft.Security/preview/2020-08-06-preview/examples/IotSensors/Put.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,32 @@
22
"parameters": {
33
"api-version": "2020-08-06-preview",
44
"scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub",
5-
"iotSensorName": "mySensor"
5+
"iotSensorName": "mySensor",
6+
"iotSensorsModel": {
7+
"properties": {
8+
"zone": "Zone Name"
9+
}
10+
}
611
},
712
"responses": {
813
"200": {
914
"body": {
1015
"name": "mySensor",
1116
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.Security/iotSensors/mySensor",
1217
"type": "Microsoft.Security/iotSensors",
13-
"properties": {}
18+
"properties": {
19+
"zone": "Zone Name"
20+
}
1421
}
1522
},
1623
"201": {
1724
"body": {
1825
"name": "mySensor",
1926
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.Security/iotSensors/mySensor",
2027
"type": "Microsoft.Security/iotSensors",
21-
"properties": {}
28+
"properties": {
29+
"zone": "Zone Name"
30+
}
2231
}
2332
}
2433
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-08-06-preview",
4+
"scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub"
5+
},
6+
"responses": {
7+
"200": {},
8+
"204": {}
9+
}
10+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-08-06-preview",
4+
"scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub"
5+
},
6+
"responses": {
7+
"200": {
8+
"body": {
9+
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.Security/iotSites/default",
10+
"type": "Microsoft.Security/iotSites",
11+
"name": "default",
12+
"properties": {
13+
"displayName": "IoT site name",
14+
"tags": {
15+
"key1": "value1",
16+
"key2": "value2"
17+
}
18+
}
19+
}
20+
}
21+
}
22+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-08-06-preview",
4+
"scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/iotSites"
5+
},
6+
"responses": {
7+
"200": {
8+
"body": {
9+
"value": [
10+
{
11+
"name": "default",
12+
"id": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.Security/iotSites/default",
13+
"type": "Microsoft.Security/iotSites",
14+
"properties": {
15+
"displayName": "IoT site name",
16+
"tags": {
17+
"key1": "value1",
18+
"key2": "value2"
19+
}
20+
}
21+
}
22+
]
23+
}
24+
}
25+
}
26+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-08-06-preview",
4+
"scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub",
5+
"iotSitesModel": {
6+
"properties": {
7+
"displayName": "IoT site name",
8+
"tags": {
9+
"key1": "value1",
10+
"key2": "value2"
11+
}
12+
}
13+
}
14+
},
15+
"responses": {
16+
"200": {
17+
"body": {
18+
"name": "default",
19+
"id": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.Security/iotSites/default",
20+
"type": "Microsoft.Security/iotSites",
21+
"properties": {
22+
"displayName": "IoT site name",
23+
"tags": {
24+
"key1": "value1",
25+
"key2": "value2"
26+
}
27+
}
28+
}
29+
},
30+
"201": {
31+
"body": {
32+
"name": "default",
33+
"id": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.Security/iotSites/default",
34+
"type": "Microsoft.Security/iotSites",
35+
"properties": {
36+
"displayName": "IoT site name",
37+
"tags": {
38+
"key1": "value1",
39+
"key2": "value2"
40+
}
41+
}
42+
}
43+
}
44+
}
45+
}

specification/security/resource-manager/Microsoft.Security/preview/2020-08-06-preview/iotSensors.json

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"200": {
9898
"description": "OK",
9999
"schema": {
100-
"$ref": "#/definitions/IotSensor"
100+
"$ref": "#/definitions/IotSensorsModel"
101101
}
102102
},
103103
"default": {
@@ -128,19 +128,22 @@
128128
},
129129
{
130130
"$ref": "#/parameters/IotSensorName"
131+
},
132+
{
133+
"$ref": "#/parameters/IotSensorsModel"
131134
}
132135
],
133136
"responses": {
134137
"200": {
135138
"description": "Updated IoT sensor",
136139
"schema": {
137-
"$ref": "#/definitions/IotSensor"
140+
"$ref": "#/definitions/IotSensorsModel"
138141
}
139142
},
140143
"201": {
141144
"description": "Created IoT sensor",
142145
"schema": {
143-
"$ref": "#/definitions/IotSensor"
146+
"$ref": "#/definitions/IotSensorsModel"
144147
}
145148
},
146149
"default": {
@@ -296,14 +299,14 @@
296299
"readOnly": true,
297300
"type": "array",
298301
"items": {
299-
"$ref": "#/definitions/IotSensor"
302+
"$ref": "#/definitions/IotSensorsModel"
300303
}
301304
}
302305
}
303306
},
304-
"IotSensor": {
307+
"IotSensorsModel": {
305308
"type": "object",
306-
"description": "IoT sensor",
309+
"description": "IoT sensor model",
307310
"properties": {
308311
"properties": {
309312
"x-ms-client-flatten": true,
@@ -320,7 +323,12 @@
320323
"IotSensorProperties": {
321324
"type": "object",
322325
"description": "IoT sensor properties",
323-
"properties": {}
326+
"properties": {
327+
"zone": {
328+
"type": "string",
329+
"description": "Display name of the IoT zone"
330+
}
331+
}
324332
},
325333
"ResetPasswordInput": {
326334
"type": "object",
@@ -350,6 +358,16 @@
350358
"type": "string",
351359
"description": "Name of the IoT sensor",
352360
"x-ms-parameter-location": "method"
361+
},
362+
"IotSensorsModel": {
363+
"name": "iotSensorsModel",
364+
"in": "body",
365+
"required": true,
366+
"description": "The IoT sensor model",
367+
"schema": {
368+
"$ref": "#/definitions/IotSensorsModel"
369+
},
370+
"x-ms-parameter-location": "method"
353371
}
354372
}
355373
}

0 commit comments

Comments
 (0)