mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fixing migration extension to reflect latest RP changes (#15157)
* Fixing sms object * extension vbump
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"name": "sql-migration",
|
"name": "sql-migration",
|
||||||
"displayName": "%displayName%",
|
"displayName": "%displayName%",
|
||||||
"description": "%description%",
|
"description": "%description%",
|
||||||
"version": "0.0.8",
|
"version": "0.0.9",
|
||||||
"publisher": "Microsoft",
|
"publisher": "Microsoft",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt",
|
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt",
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ export async function getSqlMigrationService(account: azdata.Account, subscripti
|
|||||||
if (response.errors.length > 0) {
|
if (response.errors.length > 0) {
|
||||||
throw new Error(response.errors.toString());
|
throw new Error(response.errors.toString());
|
||||||
}
|
}
|
||||||
|
response.response.data.properties.resourceGroup = getResourceGroupFromId(response.response.data.id);
|
||||||
return response.response.data;
|
return response.response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,6 +139,9 @@ export async function getSqlMigrationServices(account: azdata.Account, subscript
|
|||||||
throw new Error(response.errors.toString());
|
throw new Error(response.errors.toString());
|
||||||
}
|
}
|
||||||
sortResourceArrayByName(response.response.data.value);
|
sortResourceArrayByName(response.response.data.value);
|
||||||
|
response.response.data.value.forEach((sms: SqlMigrationService) => {
|
||||||
|
sms.properties.resourceGroup = getResourceGroupFromId(sms.id);
|
||||||
|
});
|
||||||
return response.response.data.value;
|
return response.response.data.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,6 +291,10 @@ function sortResourceArrayByName(resourceArray: SortableAzureResources[]): void
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getResourceGroupFromId(id: string): string {
|
||||||
|
return id.replace(RegExp('^(.*?)/resourceGroups/'), '').replace(RegExp('/providers/.*'), '').toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
export interface SqlMigrationServiceProperties {
|
export interface SqlMigrationServiceProperties {
|
||||||
name: string;
|
name: string;
|
||||||
subscriptionId: string;
|
subscriptionId: string;
|
||||||
|
|||||||
@@ -648,7 +648,7 @@ export class MigrationStateModel implements Model, vscode.Disposable {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const requestBody: StartDatabaseMigrationRequest = {
|
const requestBody: StartDatabaseMigrationRequest = {
|
||||||
location: this._sqlMigrationService?.properties.location!,
|
location: this._sqlMigrationService?.location!,
|
||||||
properties: {
|
properties: {
|
||||||
sourceDatabaseName: '',
|
sourceDatabaseName: '',
|
||||||
migrationService: this._sqlMigrationService?.id!,
|
migrationService: this._sqlMigrationService?.id!,
|
||||||
@@ -682,7 +682,7 @@ export class MigrationStateModel implements Model, vscode.Disposable {
|
|||||||
const response = await startDatabaseMigration(
|
const response = await startDatabaseMigration(
|
||||||
this._azureAccount,
|
this._azureAccount,
|
||||||
this._targetSubscription,
|
this._targetSubscription,
|
||||||
this._sqlMigrationService?.properties.location!,
|
this._sqlMigrationService?.location!,
|
||||||
this._targetServerInstance,
|
this._targetServerInstance,
|
||||||
this._targetDatabaseNames[i],
|
this._targetDatabaseNames[i],
|
||||||
requestBody
|
requestBody
|
||||||
|
|||||||
@@ -172,14 +172,14 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
this.migrationStateModel._azureAccount,
|
this.migrationStateModel._azureAccount,
|
||||||
this.migrationStateModel._targetSubscription,
|
this.migrationStateModel._targetSubscription,
|
||||||
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
|
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
|
||||||
this.migrationStateModel._sqlMigrationService.properties.location,
|
this.migrationStateModel._sqlMigrationService.location,
|
||||||
this.migrationStateModel._sqlMigrationService.name);
|
this.migrationStateModel._sqlMigrationService.name);
|
||||||
this.migrationStateModel._sqlMigrationService = migrationService;
|
this.migrationStateModel._sqlMigrationService = migrationService;
|
||||||
const migrationServiceMonitoringStatus = await getSqlMigrationServiceMonitoringData(
|
const migrationServiceMonitoringStatus = await getSqlMigrationServiceMonitoringData(
|
||||||
this.migrationStateModel._azureAccount,
|
this.migrationStateModel._azureAccount,
|
||||||
this.migrationStateModel._targetSubscription,
|
this.migrationStateModel._targetSubscription,
|
||||||
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
|
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
|
||||||
this.migrationStateModel._sqlMigrationService.properties.location,
|
this.migrationStateModel._sqlMigrationService.location,
|
||||||
this.migrationStateModel._sqlMigrationService!.name);
|
this.migrationStateModel._sqlMigrationService!.name);
|
||||||
this.migrationStateModel._nodeNames = migrationServiceMonitoringStatus.nodes.map((node) => {
|
this.migrationStateModel._nodeNames = migrationServiceMonitoringStatus.nodes.map((node) => {
|
||||||
return node.nodeName;
|
return node.nodeName;
|
||||||
@@ -188,7 +188,7 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
this.migrationStateModel._azureAccount,
|
this.migrationStateModel._azureAccount,
|
||||||
this.migrationStateModel._targetSubscription,
|
this.migrationStateModel._targetSubscription,
|
||||||
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
|
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
|
||||||
this.migrationStateModel._sqlMigrationService.properties.location,
|
this.migrationStateModel._sqlMigrationService.location,
|
||||||
this.migrationStateModel._sqlMigrationService!.name
|
this.migrationStateModel._sqlMigrationService!.name
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -239,14 +239,14 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
this.migrationStateModel._azureAccount,
|
this.migrationStateModel._azureAccount,
|
||||||
this.migrationStateModel._targetSubscription,
|
this.migrationStateModel._targetSubscription,
|
||||||
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
|
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
|
||||||
this.migrationStateModel._sqlMigrationService.properties.location,
|
this.migrationStateModel._sqlMigrationService.location,
|
||||||
this.migrationStateModel._sqlMigrationService.name);
|
this.migrationStateModel._sqlMigrationService.name);
|
||||||
this.migrationStateModel._sqlMigrationService = migrationService;
|
this.migrationStateModel._sqlMigrationService = migrationService;
|
||||||
const migrationServiceMonitoringStatus = await getSqlMigrationServiceMonitoringData(
|
const migrationServiceMonitoringStatus = await getSqlMigrationServiceMonitoringData(
|
||||||
this.migrationStateModel._azureAccount,
|
this.migrationStateModel._azureAccount,
|
||||||
this.migrationStateModel._targetSubscription,
|
this.migrationStateModel._targetSubscription,
|
||||||
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
|
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
|
||||||
this.migrationStateModel._sqlMigrationService.properties.location,
|
this.migrationStateModel._sqlMigrationService.location,
|
||||||
this.migrationStateModel._sqlMigrationService!.name);
|
this.migrationStateModel._sqlMigrationService!.name);
|
||||||
this.migrationStateModel._nodeNames = migrationServiceMonitoringStatus.nodes.map((node) => {
|
this.migrationStateModel._nodeNames = migrationServiceMonitoringStatus.nodes.map((node) => {
|
||||||
return node.nodeName;
|
return node.nodeName;
|
||||||
@@ -399,7 +399,7 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
migrationServiceTitle,
|
migrationServiceTitle,
|
||||||
createInformationRow(this._view, constants.SUBSCRIPTION, this.migrationStateModel._targetSubscription.name),
|
createInformationRow(this._view, constants.SUBSCRIPTION, this.migrationStateModel._targetSubscription.name),
|
||||||
createInformationRow(this._view, constants.RESOURCE_GROUP, migrationService.properties.resourceGroup),
|
createInformationRow(this._view, constants.RESOURCE_GROUP, migrationService.properties.resourceGroup),
|
||||||
createInformationRow(this._view, constants.LOCATION, await this.migrationStateModel.getLocationDisplayName(migrationService.properties.location)),
|
createInformationRow(this._view, constants.LOCATION, await this.migrationStateModel.getLocationDisplayName(migrationService.location)),
|
||||||
connectionLabelContainer,
|
connectionLabelContainer,
|
||||||
connectionStatusLoader,
|
connectionStatusLoader,
|
||||||
authenticationKeysLabel,
|
authenticationKeysLabel,
|
||||||
|
|||||||
Reference in New Issue
Block a user