diff --git a/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/Recommendations.json b/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/Recommendations.json index ab760a61634b..884cd7d25d55 100644 --- a/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/Recommendations.json +++ b/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/Recommendations.json @@ -151,9 +151,8 @@ "$ref": "#/parameters/RecommendationPatch" } ], - "x-ms-long-running-operation": true, "responses": { - "202": { + "200": { "description": "OK", "schema": { "$ref": "#/definitions/Recommendation" @@ -167,38 +166,64 @@ } } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}/triggerEvaluation": { + "post": { + "x-ms-examples": { + "Reevaluate a recommendation.": { + "$ref": "./examples/recommendations/ReevaluateRecommendation.json" + } + }, + "tags": [ + "recommendations" + ], + "description": "Reevaluate a recommendation.", + "operationId": "Reevaluate_Recommendation", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "../../../common/2.0/types.json#/parameters/WorkspaceName" + }, + { + "$ref": "#/parameters/RecommendationId" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ReevaluateResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/2.0/types.json#/definitions/CloudError" + } + } + } + } } }, "definitions": { "Recommendation": { "description": "Recommendation object.", "properties": { - "id": { - "description": "id of recommendation.", - "type": "string", - "format": "uuid" - }, - "instructions": { - "description": "Instructions of the recommendation.", - "$ref": "#/definitions/Instructions" - }, - "content": { - "description": "Content of the recommendation.", - "$ref": "#/definitions/Content", - "x-nullable": true - }, - "resourceId": { - "description": "Id of the resource this recommendation refers to.", - "type": "string", - "x-nullable": true + "recommendationTypeId": { + "description": "Id of the recommendation type.", + "type": "string" }, - "additionalProperties": { - "description": "Collection of additional properties for the recommendation.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-nullable": true + "state": { + "description": "State of the recommendation.", + "$ref": "#/definitions/RecommendationState" }, "title": { "description": "Title of the recommendation.", @@ -208,79 +233,52 @@ "description": "Description of the recommendation.", "type": "string" }, - "recommendationTypeTitle": { - "description": "Title of the recommendation type.", - "type": "string" - }, - "recommendationTypeId": { - "description": "Id of the recommendation type.", - "type": "string" - }, - "category": { - "description": "Category of the recommendation.", - "$ref": "#/definitions/RecommendationCategory" + "creationTimeUtc": { + "description": "The time stamp (UTC) when the recommendation was created.", + "type": "string", + "format": "date-time" }, - "context": { - "description": "Context of the recommendation.", - "$ref": "#/definitions/RecommendationContext" + "lastEvaluatedTimeUtc": { + "description": "The time stamp (UTC) when the recommendation was last evaluated.", + "type": "string", + "format": "date-time" }, - "workspaceId": { - "description": "Id of the workspace this recommendation refers to.", + "lastModifiedTimeUtc": { + "description": "The time stamp (UTC) when the recommendation was last modified.", "type": "string", - "format": "uuid" + "format": "date-time" }, - "actions": { - "description": "List of actions to take for this recommendation.", + "suggestions": { + "description": "List of suggestions to take for this recommendation.", "type": "array", "items": { - "$ref": "#/definitions/RecommendedAction" + "$ref": "#/definitions/RecommendedSuggestion" }, "x-ms-identifiers": [] }, - "state": { - "description": "State of the recommendation.", - "$ref": "#/definitions/RecommendationState" - }, - "priority": { - "description": "Priority of the recommendation.", - "$ref": "#/definitions/RecommendationPriority" - }, - "lastEvaluatedTimeUtc": { - "description": "The time stamp (UTC) when the recommendation was last evaluated.", - "type": "string", - "format": "date-time" - }, - "hideUntilTimeUtc": { - "description": "The time stamp (UTC) when the recommendation should be displayed again.", + "resourceId": { + "description": "Id of the resource this recommendation refers to.", "type": "string", - "format": "date-time", "x-nullable": true }, - "displayUntilTimeUtc": { - "description": "The timestamp (UTC) after which the recommendation should not be displayed anymore.", - "type": "string", - "format": "date-time", + "additionalProperties": { + "description": "Collection of additional properties for the recommendation.", + "type": "object", + "additionalProperties": { + "type": "string" + }, "x-nullable": true - }, - "visible": { - "description": "Value indicating if the recommendation should be displayed or not.", - "type": "boolean" } }, "required": [ - "id", - "instructions", - "title", - "description", - "recommendationTypeTitle", "recommendationTypeId", - "category", - "context", - "workspaceId", - "actions", "state", - "priority", - "lastEvaluatedTimeUtc" + "title", + "description", + "creationTimeUtc", + "lastEvaluatedTimeUtc", + "lastModifiedTimeUtc", + "suggestions" ], "type": "object" }, @@ -297,66 +295,39 @@ }, "type": "object" }, - "Content": { - "description": "Content section of the recommendation.", + "RecommendedSuggestion": { + "description": "What suggestions should be taken to complete the recommendation.", "properties": { + "suggestionTypeId": { + "description": "Id of the suggestion type.", + "type": "string" + }, "title": { - "description": "Title of the content.", + "description": "Title of the suggestion.", "type": "string" }, "description": { - "description": "Description of the content.", - "type": "string" - } - }, - "required": [ - "title", - "description" - ], - "type": "object" - }, - "Instructions": { - "description": "Instructions section of a recommendation.", - "properties": { - "actionsToBePerformed": { - "description": "What actions should be taken to complete the recommendation.", + "description": "Description of the suggestion.", "type": "string" }, - "recommendationImportance": { - "description": "Explains why the recommendation is important.", + "action": { + "description": "Action of the suggestion.", "type": "string" }, - "howToPerformActionDetails": { - "description": "How should the user complete the recommendation.", - "type": "string", + "additionalProperties": { + "description": "Collection of additional properties for the suggestion.", + "type": "object", + "additionalProperties": { + "type": "string" + }, "x-nullable": true } }, "required": [ - "actionsToBePerformed", - "recommendationImportance" - ], - "type": "object" - }, - "RecommendedAction": { - "description": "What actions should be taken to complete the recommendation.", - "properties": { - "linkText": { - "description": "Text of the link to complete the action.", - "type": "string" - }, - "linkUrl": { - "description": "The Link to complete the action.", - "type": "string" - }, - "state": { - "description": "The state of the action.", - "$ref": "#/definitions/ActionState" - } - }, - "required": [ - "linkText", - "linkUrl" + "suggestionTypeId", + "title", + "description", + "action" ], "type": "object" }, @@ -366,93 +337,19 @@ "state": { "description": "State of the recommendation.", "$ref": "#/definitions/RecommendationState" - }, - "hideUntilTimeUtc": { - "description": "The time stamp (UTC) when the recommendation should be displayed again.", - "type": "string", - "format": "date-time" } }, "type": "object" }, - "RecommendationCategory": { - "description": "Categories of recommendations.", - "type": "string", - "enum": [ - "Onboarding", - "NewFeature", - "SocEfficiency", - "CostOptimization", - "Demo" - ], - "x-ms-enum": { - "name": "Category", - "modelAsString": true, - "values": [ - { - "value": "Onboarding", - "description": "Onboarding recommendation." - }, - { - "value": "NewFeature", - "description": "New feature recommendation." - }, - { - "value": "SocEfficiency", - "description": "Soc Efficiency recommendation." - }, - { - "value": "CostOptimization", - "description": "Cost optimization recommendation." - }, - { - "value": "Demo", - "description": "Demo recommendation." - } - ] - } - }, - "RecommendationContext": { - "description": "Context of recommendation.", - "type": "string", - "enum": [ - "Analytics", - "Incidents", - "Overview", - "None" - ], - "x-ms-enum": { - "name": "Context", - "modelAsString": true, - "values": [ - { - "value": "Analytics", - "description": "Analytics context." - }, - { - "value": "Incidents", - "description": "Incidents context." - }, - { - "value": "Overview", - "description": "Overview context." - }, - { - "value": "None", - "description": "No context." - } - ] - } - }, "RecommendationState": { "description": "State of recommendation.", "type": "string", "enum": [ "Active", - "Disabled", + "InProgress", + "Dismissed", "CompletedByUser", - "CompletedByAction", - "Hidden" + "CompletedBySystem" ], "x-ms-enum": { "name": "State", @@ -463,77 +360,37 @@ "description": "Recommendation is active." }, { - "value": "Disabled", - "description": "Recommendation is disabled." - }, - { - "value": "CompletedByUser", - "description": "Recommendation has been completed by user." + "value": "InProgress", + "description": "Recommendation is in progress." }, { - "value": "CompletedByAction", - "description": "Recommendation has been completed by action." + "value": "Dismissed", + "description": "Recommendation has been dismissed." }, { - "value": "Hidden", - "description": "Recommendation is hidden." - } - ] - } - }, - "RecommendationPriority": { - "description": "Priority of recommendation.", - "type": "string", - "enum": [ - "Low", - "Medium", - "High" - ], - "x-ms-enum": { - "name": "Priority", - "modelAsString": true, - "values": [ - { - "value": "Low", - "description": "Low priority for recommendation." - }, - { - "value": "Medium", - "description": "Medium priority for recommendation." + "value": "CompletedByUser", + "description": "Recommendation has been completed by user." }, { - "value": "High", - "description": "High priority for recommendation." + "value": "CompletedBySystem", + "description": "Recommendation has been completed by the system." } ] } }, - "ActionState": { - "description": "Represents the state the recommendation action is currently in.", - "type": "string", - "enum": [ - "Active", - "InProgress", - "Done" + "ReevaluateResponse": { + "description": "Reevaluate response object.", + "properties": { + "lastEvaluatedTimeUtc": { + "description": "The time stamp (UTC) when the recommendation was last evaluated.", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "lastEvaluatedTimeUtc" ], - "x-ms-enum": { - "name": "Priority", - "modelAsString": true, - "values": [ - { - "value": "Active", - "description": "Default state of actions." - }, - { - "value": "InProgress", - "description": "State for when actions have been clicked on." - }, - { - "value": "Done", - "description": "State of completed actions." - } - ] - } + "type": "object" } }, "parameters": { @@ -552,10 +409,8 @@ "name": "recommendationPatch", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/RecommendationPatch" - }, + "type": "object", + "$ref": "#/definitions/RecommendationPatch", "x-ms-identifiers": [] }, "x-ms-parameter-location": "method" diff --git a/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/GetRecommendation.json b/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/GetRecommendation.json index 470da6f7cde4..8d764080ce43 100644 --- a/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/GetRecommendation.json +++ b/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/GetRecommendation.json @@ -10,38 +10,27 @@ "200": { "body": { "recommendationTypeId": "Swagger_Example", - "id": "6d4b54eb-8684-4aa3-a156-3aa37b8014bc", - "priority": "Medium", - "category": "Onboarding", - "context": "None", - "content": { - "title": "someText", - "description": "someText" - }, - "resourceId": "someId", - "recommendationTypeTitle": "someText", - "recommendationTypeDescription": "someText", - "instructions": { - "actionsToBePerformed": "someText", - "recommendationImportance": "someText" - }, - "additionalProperties": { - "someKey": "someValue" - }, + "state": "CompletedBySystem", "title": "someText", "description": "someText", - "workspaceId": "9a7711dc-40de-43b5-bf7e-ba25ec4592f3", - "actions": [ + "creationTimeUtc": "2022-02-19T03:09:03.4888396+00:00", + "lastEvaluatedTimeUtc": "2022-02-19T03:09:03.4888396+00:00", + "lastModifiedTimeUtc": "2022-02-19T03:57:31.7964447+00:00", + "suggestions": [ { - "linkText": "someText", - "linkUrl": "https://www.someuri.com", - "state": "Active" + "suggestionTypeId": "ThreatIntelligence_Example_Suggestion_Example", + "title": "someText", + "description": "someText", + "action": "someText", + "additionalProperties": { + "someKey": "someValue" + } } ], - "state": "CompletedByAction", - "hideUntilTimeUtc": "2022-02-19T03:09:03.4888396+00:00", - "displayUntilTimeUtc": "2022-02-19T03:57:31.7964447+00:00", - "lastEvaluatedTimeUtc": "2022-02-19T03:09:03.4888396+00:00" + "resourceId": "someId", + "additionalProperties": { + "someKey": "someValue" + } } } } diff --git a/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/GetRecommendations.json b/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/GetRecommendations.json index dd7cf9b9a366..a09c474f7ed2 100644 --- a/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/GetRecommendations.json +++ b/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/GetRecommendations.json @@ -11,38 +11,27 @@ "value": [ { "recommendationTypeId": "ThreatIntelligence_Example", - "id": "6d4b54eb-8684-4aa3-a156-3aa37b8014bc", - "priority": "Medium", - "category": "Onboarding", - "context": "None", - "content": { - "title": "someText", - "description": "someText" - }, - "resourceId": "someId", - "recommendationTypeTitle": "someText", - "recommendationTypeDescription": "someText", - "instructions": { - "actionsToBePerformed": "someText", - "recommendationImportance": "someText" - }, - "additionalProperties": { - "someKey": "someValue" - }, + "state": "CompletedBySystem", "title": "someText", "description": "someText", - "workspaceId": "9a7711dc-40de-43b5-bf7e-ba25ec4592f3", - "actions": [ + "creationTimeUtc": "2022-02-19T03:09:03.4888396+00:00", + "lastEvaluatedTimeUtc": "2022-02-19T03:09:03.4888396+00:00", + "lastModifiedTimeUtc": "2022-02-19T03:57:31.7964447+00:00", + "suggestions": [ { - "linkText": "someText", - "linkUrl": "https://www.someuri.com", - "state": "Active" + "suggestionTypeId": "ThreatIntelligence_Example_Suggestion_Example", + "title": "someText", + "description": "someText", + "action": "someText", + "additionalProperties": { + "someKey": "someValue" + } } ], - "state": "CompletedByAction", - "hideUntilTimeUtc": "2022-02-19T03:09:03.4888396+00:00", - "displayUntilTimeUtc": "2022-02-19T03:57:31.7964447+00:00", - "lastEvaluatedTimeUtc": "2022-02-19T03:09:03.4888396+00:00" + "resourceId": "someId", + "additionalProperties": { + "someKey": "someValue" + } } ] } diff --git a/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/PatchRecommendation.json b/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/PatchRecommendation.json index 2ed574a2a6cd..16b2f48d55ba 100644 --- a/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/PatchRecommendation.json +++ b/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/PatchRecommendation.json @@ -5,51 +5,35 @@ "resourceGroupName": "myRg", "workspaceName": "myWorkspace", "recommendationId": "6d4b54eb-8684-4aa3-a156-3aa37b8014bc", - "recommendationPatch": [ - { - "state": "Active" - } - ] + "recommendationPatch": { + "state": "Active" + } }, "responses": { - "202": { - "headers": { - "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.SecurityInsights/recommendations/6d4b54eb-8684-4aa3-a156-3aa37b8014bc?api-version=2024-01-01-preview" - }, + "200": { "body": { "recommendationTypeId": "ThreatIntelligence_Example", - "id": "6d4b54eb-8684-4aa3-a156-3aa37b8014bc", - "priority": "Medium", - "category": "Onboarding", - "context": "None", - "content": { - "title": "someText", - "description": "someText" - }, - "resourceId": "someId", - "recommendationTypeTitle": "someText", - "recommendationTypeDescription": "someText", - "instructions": { - "actionsToBePerformed": "someText", - "recommendationImportance": "someText" - }, - "additionalProperties": { - "someKey": "someValue" - }, + "state": "CompletedByUser", "title": "someText", "description": "someText", - "workspaceId": "9a7711dc-40de-43b5-bf7e-ba25ec4592f3", - "actions": [ + "creationTimeUtc": "2022-02-19T03:09:03.4888396+00:00", + "lastEvaluatedTimeUtc": "2022-02-19T03:09:03.4888396+00:00", + "lastModifiedTimeUtc": "2022-02-19T03:57:31.7964447+00:00", + "suggestions": [ { - "linkText": "someText", - "linkUrl": "https://www.someuri.com", - "state": "Active" + "suggestionTypeId": "ThreatIntelligence_Example_Suggestion_Example", + "title": "someText", + "description": "someText", + "action": "someText", + "additionalProperties": { + "someKey": "someValue" + } } ], - "state": "CompletedByUser", - "hideUntilTimeUtc": "2022-02-19T03:09:03.4888396+00:00", - "displayUntilTimeUtc": "2022-02-19T03:57:31.7964447+00:00", - "lastEvaluatedTimeUtc": "2022-02-19T03:09:03.4888396+00:00" + "resourceId": "someId", + "additionalProperties": { + "someKey": "someValue" + } } } } diff --git a/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/ReevaluateRecommendation.json b/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/ReevaluateRecommendation.json new file mode 100644 index 000000000000..8a62608705c2 --- /dev/null +++ b/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-01-01-preview/examples/recommendations/ReevaluateRecommendation.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "api-version": "2024-01-01-preview", + "subscriptionId": "d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", + "resourceGroupName": "myRg", + "workspaceName": "myWorkspace", + "recommendationId": "6d4b54eb-8684-4aa3-a156-3aa37b8014bc" + }, + "responses": { + "200": { + "body": { + "lastEvaluatedTimeUtc": "2023-10-10T03:09:03.4888396+00:00" + } + } + } +}