-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dataprotection] Support for PostgreSQLFlexibleServer and MySQL and c…
…ode cleanup (#7490) * Ignore intermediary jsons * Upgrade all modules to 2023-11-01 * all tests passing for updated API version * Add CRR group, validateCRR working, add ARG vault, modify ARG BI, cleanup BI init * fixed BI init, imports in helpers * Restore trigger now definitely works, about to start customizing * Validate CRR, BV list from resourcegraph complete Also code cleanup. * Recovery point list supports use-secondary-region now * Complete commands: restore trigger, job fetch. Added a secondary region mapping as fallback in case of poorly populated fields from service. * Hiding explicit CRR commands * backup vault creation/editing with CRR * Alias for --cross-region-restore-state * Backup vault ID option for list-from-resourcegraph * CRR Vault create, update tests updated * Backup vault list from RG test created * Cleaning up restore initialize * Running tests * Complete all tests for CRR refresh * fixed Update msi permissions * add tests, commented out * fix linter * version number update * single job show added, all tests except CRR recorded * committing CRR test, runs but not recorded * NON TESTED initial progress on pgflex * Everything complete, proceeding to review * Trying to pass the linter rules * Updating history * linter show_job rules * linter show_job rules * flake8 for test folder * flake8 more issues * show_command for linter * fix show command * All linters work * All linters work * Update MSI work for backup pgflex * Untested cleanup for update-msi, new workload should work. * Corrected role assignment for restore DSperms, minor refactoring * Fixed templatized help text for update perms for restore. Generic text for DS also added. * Made changes for update perms in MySQL and restore fixxes * Testing for new workloads * Version 1.1.0 and history * Style and linter changes * Linter long option name * Fix for linter exclusion * Remove experimental tag. --------- Co-authored-by: Zubair Abid <zubairabid@microsoft.com>
- Loading branch information
1 parent
cd3b6ff
commit 2f40c7f
Showing
15 changed files
with
24,443 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{ | ||
"azext.isExperimental": true, | ||
"azext.minCliCoreVersion": "2.51.0" | ||
} |
98 changes: 98 additions & 0 deletions
98
src/dataprotection/azext_dataprotection/manual/Manifests/AzureDatabaseForMySQL.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
manifest = ''' | ||
{ | ||
"isProxyResource": false, | ||
"enableDataSourceSetInfo": false, | ||
"resourceType": "Microsoft.DBforMySQL/flexibleServers", | ||
"parentResourceType": "Microsoft.DBforMySQL/flexibleServers", | ||
"datasourceType": "Microsoft.DBforMySQL/flexibleServers", | ||
"allowedRestoreModes": [ "RecoveryPointBased" ], | ||
"allowedRestoreTargetTypes": [ "RestoreAsFiles" ], | ||
"itemLevelRecoveyEnabled": false, | ||
"addBackupDatasourceParametersList": false, | ||
"addDataStoreParametersList": false, | ||
"friendlyNameRequired": false, | ||
"supportSecretStoreAuthentication": false, | ||
"backupVaultPermissions": [ | ||
{ | ||
"roleDefinitionName": "Reader", | ||
"type": "DataSourceRG" | ||
}, | ||
{ | ||
"roleDefinitionName": "MySQL Backup And Export Operator", | ||
"type": "DataSource" | ||
} | ||
], | ||
"backupVaultRestorePermissions": [ | ||
{ | ||
"roleDefinitionName": "Storage Blob Data Contributor", | ||
"type": "TargetStorageAccount" | ||
} | ||
], | ||
"policySettings": { | ||
"supportedRetentionTags": [ "Weekly", "Monthly", "Yearly" ], | ||
"supportedDatastoreTypes": [ "VaultStore", "ArchiveStore" ], | ||
"disableAddRetentionRule": false, | ||
"disableCustomRetentionTag": false, | ||
"backupScheduleSupported": true, | ||
"supportedBackupFrequency": [ "Weekly" ], | ||
"defaultPolicy": { | ||
"policyRules": [ | ||
{ | ||
"name": "BackupWeekly", | ||
"objectType": "AzureBackupRule", | ||
"backupParameters": { | ||
"backupType": "Full", | ||
"objectType": "AzureBackupParams" | ||
}, | ||
"dataStore": { | ||
"dataStoreType": "VaultStore", | ||
"objectType": "DataStoreInfoBase" | ||
}, | ||
"trigger": { | ||
"schedule": { | ||
"timeZone": "UTC", | ||
"repeatingTimeIntervals": [ "R/2021-08-15T06:30:00+00:00/P1W" ] | ||
}, | ||
"taggingCriteria": [ | ||
{ | ||
"isDefault": true, | ||
"taggingPriority": 99, | ||
"tagInfo": { | ||
"id": "Default_", | ||
"tagName": "Default" | ||
} | ||
} | ||
], | ||
"objectType": "ScheduleBasedTriggerContext" | ||
} | ||
}, | ||
{ | ||
"name": "Default", | ||
"objectType": "AzureRetentionRule", | ||
"isDefault": true, | ||
"lifecycles": [ | ||
{ | ||
"deleteAfter": { | ||
"duration": "P3M", | ||
"objectType": "AbsoluteDeleteOption" | ||
}, | ||
"sourceDataStore": { | ||
"dataStoreType": "VaultStore", | ||
"objectType": "DataStoreInfoBase" | ||
}, | ||
"targetDataStoreCopySettings": [] | ||
} | ||
] | ||
} | ||
], | ||
"datasourceTypes": [ "Microsoft.DBforMySQL/flexibleServers" ], | ||
"objectType": "BackupPolicy", | ||
"name": "MySQLFlexiblePolicy1" | ||
} | ||
} | ||
}''' |
98 changes: 98 additions & 0 deletions
98
...tection/azext_dataprotection/manual/Manifests/AzureDatabaseForPostgreSQLFlexibleServer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
manifest = ''' | ||
{ | ||
"isProxyResource": false, | ||
"enableDataSourceSetInfo": false, | ||
"resourceType": "Microsoft.DBforPostgreSQL/flexibleServers", | ||
"parentResourceType": "Microsoft.DBforPostgreSQL/flexibleServers", | ||
"datasourceType": "Microsoft.DBforPostgreSQL/flexibleServers", | ||
"allowedRestoreModes": [ "RecoveryPointBased" ], | ||
"allowedRestoreTargetTypes": [ "RestoreAsFiles" ], | ||
"itemLevelRecoveyEnabled": false, | ||
"addBackupDatasourceParametersList": false, | ||
"addDataStoreParametersList": false, | ||
"friendlyNameRequired": false, | ||
"supportSecretStoreAuthentication": false, | ||
"backupVaultPermissions": [ | ||
{ | ||
"roleDefinitionName": "Reader", | ||
"type": "DataSourceRG" | ||
}, | ||
{ | ||
"roleDefinitionName": "PostgreSQL Flexible Server Long Term Retention Backup Role", | ||
"type": "DataSource" | ||
} | ||
], | ||
"backupVaultRestorePermissions": [ | ||
{ | ||
"roleDefinitionName": "Storage Blob Data Contributor", | ||
"type": "TargetStorageAccount" | ||
} | ||
], | ||
"policySettings": { | ||
"supportedRetentionTags": [ "Weekly", "Monthly", "Yearly" ], | ||
"supportedDatastoreTypes": [ "VaultStore", "ArchiveStore" ], | ||
"disableAddRetentionRule": false, | ||
"disableCustomRetentionTag": false, | ||
"backupScheduleSupported": true, | ||
"supportedBackupFrequency": [ "Weekly" ], | ||
"defaultPolicy": { | ||
"policyRules": [ | ||
{ | ||
"name": "BackupWeekly", | ||
"objectType": "AzureBackupRule", | ||
"backupParameters": { | ||
"backupType": "Full", | ||
"objectType": "AzureBackupParams" | ||
}, | ||
"dataStore": { | ||
"dataStoreType": "VaultStore", | ||
"objectType": "DataStoreInfoBase" | ||
}, | ||
"trigger": { | ||
"schedule": { | ||
"timeZone": "UTC", | ||
"repeatingTimeIntervals": [ "R/2021-08-15T06:30:00+00:00/P1W" ] | ||
}, | ||
"taggingCriteria": [ | ||
{ | ||
"isDefault": true, | ||
"taggingPriority": 99, | ||
"tagInfo": { | ||
"id": "Default_", | ||
"tagName": "Default" | ||
} | ||
} | ||
], | ||
"objectType": "ScheduleBasedTriggerContext" | ||
} | ||
}, | ||
{ | ||
"name": "Default", | ||
"objectType": "AzureRetentionRule", | ||
"isDefault": true, | ||
"lifecycles": [ | ||
{ | ||
"deleteAfter": { | ||
"duration": "P3M", | ||
"objectType": "AbsoluteDeleteOption" | ||
}, | ||
"sourceDataStore": { | ||
"dataStoreType": "VaultStore", | ||
"objectType": "DataStoreInfoBase" | ||
}, | ||
"targetDataStoreCopySettings": [] | ||
} | ||
] | ||
} | ||
], | ||
"datasourceTypes": [ "Microsoft.DBforPostgreSQL/flexibleServers" ], | ||
"objectType": "BackupPolicy", | ||
"name": "OssFlexiblePolicy1" | ||
} | ||
} | ||
}''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.