mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 01:25:37 -05:00
Fixing migration private preview bugs WIP 3 (#14928)
* Adding server name to wizard and dialog title Surfacing async errors Fixing a bunch of strings to match the mockup * Adding auto refresh for migration status * Removing errors for sql vm migration * using new logic to get sql server username * Fixing help links * Removing unncessary await
This commit is contained in:
@@ -187,7 +187,6 @@ export async function getSqlMigrationServiceMonitoringData(account: azdata.Accou
|
||||
if (response.errors.length > 0) {
|
||||
throw new Error(response.errors.toString());
|
||||
}
|
||||
console.log(response);
|
||||
return response.response.data;
|
||||
}
|
||||
|
||||
@@ -198,7 +197,9 @@ export async function startDatabaseMigration(account: azdata.Account, subscripti
|
||||
if (response.errors.length > 0) {
|
||||
throw new Error(response.errors.toString());
|
||||
}
|
||||
const asyncUrl = response.response.headers['azure-asyncoperation'];
|
||||
return {
|
||||
asyncUrl: asyncUrl,
|
||||
status: response.response.status,
|
||||
databaseMigration: response.response.data
|
||||
};
|
||||
@@ -227,6 +228,15 @@ export async function getMigrationStatus(account: azdata.Account, subscription:
|
||||
return response.response.data;
|
||||
}
|
||||
|
||||
export async function getMigrationAsyncOperationDetails(account: azdata.Account, subscription: Subscription, url: string): Promise<AzureAsyncOperationResource> {
|
||||
const api = await getAzureCoreAPI();
|
||||
const response = await api.makeAzureRestRequest(account, subscription, url.replace('https://management.azure.com/', ''), azurecore.HttpRequestMethod.GET, undefined, true);
|
||||
if (response.errors.length > 0) {
|
||||
throw new Error(response.errors.toString());
|
||||
}
|
||||
return response.response.data;
|
||||
}
|
||||
|
||||
export async function listMigrationsBySqlMigrationService(account: azdata.Account, subscription: Subscription, sqlMigrationService: SqlMigrationService): Promise<DatabaseMigration[]> {
|
||||
const api = await getAzureCoreAPI();
|
||||
const path = `${sqlMigrationService.id}/listMigrations?$expand=MigrationStatusDetails&api-version=2020-09-01-preview`;
|
||||
@@ -359,6 +369,7 @@ export interface StartDatabaseMigrationRequest {
|
||||
export interface StartDatabaseMigrationResponse {
|
||||
status: number,
|
||||
databaseMigration: DatabaseMigration
|
||||
asyncUrl: string
|
||||
}
|
||||
|
||||
export interface DatabaseMigration {
|
||||
@@ -460,3 +471,12 @@ export interface DatabaseMigrationAzureBlob {
|
||||
accountKey: string;
|
||||
blobContainerName: string;
|
||||
}
|
||||
|
||||
export interface AzureAsyncOperationResource {
|
||||
name: string,
|
||||
status: string,
|
||||
startTime: string,
|
||||
endTime: string,
|
||||
percentComplete: number,
|
||||
error: ErrorInfo
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user