From 5bf8e98e8cf130f170e5dc575652d45210750c0c Mon Sep 17 00:00:00 2001 From: Or Avital Date: Mon, 12 Dec 2022 14:57:37 +0200 Subject: [PATCH 1/4] Update governance operation result --- ...ManagementGroupGovernanceRule_example.json | 1 + ...oupGovernanceRuleDeleteStatus_example.json | 14 -- ...upGovernanceRuleExecuteStatus_example.json | 2 +- .../2022-01-01-preview/governanceRules.json | 125 +++++++----------- 4 files changed, 52 insertions(+), 90 deletions(-) delete mode 100644 specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleDeleteStatus_example.json diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json index 785b6b113c12..45b1629f50be 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json @@ -5,6 +5,7 @@ "ruleId": "ad9a8e26-29d9-4829-bb30-e597a58cdbb8" }, "responses": { + "200": {}, "202": { "headers": { "location": "https://management.azure.com/providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8/operationResults/58b33f4f-c8c7-4b01-99cc-d437db4d40dd?api-version=2022-01-01-preview" diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleDeleteStatus_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleDeleteStatus_example.json deleted file mode 100644 index 3e745429ec66..000000000000 --- a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleDeleteStatus_example.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "parameters": { - "api-version": "2022-01-01-preview", - "managementGroupId": "contoso", - "ruleId": "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - "operationId": "58b33f4f-c8c7-4b01-99cc-d437db4d40dd" - }, - "responses": { - "202": { - "location": "https://management.azure.com/providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8/delete/operationResults/58b33f4f-c8c7-4b01-99cc-d437db4d40dd?api-version=2022-01-01-preview" - }, - "204": {} - } -} diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json index 057d6492413c..c67745607254 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json @@ -7,7 +7,7 @@ }, "responses": { "202": { - "location": "https://management.azure.com/providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8/execute/operationResults/58b33f4f-c8c7-4b01-99cc-d437db4d40dd?api-version=2022-01-01-preview" + "location": "https://management.azure.com/providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8/operationResults/58b33f4f-c8c7-4b01-99cc-d437db4d40dd?api-version=2022-01-01-preview" }, "200": { "body": { diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/governanceRules.json b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/governanceRules.json index 22f4734fbc73..ff54a39a3c59 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/governanceRules.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/governanceRules.json @@ -366,7 +366,7 @@ "description": "OK - Governance rule was deleted" }, "202": { - "description": "Accepted - Governance rule deletion on management scope", + "description": "Accepted - The operation still in progress", "headers": { "location": { "type": "string", @@ -437,7 +437,7 @@ "GovernanceRules" ], "description": "Get a specific governance rule for the requested scope by ruleId", - "operationId": "managementGroupGovernanceRules_Get", + "operationId": "ManagementGroupGovernanceRules_Get", "parameters": [ { "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" @@ -534,7 +534,7 @@ ], "responses": { "202": { - "description": "Accepted - Governance rule deletion on management scope", + "description": "Accepted - The operation still in progress", "headers": { "location": { "type": "string", @@ -711,15 +711,15 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}": { "get": { "x-ms-examples": { - "Get governance rules execution status by specific governanceRuleId": { + "Get governance rule long run operation status by specific governance rule ID": { "$ref": "./examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json" } }, "tags": [ "GovernanceRules" ], - "description": "Get a specific governance rule execution status for the requested scope by ruleId and operationId", - "operationId": "SubscriptionGovernanceRulesExecuteStatus_Get", + "description": "Get governance rule long run operation status for the requested scope by ruleId and operationId", + "operationId": "SubscriptionGovernanceRulesLongRunOperationStatus_Get", "parameters": [ { "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" @@ -736,13 +736,13 @@ ], "responses": { "200": { - "description": "OK", + "description": "OK - The operation completed", "schema": { - "$ref": "#/definitions/ExecuteRuleStatus" + "$ref": "#/definitions/LongRunOperationStatus" } }, "202": { - "description": "Accepted", + "description": "Accepted - The operation still in progress", "headers": { "location": { "type": "string", @@ -762,15 +762,15 @@ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}": { "get": { "x-ms-examples": { - "Get governance rules execution status by specific governanceRuleId": { + "Get governance rule long run operation status by specific governance rule ID": { "$ref": "./examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json" } }, "tags": [ "GovernanceRules" ], - "description": "Get a specific governance rule execution status for the requested scope by ruleId and operationId", - "operationId": "SecurityConnectorGovernanceRulesExecuteStatus_Get", + "description": "Get governance rule long run operation status for the requested scope by ruleId and operationId", + "operationId": "SecurityConnectorGovernanceRulesLongRunOperationStatus_Get", "parameters": [ { "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" @@ -793,13 +793,13 @@ ], "responses": { "200": { - "description": "OK", + "description": "OK - The operation completed", "schema": { - "$ref": "#/definitions/ExecuteRuleStatus" + "$ref": "#/definitions/LongRunOperationStatus" } }, "202": { - "description": "Accepted", + "description": "Accepted - The operation still in progress", "headers": { "location": { "type": "string", @@ -816,18 +816,18 @@ } } }, - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute/operationResults/{operationId}": { + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}": { "get": { "x-ms-examples": { - "Get governance rules execution status by specific governance rule ID": { + "Get governance rules long run operation status by specific governance rule ID": { "$ref": "./examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json" } }, "tags": [ "GovernanceRules" ], - "description": "Get a specific governance rule execution status for the requested scope by ruleId and operationId", - "operationId": "ManagementGroupGovernanceRulesExecuteStatus_Get", + "description": "Get governance rule long run operation status for the requested scope by ruleId and operationId", + "operationId": "ManagementGroupGovernanceRulesLongRunOperationStatus_Get", "parameters": [ { "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" @@ -844,13 +844,13 @@ ], "responses": { "200": { - "description": "OK", + "description": "OK - The operation completed", "schema": { - "$ref": "#/definitions/ExecuteRuleStatus" + "$ref": "#/definitions/LongRunOperationStatus" } }, "202": { - "description": "Accepted", + "description": "Accepted - The operation still in progress", "headers": { "location": { "type": "string", @@ -866,54 +866,6 @@ } } } - }, - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}/delete/operationResults/{operationId}": { - "get": { - "x-ms-examples": { - "Get governance rules deletion status by specific governance rule ID": { - "$ref": "./examples/GovernanceRules/GetManagementGroupGovernanceRuleDeleteStatus_example.json" - } - }, - "tags": [ - "GovernanceRules" - ], - "description": "Get a specific governance rule deletion status for the requested scope by rule ID and operation ID", - "operationId": "ManagementGroupGovernanceRulesDeleteStatus_Get", - "parameters": [ - { - "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" - }, - { - "$ref": "../../../common/v1/types.json#/parameters/ManagementGroupId" - }, - { - "$ref": "#/parameters/RuleId" - }, - { - "$ref": "#/parameters/OperationId" - } - ], - "responses": { - "204": { - "description": "Delete succeeded" - }, - "202": { - "description": "Accepted", - "headers": { - "location": { - "type": "string", - "description": "Location URL for the deletion status" - } - } - }, - "default": { - "description": "Error response describing why the operation failed", - "schema": { - "$ref": "../../../common/v1/types.json#/definitions/CloudError" - } - } - } - } } }, "definitions": { @@ -1205,14 +1157,37 @@ } } }, - "ExecuteRuleStatus": { + "LongRunOperationStatus": { "type": "object", - "description": "Execute status of governance rule over a given scope", + "description": "Long run operation status of governance rule over a given scope", "properties": { - "operationId": { - "description": "Unique key for the execution of governance rule", + "status": { "type": "string", - "readOnly": true + "description": "The status of the long run operation status of governance rule", + "readOnly": true, + "enum": [ + "Succeeded", + "Failed", + "Canceled" + ], + "x-ms-enum": { + "name": "OperationResultStatus", + "modelAsString": true, + "values": [ + { + "value": "Succeeded", + "description": "The operation succeeded" + }, + { + "value": "Failed", + "description": "The operation failed" + }, + { + "value": "Canceled", + "description": "The operation canceled" + } + ] + } } } } From 878051be3ba44e96330e35e37569b04c079cc668 Mon Sep 17 00:00:00 2001 From: Or Avital Date: Mon, 12 Dec 2022 15:29:38 +0200 Subject: [PATCH 2/4] Fix Model Validation --- .../DeleteManagementGroupGovernanceRule_example.json | 1 - .../GovernanceRules/GetGovernanceRuleExecuteStatus_example.json | 2 +- .../GetManagementGroupGovernanceRuleExecuteStatus_example.json | 2 +- ...GetSecurityConnectorGovernanceRuleExecuteStatus_example.json | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json index 45b1629f50be..785b6b113c12 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json @@ -5,7 +5,6 @@ "ruleId": "ad9a8e26-29d9-4829-bb30-e597a58cdbb8" }, "responses": { - "200": {}, "202": { "headers": { "location": "https://management.azure.com/providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8/operationResults/58b33f4f-c8c7-4b01-99cc-d437db4d40dd?api-version=2022-01-01-preview" diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json index c8a0bc956ec1..34d59ce6df71 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json @@ -11,7 +11,7 @@ }, "200": { "body": { - "operationId": "58b33f4f-c8c7-4b01-99cc-d437db4d40dd" + "status": "Succeeded" } } } diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json index c67745607254..37eca3d6e94e 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json @@ -11,7 +11,7 @@ }, "200": { "body": { - "operationId": "58b33f4f-c8c7-4b01-99cc-d437db4d40dd" + "status": "Succeeded" } } } diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json index f1f6fb2e254f..f74dbcec8748 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json @@ -13,7 +13,7 @@ }, "200": { "body": { - "operationId": "58b33f4f-c8c7-4b01-99cc-d437db4d40dd" + "status": "Succeeded" } } } From 05dbbd0f98828819d73f80cc4b324779e909158c Mon Sep 17 00:00:00 2001 From: Or Avital Date: Thu, 15 Dec 2022 13:31:21 +0200 Subject: [PATCH 3/4] Fix comment --- .../2022-01-01-preview/governanceRules.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/governanceRules.json b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/governanceRules.json index ff54a39a3c59..452a92badcff 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/governanceRules.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/governanceRules.json @@ -719,7 +719,7 @@ "GovernanceRules" ], "description": "Get governance rule long run operation status for the requested scope by ruleId and operationId", - "operationId": "SubscriptionGovernanceRulesLongRunOperationStatus_Get", + "operationId": "SubscriptionGovernanceRulesOperationResult_Get", "parameters": [ { "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" @@ -738,7 +738,7 @@ "200": { "description": "OK - The operation completed", "schema": { - "$ref": "#/definitions/LongRunOperationStatus" + "$ref": "#/definitions/OperationResult" } }, "202": { @@ -770,7 +770,7 @@ "GovernanceRules" ], "description": "Get governance rule long run operation status for the requested scope by ruleId and operationId", - "operationId": "SecurityConnectorGovernanceRulesLongRunOperationStatus_Get", + "operationId": "SecurityConnectorGovernanceRulesOperationResult_Get", "parameters": [ { "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" @@ -795,7 +795,7 @@ "200": { "description": "OK - The operation completed", "schema": { - "$ref": "#/definitions/LongRunOperationStatus" + "$ref": "#/definitions/OperationResult" } }, "202": { @@ -827,7 +827,7 @@ "GovernanceRules" ], "description": "Get governance rule long run operation status for the requested scope by ruleId and operationId", - "operationId": "ManagementGroupGovernanceRulesLongRunOperationStatus_Get", + "operationId": "ManagementGroupGovernanceRulesOperationResult_Get", "parameters": [ { "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" @@ -846,7 +846,7 @@ "200": { "description": "OK - The operation completed", "schema": { - "$ref": "#/definitions/LongRunOperationStatus" + "$ref": "#/definitions/OperationResult" } }, "202": { @@ -1157,13 +1157,13 @@ } } }, - "LongRunOperationStatus": { + "OperationResult": { "type": "object", "description": "Long run operation status of governance rule over a given scope", "properties": { "status": { "type": "string", - "description": "The status of the long run operation status of governance rule", + "description": "The status of the long run operation result of governance rule", "readOnly": true, "enum": [ "Succeeded", @@ -1171,7 +1171,7 @@ "Canceled" ], "x-ms-enum": { - "name": "OperationResultStatus", + "name": "OperationResult", "modelAsString": true, "values": [ { From 1ae8826ff8e3a12951c84335e302f8a519684453 Mon Sep 17 00:00:00 2001 From: Or Avital Date: Sun, 18 Dec 2022 08:39:16 +0200 Subject: [PATCH 4/4] Fix comment --- .../preview/2022-01-01-preview/governanceRules.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/governanceRules.json b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/governanceRules.json index 452a92badcff..26f3b8ac81be 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/governanceRules.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/governanceRules.json @@ -711,14 +711,14 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}": { "get": { "x-ms-examples": { - "Get governance rule long run operation status by specific governance rule ID": { + "Get governance rules long run operation result by specific governance rule ID": { "$ref": "./examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json" } }, "tags": [ "GovernanceRules" ], - "description": "Get governance rule long run operation status for the requested scope by ruleId and operationId", + "description": "Get governance rules long run operation result for the requested scope by ruleId and operationId", "operationId": "SubscriptionGovernanceRulesOperationResult_Get", "parameters": [ { @@ -762,14 +762,14 @@ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}": { "get": { "x-ms-examples": { - "Get governance rule long run operation status by specific governance rule ID": { + "Get governance rules long run operation result by specific governance rule ID": { "$ref": "./examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json" } }, "tags": [ "GovernanceRules" ], - "description": "Get governance rule long run operation status for the requested scope by ruleId and operationId", + "description": "Get governance rule long run operation result for the requested scope by ruleId and operationId", "operationId": "SecurityConnectorGovernanceRulesOperationResult_Get", "parameters": [ { @@ -819,14 +819,14 @@ "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}": { "get": { "x-ms-examples": { - "Get governance rules long run operation status by specific governance rule ID": { + "Get governance rules long run operation result by specific governance rule ID": { "$ref": "./examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json" } }, "tags": [ "GovernanceRules" ], - "description": "Get governance rule long run operation status for the requested scope by ruleId and operationId", + "description": "Get governance rules long run operation result for the requested scope by ruleId and operationId", "operationId": "ManagementGroupGovernanceRulesOperationResult_Get", "parameters": [ {