diff --git a/specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/agfood.json b/specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/agfood.json index 699431e30fb5..faec8934cbc8 100644 --- a/specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/agfood.json +++ b/specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/agfood.json @@ -11,8 +11,11 @@ "tags": [ "Extensions" ], - "description": "Install extension.", - "operationId": "Extensions_Create", + "description": "Install or Update extension.", + "operationId": "Extensions_CreateOrUpdate", + "consumes": [ + "application/json" + ], "produces": [ "application/json" ], @@ -31,15 +34,29 @@ }, { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "requestBody", + "description": "Extension resource request body.", + "schema": { + "$ref": "#/definitions/ExtensionInstallationRequest" + } } ], "responses": { - "201": { + "200": { "description": "Success", "schema": { "$ref": "#/definitions/Extension" } }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/Extension" + } + }, "default": { "description": "Error", "schema": { @@ -48,8 +65,8 @@ } }, "x-ms-examples": { - "Extensions_Create": { - "$ref": "./examples/Extensions_Create.json" + "Extensions_CreateOrUpdate": { + "$ref": "./examples/Extensions_CreateOrUpdate.json" } } }, @@ -99,52 +116,6 @@ } } }, - "patch": { - "tags": [ - "Extensions" - ], - "description": "Upgrade to latest extension.", - "operationId": "Extensions_Update", - "produces": [ - "application/json" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/FarmBeatsResourceNameParameter" - }, - { - "$ref": "#/parameters/ExtensionIdParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Extension" - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Extensions_Update": { - "$ref": "./examples/Extensions_Update.json" - } - } - }, "delete": { "tags": [ "Extensions" @@ -1233,6 +1204,19 @@ } }, "definitions": { + "ApiProperties": { + "description": "Api properties.", + "type": "object", + "properties": { + "apiFreshnessWindow": { + "format": "int32", + "description": "Iterval in seconds for which the weather data for the api needs to be refreshed.", + "maximum": 3600, + "minimum": 0, + "type": "integer" + } + } + }, "ExtensionProperties": { "description": "Extension resource properties.", "type": "object", @@ -1290,6 +1274,29 @@ }, "x-ms-azure-resource": true }, + "ExtensionInstallationRequest": { + "description": "Extension Installation Request Body.", + "required": [ + "apiProperties" + ], + "type": "object", + "properties": { + "extensionVersion": { + "description": "Extension Version.", + "default": null, + "maxLength": 10, + "minLength": 3, + "type": "string" + }, + "apiProperties": { + "description": "Api Properties.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ApiProperties" + } + } + } + }, "ExtensionListResponse": { "description": "Paged response contains list of requested objects and a URL link to get the next set of results.", "type": "object", diff --git a/specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Create.json b/specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Create.json deleted file mode 100644 index 94648abfe0f5..000000000000 --- a/specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Create.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "parameters": { - "api-version": "2021-09-01-preview", - "subscriptionId": "11111111-2222-3333-4444-555555555555", - "resourceGroupName": "examples-rg", - "farmBeatsResourceName": "examples-farmbeatsResourceName", - "extensionId": "provider.extension" - }, - "responses": { - "201": { - "body": { - "id": "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/examples-rg/Microsoft.AgFoodPlatform/farmBeats/examples-farmbeatsResourceName/extensions/provider.extension", - "name": "provider.extension", - "type": "Microsoft.AgFoodPlatform/farmBeats/extensions", - "systemData": { - "createdBy": "string", - "createdByType": "User", - "createdAt": "2020-02-01T01:01:01.1075056Z", - "lastModifiedBy": "string", - "lastModifiedByType": "User", - "lastModifiedAt": "2020-02-01T01:01:01.1075056Z" - }, - "eTag": "7200b954-0000-0700-0000-603cbbc40000", - "properties": { - "extensionCategory": "Weather", - "installedExtensionVersion": "1.0", - "extensionAuthLink": "https://www.provider.com/extension/", - "extensionApiDocsLink": "https://docs.provider.com/documentation/extension" - } - } - } - } -} diff --git a/specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Update.json b/specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Update.json deleted file mode 100644 index aac8522bf990..000000000000 --- a/specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Update.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "parameters": { - "api-version": "2021-09-01-preview", - "subscriptionId": "11111111-2222-3333-4444-555555555555", - "resourceGroupName": "examples-rg", - "farmBeatsResourceName": "examples-farmbeatsResourceName", - "extensionId": "provider.extension" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/examples-rg/Microsoft.AgFoodPlatform/farmBeats/examples-farmbeatsResourceName/extensions/provider.extension", - "name": "provider.extension", - "type": "Microsoft.AgFoodPlatform/farmBeats/extensions", - "systemData": { - "createdBy": "string", - "createdByType": "User", - "createdAt": "2020-02-01T01:01:01.1075056Z", - "lastModifiedBy": "string", - "lastModifiedByType": "User", - "lastModifiedAt": "2020-02-01T01:01:01.1075056Z" - }, - "eTag": "7200b954-0000-0700-0000-603cbbc40000", - "properties": { - "extensionCategory": "Weather", - "installedExtensionVersion": "2.0", - "extensionAuthLink": "https://www.provider.com/extension/", - "extensionApiDocsLink": "https://docs.provider.com/documentation/extension" - } - } - } - } -}