From c3beceb91458c77b1d79cc251aa66c57bab47237 Mon Sep 17 00:00:00 2001 From: Liran Chen <1437075+liranc@users.noreply.github.com> Date: Wed, 17 Mar 2021 07:09:24 +0200 Subject: [PATCH] Microsoft.IoTSecurity - Add locations and deviceSecurityGroups (#13091) * Locations * v1 * v2 * v3 * File rename * Rename resource * Update common types file path * add pageable option * Add missing nextLink property Co-authored-by: Liran Chen --- .../2021-02-01-preview/deviceGroups.json | 279 ++++++++++++++++++ .../examples/DeviceGroups/Delete.json | 12 + .../examples/DeviceGroups/Get.json | 26 ++ .../examples/DeviceGroups/List.json | 29 ++ .../examples/DeviceGroups/Put.json | 45 +++ .../examples/Locations/Get.json | 25 ++ .../examples/Locations/List.json | 28 ++ .../preview/2021-02-01-preview/locations.json | 164 ++++++++++ .../resource-manager/common/1.0/types.json | 19 ++ .../iotsecurity/resource-manager/readme.md | 2 + 10 files changed, 629 insertions(+) create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/deviceGroups.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/Delete.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/Get.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/List.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/Put.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Locations/Get.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Locations/List.json create mode 100644 specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/locations.json create mode 100644 specification/iotsecurity/resource-manager/common/1.0/types.json diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/deviceGroups.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/deviceGroups.json new file mode 100644 index 000000000000..7d7a9e5fa9ce --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/deviceGroups.json @@ -0,0 +1,279 @@ +{ + "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": { + "/subscriptions/{subscriptionId}/providers/Microsoft.IoTSecurity/locations/{iotDefenderLocation}/deviceGroups": { + "get": { + "x-ms-examples": { + "List device groups": { + "$ref": "./examples/DeviceGroups/List.json" + } + }, + "tags": [ + "Device Groups" + ], + "description": "List device groups", + "operationId": "DeviceGroups_List", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/1.0/types.json#/parameters/IotDefenderLocation" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DeviceGroupList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.IoTSecurity/locations/{iotDefenderLocation}/deviceGroups/{deviceGroupName}": { + "get": { + "x-ms-examples": { + "Get device group": { + "$ref": "./examples/DeviceGroups/Get.json" + } + }, + "tags": [ + "Device Groups" + ], + "operationId": "DeviceGroups_Get", + "description": "Get device group", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/1.0/types.json#/parameters/IotDefenderLocation" + }, + { + "$ref": "#/parameters/DeviceGroupName" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DeviceGroupModel" + } + }, + "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 device group": { + "$ref": "./examples/DeviceGroups/Put.json" + } + }, + "tags": [ + "Device Groups" + ], + "operationId": "DeviceGroups_CreateOrUpdate", + "description": "Create or update device group", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/1.0/types.json#/parameters/IotDefenderLocation" + }, + { + "$ref": "#/parameters/DeviceGroupName" + }, + { + "$ref": "#/parameters/DeviceGroupModel" + } + ], + "responses": { + "200": { + "description": "Updated device group", + "schema": { + "$ref": "#/definitions/DeviceGroupModel" + } + }, + "201": { + "description": "Created device group", + "schema": { + "$ref": "#/definitions/DeviceGroupModel" + } + }, + "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 device group": { + "$ref": "./examples/DeviceGroups/Delete.json" + } + }, + "tags": [ + "Device Groups" + ], + "operationId": "DeviceGroups_Delete", + "description": "Delete device group", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/1.0/types.json#/parameters/IotDefenderLocation" + }, + { + "$ref": "#/parameters/DeviceGroupName" + } + ], + "responses": { + "200": { + "description": "Device group deleted" + }, + "204": { + "description": "Device group does not exist" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "DeviceGroupList": { + "description": "List of device groups", + "type": "object", + "properties": { + "value": { + "description": "List data", + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/DeviceGroupModel" + } + }, + "nextLink": { + "description": "Link to next page of resources.", + "type": "string", + "readOnly": true + } + } + }, + "DeviceGroupModel": { + "type": "object", + "description": "Device group", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Device group properties", + "$ref": "#/definitions/DeviceGroupProperties" + }, + "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" + } + ] + }, + "DeviceGroupProperties": { + "type": "object", + "description": "Device group properties", + "properties": {} + } + }, + "parameters": { + "DeviceGroupName": { + "name": "deviceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "Device group name", + "x-ms-parameter-location": "method" + }, + "DeviceGroupModel": { + "name": "deviceGroupModel", + "in": "body", + "required": true, + "description": "Device group model", + "schema": { + "$ref": "#/definitions/DeviceGroupModel" + }, + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/Delete.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/Delete.json new file mode 100644 index 000000000000..e042d9ab2073 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/Delete.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "iotDefenderLocation": "eastus", + "deviceGroupName": "myGroup" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/Get.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/Get.json new file mode 100644 index 000000000000..f1aa41ccd382 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/Get.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "iotDefenderLocation": "eastus", + "deviceGroupName": "myGroup" + }, + "responses": { + "200": { + "body": { + "name": "myGroup", + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/locations/eastus/deviceGroups/myGroup", + "type": "Microsoft.IoTSecurity/locations/deviceGroups", + "properties": {}, + "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-02-01-preview/examples/DeviceGroups/List.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/List.json new file mode 100644 index 000000000000..0ef17acc3b7f --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/List.json @@ -0,0 +1,29 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "iotDefenderLocation": "eastus" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "myGroup", + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/locations/eastus/deviceGroups/myGroup", + "type": "Microsoft.IoTSecurity/locations/deviceGroups", + "properties": {}, + "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-02-01-preview/examples/DeviceGroups/Put.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/Put.json new file mode 100644 index 000000000000..a0a3232d51ce --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/Put.json @@ -0,0 +1,45 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "iotDefenderLocation": "eastus", + "deviceGroupName": "myGroup", + "deviceGroupModel": { + "properties": {} + } + }, + "responses": { + "200": { + "body": { + "name": "myGroup", + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/deviceGroups/myGroup", + "type": "Microsoft.IoTSecurity/locations/deviceGroups", + "properties": {}, + "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": "myGroup", + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/deviceGroups/myGroup", + "type": "Microsoft.IoTSecurity/locations/deviceGroups", + "properties": {}, + "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-02-01-preview/examples/Locations/Get.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Locations/Get.json new file mode 100644 index 000000000000..22ef851e6e37 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Locations/Get.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "iotDefenderLocation": "eastus" + }, + "responses": { + "200": { + "body": { + "name": "eastus", + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/locations/eastus", + "type": "Microsoft.IoTSecurity/locations", + "properties": {}, + "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-02-01-preview/examples/Locations/List.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Locations/List.json new file mode 100644 index 000000000000..008cf96b1af6 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Locations/List.json @@ -0,0 +1,28 @@ +{ + "parameters": { + "api-version": "2021-02-01-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "eastus", + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/locations/eastus", + "type": "Microsoft.IoTSecurity/locations", + "properties": {}, + "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-02-01-preview/locations.json b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/locations.json new file mode 100644 index 000000000000..2eccab51b6a4 --- /dev/null +++ b/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/locations.json @@ -0,0 +1,164 @@ +{ + "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": { + "/subscriptions/{subscriptionId}/providers/Microsoft.IoTSecurity/locations": { + "get": { + "x-ms-examples": { + "List locations": { + "$ref": "./examples/Locations/List.json" + } + }, + "tags": [ + "Locations" + ], + "description": "Lists Defender for IoT locations associated with the given subscription.", + "operationId": "Locations_List", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/LocationList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.IoTSecurity/locations/{iotDefenderLocation}": { + "get": { + "x-ms-examples": { + "Get location": { + "$ref": "./examples/Locations/Get.json" + } + }, + "tags": [ + "Locations" + ], + "operationId": "Locations_Get", + "description": "Get a Defender for IoT location associated with the given subscription.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../common/1.0/types.json#/parameters/IotDefenderLocation" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/LocationModel" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "LocationList": { + "description": "List of Defender for IoT locations", + "type": "object", + "properties": { + "value": { + "description": "List data", + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/LocationModel" + } + }, + "nextLink": { + "description": "Link to next page of resources.", + "type": "string", + "readOnly": true + } + } + }, + "LocationModel": { + "type": "object", + "description": "IoT Defender location", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "IoT Defender location properties", + "$ref": "#/definitions/LocationProperties" + }, + "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" + } + ] + }, + "LocationProperties": { + "type": "object", + "description": "Defender for IoT location properties", + "properties": {} + } + } +} diff --git a/specification/iotsecurity/resource-manager/common/1.0/types.json b/specification/iotsecurity/resource-manager/common/1.0/types.json new file mode 100644 index 000000000000..866704943a76 --- /dev/null +++ b/specification/iotsecurity/resource-manager/common/1.0/types.json @@ -0,0 +1,19 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0", + "title": "Common types" + }, + "paths": {}, + "definitions": {}, + "parameters": { + "IotDefenderLocation": { + "name": "iotDefenderLocation", + "in": "path", + "required": true, + "type": "string", + "description": "Defender for IoT location", + "x-ms-parameter-location": "client" + } + } +} diff --git a/specification/iotsecurity/resource-manager/readme.md b/specification/iotsecurity/resource-manager/readme.md index 1e9c2493da86..bf8d3eb5236f 100644 --- a/specification/iotsecurity/resource-manager/readme.md +++ b/specification/iotsecurity/resource-manager/readme.md @@ -64,6 +64,8 @@ input-file: - Microsoft.IoTSecurity/preview/2021-02-01-preview/sites.json - Microsoft.IoTSecurity/preview/2021-02-01-preview/sensors.json - Microsoft.IoTSecurity/preview/2021-02-01-preview/onPremiseSensors.json +- Microsoft.IoTSecurity/preview/2021-02-01-preview/locations.json +- Microsoft.IoTSecurity/preview/2021-02-01-preview/deviceGroups.json ``` ---