From 117fdf386840994281083cab0cc41e6a38b88d59 Mon Sep 17 00:00:00 2001 From: rishky-msft Date: Sun, 11 Sep 2022 23:36:09 +0530 Subject: [PATCH 01/10] Flexible MySQL: Adding apis for BackupAndExport/LTR Backup --- .../BackupAndExport.json | 316 ++++++++++++++++++ .../examples/BackupAndExport.json | 31 ++ .../examples/PreBackup.json | 19 ++ .../mysql/resource-manager/readme.md | 9 + 4 files changed, 375 insertions(+) create mode 100644 specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json create mode 100644 specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json create mode 100644 specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json new file mode 100644 index 000000000000..4e657cc54609 --- /dev/null +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json @@ -0,0 +1,316 @@ +{ + "swagger": "2.0", + "consumes": [ + "application/json" + ], + "definitions": { + "BackupRequestBase": { + "description": "BackupRequestBase is the base for all backup request.", + "required": [ + "backupSettings" + ], + "type": "object", + "properties": { + "backupSettings": { + "$ref": "#/definitions/BackupSettings", + "description": "Backup Settings" + } + } + }, + "BackupAndExportRequest": { + "description": "BackupAndExportRequest", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/BackupRequestBase" + } + ], + "required": [ + "backupSettings", + "targetDetails" + ], + "properties": { + "targetDetails": { + "$ref": "#/definitions/BackupTargetDetails", + "description": "Backup Target Details" + } + } + }, + "PreBackupRequest": { + "description": "PreBackupRequest.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/BackupRequestBase" + } + ] + }, + "BackupTargetDetails": { + "description": "BackupTargetDetails is used for scenarios where backup data is streamed/copied over to a storage destination.", + "type": "object", + "required": [ + "sasUriList" + ], + "properties": { + "sasUriList": { + "description": "SASUriList of storage containers where backup data is to be streamed/copied.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "BackupSettings": { + "description": "Backup Settings", + "type": "object", + "required": [ + "backupName" + ], + "properties": { + "backupName": { + "type": "string", + "description": "Backup Name for the current backup" + }, + "backupFormat": { + "description": "Backup Format for the current backup.", + "enum": [ + "None", + "Mapped", + "Raw" + ], + "type": "string", + "x-ms-enum": { + "name": "BackupFormat", + "modelAsString": true + } + } + } + }, + "PreBackupResponseProperties": { + "description": "PreBackupResponseProperties", + "type": "object", + "required": [ + "estimatedBackupSize" + ], + "properties": { + "estimatedBackupSize": { + "format": "int64", + "description": "Estimated size of the resource data to be backed up.", + "type": "integer" + } + } + }, + "BackupAndExportResponseProperties": { + "description": "BackupResponseProperties", + "type": "object", + "required": [ + "datasourceSizeInBytes", + "dataTransferredInBytes", + "backupMetadata" + ], + "properties": { + "datasourceSizeInBytes": { + "format": "int64", + "description": "Size of datasource in bytes", + "type": "integer" + }, + "dataTransferredInBytes": { + "format": "int64", + "description": "Data transferred in bytes", + "type": "integer" + }, + "backupMetadata": { + "description": "Metadata related to backup to be stored for restoring resource in key-value pairs.", + "type": "string" + } + } + }, + "BackupAndExportResponse": { + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/BackupAndExportResponseProperties", + "x-ms-client-flatten": true, + "description": "The response properties of an backup and export operation." + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ], + "description": "Represents BackupAndExport API Response" + }, + "PreBackupResponse": { + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/PreBackupResponseProperties", + "x-ms-client-flatten": true, + "description": "The response properties of an pre backup operation." + } + }, + "description": "Represents PreBackup API Response" + }, + "CloudError": { + "type": "object", + "x-ms-external": true, + "properties": { + "error": { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse", + "description": "The resource management error response." + } + }, + "description": "An error response from the Batch service." + } + }, + "host": "management.azure.com", + "info": { + "title": "MySQLManagementClient", + "description": "The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules and configurations.", + "version": "2021-12-01-preview" + }, + "parameters": { + "ServerNameParameter": { + "name": "serverName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the server.", + "x-ms-parameter-location": "method" + } + }, + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupAndExport": { + "post": { + "tags": [ + "Servers" + ], + "operationId": "Servers_BackupAndExport", + "x-ms-examples": { + "Create and Export Backup": { + "$ref": "./examples/BackupAndExport.json" + } + }, + "description": "Exports the backup of the given server by creating a backup if not existing.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BackupAndExportRequest" + }, + "description": "The required parameters for creating and exporting backup of the given server." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BackupAndExportResponse" + } + }, + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/preBackup": { + "post": { + "tags": [ + "Servers" + ], + "operationId": "Servers_PreBackup", + "x-ms-examples": { + "Pre Backup": { + "$ref": "./examples/PreBackup.json" + } + }, + "description": "Validates if backup can be performed for given server and estimates backup size.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PreBackupRequest" + }, + "description": "The required parameters for validating if backup can be performed for given server." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/PreBackupResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + } + }, + "produces": [ + "application/json" + ], + "schemes": [ + "https" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + } +} \ No newline at end of file diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json new file mode 100644 index 000000000000..330cdfa93860 --- /dev/null +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "api-version": "2022-08-01-privatepreview", + "parameters": { + "targetDetails": { + "sasUriList": [ + "sasuri1", + "sasuri2" + ] + }, + "backupSettings": { + "backupName": "customer-backup-name" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/customer-backup-name", + "name": "customer-backup-name", + "type": "Microsoft.DBforMySQL/flexibleServers/backups", + "properties": { + "datasourceSizeInBytes": 1024, + "dataTransferredInBytes": 1024, + "backupMetadata": "{\"key1\":\"value1\",\"key2\":\"value2\"}" + } + } + }, + "202": {} + } +} \ No newline at end of file diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json new file mode 100644 index 000000000000..b2a88f5401ca --- /dev/null +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2022-08-01-privatepreview", + "parameters": { + "backupSettings": { + "backupName": "customer-backup-name" + } + } + }, + "responses": { + "200": { + "body": { + "properties": { + "estimatedBackupSize": 1024 + } + } + } + } +} \ No newline at end of file diff --git a/specification/mysql/resource-manager/readme.md b/specification/mysql/resource-manager/readme.md index 0432467d6613..a918846ef83c 100644 --- a/specification/mysql/resource-manager/readme.md +++ b/specification/mysql/resource-manager/readme.md @@ -160,6 +160,15 @@ input-file: - Microsoft.DBforMySQL/preview/2021-12-01-preview/AzureADAdministrator.json ``` +### Tag: package-flexibleserver-2022-08-01-privatepreview + +These settings apply only when `--tag=package-flexibleserver-2022-08-01-preview` is specified on the command line. + +``` yaml $(tag) == 'package-flexibleserver-2022-08-01-preview' +input-file: +- Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json +``` + ## Suppression ``` yaml From 0d2927e9c6cb39b2743aed9a627fac9ee87cb6b9 Mon Sep 17 00:00:00 2001 From: rishky-msft Date: Mon, 12 Sep 2022 10:45:08 +0530 Subject: [PATCH 02/10] Fixing model validation errors --- .../2022-08-01-privatepreview/examples/BackupAndExport.json | 3 +++ .../preview/2022-08-01-privatepreview/examples/PreBackup.json | 3 +++ 2 files changed, 6 insertions(+) diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json index 330cdfa93860..b12f66a69f6a 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json @@ -1,6 +1,9 @@ { "parameters": { "api-version": "2022-08-01-privatepreview", + "serverName": "mysqltestserver", + "resourceGroupName": "TestGroup", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", "parameters": { "targetDetails": { "sasUriList": [ diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json index b2a88f5401ca..6db4981edc4a 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json @@ -1,6 +1,9 @@ { "parameters": { "api-version": "2022-08-01-privatepreview", + "serverName": "mysqltestserver", + "resourceGroupName": "TestGroup", + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", "parameters": { "backupSettings": { "backupName": "customer-backup-name" From a29849e95d8eb0fd0bb84ef2c20d2f2aaf302222 Mon Sep 17 00:00:00 2001 From: rishky-msft Date: Mon, 12 Sep 2022 11:32:45 +0530 Subject: [PATCH 03/10] Fixing lint errors --- .../BackupAndExport.json | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json index 4e657cc54609..426cc8a8e4e9 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json @@ -18,7 +18,7 @@ } }, "BackupAndExportRequest": { - "description": "BackupAndExportRequest", + "description": "BackupAndExport API Request", "type": "object", "allOf": [ { @@ -37,7 +37,7 @@ } }, "PreBackupRequest": { - "description": "PreBackupRequest.", + "description": "PreBackup API Request.", "type": "object", "allOf": [ { @@ -88,7 +88,7 @@ } }, "PreBackupResponseProperties": { - "description": "PreBackupResponseProperties", + "description": "PreBackup Response Properties", "type": "object", "required": [ "estimatedBackupSize" @@ -102,7 +102,7 @@ } }, "BackupAndExportResponseProperties": { - "description": "BackupResponseProperties", + "description": "BackupAndExport Response Properties", "type": "object", "required": [ "datasourceSizeInBytes", @@ -137,7 +137,7 @@ }, "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource" + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" } ], "description": "Represents BackupAndExport API Response" @@ -158,7 +158,7 @@ "x-ms-external": true, "properties": { "error": { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse", + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse", "description": "The resource management error response." } }, @@ -196,13 +196,13 @@ "description": "Exports the backup of the given server by creating a backup if not existing.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/ServerNameParameter" @@ -251,13 +251,13 @@ "description": "Validates if backup can be performed for given server and estimates backup size.", "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/ServerNameParameter" From 13b829a5cfc504dc50c8c3cad22be854f231ee82 Mon Sep 17 00:00:00 2001 From: rishky-msft Date: Mon, 12 Sep 2022 11:42:17 +0530 Subject: [PATCH 04/10] Fixing swagger api version --- .../preview/2022-08-01-privatepreview/BackupAndExport.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json index 426cc8a8e4e9..919a1f887b43 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json @@ -169,7 +169,7 @@ "info": { "title": "MySQLManagementClient", "description": "The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules and configurations.", - "version": "2021-12-01-preview" + "version": "2022-08-01-privatepreview" }, "parameters": { "ServerNameParameter": { From 80837cb6497fbdd77ceeb1db9976b31e3416edd2 Mon Sep 17 00:00:00 2001 From: rishky-msft Date: Mon, 12 Sep 2022 11:50:05 +0530 Subject: [PATCH 05/10] Prettier fix --- .../preview/2022-08-01-privatepreview/BackupAndExport.json | 2 +- .../2022-08-01-privatepreview/examples/BackupAndExport.json | 2 +- .../preview/2022-08-01-privatepreview/examples/PreBackup.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json index 919a1f887b43..ae22b89ff07f 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json @@ -313,4 +313,4 @@ } } } -} \ No newline at end of file +} diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json index b12f66a69f6a..82600ec9ad0c 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json @@ -31,4 +31,4 @@ }, "202": {} } -} \ No newline at end of file +} diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json index 6db4981edc4a..ec0c033b2450 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json @@ -19,4 +19,4 @@ } } } -} \ No newline at end of file +} From 0018d44dc073f064e0171591dcb9dcdd558ed7a0 Mon Sep 17 00:00:00 2001 From: rishky-msft Date: Mon, 12 Sep 2022 12:16:20 +0530 Subject: [PATCH 06/10] Fixing lint check --- .../preview/2022-08-01-privatepreview/BackupAndExport.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json index ae22b89ff07f..2c2a484f1fe2 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json @@ -158,7 +158,7 @@ "x-ms-external": true, "properties": { "error": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse", + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse", "description": "The resource management error response." } }, @@ -234,7 +234,10 @@ } } }, - "x-ms-long-running-operation": true + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/preBackup": { From c1b871039fb1e1feb65374fa9d81745ea7fe4274 Mon Sep 17 00:00:00 2001 From: rishky-msft Date: Tue, 13 Sep 2022 07:32:28 +0530 Subject: [PATCH 07/10] Adding existing apis in readme for new tag --- specification/mysql/resource-manager/readme.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/specification/mysql/resource-manager/readme.md b/specification/mysql/resource-manager/readme.md index a918846ef83c..984c362b02b6 100644 --- a/specification/mysql/resource-manager/readme.md +++ b/specification/mysql/resource-manager/readme.md @@ -166,6 +166,14 @@ These settings apply only when `--tag=package-flexibleserver-2022-08-01-preview` ``` yaml $(tag) == 'package-flexibleserver-2022-08-01-preview' input-file: +- Microsoft.DBforMySQL/preview/2021-12-01-preview/Backups.json +- Microsoft.DBforMySQL/preview/2021-12-01-preview/Configurations.json +- Microsoft.DBforMySQL/preview/2021-12-01-preview/Databases.json +- Microsoft.DBforMySQL/preview/2021-12-01-preview/FirewallRules.json +- Microsoft.DBforMySQL/preview/2021-12-01-preview/FlexibleServers.json +- Microsoft.DBforMySQL/preview/2021-12-01-preview/LogFiles.json +- Microsoft.DBforMySQL/preview/2021-12-01-preview/ServiceOperations.json +- Microsoft.DBforMySQL/preview/2021-12-01-preview/AzureADAdministrator.json - Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json ``` From d3c1acb959d824e8edfdbe60222d56516e51198c Mon Sep 17 00:00:00 2001 From: rishky-msft Date: Tue, 13 Sep 2022 19:24:17 +0530 Subject: [PATCH 08/10] Changing prebackup response parameter and adding base class for storage details. --- .../BackupAndExport.json | 41 ++++++++++++++----- .../examples/BackupAndExport.json | 1 + .../examples/PreBackup.json | 2 +- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json index 2c2a484f1fe2..9697fe36cc41 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json @@ -31,8 +31,8 @@ ], "properties": { "targetDetails": { - "$ref": "#/definitions/BackupTargetDetails", - "description": "Backup Target Details" + "$ref": "#/definitions/BackupStoreDetails", + "description": "Backup Target Store Details" } } }, @@ -45,12 +45,32 @@ } ] }, - "BackupTargetDetails": { - "description": "BackupTargetDetails is used for scenarios where backup data is streamed/copied over to a storage destination.", + "BackupStoreDetails": { + "description": "Details about the target where the backup content will be stored.", + "required": [ + "objectType" + ], + "type": "object", + "properties": { + "objectType": { + "description": "Type of the specific object - used for deserializing", + "type": "string", + "readOnly": false + } + }, + "discriminator": "objectType" + }, + "FullBackupStoreDetails": { + "description": "FullBackupStoreDetails is used for scenarios where backup data is streamed/copied over to a storage destination.", "type": "object", "required": [ "sasUriList" ], + "allOf": [ + { + "$ref": "#/definitions/BackupStoreDetails" + } + ], "properties": { "sasUriList": { "description": "SASUriList of storage containers where backup data is to be streamed/copied.", @@ -76,8 +96,7 @@ "description": "Backup Format for the current backup.", "enum": [ "None", - "Mapped", - "Raw" + "CollatedFormat" ], "type": "string", "x-ms-enum": { @@ -91,12 +110,12 @@ "description": "PreBackup Response Properties", "type": "object", "required": [ - "estimatedBackupSize" + "numberOfContainers" ], "properties": { - "estimatedBackupSize": { - "format": "int64", - "description": "Estimated size of the resource data to be backed up.", + "numberOfContainers": { + "format": "int32", + "description": "Estimated no of storage containers required for resource data to be backed up.", "type": "integer" } } @@ -251,7 +270,7 @@ "$ref": "./examples/PreBackup.json" } }, - "description": "Validates if backup can be performed for given server and estimates backup size.", + "description": "Validates if backup can be performed for given server.", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json index 82600ec9ad0c..9430e206ff15 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/BackupAndExport.json @@ -6,6 +6,7 @@ "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", "parameters": { "targetDetails": { + "objectType": "FullBackupStoreDetails", "sasUriList": [ "sasuri1", "sasuri2" diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json index ec0c033b2450..06087e435f60 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json @@ -14,7 +14,7 @@ "200": { "body": { "properties": { - "estimatedBackupSize": 1024 + "numberOfContainers": 1 } } } From 4c057a2ea5610a4b710f79c106bfe36032133be9 Mon Sep 17 00:00:00 2001 From: sumitkumams <107923889+sumitkumams@users.noreply.github.com> Date: Tue, 20 Sep 2022 10:24:32 +0530 Subject: [PATCH 09/10] changes after PR comments 1. change name from "PreBackup" to "ValidateBackup" 2. add tag in backupFormat "INTERNAL - DO NOT USE" 3. change the order of securitydefinitions , title, paths --- .../BackupAndExport.json | 294 +++++++++--------- .../{PreBackup.json => ValidateBackup.json} | 0 2 files changed, 147 insertions(+), 147 deletions(-) rename specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/{PreBackup.json => ValidateBackup.json} (100%) diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json index 9697fe36cc41..b492b8bb3f6f 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json @@ -3,6 +3,144 @@ "consumes": [ "application/json" ], + "host": "management.azure.com", + "info": { + "title": "MySQLManagementClient", + "description": "The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules and configurations.", + "version": "2022-08-01-privatepreview" + }, + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "parameters": { + "ServerNameParameter": { + "name": "serverName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the server.", + "x-ms-parameter-location": "method" + } + }, + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupAndExport": { + "post": { + "tags": [ + "Servers" + ], + "operationId": "Servers_BackupAndExport", + "x-ms-examples": { + "Create and Export Backup": { + "$ref": "./examples/BackupAndExport.json" + } + }, + "description": "Exports the backup of the given server by creating a backup if not existing.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BackupAndExportRequest" + }, + "description": "The required parameters for creating and exporting backup of the given server." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BackupAndExportResponse" + } + }, + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/validateBackup": { + "post": { + "tags": [ + "Servers" + ], + "operationId": "Servers_ValidateBackup", + "x-ms-examples": { + "Validate Backup": { + "$ref": "./examples/ValidateBackup.json" + } + }, + "description": "Validates if backup can be performed for given server.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ValidateBackupRequest" + }, + "description": "The required parameters for validating if backup can be performed for given server." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ValidateBackupResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + } + }, "definitions": { "BackupRequestBase": { "description": "BackupRequestBase is the base for all backup request.", @@ -36,8 +174,8 @@ } } }, - "PreBackupRequest": { - "description": "PreBackup API Request.", + "ValidateBackupRequest": { + "description": "ValidateBackup API Request.", "type": "object", "allOf": [ { @@ -93,7 +231,7 @@ "description": "Backup Name for the current backup" }, "backupFormat": { - "description": "Backup Format for the current backup.", + "description": "Backup Format for the current backup. INTERNAL – DO NOT USE", "enum": [ "None", "CollatedFormat" @@ -106,8 +244,8 @@ } } }, - "PreBackupResponseProperties": { - "description": "PreBackup Response Properties", + "ValidateBackupResponseProperties": { + "description": "ValidateBackup Response Properties", "type": "object", "required": [ "numberOfContainers" @@ -161,16 +299,16 @@ ], "description": "Represents BackupAndExport API Response" }, - "PreBackupResponse": { + "ValidateBackupResponse": { "type": "object", "properties": { "properties": { - "$ref": "#/definitions/PreBackupResponseProperties", + "$ref": "#/definitions/ValidateBackupResponseProperties", "x-ms-client-flatten": true, "description": "The response properties of an pre backup operation." } }, - "description": "Represents PreBackup API Response" + "description": "Represents ValidateBackup API Response" }, "CloudError": { "type": "object", @@ -184,133 +322,6 @@ "description": "An error response from the Batch service." } }, - "host": "management.azure.com", - "info": { - "title": "MySQLManagementClient", - "description": "The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules and configurations.", - "version": "2022-08-01-privatepreview" - }, - "parameters": { - "ServerNameParameter": { - "name": "serverName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the server.", - "x-ms-parameter-location": "method" - } - }, - "paths": { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupAndExport": { - "post": { - "tags": [ - "Servers" - ], - "operationId": "Servers_BackupAndExport", - "x-ms-examples": { - "Create and Export Backup": { - "$ref": "./examples/BackupAndExport.json" - } - }, - "description": "Exports the backup of the given server by creating a backup if not existing.", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/ServerNameParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BackupAndExportRequest" - }, - "description": "The required parameters for creating and exporting backup of the given server." - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BackupAndExportResponse" - } - }, - "202": { - "description": "Accepted" - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/CloudError" - } - } - }, - "x-ms-long-running-operation": true, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - } - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/preBackup": { - "post": { - "tags": [ - "Servers" - ], - "operationId": "Servers_PreBackup", - "x-ms-examples": { - "Pre Backup": { - "$ref": "./examples/PreBackup.json" - } - }, - "description": "Validates if backup can be performed for given server.", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/ServerNameParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PreBackupRequest" - }, - "description": "The required parameters for validating if backup can be performed for given server." - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PreBackupResponse" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/CloudError" - } - } - } - } - } - }, "produces": [ "application/json" ], @@ -323,16 +334,5 @@ "user_impersonation" ] } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - } + ] } diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/ValidateBackup.json similarity index 100% rename from specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/PreBackup.json rename to specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/examples/ValidateBackup.json From c090b06ebe8f7c1ccde7a0e2687a7c3f9e2e1d37 Mon Sep 17 00:00:00 2001 From: sumitkumams <107923889+sumitkumams@users.noreply.github.com> Date: Tue, 20 Sep 2022 15:43:08 +0530 Subject: [PATCH 10/10] updated description for "CollatedFormat" do not use. just added description for "CollatedFormat" to not use. --- .../preview/2022-08-01-privatepreview/BackupAndExport.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json index b492b8bb3f6f..59028e2d6005 100644 --- a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2022-08-01-privatepreview/BackupAndExport.json @@ -231,7 +231,7 @@ "description": "Backup Name for the current backup" }, "backupFormat": { - "description": "Backup Format for the current backup. INTERNAL – DO NOT USE", + "description": "Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE)", "enum": [ "None", "CollatedFormat"