Skip to content

Commit 19b0109

Browse files
author
Ami Hollander
committed
operation results and statuses
1 parent 794f7f5 commit 19b0109

File tree

10 files changed

+358
-0
lines changed

10 files changed

+358
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23",
4+
"location": "eastus",
5+
"operationId": "00000000-0000-0000-0000-000000000000",
6+
"api-version": "2025-10-01-preview"
7+
},
8+
"responses": {
9+
"200": {}
10+
}
11+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23",
4+
"location": "eastus",
5+
"operationId": "55555555-5555-5555-5555-555555555555",
6+
"api-version": "2025-10-01-preview"
7+
},
8+
"responses": {
9+
"default": {
10+
"body": {
11+
"error": {
12+
"code": "OperationNotFound",
13+
"message": "The requested operation was not found.",
14+
"target": "operationId",
15+
"details": [
16+
{
17+
"code": "InvalidOperationId",
18+
"message": "The operation ID '55555555-5555-5555-5555-555555555555' does not exist or has expired."
19+
}
20+
]
21+
}
22+
}
23+
}
24+
}
25+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23",
4+
"location": "eastus",
5+
"operationId": "00000000-0000-0000-0000-000000000001",
6+
"api-version": "2025-10-01-preview"
7+
},
8+
"responses": {
9+
"202": {
10+
"headers": {
11+
"Location": "https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/eastus/operationResults/00000000-0000-0000-0000-000000000001?api-version=2025-10-01-preview",
12+
"Retry-After": "10"
13+
}
14+
}
15+
}
16+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23",
4+
"location": "westeurope",
5+
"operationId": "44444444-4444-4444-4444-444444444444",
6+
"api-version": "2025-10-01-preview"
7+
},
8+
"responses": {
9+
"204": {}
10+
}
11+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23",
4+
"location": "eastus",
5+
"operationId": "00000000-0000-0000-0000-000000000000",
6+
"api-version": "2025-10-01-preview"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/eastus/operationStatuses/00000000-0000-0000-0000-000000000000",
12+
"name": "00000000-0000-0000-0000-000000000000",
13+
"status": "Succeeded",
14+
"startTime": "2025-10-01T10:00:00.000Z",
15+
"endTime": "2025-10-01T10:05:00.000Z",
16+
"percentComplete": 100.0,
17+
"properties": {
18+
"resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myResourceGroup/providers/Microsoft.Security/securityConnectors/mySecurityConnector"
19+
}
20+
}
21+
}
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23",
4+
"location": "westus",
5+
"operationId": "33333333-3333-3333-3333-333333333333",
6+
"api-version": "2025-10-01-preview"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westus/operationStatuses/33333333-3333-3333-3333-333333333333",
12+
"name": "33333333-3333-3333-3333-333333333333",
13+
"status": "Canceled",
14+
"startTime": "2025-10-01T09:00:00.000Z",
15+
"endTime": "2025-10-01T09:01:15.000Z",
16+
"percentComplete": 25.0,
17+
"properties": {
18+
"resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/testResourceGroup/providers/Microsoft.Security/automations/myAutomation"
19+
}
20+
}
21+
}
22+
}
23+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23",
4+
"location": "eastus",
5+
"operationId": "22222222-2222-2222-2222-222222222222",
6+
"api-version": "2025-10-01-preview"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/eastus/operationStatuses/22222222-2222-2222-2222-222222222222",
12+
"name": "22222222-2222-2222-2222-222222222222",
13+
"status": "Failed",
14+
"startTime": "2025-10-01T10:00:00.000Z",
15+
"endTime": "2025-10-01T10:02:30.000Z",
16+
"percentComplete": 100.0,
17+
"error": {
18+
"code": "ResourceValidationFailed",
19+
"message": "The resource validation failed with the following error: Invalid configuration provided.",
20+
"target": "securityConnector",
21+
"details": [
22+
{
23+
"code": "InvalidParameter",
24+
"message": "The parameter 'environmentName' is invalid.",
25+
"target": "environmentName"
26+
}
27+
]
28+
},
29+
"properties": {
30+
"resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myResourceGroup/providers/Microsoft.Security/securityConnectors/mySecurityConnector"
31+
}
32+
}
33+
}
34+
}
35+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23",
4+
"location": "eastus",
5+
"operationId": "11111111-1111-1111-1111-111111111111",
6+
"api-version": "2025-10-01-preview"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/eastus/operationStatuses/11111111-1111-1111-1111-111111111111",
12+
"name": "11111111-1111-1111-1111-111111111111",
13+
"status": "InProgress",
14+
"startTime": "2025-10-01T10:00:00.000Z",
15+
"percentComplete": 45.5,
16+
"properties": {
17+
"resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myResourceGroup/providers/Microsoft.Security/securityConnectors/mySecurityConnector"
18+
}
19+
}
20+
}
21+
}
22+
}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "Microsoft Defender for Cloud",
5+
"description": "API spec for Microsoft Defender for Cloud operation results.",
6+
"version": "2025-10-01-preview"
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"consumes": [
13+
"application/json"
14+
],
15+
"produces": [
16+
"application/json"
17+
],
18+
"security": [
19+
{
20+
"azure_auth": [
21+
"user_impersonation"
22+
]
23+
}
24+
],
25+
"securityDefinitions": {
26+
"azure_auth": {
27+
"type": "oauth2",
28+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
29+
"flow": "implicit",
30+
"description": "Azure Active Directory OAuth2 Flow",
31+
"scopes": {
32+
"user_impersonation": "impersonate your user account"
33+
}
34+
}
35+
},
36+
"paths": {
37+
"/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{location}/operationResults/{operationId}": {
38+
"get": {
39+
"x-ms-examples": {
40+
"Get operation result - Completed (200)": {
41+
"$ref": "./examples/OperationResults/GetOperationResult.json"
42+
},
43+
"Get operation result - In Progress (202)": {
44+
"$ref": "./examples/OperationResults/GetOperationResultInProgress.json"
45+
},
46+
"Get operation result - No Content (204)": {
47+
"$ref": "./examples/OperationResults/GetOperationResultNoContent.json"
48+
},
49+
"Get operation result - Error": {
50+
"$ref": "./examples/OperationResults/GetOperationResultError.json"
51+
}
52+
},
53+
"tags": [
54+
"OperationResults"
55+
],
56+
"description": "Returns operation results for long running operations executing DELETE or PATCH on the resource.",
57+
"operationId": "OperationResults_Get",
58+
"parameters": [
59+
{
60+
"$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter"
61+
},
62+
{
63+
"$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/LocationParameter"
64+
},
65+
{
66+
"$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/OperationIdParameter"
67+
},
68+
{
69+
"$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter"
70+
}
71+
],
72+
"responses": {
73+
"200": {
74+
"description": "Successfully retrieved the operation result."
75+
},
76+
"202": {
77+
"description": "The operation is still in progress.",
78+
"headers": {
79+
"Location": {
80+
"type": "string",
81+
"description": "URL for determining when an operation has completed. Check OperationResult resources this URL to determine the result of the asynchronous operation."
82+
},
83+
"Retry-After": {
84+
"type": "integer",
85+
"format": "int32",
86+
"description": "The recommended number of seconds to wait before calling the URI specified in Location."
87+
}
88+
}
89+
},
90+
"204": {
91+
"description": "No Content. The operation completed successfully but returned no content."
92+
},
93+
"default": {
94+
"description": "Error response describing why the operation failed.",
95+
"schema": {
96+
"$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse"
97+
}
98+
}
99+
}
100+
}
101+
}
102+
}
103+
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "Microsoft Defender for Cloud",
5+
"description": "API spec for Microsoft Defender for Cloud operation statuses.",
6+
"version": "2025-10-01-preview"
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"consumes": [
13+
"application/json"
14+
],
15+
"produces": [
16+
"application/json"
17+
],
18+
"security": [
19+
{
20+
"azure_auth": [
21+
"user_impersonation"
22+
]
23+
}
24+
],
25+
"securityDefinitions": {
26+
"azure_auth": {
27+
"type": "oauth2",
28+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
29+
"flow": "implicit",
30+
"description": "Azure Active Directory OAuth2 Flow",
31+
"scopes": {
32+
"user_impersonation": "impersonate your user account"
33+
}
34+
}
35+
},
36+
"paths": {
37+
"/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{location}/operationStatuses/{operationId}": {
38+
"get": {
39+
"x-ms-examples": {
40+
"Get operation status - Succeeded": {
41+
"$ref": "./examples/OperationStatuses/GetOperationStatus.json"
42+
},
43+
"Get operation status - InProgress": {
44+
"$ref": "./examples/OperationStatuses/GetOperationStatusInProgress.json"
45+
},
46+
"Get operation status - Failed": {
47+
"$ref": "./examples/OperationStatuses/GetOperationStatusFailed.json"
48+
},
49+
"Get operation status - Canceled": {
50+
"$ref": "./examples/OperationStatuses/GetOperationStatusCanceled.json"
51+
}
52+
},
53+
"tags": [
54+
"OperationStatuses"
55+
],
56+
"description": "Get the status of a long running azure asynchronous operation.",
57+
"operationId": "OperationStatuses_Get",
58+
"parameters": [
59+
{
60+
"$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/SubscriptionIdParameter"
61+
},
62+
{
63+
"$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/LocationParameter"
64+
},
65+
{
66+
"$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/OperationIdParameter"
67+
},
68+
{
69+
"$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter"
70+
}
71+
],
72+
"responses": {
73+
"200": {
74+
"description": "OK. Operation status.",
75+
"schema": {
76+
"$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/OperationStatusResult"
77+
}
78+
},
79+
"default": {
80+
"description": "Error response describing why the operation failed.",
81+
"schema": {
82+
"$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse"
83+
}
84+
}
85+
}
86+
}
87+
}
88+
}
89+
}

0 commit comments

Comments
 (0)