Skip to content

Commit 306cb14

Browse files
ayushiaksAyushi Srivastava
authored andcommitted
Updating OperationResults Model and examples (Azure#22168)
* Updating OperationResults Model and examples * File renamings * Fix build - Add Correct Param Refs * Fix references * Build fixes * Prettier Fixes * Lint and Prettier fixes * Lint and Prettier fixes * Prettier fix * Prettier fix --------- Co-authored-by: Ayushi Srivastava <aysriva@microsoft.com>
1 parent 6ec4b52 commit 306cb14

File tree

4 files changed

+145
-24
lines changed

4 files changed

+145
-24
lines changed

specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2020-05-12-preview/agfood.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,60 @@
276276
}
277277
}
278278
},
279+
"/subscriptions/{subscriptionId}/providers/Microsoft.AgFoodPlatform/locations/{locations}/operationResults/{operationResultsId}": {
280+
"get": {
281+
"tags": [
282+
"OperationResults"
283+
],
284+
"description": "Get operationResults for a FarmBeats resource.",
285+
"operationId": "OperationResults_Get",
286+
"produces": [
287+
"application/json"
288+
],
289+
"parameters": [
290+
{
291+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
292+
},
293+
{
294+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
295+
},
296+
{
297+
"in": "path",
298+
"name": "locations",
299+
"description": "Location.",
300+
"required": true,
301+
"type": "string"
302+
},
303+
{
304+
"in": "path",
305+
"name": "operationResultsId",
306+
"description": "operation Results Id.",
307+
"required": true,
308+
"type": "string",
309+
"pattern": "^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$"
310+
}
311+
],
312+
"responses": {
313+
"200": {
314+
"description": "Success",
315+
"schema": {
316+
"$ref": "#/definitions/ArmAsyncOperation"
317+
}
318+
},
319+
"default": {
320+
"description": "Error",
321+
"schema": {
322+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
323+
}
324+
}
325+
},
326+
"x-ms-examples": {
327+
"OperationResults_Get": {
328+
"$ref": "./examples/OperationResults_Get.json"
329+
}
330+
}
331+
}
332+
},
279333
"/providers/Microsoft.AgFoodPlatform/farmBeatsExtensionDefinitions": {
280334
"get": {
281335
"tags": [
@@ -1073,6 +1127,33 @@
10731127
}
10741128
}
10751129
},
1130+
"ArmAsyncOperation": {
1131+
"description": "Arm async operation class.\r\nRef: https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/async-operations.",
1132+
"type": "object",
1133+
"properties": {
1134+
"status": {
1135+
"description": "Status of the async operation.",
1136+
"type": "string"
1137+
},
1138+
"error": {
1139+
"$ref": "#/definitions/ArmAsyncOperationError"
1140+
}
1141+
}
1142+
},
1143+
"ArmAsyncOperationError": {
1144+
"description": "Arm async operation error class.\r\nRef: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#azure-asyncoperation-resource-format.",
1145+
"type": "object",
1146+
"properties": {
1147+
"code": {
1148+
"description": "Status of the async operation.",
1149+
"type": "string"
1150+
},
1151+
"message": {
1152+
"description": "Status of the async operation.",
1153+
"type": "string"
1154+
}
1155+
}
1156+
},
10761157
"FarmBeatsProperties": {
10771158
"description": "FarmBeats ARM Resource properties.",
10781159
"type": "object",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-05-12-preview",
4+
"subscriptionId": "11111111-2222-3333-4444-555555555555",
5+
"locations": "westus",
6+
"operationResultsId": "resource-provisioning-id-farmBeatsResourceName"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"status": "Failed",
12+
"error": {
13+
"code": "BadArgument",
14+
"message": "The provided database 'foo' has an invalid username."
15+
}
16+
}
17+
}
18+
}
19+
}

specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/agfood.json

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -718,13 +718,13 @@
718718
}
719719
}
720720
},
721-
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/operationResults/{operationResultsId}": {
721+
"/subscriptions/{subscriptionId}/providers/Microsoft.AgFoodPlatform/locations/{locations}/operationResults/{operationResultsId}": {
722722
"get": {
723723
"tags": [
724-
"FarmBeatsModels"
724+
"OperationResults"
725725
],
726726
"description": "Get operationResults for a FarmBeats resource.",
727-
"operationId": "FarmBeatsModels_GetOperationResult",
727+
"operationId": "OperationResults_Get",
728728
"produces": [
729729
"application/json"
730730
],
@@ -733,18 +733,19 @@
733733
"$ref": "../../../../../common-types/resource-management/v4/types.json#/parameters/SubscriptionIdParameter"
734734
},
735735
{
736-
"$ref": "../../../../../common-types/resource-management/v4/types.json#/parameters/ResourceGroupNameParameter"
737-
},
738-
{
739-
"$ref": "#/parameters/FarmBeatsResourceNameParameter"
736+
"$ref": "../../../../../common-types/resource-management/v4/types.json#/parameters/ApiVersionParameter"
740737
},
741738
{
742-
"$ref": "../../../../../common-types/resource-management/v4/types.json#/parameters/ApiVersionParameter"
739+
"in": "path",
740+
"name": "locations",
741+
"description": "Location.",
742+
"required": true,
743+
"type": "string"
743744
},
744745
{
745746
"in": "path",
746747
"name": "operationResultsId",
747-
"description": "The operation results id.",
748+
"description": "operation Results Id.",
748749
"required": true,
749750
"type": "string",
750751
"pattern": "^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$"
@@ -765,8 +766,8 @@
765766
}
766767
},
767768
"x-ms-examples": {
768-
"FarmBeatsModels_GetOperationResult": {
769-
"$ref": "./examples/FarmBeatsModels_GetOperationResult.json"
769+
"OperationResults_Get": {
770+
"$ref": "./examples/OperationResults_Get.json"
770771
}
771772
}
772773
}
@@ -1898,6 +1899,33 @@
18981899
}
18991900
}
19001901
},
1902+
"ArmAsyncOperation": {
1903+
"description": "Arm async operation class.\r\nRef: https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/async-operations.",
1904+
"type": "object",
1905+
"properties": {
1906+
"status": {
1907+
"description": "Status of the async operation.",
1908+
"type": "string"
1909+
},
1910+
"error": {
1911+
"$ref": "#/definitions/ArmAsyncOperationError"
1912+
}
1913+
}
1914+
},
1915+
"ArmAsyncOperationError": {
1916+
"description": "Arm async operation error class.\r\nRef: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#azure-asyncoperation-resource-format.",
1917+
"type": "object",
1918+
"properties": {
1919+
"code": {
1920+
"description": "Status of the async operation.",
1921+
"type": "string"
1922+
},
1923+
"message": {
1924+
"description": "Status of the async operation.",
1925+
"type": "string"
1926+
}
1927+
}
1928+
},
19011929
"SensorIntegration": {
19021930
"description": "Sensor integration request model.",
19031931
"type": "object",
@@ -2050,16 +2078,6 @@
20502078
}
20512079
}
20522080
},
2053-
"ArmAsyncOperation": {
2054-
"description": "Arm async operation class.\r\nRef: https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/async-operations.",
2055-
"type": "object",
2056-
"properties": {
2057-
"status": {
2058-
"description": "Status of the async operation.",
2059-
"type": "string"
2060-
}
2061-
}
2062-
},
20632081
"SolutionProperties": {
20642082
"description": "Solution resource properties.",
20652083
"required": [

specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_GetOperationResult.json renamed to specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/OperationResults_Get.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
"parameters": {
33
"api-version": "2021-09-01-preview",
44
"subscriptionId": "11111111-2222-3333-4444-555555555555",
5-
"resourceGroupName": "examples-rg",
6-
"farmBeatsResourceName": "examples-farmBeatsResourceName",
5+
"locations": "westus",
76
"operationResultsId": "resource-provisioning-id-farmBeatsResourceName"
87
},
98
"responses": {
109
"200": {
1110
"body": {
12-
"status": "Succeeded"
11+
"status": "Failed",
12+
"error": {
13+
"code": "BadArgument",
14+
"message": "The provided database 'foo' has an invalid username."
15+
}
1316
}
1417
}
1518
}

0 commit comments

Comments
 (0)