Skip to content

Commit 2ac5bb0

Browse files
JatinKhatri03prabhavguptaprabguptapriyankajayaswal1msyyc
authored andcommitted
Users/prjayasw/agrifoodrp (Azure#20363)
* Adds base for updating Microsoft.AgFoodPlatform from version preview/2020-05-12-preview to version 2021-09-01-preview * Adds base for updating Microsoft.AgFoodPlatform from version preview/2020-05-12-preview to version 2021-09-01-preview * Updates readme * Updates API version in new specs and examples * Private endpoint changes * updated examples * updated db update example * build fixes * changed common-types version * pr comments * minor update * Removed 202 response code from Put call * update examples * prettier fix * enum example fix * Incremental change of sensor feature * Adding support for operationResults api for farmbeats resource. * Making cosmetic changes to fix checks * Update readme.python.md pin the title for python SDK * Fixing one change * Rsolving comments * Updating Extension Create api and removing extension update api * Removing ApiProperties from required list and adding Extension_CreateOrUpdate.json * Adding examples/Extensions_Delete.json and removing examples/Extensions_Update.json. Also, adding few small changes to Extension apis * Fixing a small typo * Fixing failing checks * Fixing example for extension create or update * Fixing prettier error Co-authored-by: Prabhav Gupta <[email protected]> Co-authored-by: Prabhav Gupta <[email protected]> Co-authored-by: Priyanka Jayaswal <[email protected]> Co-authored-by: Yuchao Yan <[email protected]>
1 parent 125b342 commit 2ac5bb0

File tree

5 files changed

+137
-118
lines changed

5 files changed

+137
-118
lines changed

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

Lines changed: 63 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
"tags": [
1212
"Extensions"
1313
],
14-
"description": "Install extension.",
15-
"operationId": "Extensions_Create",
14+
"description": "Install or Update extension. AdditionalApiProperties are merged patch and if the extension is updated to a new version then the obsolete entries will be auto deleted from AdditionalApiProperties.",
15+
"operationId": "Extensions_CreateOrUpdate",
16+
"consumes": [
17+
"application/json"
18+
],
1619
"produces": [
1720
"application/json"
1821
],
@@ -31,15 +34,29 @@
3134
},
3235
{
3336
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter"
37+
},
38+
{
39+
"in": "body",
40+
"name": "requestBody",
41+
"description": "Extension resource request body.",
42+
"schema": {
43+
"$ref": "#/definitions/ExtensionInstallationRequest"
44+
}
3445
}
3546
],
3647
"responses": {
37-
"201": {
48+
"200": {
3849
"description": "Success",
3950
"schema": {
4051
"$ref": "#/definitions/Extension"
4152
}
4253
},
54+
"201": {
55+
"description": "Created",
56+
"schema": {
57+
"$ref": "#/definitions/Extension"
58+
}
59+
},
4360
"default": {
4461
"description": "Error",
4562
"schema": {
@@ -48,8 +65,8 @@
4865
}
4966
},
5067
"x-ms-examples": {
51-
"Extensions_Create": {
52-
"$ref": "./examples/Extensions_Create.json"
68+
"Extensions_CreateOrUpdate": {
69+
"$ref": "./examples/Extensions_CreateOrUpdate.json"
5370
}
5471
}
5572
},
@@ -99,52 +116,6 @@
99116
}
100117
}
101118
},
102-
"patch": {
103-
"tags": [
104-
"Extensions"
105-
],
106-
"description": "Upgrade to latest extension.",
107-
"operationId": "Extensions_Update",
108-
"produces": [
109-
"application/json"
110-
],
111-
"parameters": [
112-
{
113-
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter"
114-
},
115-
{
116-
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter"
117-
},
118-
{
119-
"$ref": "#/parameters/FarmBeatsResourceNameParameter"
120-
},
121-
{
122-
"$ref": "#/parameters/ExtensionIdParameter"
123-
},
124-
{
125-
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter"
126-
}
127-
],
128-
"responses": {
129-
"200": {
130-
"description": "Success",
131-
"schema": {
132-
"$ref": "#/definitions/Extension"
133-
}
134-
},
135-
"default": {
136-
"description": "Error",
137-
"schema": {
138-
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
139-
}
140-
}
141-
},
142-
"x-ms-examples": {
143-
"Extensions_Update": {
144-
"$ref": "./examples/Extensions_Update.json"
145-
}
146-
}
147-
},
148119
"delete": {
149120
"tags": [
150121
"Extensions"
@@ -1233,6 +1204,19 @@
12331204
}
12341205
},
12351206
"definitions": {
1207+
"ApiProperties": {
1208+
"description": "Api properties.",
1209+
"type": "object",
1210+
"properties": {
1211+
"apiFreshnessWindowInMinutes": {
1212+
"format": "int32",
1213+
"description": "Interval in minutes for which the weather data for the api needs to be refreshed.",
1214+
"maximum": 10080,
1215+
"minimum": 0,
1216+
"type": "integer"
1217+
}
1218+
}
1219+
},
12361220
"ExtensionProperties": {
12371221
"description": "Extension resource properties.",
12381222
"type": "object",
@@ -1263,6 +1247,14 @@
12631247
"description": "Extension api docs link.",
12641248
"type": "string",
12651249
"readOnly": true
1250+
},
1251+
"additionalApiProperties": {
1252+
"description": "Additional api properties.",
1253+
"type": "object",
1254+
"additionalProperties": {
1255+
"$ref": "#/definitions/ApiProperties"
1256+
},
1257+
"readOnly": true
12661258
}
12671259
}
12681260
},
@@ -1290,6 +1282,26 @@
12901282
},
12911283
"x-ms-azure-resource": true
12921284
},
1285+
"ExtensionInstallationRequest": {
1286+
"description": "Extension Installation Request Body.",
1287+
"type": "object",
1288+
"properties": {
1289+
"extensionVersion": {
1290+
"description": "Extension Version.",
1291+
"default": null,
1292+
"maxLength": 10,
1293+
"minLength": 3,
1294+
"type": "string"
1295+
},
1296+
"additionalApiProperties": {
1297+
"description": "Additional Api Properties.",
1298+
"type": "object",
1299+
"additionalProperties": {
1300+
"$ref": "#/definitions/ApiProperties"
1301+
}
1302+
}
1303+
}
1304+
},
12931305
"ExtensionListResponse": {
12941306
"description": "Paged response contains list of requested objects and a URL link to get the next set of results.",
12951307
"type": "object",

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

Lines changed: 0 additions & 33 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"parameters": {
3+
"api-version": "2021-09-01-preview",
4+
"subscriptionId": "11111111-2222-3333-4444-555555555555",
5+
"resourceGroupName": "examples-rg",
6+
"farmBeatsResourceName": "examples-farmbeatsResourceName",
7+
"extensionId": "provider.extension",
8+
"body": {
9+
"extensionVersion": "1.0",
10+
"apiProperties": {
11+
"examples-api": {
12+
"apiFreshnessWindow": 3600
13+
}
14+
}
15+
}
16+
},
17+
"responses": {
18+
"200": {
19+
"body": {
20+
"id": "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/examples-rg/Microsoft.AgFoodPlatform/farmBeats/examples-farmbeatsResourceName/extensions/provider.extension",
21+
"name": "provider.extension",
22+
"type": "Microsoft.AgFoodPlatform/farmBeats/extensions",
23+
"systemData": {
24+
"createdBy": "string",
25+
"createdByType": "User",
26+
"createdAt": "2020-02-01T01:01:01.1075056Z",
27+
"lastModifiedBy": "string",
28+
"lastModifiedByType": "User",
29+
"lastModifiedAt": "2020-02-01T01:01:01.1075056Z"
30+
},
31+
"eTag": "7200b954-0000-0700-0000-603cbbc40000",
32+
"properties": {
33+
"extensionCategory": "Weather",
34+
"installedExtensionVersion": "1.0",
35+
"extensionAuthLink": "https://www.provider.com/extension/",
36+
"extensionApiDocsLink": "https://docs.provider.com/documentation/extension",
37+
"additionalApiProperties": {
38+
"examples-api": {
39+
"apiFreshnessWindowInMinutes": 3600
40+
}
41+
}
42+
}
43+
}
44+
},
45+
"201": {
46+
"body": {
47+
"id": "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/examples-rg/Microsoft.AgFoodPlatform/farmBeats/examples-farmbeatsResourceName/extensions/provider.extension",
48+
"name": "provider.extension",
49+
"type": "Microsoft.AgFoodPlatform/farmBeats/extensions",
50+
"systemData": {
51+
"createdBy": "string",
52+
"createdByType": "User",
53+
"createdAt": "2020-02-01T01:01:01.1075056Z",
54+
"lastModifiedBy": "string",
55+
"lastModifiedByType": "User",
56+
"lastModifiedAt": "2020-02-01T01:01:02.1075056Z"
57+
},
58+
"eTag": "7200b954-0000-0700-0000-603cbbc40000",
59+
"properties": {
60+
"extensionCategory": "Weather",
61+
"installedExtensionVersion": "1.0",
62+
"extensionAuthLink": "https://www.provider.com/extension/",
63+
"extensionApiDocsLink": "https://docs.provider.com/documentation/extension",
64+
"additionalApiProperties": {
65+
"examples-api": {
66+
"apiFreshnessWindowInMinutes": 3600
67+
}
68+
}
69+
}
70+
}
71+
}
72+
}
73+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"parameters": {
3-
"api-version": "2021-09-01-preview",
3+
"api-version": "2020-05-12-preview",
44
"subscriptionId": "11111111-2222-3333-4444-555555555555",
55
"resourceGroupName": "examples-rg",
66
"farmBeatsResourceName": "examples-farmbeatsResourceName",

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

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)