Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Nic entity type and IoT Device properties to EntityTypes.json #19391

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@
"Mailbox",
"MailCluster",
"MailMessage",
"SubmissionMail"
"SubmissionMail",
"Nic"
],
"type": "string",
"x-ms-enum": {
Expand Down Expand Up @@ -381,6 +382,10 @@
{
"description": "Entity represents submission mail in the system.",
"value": "SubmissionMail"
},
{
"description": "Entity represents network interface in the system.",
"value": "Nic"
}
]
}
Expand Down Expand Up @@ -408,7 +413,8 @@
"MailCluster",
"MailMessage",
"Mailbox",
"SubmissionMail"
"SubmissionMail",
"Nic"
],
"type": "string",
"x-ms-enum": {
Expand Down Expand Up @@ -498,6 +504,10 @@
{
"description": "Entity represents submission mail in the system.",
"value": "SubmissionMail"
},
{
"description": "Entity represents network interface in the system.",
"value": "Nic"
}
]
}
Expand Down Expand Up @@ -1000,6 +1010,96 @@
"readOnly": true,
"type": "array",
"x-ms-identifiers": []
},
"owners": {
"description": "A list of owners of the IoTDevice entity.",
"items": {
"type": "string"
},
"readOnly": true,
"type": "array",
"x-ms-identifiers": []
},
"nicEntityIds": {
"description": "A list of Nic entity ids of the IoTDevice entity.",
"items": {
"type": "string"
},
"readOnly": true,
"type": "array",
"x-ms-identifiers": []
},
"site": {
"description": "The site of the device",
"readOnly": true,
"type": "string"
},
"zone": {
"description": "The zone location of the device within a site",
"readOnly": true,
"type": "string"
},
"sensor": {
"description": "The sensor the device is monitored by",
"readOnly": true,
"type": "string"
},
"deviceSubType": {
"description": "The subType of the device ('PLC', 'HMI', 'EWS', etc.)",
"readOnly": true,
"type": "string"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider using enum if applicable

},
"importance": {
"description": "Device importance, determines if the device classified as 'crown jewel'",
"enum": [
"Unknown",
"Low",
"Normal",
"High"
],
"type": "string",
"x-ms-enum": {
"modelAsString": true,
"name": "DeviceImportance",
"values": [
{
"description": "Unknown - Default value",
"value": "Unknown"
},
{
"description": "Low",
"value": "Low"
},
{
"description": "Normal",
"value": "Normal"
},
{
"description": "High",
"value": "High"
}
]
}
},
"purdueLayer": {
"description": "The Purdue Layer of the device",
"readOnly": true,
"type": "string"
},
"isAuthorized": {
"description": "Determines whether the device classified as authorized device",
"readOnly": true,
"type": "boolean"
},
"isProgramming": {
"description": "Determines whether the device classified as programming device",
"readOnly": true,
"type": "boolean"
},
"isScanner": {
"description": "Is the device classified as a scanner device",
"readOnly": true,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider upgrading to enum as explained here : https://armwiki.azurewebsites.net/rp_onboarding/process/api_review_best_practices.html#common-issues-found-in-review

Replace boolean/switch properties with better enum
A Boolean will forever have two valid values (true or false). A string enum type is always preferred. Also, properties should always provide better values just than True and False. For example two switches "isTypeA" and "isTypeB" should be replaced with one enum "type": [A, B, DefaultType]. Even if you still believe [True, False] are the correct values for a property, you should use a string enum with values [True, False] instead of boolean. Enums are always a more flexible and future proof option because they allow additional values to be added in the future in a non-breaking way, e.g. [True, False, Unknown].

"type": "boolean"
}
},
"type": "object"
Expand Down Expand Up @@ -2399,6 +2499,53 @@
}
},
"type": "object"
},
"NicEntity": {
"allOf": [
{
"$ref": "#/definitions/Entity"
}
],
"description": "Represents an network interface entity.",
"properties": {
"properties": {
"$ref": "#/definitions/NicEntityProperties",
"description": "Network interface entity properties",
"x-ms-client-flatten": true
}
},
"type": "object",
"x-ms-discriminator-value": "Nic"
},
"NicEntityProperties": {
"allOf": [
{
"$ref": "#/definitions/EntityCommonProperties"
}
],
"description": "Nic entity property bag.",
"properties": {
"macAddress": {
"description": "The MAC address of this network interface",
"readOnly": true,
"type": "string"
},
"ipAddressEntityId": {
"description": "The IP entity id of this network interface",
"readOnly": true,
"type": "string"
},
"vlans": {
"description": "A list of VLANs of the network interface entity.",
"items": {
"type": "string"
},
"readOnly": true,
"type": "array",
"x-ms-identifiers": []
}
},
"type": "object"
}
},
"parameters": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,28 @@
"properties": {
"friendlyName": "device1",
"deviceId": "device1",
"iotHubEntityId": "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/entities/8b2d9401-f953-e89d-2583-be9b4975870c"
"deviceName": "device1",
"iotHubEntityId": "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/entities/8b2d9401-f953-e89d-2583-be9b4975870c",
"nicEntityIds": [
"/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/entities/6ee379bd-ace8-44cf-ab10-ee669a1b71e2"
],
"deviceType": "Industrial",
"firmwareVersion": "20.11",
"importance": "Normal",
"isAuthorized": true,
"isProgramming": false,
"isScanner": false,
"model": "demo-model",
"protocols": [
"CIP",
"EtherNet/IP"
],
"operatingSystem": "Windows",
"purdueLayer": "ProcessControl",
"sensor": "demo-sensor",
"site": "demo-site",
"vendor": "demo-vendor",
"zone": "zone"
}
}
}
Expand Down