bug - use new cancel/cutover api format (#19037)

* bug - use new cancel/cutover api format

* fix telemetry bug with unregistered ir
This commit is contained in:
brian-harris
2022-04-12 19:50:14 -07:00
committed by GitHub
parent b342a2df7e
commit fcd4c6e15b
3 changed files with 7 additions and 8 deletions

View File

@@ -337,8 +337,9 @@ export async function getMigrationAsyncOperationDetails(account: azdata.Account,
export async function startMigrationCutover(account: azdata.Account, subscription: Subscription, migration: DatabaseMigration): Promise<any> {
const api = await getAzureCoreAPI();
const path = encodeURI(`${migration.id}/operations/${migration.properties.migrationOperationId}/cutover?api-version=2022-01-30-preview`);
const response = await api.makeAzureRestRequest(account, subscription, path, azurecore.HttpRequestMethod.POST, undefined, true, undefined, undefined);
const path = encodeURI(`${migration.id}/cutover?api-version=2022-01-30-preview`);
const requestBody = { migrationOperationId: migration.properties.migrationOperationId };
const response = await api.makeAzureRestRequest(account, subscription, path, azurecore.HttpRequestMethod.POST, requestBody, true, undefined, undefined);
if (response.errors.length > 0) {
throw new Error(response.errors.toString());
}
@@ -347,8 +348,9 @@ export async function startMigrationCutover(account: azdata.Account, subscriptio
export async function stopMigration(account: azdata.Account, subscription: Subscription, migration: DatabaseMigration): Promise<void> {
const api = await getAzureCoreAPI();
const path = encodeURI(`${migration.id}/operations/${migration.properties.migrationOperationId}/cancel?api-version=2022-01-30-preview`);
const response = await api.makeAzureRestRequest(account, subscription, path, azurecore.HttpRequestMethod.POST, undefined, true, undefined, undefined);
const path = encodeURI(`${migration.id}/cancel?api-version=2022-01-30-preview`);
const requestBody = { migrationOperationId: migration.properties.migrationOperationId };
const response = await api.makeAzureRestRequest(account, subscription, path, azurecore.HttpRequestMethod.POST, requestBody, true, undefined, undefined);
if (response.errors.length > 0) {
throw new Error(response.errors.toString());
}

View File

@@ -1628,7 +1628,7 @@ export class MigrationStateModel implements Model, vscode.Disposable {
'targetDatabaseName': this._targetDatabaseNames[i],
'serverName': this._targetServerInstance.name,
'sqlMigrationServiceId': Buffer.from(this._sqlMigrationService?.id!).toString('base64'),
'irRegistered': (this._nodeNames.length > 0).toString(),
'irRegistered': (this._nodeNames?.length > 0).toString(),
'wizardEntryPoint': wizardEntryPoint,
},
{

View File

@@ -431,9 +431,6 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
this.migrationStateModel._sqlMigrationService.location,
this.migrationStateModel._sqlMigrationService!.name);
this.migrationStateModel._nodeNames = migrationServiceMonitoringStatus.nodes.map(
node => node.nodeName);
const state = migrationService.properties.integrationRuntimeState;
if (state === 'Online') {
await this._dmsStatusInfoBox.updateProperties(<azdata.InfoBoxComponentProperties>{