From d963f3af4781e43353a7994f52abb6dd1c2fde39 Mon Sep 17 00:00:00 2001 From: Orel Kayam Date: Mon, 28 Jun 2021 14:48:18 +0300 Subject: [PATCH] Old version as PR baseline --- .vscode/settings.json | 2 +- .../2021-07-01-preview/Sensors/Delete.json | 11 + .../Sensors/DownloadActivation.json | 15 + .../Sensors/DownloadResetPassword.json | 18 + .../2021-07-01-preview/Sensors/Get.json | 36 ++ .../2021-07-01-preview/Sensors/List.json | 64 +++ .../2021-07-01-preview/Sensors/Put.json | 62 ++ .../Sensors/TriggerTiPackageUpdate.json | 10 + .../2021-07-01-preview/Sites/Delete.json | 10 + .../preview/2021-07-01-preview/Sites/Get.json | 30 + .../2021-07-01-preview/Sites/List.json | 34 ++ .../preview/2021-07-01-preview/Sites/Put.json | 61 ++ .../preview/2021-07-01-preview/sensors.json | 528 ++++++++++++++++++ .../preview/2021-07-01-preview/sites.json | 266 +++++++++ 14 files changed, 1146 insertions(+), 1 deletion(-) create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/Delete.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/DownloadActivation.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/DownloadResetPassword.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/Get.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/List.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/Put.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/TriggerTiPackageUpdate.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/Delete.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/Get.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/List.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/Put.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/sensors.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/sites.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 76eab4509993..60d1dce046d5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -22,6 +22,6 @@ ], "typescript.tsdk": "node_modules\\typescript\\lib", "[json]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "vscode.json-language-features" } } diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/Delete.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/Delete.json new file mode 100644 index 000000000000..965babba055f --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/Delete.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", + "sensorName": "mySensor" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/DownloadActivation.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/DownloadActivation.json new file mode 100644 index 000000000000..0f18c17ca23f --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/DownloadActivation.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", + "sensorName": "mySensor" + }, + "responses": { + "200": { + "headers": { + "content-type": "application/zip" + }, + "body": "{Binary}" + } + } +} diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/DownloadResetPassword.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/DownloadResetPassword.json new file mode 100644 index 000000000000..bf5e66d7f84c --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/DownloadResetPassword.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", + "sensorName": "mySensor", + "body": { + "applianceId": "3214-528AV23-D121-D3-E1" + } + }, + "responses": { + "200": { + "headers": { + "content-type": "application/zip" + }, + "body": "{Binary}" + } + } +} diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/Get.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/Get.json new file mode 100644 index 000000000000..7448efebc105 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/Get.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", + "sensorName": "mySensor" + }, + "responses": { + "200": { + "body": { + "name": "mySensor", + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sensors/mySensor", + "type": "Microsoft.IoTSecurity/sensors", + "properties": { + "connectivityTime": "2020-11-17T12:31:25Z", + "dynamicLearning": true, + "learningMode": true, + "sensorStatus": "Ok", + "sensorVersion": "2020.11.01.1643", + "tiAutomaticUpdates": true, + "tiStatus": "Ok", + "tiVersion": "2020-11-17T12:31:25Z", + "zone": "Zone Name", + "sensorType": "Ot" + }, + "systemData": { + "createdBy": "string", + "createdByType": "User", + "createdAt": "2020-04-27T21:53:29.0928001Z", + "lastModifiedBy": "string", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-04-27T21:53:29.0928001Z" + } + } + } + } +} diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/List.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/List.json new file mode 100644 index 000000000000..df5b64d56593 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/List.json @@ -0,0 +1,64 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "mySensor", + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sensors/mySensor", + "type": "Microsoft.IoTSecurity/sensors", + "properties": { + "connectivityTime": "2020-11-17T12:31:25Z", + "dynamicLearning": true, + "learningMode": true, + "sensorStatus": "Ok", + "sensorVersion": "2020.11.01.1643", + "tiAutomaticUpdates": true, + "tiStatus": "Ok", + "tiVersion": "2020-11-17T12:31:25Z", + "zone": "Zone Name", + "sensorType": "Ot" + }, + "systemData": { + "createdBy": "string", + "createdByType": "User", + "createdAt": "2020-04-27T21:53:29.0928001Z", + "lastModifiedBy": "string", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-04-27T21:53:29.0928001Z" + } + }, + { + "name": "otherSensor", + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sensors/otherSensor", + "type": "Microsoft.IoTSecurity/sensors", + "properties": { + "connectivityTime": "2020-11-17T12:31:25Z", + "dynamicLearning": false, + "learningMode": false, + "sensorStatus": "Disconnected", + "sensorVersion": "2020.11.01.1643", + "tiAutomaticUpdates": true, + "tiStatus": "Ok", + "tiVersion": "2020-11-17T12:31:25Z", + "zone": "Zone Name", + "sensorType": "Ot" + }, + "systemData": { + "createdBy": "string", + "createdByType": "User", + "createdAt": "2020-04-27T21:53:29.0928001Z", + "lastModifiedBy": "string", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-04-27T21:53:29.0928001Z" + } + } + ] + } + } + } +} diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/Put.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/Put.json new file mode 100644 index 000000000000..93034b813e1b --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/Put.json @@ -0,0 +1,62 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", + "sensorName": "mySensor", + "sensorModel": { + "properties": { + "tiAutomaticUpdates": true, + "zone": "Zone Name", + "sensorType": "Ot" + } + } + }, + "responses": { + "200": { + "body": { + "name": "mySensor", + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sensors/mySensor", + "type": "Microsoft.IoTSecurity/sensors", + "properties": { + "connectivityTime": "2020-11-17T12:31:25Z", + "dynamicLearning": true, + "learningMode": true, + "sensorStatus": "Ok", + "sensorVersion": "2020.11.01.1643", + "tiAutomaticUpdates": true, + "tiStatus": "Ok", + "tiVersion": "2020-11-17T12:31:25Z", + "zone": "Zone Name", + "sensorType": "Ot" + } + } + }, + "201": { + "body": { + "name": "mySensor", + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sensors/mySensor", + "type": "Microsoft.IoTSecurity/sensors", + "properties": { + "connectivityTime": "2020-11-17T12:31:25Z", + "dynamicLearning": true, + "learningMode": true, + "sensorStatus": "Ok", + "sensorVersion": "2020.11.01.1643", + "tiAutomaticUpdates": true, + "tiStatus": "Ok", + "tiVersion": "2020-11-17T12:31:25Z", + "zone": "Zone Name", + "sensorType": "Ot" + }, + "systemData": { + "createdBy": "string", + "createdByType": "User", + "createdAt": "2020-04-27T21:53:29.0928001Z", + "lastModifiedBy": "string", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-04-27T21:53:29.0928001Z" + } + } + } + } +} diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/TriggerTiPackageUpdate.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/TriggerTiPackageUpdate.json new file mode 100644 index 000000000000..c79a50ab4852 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sensors/TriggerTiPackageUpdate.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", + "sensorName": "mySensor" + }, + "responses": { + "200": {} + } +} diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/Delete.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/Delete.json new file mode 100644 index 000000000000..19db474a1fd3 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/Delete.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/Get.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/Get.json new file mode 100644 index 000000000000..895bb29b0d70 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/Get.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sites/default", + "type": "Microsoft.IoTSecurity/sites", + "name": "default", + "properties": { + "displayName": "IoT site name", + "tags": { + "key1": "value1", + "key2": "value2" + } + }, + "systemData": { + "createdBy": "string", + "createdByType": "User", + "createdAt": "2020-04-27T21:53:29.0928001Z", + "lastModifiedBy": "string", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-04-27T21:53:29.0928001Z" + } + } + } + } +} diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/List.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/List.json new file mode 100644 index 000000000000..b9ca5bf9e754 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/List.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/sites" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "default", + "id": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sites/default", + "type": "Microsoft.IoTSecurity/sites", + "properties": { + "displayName": "IoT site name", + "tags": { + "key1": "value1", + "key2": "value2" + } + }, + "systemData": { + "createdBy": "string", + "createdByType": "User", + "createdAt": "2020-04-27T21:53:29.0928001Z", + "lastModifiedBy": "string", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-04-27T21:53:29.0928001Z" + } + } + ] + } + } + } +} diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/Put.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/Put.json new file mode 100644 index 000000000000..843fdaa09745 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/Sites/Put.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "scope": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", + "siteModel": { + "properties": { + "displayName": "IoT site name", + "tags": { + "key1": "value1", + "key2": "value2" + } + } + } + }, + "responses": { + "200": { + "body": { + "name": "default", + "id": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sites/default", + "type": "Microsoft.IoTSecurity/sites", + "properties": { + "displayName": "IoT site name", + "tags": { + "key1": "value1", + "key2": "value2" + } + }, + "systemData": { + "createdBy": "string", + "createdByType": "User", + "createdAt": "2020-04-27T21:53:29.0928001Z", + "lastModifiedBy": "string", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-04-27T21:53:29.0928001Z" + } + } + }, + "201": { + "body": { + "name": "default", + "id": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sites/default", + "type": "Microsoft.IoTSecurity/sites", + "properties": { + "displayName": "IoT site name", + "tags": { + "key1": "value1", + "key2": "value2" + } + }, + "systemData": { + "createdBy": "string", + "createdByType": "User", + "createdAt": "2020-04-27T21:53:29.0928001Z", + "lastModifiedBy": "string", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-04-27T21:53:29.0928001Z" + } + } + } + } +} diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/sensors.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/sensors.json new file mode 100644 index 000000000000..19a11fa8f7c8 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/sensors.json @@ -0,0 +1,528 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Defender for IoT", + "description": "API spec for Microsoft.IoTSecurity (Azure Defender for IoT) resource provider", + "version": "2021-02-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": { + "/{scope}/providers/Microsoft.IoTSecurity/sensors": { + "get": { + "x-ms-examples": { + "List IoT sensors": { + "$ref": "./examples/Sensors/List.json" + } + }, + "tags": [ + "Sensors" + ], + "description": "List IoT sensors", + "operationId": "Sensors_List", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SensorScope" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SensorsList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.IoTSecurity/sensors/{sensorName}": { + "get": { + "x-ms-examples": { + "Get IoT sensor": { + "$ref": "./examples/Sensors/Get.json" + } + }, + "tags": [ + "Sensors" + ], + "operationId": "Sensors_Get", + "description": "Get IoT sensor", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SensorScope" + }, + { + "$ref": "#/parameters/SensorName" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SensorModel" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "x-ms-examples": { + "Create or update IoT sensor": { + "$ref": "./examples/Sensors/Put.json" + } + }, + "tags": [ + "Sensors" + ], + "operationId": "Sensors_CreateOrUpdate", + "description": "Create or update IoT sensor", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SensorScope" + }, + { + "$ref": "#/parameters/SensorName" + }, + { + "$ref": "#/parameters/SensorModel" + } + ], + "responses": { + "200": { + "description": "Updated IoT sensor", + "schema": { + "$ref": "#/definitions/SensorModel" + } + }, + "201": { + "description": "Created IoT sensor", + "schema": { + "$ref": "#/definitions/SensorModel" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "x-ms-examples": { + "Delete IoT sensor": { + "$ref": "./examples/Sensors/Delete.json" + } + }, + "tags": [ + "Sensors" + ], + "operationId": "Sensors_Delete", + "description": "Delete IoT sensor", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SensorScope" + }, + { + "$ref": "#/parameters/SensorName" + } + ], + "responses": { + "200": { + "description": "Deleted IoT sensor" + }, + "204": { + "description": "IoT sensor does not exist" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.IoTSecurity/sensors/{sensorName}/downloadActivation": { + "post": { + "x-ms-examples": { + "Download activation file": { + "$ref": "./examples/Sensors/DownloadActivation.json" + } + }, + "tags": [ + "Sensors" + ], + "operationId": "Sensors_DownloadActivation", + "description": "Download sensor activation file", + "produces": [ + "application/zip" + ], + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SensorScope" + }, + { + "$ref": "#/parameters/SensorName" + } + ], + "responses": { + "200": { + "description": "Downloaded activation file", + "schema": { + "type": "object", + "format": "file" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.IoTSecurity/sensors/{sensorName}/downloadResetPassword": { + "post": { + "x-ms-examples": { + "Download file for reset password of the sensor": { + "$ref": "./examples/Sensors/DownloadResetPassword.json" + } + }, + "tags": [ + "Sensors" + ], + "operationId": "Sensors_DownloadResetPassword", + "description": "Download file for reset password of the sensor", + "produces": [ + "application/zip" + ], + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SensorScope" + }, + { + "$ref": "#/parameters/SensorName" + }, + { + "in": "body", + "name": "body", + "required": true, + "description": "The reset password input.", + "schema": { + "$ref": "#/definitions/ResetPasswordInput" + }, + "x-ms-parameter-location": "method" + } + ], + "responses": { + "200": { + "description": "Downloaded reset password file", + "schema": { + "type": "object", + "format": "file" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.IoTSecurity/sensors/{sensorName}/triggerTiPackageUpdate": { + "post": { + "x-ms-examples": { + "Trigger threat intelligence package update": { + "$ref": "./examples/Sensors/TriggerTiPackageUpdate.json" + } + }, + "tags": [ + "Sensors" + ], + "operationId": "Sensors_TriggerTiPackageUpdate", + "description": "Trigger threat intelligence package update", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SensorScope" + }, + { + "$ref": "#/parameters/SensorName" + } + ], + "responses": { + "200": { + "description": "Triggered threat intelligence package update" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "SensorsList": { + "description": "List of IoT sensors", + "type": "object", + "properties": { + "value": { + "description": "List data", + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/SensorModel" + } + } + } + }, + "SensorModel": { + "type": "object", + "description": "IoT sensor model", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "IoT sensor properties", + "$ref": "#/definitions/SensorProperties" + }, + "systemData": { + "readOnly": true, + "type": "object", + "description": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/Resource" + } + ] + }, + "SensorProperties": { + "type": "object", + "description": "IoT sensor properties", + "properties": { + "connectivityTime": { + "description": "Last connectivity time of the IoT sensor", + "readOnly": true, + "type": "string", + "example": "2020-11-17T12:31:25Z" + }, + "dynamicLearning": { + "description": "Dynamic mode status of the IoT sensor", + "example": true, + "readOnly": true, + "type": "boolean" + }, + "learningMode": { + "description": "Learning mode status of the IoT sensor", + "example": true, + "readOnly": true, + "type": "boolean" + }, + "sensorStatus": { + "readOnly": true, + "type": "string", + "example": "Ok", + "description": "Status of the IoT sensor", + "enum": [ + "Ok", + "Disconnected", + "Unavailable" + ], + "x-ms-enum": { + "name": "sensorStatus", + "modelAsString": true, + "values": [ + { + "value": "Ok" + }, + { + "value": "Disconnected" + }, + { + "value": "Unavailable" + } + ] + } + }, + "sensorVersion": { + "description": "Version of the IoT sensor", + "readOnly": true, + "type": "string", + "example": "2020.11.01.1643" + }, + "tiAutomaticUpdates": { + "description": "TI Automatic mode status of the IoT sensor", + "example": true, + "type": "boolean" + }, + "tiStatus": { + "readOnly": true, + "type": "string", + "example": "Ok", + "description": "TI Status of the IoT sensor", + "enum": [ + "Ok", + "Failed", + "InProgress", + "UpdateAvailable" + ], + "x-ms-enum": { + "name": "tiStatus", + "modelAsString": true, + "values": [ + { + "value": "Ok" + }, + { + "value": "Failed" + }, + { + "value": "InProgress" + }, + { + "value": "UpdateAvailable" + } + ] + } + }, + "tiVersion": { + "description": "TI Version of the IoT sensor", + "readOnly": true, + "type": "string", + "example": "2020-11-17T12:31:25Z" + }, + "zone": { + "type": "string", + "description": "Zone of the IoT sensor", + "example": "A12" + }, + "sensorType": { + "description": "Type of sensor", + "example": "Ot", + "type": "string", + "enum": [ + "Ot", + "Enterprise" + ], + "x-ms-enum": { + "name": "sensorType", + "modelAsString": true, + "values": [ + { + "value": "Ot" + }, + { + "value": "Enterprise" + } + ] + } + } + } + }, + "ResetPasswordInput": { + "type": "object", + "description": "Reset password input.", + "properties": { + "applianceId": { + "description": "The appliance id of the sensor.", + "type": "string" + } + } + } + }, + "parameters": { + "SensorScope": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub)", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "SensorName": { + "name": "sensorName", + "in": "path", + "required": true, + "type": "string", + "description": "Name of the IoT sensor", + "x-ms-parameter-location": "method" + }, + "SensorModel": { + "name": "sensorModel", + "in": "body", + "required": true, + "description": "The IoT sensor model", + "schema": { + "$ref": "#/definitions/SensorModel" + }, + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/sites.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/sites.json new file mode 100644 index 000000000000..722abaf53153 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-07-01-preview/sites.json @@ -0,0 +1,266 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Defender for IoT", + "description": "API spec for Microsoft.IoTSecurity (Azure Defender for IoT) resource provider", + "version": "2021-02-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": { + "/{scope}/providers/Microsoft.IoTSecurity/sites": { + "get": { + "x-ms-examples": { + "List IoT sites": { + "$ref": "./examples/Sites/List.json" + } + }, + "tags": [ + "Sites" + ], + "description": "List IoT sites", + "operationId": "Sites_List", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SiteScope" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SitesList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.IoTSecurity/sites/default": { + "get": { + "x-ms-examples": { + "Get IoT site": { + "$ref": "./examples/Sites/Get.json" + } + }, + "tags": [ + "Sites" + ], + "operationId": "Sites_Get", + "description": "Get IoT site", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SiteScope" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SiteModel" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "x-ms-examples": { + "Create or update IoT site": { + "$ref": "./examples/Sites/Put.json" + } + }, + "tags": [ + "Sites" + ], + "operationId": "Sites_CreateOrUpdate", + "description": "Create or update IoT site", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SiteScope" + }, + { + "$ref": "#/parameters/SiteModel" + } + ], + "responses": { + "200": { + "description": "Updated IoT site", + "schema": { + "$ref": "#/definitions/SiteModel" + } + }, + "201": { + "description": "Created IoT site", + "schema": { + "$ref": "#/definitions/SiteModel" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "x-ms-examples": { + "Delete IoT site": { + "$ref": "./examples/Sites/Delete.json" + } + }, + "tags": [ + "Sites" + ], + "operationId": "Sites_Delete", + "description": "Delete IoT site", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SiteScope" + } + ], + "responses": { + "200": { + "description": "Deleted IoT site" + }, + "204": { + "description": "IoT site does not exist" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "SitesList": { + "description": "List of IoT sites", + "type": "object", + "properties": { + "value": { + "description": "List data", + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/SiteModel" + } + } + } + }, + "SiteModel": { + "type": "object", + "description": "IoT site model", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "IoT site properties", + "$ref": "#/definitions/SiteProperties" + }, + "systemData": { + "readOnly": true, + "type": "object", + "description": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ProxyResource" + } + ] + }, + "SiteProperties": { + "type": "object", + "description": "IoT site properties", + "properties": { + "displayName": { + "type": "string", + "description": "Display name of the IoT site" + }, + "tags": { + "type": "object", + "description": "Tags of the IoT site", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "displayName" + ] + } + }, + "parameters": { + "SiteScope": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub)", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "SiteModel": { + "name": "siteModel", + "in": "body", + "required": true, + "description": "The IoT sites model", + "schema": { + "$ref": "#/definitions/SiteModel" + }, + "x-ms-parameter-location": "method" + } + } +}