Skip to content

Commit

Permalink
Microsoft.IoTSecurity - Add locations and deviceSecurityGroups (Azure…
Browse files Browse the repository at this point in the history
…#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 <lirche@microsoft.com>
  • Loading branch information
liranc and Liran Chen authored Mar 17, 2021
1 parent 0be85f0 commit c3beceb
Show file tree
Hide file tree
Showing 10 changed files with 629 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parameters": {
"api-version": "2021-02-01-preview",
"subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23",
"iotDefenderLocation": "eastus",
"deviceGroupName": "myGroup"
},
"responses": {
"200": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
}
Loading

0 comments on commit c3beceb

Please sign in to comment.