Add SQL MIAA Upgrade Management tab (#19238)

* Added sql upgrade management page and fixed icon for dc and sql upgrade

* Added logic for figuring out MIAA version, loading proper entries for table.

* Added PR comment changes

Co-authored-by: Candice Ye <canye@microsoft.com>
This commit is contained in:
Candice Ye
2022-05-09 14:35:42 -07:00
committed by GitHub
parent c09ab8d0a9
commit adf6f253f0
13 changed files with 531 additions and 44 deletions

View File

@@ -15,6 +15,7 @@ import { ConnectToMiaaSqlDialog } from '../ui/dialogs/connectMiaaDialog';
import { AzureArcTreeDataProvider } from '../ui/tree/azureArcTreeDataProvider';
import { ControllerModel, Registration } from './controllerModel';
import { ResourceModel } from './resourceModel';
import { ConnectionMode } from '../constants';
export type DatabaseModel = { name: string, status: string, earliestBackup: string, lastBackup: string };
export type RPModel = { recoveryPointObjective: string, retentionDays: string };
@@ -98,7 +99,26 @@ export class MiaaModel extends ResourceModel {
this._refreshPromise = new Deferred();
try {
try {
const result = await this._azApi.az.sql.miarc.show(this.info.name, this.controllerModel.info.namespace, this.controllerModel.azAdditionalEnvVars);
let result;
if (this.controllerModel.info.connectionMode === ConnectionMode.direct) {
result = await this._azApi.az.sql.miarc.show(
this.info.name,
{
resourceGroup: this.controllerModel.info.resourceGroup,
namespace: undefined
},
this.controllerModel.azAdditionalEnvVars
);
} else {
result = await this._azApi.az.sql.miarc.show(
this.info.name,
{
resourceGroup: undefined,
namespace: this.controllerModel.info.namespace
},
this.controllerModel.azAdditionalEnvVars
);
}
this._config = result.stdout;
this.configLastUpdated = new Date();
this.rpSettings.retentionDays = this._config?.spec?.backup?.retentionPeriodInDays?.toString() ?? '';