Update product references from 'sqlops' to 'azdata' (#4259)

* Update extensions to use azdata

* Switch core code to use azdata
This commit is contained in:
Karl Burtram
2019-03-01 13:59:37 -08:00
committed by GitHub
parent 220685a522
commit 84890eb1b4
371 changed files with 3208 additions and 3184 deletions

View File

@@ -5,7 +5,7 @@
// This is the place for extensions to expose APIs.
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
/**
@@ -35,10 +35,10 @@ export interface MssqlObjectExplorerBrowser {
/**
* Gets the matching node given a context object, e.g. one from a right-click on a node in Object Explorer
*
* @param {sqlops.ObjectExplorerContext} objectExplorerContext
* @param {azdata.ObjectExplorerContext} objectExplorerContext
* @returns {Promise<T>}
*/
getNode<T extends ITreeNode>(objectExplorerContext: sqlops.ObjectExplorerContext): Promise<T>;
getNode<T extends ITreeNode>(objectExplorerContext: azdata.ObjectExplorerContext): Promise<T>;
}
/**
@@ -48,7 +48,7 @@ export interface MssqlObjectExplorerBrowser {
* @interface ITreeNode
*/
export interface ITreeNode {
getNodeInfo(): sqlops.NodeInfo;
getNodeInfo(): azdata.NodeInfo;
getChildren(refreshChildren: boolean): ITreeNode[] | Promise<ITreeNode[]>;
}

View File

@@ -6,7 +6,7 @@
'use strict';
import * as vscode from 'vscode';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
/**
* Wrapper class to act as a facade over VSCode and Data APIs and allow us to test / mock callbacks into
@@ -17,44 +17,44 @@ import * as sqlops from 'sqlops';
*/
export class ApiWrapper {
// Data APIs
public registerConnectionProvider(provider: sqlops.ConnectionProvider): vscode.Disposable {
return sqlops.dataprotocol.registerConnectionProvider(provider);
public registerConnectionProvider(provider: azdata.ConnectionProvider): vscode.Disposable {
return azdata.dataprotocol.registerConnectionProvider(provider);
}
public registerObjectExplorerNodeProvider(provider: sqlops.ObjectExplorerNodeProvider): vscode.Disposable {
return sqlops.dataprotocol.registerObjectExplorerNodeProvider(provider);
public registerObjectExplorerNodeProvider(provider: azdata.ObjectExplorerNodeProvider): vscode.Disposable {
return azdata.dataprotocol.registerObjectExplorerNodeProvider(provider);
}
public registerTaskServicesProvider(provider: sqlops.TaskServicesProvider): vscode.Disposable {
return sqlops.dataprotocol.registerTaskServicesProvider(provider);
public registerTaskServicesProvider(provider: azdata.TaskServicesProvider): vscode.Disposable {
return azdata.dataprotocol.registerTaskServicesProvider(provider);
}
public registerFileBrowserProvider(provider: sqlops.FileBrowserProvider): vscode.Disposable {
return sqlops.dataprotocol.registerFileBrowserProvider(provider);
public registerFileBrowserProvider(provider: azdata.FileBrowserProvider): vscode.Disposable {
return azdata.dataprotocol.registerFileBrowserProvider(provider);
}
public createDialog(title: string): sqlops.window.Dialog {
return sqlops.window.createModelViewDialog(title);
public createDialog(title: string): azdata.window.Dialog {
return azdata.window.createModelViewDialog(title);
}
public openDialog(dialog: sqlops.window.Dialog): void {
return sqlops.window.openDialog(dialog);
public openDialog(dialog: azdata.window.Dialog): void {
return azdata.window.openDialog(dialog);
}
public closeDialog(dialog: sqlops.window.Dialog): void {
return sqlops.window.closeDialog(dialog);
public closeDialog(dialog: azdata.window.Dialog): void {
return azdata.window.closeDialog(dialog);
}
public registerTaskHandler(taskId: string, handler: (profile: sqlops.IConnectionProfile) => void): void {
sqlops.tasks.registerTask(taskId, handler);
public registerTaskHandler(taskId: string, handler: (profile: azdata.IConnectionProfile) => void): void {
azdata.tasks.registerTask(taskId, handler);
}
public startBackgroundOperation(operationInfo: sqlops.BackgroundOperationInfo): void {
sqlops.tasks.startBackgroundOperation(operationInfo);
public startBackgroundOperation(operationInfo: azdata.BackgroundOperationInfo): void {
azdata.tasks.startBackgroundOperation(operationInfo);
}
public getActiveConnections(): Thenable<sqlops.connection.Connection[]> {
return sqlops.connection.getActiveConnections();
public getActiveConnections(): Thenable<azdata.connection.Connection[]> {
return azdata.connection.getActiveConnections();
}
// VSCode APIs
@@ -113,7 +113,7 @@ export class ApiWrapper {
return vscode.window.createOutputChannel(name);
}
public createTab(title: string): sqlops.window.DialogTab {
return sqlops.window.createTab(title);
public createTab(title: string): azdata.window.DialogTab {
return azdata.window.createTab(title);
}
}

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as vscode from 'vscode';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as types from './types';
import * as Constants from './constants';
@@ -33,11 +33,11 @@ export default class ContextProvider {
private _disposables = new Array<vscode.Disposable>();
constructor() {
this._disposables.push(sqlops.workspace.onDidOpenDashboard(this.onDashboardOpen, this));
this._disposables.push(sqlops.workspace.onDidChangeToDashboard(this.onDashboardOpen, this));
this._disposables.push(azdata.workspace.onDidOpenDashboard(this.onDashboardOpen, this));
this._disposables.push(azdata.workspace.onDidChangeToDashboard(this.onDashboardOpen, this));
}
public onDashboardOpen(e: sqlops.DashboardDocument): void {
public onDashboardOpen(e: azdata.DashboardDocument): void {
let iscloud: boolean;
let edition: number;
let isCluster: boolean = false;

View File

@@ -6,7 +6,7 @@
import { NotificationType, RequestType } from 'vscode-languageclient';
import { ITelemetryEventProperties, ITelemetryEventMeasures } from './telemetry';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
// ------------------------------- < Telemetry Sent Event > ------------------------------------
@@ -51,18 +51,18 @@ export interface AgentJobActionParams {
export interface CreateAgentJobParams {
ownerUri: string;
job: sqlops.AgentJobInfo;
job: azdata.AgentJobInfo;
}
export interface UpdateAgentJobParams {
ownerUri: string;
originalJobName: string;
job: sqlops.AgentJobInfo;
job: azdata.AgentJobInfo;
}
export interface DeleteAgentJobParams {
ownerUri: string;
job: sqlops.AgentJobInfo;
job: azdata.AgentJobInfo;
}
export interface AgentJobDefaultsParams {
@@ -72,18 +72,18 @@ export interface AgentJobDefaultsParams {
// Job Step management parameters
export interface CreateAgentJobStepParams {
ownerUri: string;
step: sqlops.AgentJobStepInfo;
step: azdata.AgentJobStepInfo;
}
export interface UpdateAgentJobStepParams {
ownerUri: string;
originalJobStepName: string;
step: sqlops.AgentJobStepInfo;
step: azdata.AgentJobStepInfo;
}
export interface DeleteAgentJobStepParams {
ownerUri: string;
step: sqlops.AgentJobStepInfo;
step: azdata.AgentJobStepInfo;
}
// Alert management parameters
@@ -93,18 +93,18 @@ export interface AgentAlertsParams {
export interface CreateAgentAlertParams {
ownerUri: string;
alert: sqlops.AgentAlertInfo;
alert: azdata.AgentAlertInfo;
}
export interface UpdateAgentAlertParams {
ownerUri: string;
originalAlertName: string;
alert: sqlops.AgentAlertInfo;
alert: azdata.AgentAlertInfo;
}
export interface DeleteAgentAlertParams {
ownerUri: string;
alert: sqlops.AgentAlertInfo;
alert: azdata.AgentAlertInfo;
}
// Operator management parameters
@@ -114,18 +114,18 @@ export interface AgentOperatorsParams {
export interface CreateAgentOperatorParams {
ownerUri: string;
operator: sqlops.AgentOperatorInfo;
operator: azdata.AgentOperatorInfo;
}
export interface UpdateAgentOperatorParams {
ownerUri: string;
originalOperatorName: string;
operator: sqlops.AgentOperatorInfo;
operator: azdata.AgentOperatorInfo;
}
export interface DeleteAgentOperatorParams {
ownerUri: string;
operator: sqlops.AgentOperatorInfo;
operator: azdata.AgentOperatorInfo;
}
// Proxy management parameters
@@ -135,18 +135,18 @@ export interface AgentProxiesParams {
export interface CreateAgentProxyParams {
ownerUri: string;
proxy: sqlops.AgentProxyInfo;
proxy: azdata.AgentProxyInfo;
}
export interface UpdateAgentProxyParams {
ownerUri: string;
originalProxyName: string;
proxy: sqlops.AgentProxyInfo;
proxy: azdata.AgentProxyInfo;
}
export interface DeleteAgentProxyParams {
ownerUri: string;
proxy: sqlops.AgentProxyInfo;
proxy: azdata.AgentProxyInfo;
}
// Agent Credentials parameters
@@ -161,133 +161,133 @@ export interface AgentJobScheduleParams {
export interface CreateAgentJobScheduleParams {
ownerUri: string;
schedule: sqlops.AgentJobScheduleInfo;
schedule: azdata.AgentJobScheduleInfo;
}
export interface UpdateAgentJobScheduleParams {
ownerUri: string;
originalScheduleName: string;
schedule: sqlops.AgentJobScheduleInfo;
schedule: azdata.AgentJobScheduleInfo;
}
export interface DeleteAgentJobScheduleParams {
ownerUri: string;
schedule: sqlops.AgentJobScheduleInfo;
schedule: azdata.AgentJobScheduleInfo;
}
// Agent Job management requests
export namespace AgentJobsRequest {
export const type = new RequestType<AgentJobsParams, sqlops.AgentJobsResult, void, void>('agent/jobs');
export const type = new RequestType<AgentJobsParams, azdata.AgentJobsResult, void, void>('agent/jobs');
}
export namespace AgentJobHistoryRequest {
export const type = new RequestType<AgentJobHistoryParams, sqlops.AgentJobHistoryResult, void, void>('agent/jobhistory');
export const type = new RequestType<AgentJobHistoryParams, azdata.AgentJobHistoryResult, void, void>('agent/jobhistory');
}
export namespace AgentJobActionRequest {
export const type = new RequestType<AgentJobActionParams, sqlops.ResultStatus, void, void>('agent/jobaction');
export const type = new RequestType<AgentJobActionParams, azdata.ResultStatus, void, void>('agent/jobaction');
}
export namespace CreateAgentJobRequest {
export const type = new RequestType<CreateAgentJobParams, sqlops.CreateAgentJobResult, void, void>('agent/createjob');
export const type = new RequestType<CreateAgentJobParams, azdata.CreateAgentJobResult, void, void>('agent/createjob');
}
export namespace UpdateAgentJobRequest {
export const type = new RequestType<UpdateAgentJobParams, sqlops.UpdateAgentJobResult, void, void>('agent/updatejob');
export const type = new RequestType<UpdateAgentJobParams, azdata.UpdateAgentJobResult, void, void>('agent/updatejob');
}
export namespace DeleteAgentJobRequest {
export const type = new RequestType<DeleteAgentJobParams, sqlops.ResultStatus, void, void>('agent/deletejob');
export const type = new RequestType<DeleteAgentJobParams, azdata.ResultStatus, void, void>('agent/deletejob');
}
export namespace AgentJobDefaultsRequest {
export const type = new RequestType<AgentJobDefaultsParams, sqlops.AgentJobDefaultsResult, void, void>('agent/jobdefaults');
export const type = new RequestType<AgentJobDefaultsParams, azdata.AgentJobDefaultsResult, void, void>('agent/jobdefaults');
}
// Job Step requests
export namespace CreateAgentJobStepRequest {
export const type = new RequestType<CreateAgentJobStepParams, sqlops.CreateAgentJobStepResult, void, void>('agent/createjobstep');
export const type = new RequestType<CreateAgentJobStepParams, azdata.CreateAgentJobStepResult, void, void>('agent/createjobstep');
}
export namespace UpdateAgentJobStepRequest {
export const type = new RequestType<UpdateAgentJobStepParams, sqlops.UpdateAgentJobStepResult, void, void>('agent/updatejobstep');
export const type = new RequestType<UpdateAgentJobStepParams, azdata.UpdateAgentJobStepResult, void, void>('agent/updatejobstep');
}
export namespace DeleteAgentJobStepRequest {
export const type = new RequestType<DeleteAgentJobStepParams, sqlops.ResultStatus, void, void>('agent/deletejobstep');
export const type = new RequestType<DeleteAgentJobStepParams, azdata.ResultStatus, void, void>('agent/deletejobstep');
}
// Alerts requests
export namespace AgentAlertsRequest {
export const type = new RequestType<CreateAgentAlertParams, sqlops.AgentAlertsResult, void, void>('agent/alerts');
export const type = new RequestType<CreateAgentAlertParams, azdata.AgentAlertsResult, void, void>('agent/alerts');
}
export namespace CreateAgentAlertRequest {
export const type = new RequestType<CreateAgentAlertParams, sqlops.CreateAgentAlertResult, void, void>('agent/createalert');
export const type = new RequestType<CreateAgentAlertParams, azdata.CreateAgentAlertResult, void, void>('agent/createalert');
}
export namespace UpdateAgentAlertRequest {
export const type = new RequestType<UpdateAgentAlertParams, sqlops.UpdateAgentAlertResult, void, void>('agent/updatealert');
export const type = new RequestType<UpdateAgentAlertParams, azdata.UpdateAgentAlertResult, void, void>('agent/updatealert');
}
export namespace DeleteAgentAlertRequest {
export const type = new RequestType<DeleteAgentAlertParams, sqlops.ResultStatus, void, void>('agent/deletealert');
export const type = new RequestType<DeleteAgentAlertParams, azdata.ResultStatus, void, void>('agent/deletealert');
}
// Operators requests
export namespace AgentOperatorsRequest {
export const type = new RequestType<CreateAgentOperatorParams, sqlops.AgentOperatorsResult, void, void>('agent/operators');
export const type = new RequestType<CreateAgentOperatorParams, azdata.AgentOperatorsResult, void, void>('agent/operators');
}
export namespace CreateAgentOperatorRequest {
export const type = new RequestType<CreateAgentOperatorParams, sqlops.CreateAgentOperatorResult, void, void>('agent/createoperator');
export const type = new RequestType<CreateAgentOperatorParams, azdata.CreateAgentOperatorResult, void, void>('agent/createoperator');
}
export namespace UpdateAgentOperatorRequest {
export const type = new RequestType<UpdateAgentOperatorParams, sqlops.UpdateAgentOperatorResult, void, void>('agent/updateoperator');
export const type = new RequestType<UpdateAgentOperatorParams, azdata.UpdateAgentOperatorResult, void, void>('agent/updateoperator');
}
export namespace DeleteAgentOperatorRequest {
export const type = new RequestType<DeleteAgentOperatorParams, sqlops.ResultStatus, void, void>('agent/deleteoperator');
export const type = new RequestType<DeleteAgentOperatorParams, azdata.ResultStatus, void, void>('agent/deleteoperator');
}
// Proxies requests
export namespace AgentProxiesRequest {
export const type = new RequestType<CreateAgentProxyParams, sqlops.AgentProxiesResult, void, void>('agent/proxies');
export const type = new RequestType<CreateAgentProxyParams, azdata.AgentProxiesResult, void, void>('agent/proxies');
}
export namespace CreateAgentProxyRequest {
export const type = new RequestType<CreateAgentProxyParams, sqlops.CreateAgentProxyResult, void, void>('agent/createproxy');
export const type = new RequestType<CreateAgentProxyParams, azdata.CreateAgentProxyResult, void, void>('agent/createproxy');
}
export namespace UpdateAgentProxyRequest {
export const type = new RequestType<UpdateAgentProxyParams, sqlops.UpdateAgentProxyResult, void, void>('agent/updateproxy');
export const type = new RequestType<UpdateAgentProxyParams, azdata.UpdateAgentProxyResult, void, void>('agent/updateproxy');
}
export namespace DeleteAgentProxyRequest {
export const type = new RequestType<DeleteAgentProxyParams, sqlops.ResultStatus, void, void>('agent/deleteproxy');
export const type = new RequestType<DeleteAgentProxyParams, azdata.ResultStatus, void, void>('agent/deleteproxy');
}
// Agent Credentials request
export namespace AgentCredentialsRequest {
export const type = new RequestType<GetCredentialsParams, sqlops.GetCredentialsResult, void, void>('security/credentials');
export const type = new RequestType<GetCredentialsParams, azdata.GetCredentialsResult, void, void>('security/credentials');
}
// Job Schedules requests
export namespace AgentJobSchedulesRequest {
export const type = new RequestType<AgentJobScheduleParams, sqlops.AgentJobSchedulesResult, void, void>('agent/schedules');
export const type = new RequestType<AgentJobScheduleParams, azdata.AgentJobSchedulesResult, void, void>('agent/schedules');
}
export namespace CreateAgentJobScheduleRequest {
export const type = new RequestType<CreateAgentJobScheduleParams, sqlops.CreateAgentJobScheduleResult, void, void>('agent/createschedule');
export const type = new RequestType<CreateAgentJobScheduleParams, azdata.CreateAgentJobScheduleResult, void, void>('agent/createschedule');
}
export namespace UpdateAgentJobScheduleRequest {
export const type = new RequestType<UpdateAgentJobScheduleParams, sqlops.UpdateAgentJobScheduleResult, void, void>('agent/updateschedule');
export const type = new RequestType<UpdateAgentJobScheduleParams, azdata.UpdateAgentJobScheduleResult, void, void>('agent/updateschedule');
}
export namespace DeleteAgentJobScheduleRequest {
export const type = new RequestType<DeleteAgentJobScheduleParams, sqlops.ResultStatus, void, void>('agent/deleteschedule');
export const type = new RequestType<DeleteAgentJobScheduleParams, azdata.ResultStatus, void, void>('agent/deleteschedule');
}
// ------------------------------- < Agent Management > ------------------------------------
@@ -347,26 +347,26 @@ export interface GenerateDeployPlanParams {
}
export namespace ExportRequest {
export const type = new RequestType<ExportParams, sqlops.DacFxResult, void, void>('dacfx/export');
export const type = new RequestType<ExportParams, azdata.DacFxResult, void, void>('dacfx/export');
}
export namespace ImportRequest {
export const type = new RequestType<ImportParams, sqlops.DacFxResult, void, void>('dacfx/import');
export const type = new RequestType<ImportParams, azdata.DacFxResult, void, void>('dacfx/import');
}
export namespace ExtractRequest {
export const type = new RequestType<ExtractParams, sqlops.DacFxResult, void, void>('dacfx/extract');
export const type = new RequestType<ExtractParams, azdata.DacFxResult, void, void>('dacfx/extract');
}
export namespace DeployRequest {
export const type = new RequestType<DeployParams, sqlops.DacFxResult, void, void>('dacfx/deploy');
export const type = new RequestType<DeployParams, azdata.DacFxResult, void, void>('dacfx/deploy');
}
export namespace GenerateDeployScriptRequest {
export const type = new RequestType<GenerateDeployScriptParams, sqlops.DacFxResult, void, void>('dacfx/generateDeploymentScript');
export const type = new RequestType<GenerateDeployScriptParams, azdata.DacFxResult, void, void>('dacfx/generateDeploymentScript');
}
export namespace GenerateDeployPlanRequest {
export const type = new RequestType<GenerateDeployPlanParams, sqlops.GenerateDeployPlanResult, void, void>('dacfx/generateDeployPlan');
export const type = new RequestType<GenerateDeployPlanParams, azdata.GenerateDeployPlanResult, void, void>('dacfx/generateDeployPlan');
}
// ------------------------------- < DacFx > ------------------------------------

View File

@@ -5,7 +5,7 @@
'use strict';
import { RequestType } from 'vscode-languageclient';
import { Credential } from 'sqlops';
import { Credential } from 'azdata';
// --------------------------------- < Read Credential Request > -------------------------------------------------

View File

@@ -10,7 +10,7 @@ import { IConfig, ServerProvider } from 'service-downloader';
import { ServerOptions, RPCMessageType, ClientCapabilities, ServerCapabilities, TransportKind } from 'vscode-languageclient';
import { Disposable } from 'vscode';
import * as UUID from 'vscode-languageclient/lib/utils/uuid';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as Contracts from './contracts';
import * as Constants from './constants';
@@ -42,7 +42,7 @@ class CredentialsFeature extends SqlOpsFeature<any> {
protected registerProvider(options: any): Disposable {
const client = this._client;
let readCredential = (credentialId: string): Thenable<sqlops.Credential> => {
let readCredential = (credentialId: string): Thenable<azdata.Credential> => {
return client.sendRequest(Contracts.ReadCredentialRequest.type, { credentialId });
};
@@ -54,7 +54,7 @@ class CredentialsFeature extends SqlOpsFeature<any> {
return client.sendRequest(Contracts.DeleteCredentialRequest.type, { credentialId });
};
return sqlops.credentials.registerProvider({
return azdata.credentials.registerProvider({
deleteCredential,
readCredential,
saveCredential,

View File

@@ -9,7 +9,7 @@ import { ClientCapabilities, StaticFeature, RPCMessageType, ServerCapabilities }
import { Disposable } from 'vscode';
import { Telemetry } from './telemetry';
import * as contracts from './contracts';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as Utils from './utils';
import * as UUID from 'vscode-languageclient/lib/utils/uuid';
@@ -54,7 +54,7 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
const client = this._client;
let self = this;
let exportBacpac = (databaseName: string, packageFilePath: string, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.DacFxResult> => {
let exportBacpac = (databaseName: string, packageFilePath: string, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.DacFxResult> => {
let params: contracts.ExportParams = { databaseName: databaseName, packageFilePath: packageFilePath, ownerUri: ownerUri, taskExecutionMode: taskExecutionMode };
return client.sendRequest(contracts.ExportRequest.type, params).then(
r => {
@@ -67,7 +67,7 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
);
};
let importBacpac = (packageFilePath: string, databaseName: string, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.DacFxResult> => {
let importBacpac = (packageFilePath: string, databaseName: string, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.DacFxResult> => {
let params: contracts.ImportParams = { packageFilePath: packageFilePath, databaseName: databaseName, ownerUri: ownerUri, taskExecutionMode: taskExecutionMode };
return client.sendRequest(contracts.ImportRequest.type, params).then(
r => {
@@ -80,7 +80,7 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
);
};
let extractDacpac = (databaseName: string, packageFilePath: string, applicationName: string, applicationVersion: string, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.DacFxResult> => {
let extractDacpac = (databaseName: string, packageFilePath: string, applicationName: string, applicationVersion: string, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.DacFxResult> => {
let params: contracts.ExtractParams = { databaseName: databaseName, packageFilePath: packageFilePath, applicationName: applicationName, applicationVersion: applicationVersion, ownerUri: ownerUri, taskExecutionMode: taskExecutionMode };
return client.sendRequest(contracts.ExtractRequest.type, params).then(
r => {
@@ -93,7 +93,7 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
);
};
let deployDacpac = (packageFilePath: string, targetDatabaseName: string, upgradeExisting: boolean, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.DacFxResult> => {
let deployDacpac = (packageFilePath: string, targetDatabaseName: string, upgradeExisting: boolean, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.DacFxResult> => {
let params: contracts.DeployParams = { packageFilePath: packageFilePath, databaseName: targetDatabaseName, upgradeExisting: upgradeExisting, ownerUri: ownerUri, taskExecutionMode: taskExecutionMode };
return client.sendRequest(contracts.DeployRequest.type, params).then(
r => {
@@ -106,7 +106,7 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
);
};
let generateDeployScript = (packageFilePath: string, targetDatabaseName: string, scriptFilePath: string, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.DacFxResult> => {
let generateDeployScript = (packageFilePath: string, targetDatabaseName: string, scriptFilePath: string, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.DacFxResult> => {
let params: contracts.GenerateDeployScriptParams = { packageFilePath: packageFilePath, databaseName: targetDatabaseName, scriptFilePath: scriptFilePath, ownerUri: ownerUri, taskExecutionMode: taskExecutionMode };
return client.sendRequest(contracts.GenerateDeployScriptRequest.type, params).then(
r => {
@@ -119,7 +119,7 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
);
};
let generateDeployPlan = (packageFilePath: string, targetDatabaseName: string, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.GenerateDeployPlanResult> => {
let generateDeployPlan = (packageFilePath: string, targetDatabaseName: string, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.GenerateDeployPlanResult> => {
let params: contracts.GenerateDeployPlanParams = { packageFilePath: packageFilePath, databaseName: targetDatabaseName, ownerUri: ownerUri, taskExecutionMode: taskExecutionMode };
return client.sendRequest(contracts.GenerateDeployPlanRequest.type, params).then(
r => {
@@ -132,7 +132,7 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
);
};
return sqlops.dataprotocol.registerDacFxServicesProvider({
return azdata.dataprotocol.registerDacFxServicesProvider({
providerId: client.providerId,
exportBacpac,
importBacpac,
@@ -185,7 +185,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
};
// Job management methods
let getJobs = (ownerUri: string): Thenable<sqlops.AgentJobsResult> => {
let getJobs = (ownerUri: string): Thenable<azdata.AgentJobsResult> => {
let params: contracts.AgentJobsParams = { ownerUri: ownerUri, jobId: null };
return client.sendRequest(contracts.AgentJobsRequest.type, params).then(
r => r,
@@ -196,7 +196,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let getJobHistory = (ownerUri: string, jobID: string, jobName: string): Thenable<sqlops.AgentJobHistoryResult> => {
let getJobHistory = (ownerUri: string, jobID: string, jobName: string): Thenable<azdata.AgentJobHistoryResult> => {
let params: contracts.AgentJobHistoryParams = { ownerUri: ownerUri, jobId: jobID, jobName: jobName };
return client.sendRequest(contracts.AgentJobHistoryRequest.type, params).then(
@@ -208,7 +208,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let jobAction = (ownerUri: string, jobName: string, action: string): Thenable<sqlops.ResultStatus> => {
let jobAction = (ownerUri: string, jobName: string, action: string): Thenable<azdata.ResultStatus> => {
let params: contracts.AgentJobActionParams = { ownerUri: ownerUri, jobName: jobName, action: action };
return client.sendRequest(contracts.AgentJobActionRequest.type, params).then(
r => r,
@@ -219,7 +219,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let createJob = (ownerUri: string, jobInfo: sqlops.AgentJobInfo): Thenable<sqlops.CreateAgentJobResult> => {
let createJob = (ownerUri: string, jobInfo: azdata.AgentJobInfo): Thenable<azdata.CreateAgentJobResult> => {
let params: contracts.CreateAgentJobParams = {
ownerUri: ownerUri,
job: jobInfo
@@ -237,7 +237,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let updateJob = (ownerUri: string, originalJobName: string, jobInfo: sqlops.AgentJobInfo): Thenable<sqlops.UpdateAgentJobResult> => {
let updateJob = (ownerUri: string, originalJobName: string, jobInfo: azdata.AgentJobInfo): Thenable<azdata.UpdateAgentJobResult> => {
let params: contracts.UpdateAgentJobParams = {
ownerUri: ownerUri,
originalJobName: originalJobName,
@@ -256,7 +256,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let deleteJob = (ownerUri: string, jobInfo: sqlops.AgentJobInfo): Thenable<sqlops.ResultStatus> => {
let deleteJob = (ownerUri: string, jobInfo: azdata.AgentJobInfo): Thenable<azdata.ResultStatus> => {
let params: contracts.DeleteAgentJobParams = {
ownerUri: ownerUri,
job: jobInfo
@@ -274,7 +274,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let getJobDefaults = (ownerUri: string): Thenable<sqlops.AgentJobDefaultsResult> => {
let getJobDefaults = (ownerUri: string): Thenable<azdata.AgentJobDefaultsResult> => {
let params: contracts.AgentJobDefaultsParams = {
ownerUri: ownerUri
};
@@ -289,7 +289,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
};
// Job Step management methods
let createJobStep = (ownerUri: string, stepInfo: sqlops.AgentJobStepInfo): Thenable<sqlops.CreateAgentJobStepResult> => {
let createJobStep = (ownerUri: string, stepInfo: azdata.AgentJobStepInfo): Thenable<azdata.CreateAgentJobStepResult> => {
let params: contracts.CreateAgentJobStepParams = {
ownerUri: ownerUri,
step: stepInfo
@@ -307,7 +307,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let updateJobStep = (ownerUri: string, originalJobStepName: string, stepInfo: sqlops.AgentJobStepInfo): Thenable<sqlops.UpdateAgentJobStepResult> => {
let updateJobStep = (ownerUri: string, originalJobStepName: string, stepInfo: azdata.AgentJobStepInfo): Thenable<azdata.UpdateAgentJobStepResult> => {
let params: contracts.UpdateAgentJobStepParams = {
ownerUri: ownerUri,
originalJobStepName: originalJobStepName,
@@ -326,7 +326,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let deleteJobStep = (ownerUri: string, stepInfo: sqlops.AgentJobStepInfo): Thenable<sqlops.ResultStatus> => {
let deleteJobStep = (ownerUri: string, stepInfo: azdata.AgentJobStepInfo): Thenable<azdata.ResultStatus> => {
let params: contracts.DeleteAgentJobStepParams = {
ownerUri: ownerUri,
step: stepInfo
@@ -345,7 +345,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
};
// Alert management methods
let getAlerts = (ownerUri: string): Thenable<sqlops.AgentAlertsResult> => {
let getAlerts = (ownerUri: string): Thenable<azdata.AgentAlertsResult> => {
let params: contracts.AgentAlertsParams = {
ownerUri: ownerUri
};
@@ -359,7 +359,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let createAlert = (ownerUri: string, alertInfo: sqlops.AgentAlertInfo): Thenable<sqlops.CreateAgentAlertResult> => {
let createAlert = (ownerUri: string, alertInfo: azdata.AgentAlertInfo): Thenable<azdata.CreateAgentAlertResult> => {
let params: contracts.CreateAgentAlertParams = {
ownerUri: ownerUri,
alert: alertInfo
@@ -377,7 +377,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let updateAlert = (ownerUri: string, originalAlertName: string, alertInfo: sqlops.AgentAlertInfo): Thenable<sqlops.UpdateAgentAlertResult> => {
let updateAlert = (ownerUri: string, originalAlertName: string, alertInfo: azdata.AgentAlertInfo): Thenable<azdata.UpdateAgentAlertResult> => {
let params: contracts.UpdateAgentAlertParams = {
ownerUri: ownerUri,
originalAlertName: originalAlertName,
@@ -396,7 +396,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let deleteAlert = (ownerUri: string, alertInfo: sqlops.AgentAlertInfo): Thenable<sqlops.ResultStatus> => {
let deleteAlert = (ownerUri: string, alertInfo: azdata.AgentAlertInfo): Thenable<azdata.ResultStatus> => {
let params: contracts.DeleteAgentAlertParams = {
ownerUri: ownerUri,
alert: alertInfo
@@ -415,7 +415,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
};
// Operator management methods
let getOperators = (ownerUri: string): Thenable<sqlops.AgentOperatorsResult> => {
let getOperators = (ownerUri: string): Thenable<azdata.AgentOperatorsResult> => {
let params: contracts.AgentOperatorsParams = {
ownerUri: ownerUri
};
@@ -429,7 +429,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let createOperator = (ownerUri: string, operatorInfo: sqlops.AgentOperatorInfo): Thenable<sqlops.CreateAgentOperatorResult> => {
let createOperator = (ownerUri: string, operatorInfo: azdata.AgentOperatorInfo): Thenable<azdata.CreateAgentOperatorResult> => {
let params: contracts.CreateAgentOperatorParams = {
ownerUri: ownerUri,
operator: operatorInfo
@@ -447,7 +447,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let updateOperator = (ownerUri: string, originalOperatorName: string, operatorInfo: sqlops.AgentOperatorInfo): Thenable<sqlops.UpdateAgentOperatorResult> => {
let updateOperator = (ownerUri: string, originalOperatorName: string, operatorInfo: azdata.AgentOperatorInfo): Thenable<azdata.UpdateAgentOperatorResult> => {
let params: contracts.UpdateAgentOperatorParams = {
ownerUri: ownerUri,
originalOperatorName: originalOperatorName,
@@ -466,7 +466,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let deleteOperator = (ownerUri: string, operatorInfo: sqlops.AgentOperatorInfo): Thenable<sqlops.ResultStatus> => {
let deleteOperator = (ownerUri: string, operatorInfo: azdata.AgentOperatorInfo): Thenable<azdata.ResultStatus> => {
let params: contracts.DeleteAgentOperatorParams = {
ownerUri: ownerUri,
operator: operatorInfo
@@ -485,7 +485,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
};
// Proxy management methods
let getProxies = (ownerUri: string): Thenable<sqlops.AgentProxiesResult> => {
let getProxies = (ownerUri: string): Thenable<azdata.AgentProxiesResult> => {
let params: contracts.AgentProxiesParams = {
ownerUri: ownerUri
};
@@ -499,7 +499,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let createProxy = (ownerUri: string, proxyInfo: sqlops.AgentProxyInfo): Thenable<sqlops.CreateAgentOperatorResult> => {
let createProxy = (ownerUri: string, proxyInfo: azdata.AgentProxyInfo): Thenable<azdata.CreateAgentOperatorResult> => {
let params: contracts.CreateAgentProxyParams = {
ownerUri: ownerUri,
proxy: proxyInfo
@@ -517,7 +517,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let updateProxy = (ownerUri: string, originalProxyName: string, proxyInfo: sqlops.AgentProxyInfo): Thenable<sqlops.UpdateAgentOperatorResult> => {
let updateProxy = (ownerUri: string, originalProxyName: string, proxyInfo: azdata.AgentProxyInfo): Thenable<azdata.UpdateAgentOperatorResult> => {
let params: contracts.UpdateAgentProxyParams = {
ownerUri: ownerUri,
originalProxyName: originalProxyName,
@@ -536,7 +536,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let deleteProxy = (ownerUri: string, proxyInfo: sqlops.AgentProxyInfo): Thenable<sqlops.ResultStatus> => {
let deleteProxy = (ownerUri: string, proxyInfo: azdata.AgentProxyInfo): Thenable<azdata.ResultStatus> => {
let params: contracts.DeleteAgentProxyParams = {
ownerUri: ownerUri,
proxy: proxyInfo
@@ -555,7 +555,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
};
// Agent Credential Method
let getCredentials = (ownerUri: string): Thenable<sqlops.GetCredentialsResult> => {
let getCredentials = (ownerUri: string): Thenable<azdata.GetCredentialsResult> => {
let params: contracts.GetCredentialsParams = {
ownerUri: ownerUri
};
@@ -571,7 +571,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
// Job Schedule management methods
let getJobSchedules = (ownerUri: string): Thenable<sqlops.AgentJobSchedulesResult> => {
let getJobSchedules = (ownerUri: string): Thenable<azdata.AgentJobSchedulesResult> => {
let params: contracts.AgentJobScheduleParams = {
ownerUri: ownerUri
};
@@ -585,7 +585,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let createJobSchedule = (ownerUri: string, scheduleInfo: sqlops.AgentJobScheduleInfo): Thenable<sqlops.CreateAgentJobScheduleResult> => {
let createJobSchedule = (ownerUri: string, scheduleInfo: azdata.AgentJobScheduleInfo): Thenable<azdata.CreateAgentJobScheduleResult> => {
let params: contracts.CreateAgentJobScheduleParams = {
ownerUri: ownerUri,
schedule: scheduleInfo
@@ -603,7 +603,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let updateJobSchedule = (ownerUri: string, originalScheduleName: string, scheduleInfo: sqlops.AgentJobScheduleInfo): Thenable<sqlops.UpdateAgentJobScheduleResult> => {
let updateJobSchedule = (ownerUri: string, originalScheduleName: string, scheduleInfo: azdata.AgentJobScheduleInfo): Thenable<azdata.UpdateAgentJobScheduleResult> => {
let params: contracts.UpdateAgentJobScheduleParams = {
ownerUri: ownerUri,
originalScheduleName: originalScheduleName,
@@ -622,7 +622,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
let deleteJobSchedule = (ownerUri: string, scheduleInfo: sqlops.AgentJobScheduleInfo): Thenable<sqlops.ResultStatus> => {
let deleteJobSchedule = (ownerUri: string, scheduleInfo: azdata.AgentJobScheduleInfo): Thenable<azdata.ResultStatus> => {
let params: contracts.DeleteAgentJobScheduleParams = {
ownerUri: ownerUri,
schedule: scheduleInfo
@@ -640,7 +640,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
);
};
return sqlops.dataprotocol.registerAgentServicesProvider({
return azdata.dataprotocol.registerAgentServicesProvider({
providerId: client.providerId,
getJobs,
getJobHistory,

View File

@@ -5,7 +5,7 @@
'use strict';
import * as vscode from 'vscode';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as path from 'path';
import * as os from 'os';
import * as nls from 'vscode-nls';
@@ -108,7 +108,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<MssqlE
resourceProvider.start();
let nodeProvider = new MssqlObjectExplorerNodeProvider(appContext);
sqlops.dataprotocol.registerObjectExplorerNodeProvider(nodeProvider);
azdata.dataprotocol.registerObjectExplorerNodeProvider(nodeProvider);
activateSparkFeatures(appContext);
activateNotebookTask(appContext);
}, e => {
@@ -131,7 +131,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<MssqlE
let api: MssqlExtensionApi = {
getMssqlObjectExplorerBrowser(): MssqlObjectExplorerBrowser {
return {
getNode: (context: sqlops.ObjectExplorerContext) => {
getNode: (context: azdata.ObjectExplorerContext) => {
let oeProvider = appContext.getService<MssqlObjectExplorerNodeProvider>(Constants.ObjectExplorerService);
return <any>oeProvider.findSqlClusterNodeByContext(context);
}
@@ -147,36 +147,36 @@ function activateSparkFeatures(appContext: AppContext): void {
let outputChannel: vscode.OutputChannel = mssqlOutputChannel;
extensionContext.subscriptions.push(new OpenSparkJobSubmissionDialogCommand(appContext, outputChannel));
extensionContext.subscriptions.push(new OpenSparkJobSubmissionDialogFromFileCommand(appContext, outputChannel));
apiWrapper.registerTaskHandler(Constants.mssqlClusterLivySubmitSparkJobTask, (profile: sqlops.IConnectionProfile) => {
apiWrapper.registerTaskHandler(Constants.mssqlClusterLivySubmitSparkJobTask, (profile: azdata.IConnectionProfile) => {
new OpenSparkJobSubmissionDialogTask(appContext, outputChannel).execute(profile);
});
apiWrapper.registerTaskHandler(Constants.mssqlClusterLivyOpenSparkHistory, (profile: sqlops.IConnectionProfile) => {
apiWrapper.registerTaskHandler(Constants.mssqlClusterLivyOpenSparkHistory, (profile: azdata.IConnectionProfile) => {
new OpenSparkYarnHistoryTask(appContext).execute(profile, true);
});
apiWrapper.registerTaskHandler(Constants.mssqlClusterLivyOpenYarnHistory, (profile: sqlops.IConnectionProfile) => {
apiWrapper.registerTaskHandler(Constants.mssqlClusterLivyOpenYarnHistory, (profile: azdata.IConnectionProfile) => {
new OpenSparkYarnHistoryTask(appContext).execute(profile, false);
});
}
function activateNotebookTask(appContext: AppContext): void {
let apiWrapper = appContext.apiWrapper;
apiWrapper.registerTaskHandler(Constants.mssqlClusterNewNotebookTask, (profile: sqlops.IConnectionProfile) => {
apiWrapper.registerTaskHandler(Constants.mssqlClusterNewNotebookTask, (profile: azdata.IConnectionProfile) => {
return saveProfileAndCreateNotebook(profile);
});
apiWrapper.registerTaskHandler(Constants.mssqlClusterOpenNotebookTask, (profile: sqlops.IConnectionProfile) => {
apiWrapper.registerTaskHandler(Constants.mssqlClusterOpenNotebookTask, (profile: azdata.IConnectionProfile) => {
return handleOpenNotebookTask(profile);
});
}
function saveProfileAndCreateNotebook(profile: sqlops.IConnectionProfile): Promise<void> {
function saveProfileAndCreateNotebook(profile: azdata.IConnectionProfile): Promise<void> {
return handleNewNotebookTask(undefined, profile);
}
async function handleNewNotebookTask(oeContext?: sqlops.ObjectExplorerContext, profile?: sqlops.IConnectionProfile): Promise<void> {
async function handleNewNotebookTask(oeContext?: azdata.ObjectExplorerContext, profile?: azdata.IConnectionProfile): Promise<void> {
// Ensure we get a unique ID for the notebook. For now we're using a different prefix to the built-in untitled files
// to handle this. We should look into improving this in the future
let untitledUri = vscode.Uri.parse(`untitled:Notebook-${untitledCounter++}`);
let editor = await sqlops.nb.showNotebookDocument(untitledUri, {
let editor = await azdata.nb.showNotebookDocument(untitledUri, {
connectionId: profile.id,
providerId: jupyterNotebookProviderId,
preview: false,
@@ -203,7 +203,7 @@ async function handleNewNotebookTask(oeContext?: sqlops.ObjectExplorerContext, p
}
}
async function handleOpenNotebookTask(profile: sqlops.IConnectionProfile): Promise<void> {
async function handleOpenNotebookTask(profile: azdata.IConnectionProfile): Promise<void> {
let notebookFileTypeName = localize('notebookFileType', 'Notebooks');
let filter = {};
filter[notebookFileTypeName] = 'ipynb';
@@ -219,7 +219,7 @@ async function handleOpenNotebookTask(profile: sqlops.IConnectionProfile): Promi
// in the future might want additional supported types
vscode.window.showErrorMessage(localize('unsupportedFileType', 'Only .ipynb Notebooks are supported'));
} else {
await sqlops.nb.showNotebookDocument(fileUri, {
await azdata.nb.showNotebookDocument(fileUri, {
connectionId: profile.id,
providerId: jupyterNotebookProviderId,
preview: false

View File

@@ -5,7 +5,7 @@
'use strict';
import * as vscode from 'vscode';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
@@ -42,7 +42,7 @@ export interface ICommandViewContext extends ICommandBaseContext {
export interface ICommandObjectExplorerContext extends ICommandBaseContext {
type: 'objectexplorer';
explorerContext: sqlops.ObjectExplorerContext;
explorerContext: azdata.ObjectExplorerContext;
}
export type CommandContext = ICommandObjectExplorerContext | ICommandViewContext | ICommandUriContext | ICommandUnknownContext;
@@ -115,7 +115,7 @@ export abstract class Command extends vscode.Disposable {
}
if (firstArg && utils.isObjectExplorerContext(firstArg)) {
const [explorerContext, ...rest] = args as [sqlops.ObjectExplorerContext, any];
const [explorerContext, ...rest] = args as [azdata.ObjectExplorerContext, any];
return [{ command: command, type: constants.ObjectExplorerService, explorerContext: explorerContext }, rest];
}

View File

@@ -5,7 +5,7 @@
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
@@ -13,14 +13,14 @@ import * as constants from '../constants';
import { IFileSource, IHdfsOptions, IRequestParams, FileSourceFactory } from './fileSources';
export class SqlClusterConnection {
private _connection: sqlops.connection.Connection;
private _profile: sqlops.IConnectionProfile;
private _connection: azdata.connection.Connection;
private _profile: azdata.IConnectionProfile;
private _host: string;
private _port: string;
private _user: string;
private _password: string;
constructor(connectionInfo: sqlops.connection.Connection | sqlops.IConnectionProfile) {
constructor(connectionInfo: azdata.connection.Connection | azdata.IConnectionProfile) {
this.validate(connectionInfo);
if ('id' in connectionInfo) {
@@ -36,14 +36,14 @@ export class SqlClusterConnection {
this._password = this._connection.options[constants.passwordPropName];
}
public get connection(): sqlops.connection.Connection { return this._connection; }
public get profile(): sqlops.IConnectionProfile { return this._profile; }
public get connection(): azdata.connection.Connection { return this._connection; }
public get profile(): azdata.IConnectionProfile { return this._profile; }
public get host(): string { return this._host; }
public get port(): number { return this._port ? Number.parseInt(this._port) : constants.defaultKnoxPort; }
public get user(): string { return this._user; }
public get password(): string { return this._password; }
public isMatch(connection: SqlClusterConnection | sqlops.ConnectionInfo): boolean {
public isMatch(connection: SqlClusterConnection | azdata.ConnectionInfo): boolean {
if (!connection) { return false; }
let options1 = connection instanceof SqlClusterConnection ?
connection._connection.options : connection.options;
@@ -69,7 +69,7 @@ export class SqlClusterConnection {
return FileSourceFactory.instance.createHdfsFileSource(options);
}
private validate(connectionInfo: sqlops.ConnectionInfo): void {
private validate(connectionInfo: azdata.ConnectionInfo): void {
if (!connectionInfo) {
throw new Error(localize('connectionInfoUndefined', 'ConnectionInfo is undefined.'));
}
@@ -84,7 +84,7 @@ export class SqlClusterConnection {
}
}
private getMissingProperties(connectionInfo: sqlops.ConnectionInfo): string[] {
private getMissingProperties(connectionInfo: azdata.ConnectionInfo): string[] {
if (!connectionInfo || !connectionInfo.options) { return undefined; }
return [
constants.hostPropName, constants.knoxPortPropName,
@@ -92,15 +92,15 @@ export class SqlClusterConnection {
].filter(e => connectionInfo.options[e] === undefined);
}
private toConnection(connProfile: sqlops.IConnectionProfile): sqlops.connection.Connection {
let connection: sqlops.connection.Connection = Object.assign(connProfile,
private toConnection(connProfile: azdata.IConnectionProfile): azdata.connection.Connection {
let connection: azdata.connection.Connection = Object.assign(connProfile,
{ connectionId: this._profile.id });
return connection;
}
private toConnectionProfile(connectionInfo: sqlops.connection.Connection): sqlops.IConnectionProfile {
private toConnectionProfile(connectionInfo: azdata.connection.Connection): azdata.IConnectionProfile {
let options = connectionInfo.options;
let connProfile: sqlops.IConnectionProfile = Object.assign(<sqlops.IConnectionProfile>{},
let connProfile: azdata.IConnectionProfile = Object.assign(<azdata.IConnectionProfile>{},
connectionInfo,
{
serverName: `${options[constants.hostPropName]},${options[constants.knoxPortPropName]}`,

View File

@@ -6,7 +6,7 @@
'use strict';
import * as vscode from 'vscode';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as fs from 'fs';
import * as fspath from 'path';
import * as clipboardy from 'clipboardy';
@@ -92,7 +92,7 @@ export class UploadFilesCommand extends ProgressCommand {
localize('uploading', 'Uploading files to HDFS'), true,
() => this.apiWrapper.showInformationMessage(localize('uploadCanceled', 'Upload operation was canceled')));
if (context.type === constants.ObjectExplorerService) {
let objectExplorerNode = await sqlops.objectexplorer.getNode(context.explorerContext.connectionProfile.id, folderNode.getNodeInfo().nodePath);
let objectExplorerNode = await azdata.objectexplorer.getNode(context.explorerContext.connectionProfile.id, folderNode.getNodeInfo().nodePath);
await objectExplorerNode.refresh();
}
}
@@ -150,7 +150,7 @@ export class MkDirCommand extends ProgressCommand {
localize('makingDir', 'Creating directory'), true,
() => this.apiWrapper.showInformationMessage(localize('mkdirCanceled', 'Operation was canceled')));
if (context.type === constants.ObjectExplorerService) {
let objectExplorerNode = await sqlops.objectexplorer.getNode(context.explorerContext.connectionProfile.id, folderNode.getNodeInfo().nodePath);
let objectExplorerNode = await azdata.objectexplorer.getNode(context.explorerContext.connectionProfile.id, folderNode.getNodeInfo().nodePath);
await objectExplorerNode.refresh();
}
}
@@ -191,9 +191,9 @@ export class DeleteFilesCommand extends Command {
// TODO ideally would let node define if it's deletable
// TODO also, would like to change this to getNodeInfo as OE is the primary use case now
let treeItem = await node.getTreeItem();
let oeNodeToRefresh: sqlops.objectexplorer.ObjectExplorerNode = undefined;
let oeNodeToRefresh: azdata.objectexplorer.ObjectExplorerNode = undefined;
if (context.type === constants.ObjectExplorerService) {
let oeNodeToDelete = await sqlops.objectexplorer.getNode(context.explorerContext.connectionProfile.id, node.getNodeInfo().nodePath);
let oeNodeToDelete = await azdata.objectexplorer.getNode(context.explorerContext.connectionProfile.id, node.getNodeInfo().nodePath);
oeNodeToRefresh = await oeNodeToDelete.getParent();
}
switch (treeItem.contextValue) {

View File

@@ -5,7 +5,7 @@
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as fspath from 'path';
import * as fs from 'fs';
@@ -153,10 +153,10 @@ export class FolderNode extends HdfsFileSourceNode {
return item;
}
getNodeInfo(): sqlops.NodeInfo {
getNodeInfo(): azdata.NodeInfo {
// TODO handle error message case by returning it in the OE API
// TODO support better mapping of node type
let nodeInfo: sqlops.NodeInfo = {
let nodeInfo: azdata.NodeInfo = {
label: this.getDisplayName(),
isLeaf: false,
errorMessage: undefined,
@@ -252,9 +252,9 @@ export class FileNode extends HdfsFileSourceNode implements IFileNode {
}
getNodeInfo(): sqlops.NodeInfo {
getNodeInfo(): azdata.NodeInfo {
// TODO improve node type handling so it's not tied to SQL Server types
let nodeInfo: sqlops.NodeInfo = {
let nodeInfo: azdata.NodeInfo = {
label: this.getDisplayName(),
isLeaf: true,
errorMessage: undefined,
@@ -349,8 +349,8 @@ export class ErrorNode extends TreeNode {
}
getNodeInfo(): sqlops.NodeInfo {
let nodeInfo: sqlops.NodeInfo = {
getNodeInfo(): azdata.NodeInfo {
let nodeInfo: azdata.NodeInfo = {
label: this.message,
isLeaf: false,
errorMessage: undefined,

View File

@@ -5,7 +5,7 @@
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
@@ -23,10 +23,10 @@ import { ICommandObjectExplorerContext } from './command';
export const mssqlOutputChannel = vscode.window.createOutputChannel(constants.providerId);
export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sqlops.ObjectExplorerNodeProvider, ITreeChangeHandler {
export class MssqlObjectExplorerNodeProvider extends ProviderBase implements azdata.ObjectExplorerNodeProvider, ITreeChangeHandler {
public readonly supportedProviderId: string = constants.providerId;
private sessionMap: Map<string, SqlClusterSession>;
private expandCompleteEmitter = new vscode.EventEmitter<sqlops.ObjectExplorerExpandInfo>();
private expandCompleteEmitter = new vscode.EventEmitter<azdata.ObjectExplorerExpandInfo>();
constructor(private appContext: AppContext) {
super();
@@ -34,7 +34,7 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
this.appContext.registerService<MssqlObjectExplorerNodeProvider>(constants.ObjectExplorerService, this);
}
handleSessionOpen(session: sqlops.ObjectExplorerSession): Thenable<boolean> {
handleSessionOpen(session: azdata.ObjectExplorerSession): Thenable<boolean> {
return new Promise((resolve, reject) => {
if (!session) {
reject('handleSessionOpen requires a session object to be passed');
@@ -44,10 +44,10 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
});
}
private async doSessionOpen(session: sqlops.ObjectExplorerSession): Promise<boolean> {
private async doSessionOpen(session: azdata.ObjectExplorerSession): Promise<boolean> {
if (!session || !session.sessionId) { return false; }
let sqlConnProfile = await sqlops.objectexplorer.getSessionConnectionProfile(session.sessionId);
let sqlConnProfile = await azdata.objectexplorer.getSessionConnectionProfile(session.sessionId);
if (!sqlConnProfile) { return false; }
let clusterConnInfo = await SqlClusterLookUp.getSqlClusterConnection(sqlConnProfile);
@@ -59,7 +59,7 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
return true;
}
expandNode(nodeInfo: sqlops.ExpandNodeInfo, isRefresh: boolean = false): Thenable<boolean> {
expandNode(nodeInfo: azdata.ExpandNodeInfo, isRefresh: boolean = false): Thenable<boolean> {
return new Promise((resolve, reject) => {
if (!nodeInfo) {
reject('expandNode requires a nodeInfo object to be passed');
@@ -69,7 +69,7 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
});
}
private async doExpandNode(nodeInfo: sqlops.ExpandNodeInfo, isRefresh: boolean = false): Promise<boolean> {
private async doExpandNode(nodeInfo: azdata.ExpandNodeInfo, isRefresh: boolean = false): Promise<boolean> {
let session = this.sessionMap.get(nodeInfo.sessionId);
let response = {
sessionId: nodeInfo.sessionId,
@@ -95,8 +95,8 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
return true;
}
private async startExpansion(session: SqlClusterSession, nodeInfo: sqlops.ExpandNodeInfo, isRefresh: boolean = false): Promise<void> {
let expandResult: sqlops.ObjectExplorerExpandInfo = {
private async startExpansion(session: SqlClusterSession, nodeInfo: azdata.ExpandNodeInfo, isRefresh: boolean = false): Promise<void> {
let expandResult: azdata.ObjectExplorerExpandInfo = {
sessionId: session.sessionId,
nodePath: nodeInfo.nodePath,
errorMessage: undefined,
@@ -125,24 +125,24 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
this.expandCompleteEmitter.fire(expandResult);
}
refreshNode(nodeInfo: sqlops.ExpandNodeInfo): Thenable<boolean> {
refreshNode(nodeInfo: azdata.ExpandNodeInfo): Thenable<boolean> {
// TODO #3815 implement properly
return this.expandNode(nodeInfo, true);
}
handleSessionClose(closeSessionInfo: sqlops.ObjectExplorerCloseSessionInfo): void {
handleSessionClose(closeSessionInfo: azdata.ObjectExplorerCloseSessionInfo): void {
this.sessionMap.delete(closeSessionInfo.sessionId);
}
findNodes(findNodesInfo: sqlops.FindNodesInfo): Thenable<sqlops.ObjectExplorerFindNodesResponse> {
findNodes(findNodesInfo: azdata.FindNodesInfo): Thenable<azdata.ObjectExplorerFindNodesResponse> {
// TODO #3814 implement
let response: sqlops.ObjectExplorerFindNodesResponse = {
let response: azdata.ObjectExplorerFindNodesResponse = {
nodes: []
};
return Promise.resolve(response);
}
registerOnExpandCompleted(handler: (response: sqlops.ObjectExplorerExpandInfo) => any): void {
registerOnExpandCompleted(handler: (response: azdata.ObjectExplorerExpandInfo) => any): void {
this.expandCompleteEmitter.event(handler);
}
@@ -157,7 +157,7 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
this.appContext.apiWrapper.showErrorMessage(localize('sessionNotFound', 'Session for node {0} does not exist', node.nodePathValue));
} else {
let nodeInfo = node.getNodeInfo();
let expandInfo: sqlops.ExpandNodeInfo = {
let expandInfo: azdata.ExpandNodeInfo = {
nodePath: nodeInfo.nodePath,
sessionId: session.sessionId
};
@@ -181,7 +181,7 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
return sqlClusterSession;
}
async findSqlClusterNodeByContext<T extends TreeNode>(context: ICommandObjectExplorerContext | sqlops.ObjectExplorerContext): Promise<T> {
async findSqlClusterNodeByContext<T extends TreeNode>(context: ICommandObjectExplorerContext | azdata.ObjectExplorerContext): Promise<T> {
let node: T = undefined;
let explorerContext = 'explorerContext' in context ? context.explorerContext : context;
let sqlConnProfile = explorerContext.connectionProfile;
@@ -198,7 +198,7 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
return node;
}
public findSqlClusterSessionBySqlConnProfile(connectionProfile: sqlops.IConnectionProfile): SqlClusterSession {
public findSqlClusterSessionBySqlConnProfile(connectionProfile: azdata.IConnectionProfile): SqlClusterSession {
for (let session of this.sessionMap.values()) {
if (session.isMatchedSqlConnection(connectionProfile)) {
return session;
@@ -213,8 +213,8 @@ export class SqlClusterSession {
constructor(
private _sqlClusterConnection: SqlClusterConnection,
private _sqlSession: sqlops.ObjectExplorerSession,
private _sqlConnectionProfile: sqlops.IConnectionProfile,
private _sqlSession: azdata.ObjectExplorerSession,
private _sqlConnectionProfile: azdata.IConnectionProfile,
private _appContext: AppContext,
private _changeHandler: ITreeChangeHandler
) {
@@ -224,12 +224,12 @@ export class SqlClusterSession {
}
public get sqlClusterConnection(): SqlClusterConnection { return this._sqlClusterConnection; }
public get sqlSession(): sqlops.ObjectExplorerSession { return this._sqlSession; }
public get sqlConnectionProfile(): sqlops.IConnectionProfile { return this._sqlConnectionProfile; }
public get sqlSession(): azdata.ObjectExplorerSession { return this._sqlSession; }
public get sqlConnectionProfile(): azdata.IConnectionProfile { return this._sqlConnectionProfile; }
public get sessionId(): string { return this._sqlSession.sessionId; }
public get rootNode(): SqlClusterRootNode { return this._rootNode; }
public isMatchedSqlConnection(sqlConnProfile: sqlops.IConnectionProfile): boolean {
public isMatchedSqlConnection(sqlConnProfile: azdata.IConnectionProfile): boolean {
return this._sqlConnectionProfile.id === sqlConnProfile.id;
}
}
@@ -266,8 +266,8 @@ class SqlClusterRootNode extends TreeNode {
throw new Error('Not intended for use in a file explorer view.');
}
getNodeInfo(): sqlops.NodeInfo {
let nodeInfo: sqlops.NodeInfo = {
getNodeInfo(): azdata.NodeInfo {
let nodeInfo: azdata.NodeInfo = {
label: localize('rootLabel', 'Root'),
isLeaf: false,
errorMessage: undefined,
@@ -311,8 +311,8 @@ class DataServicesNode extends TreeNode {
throw new Error('Not intended for use in a file explorer view.');
}
getNodeInfo(): sqlops.NodeInfo {
let nodeInfo: sqlops.NodeInfo = {
getNodeInfo(): azdata.NodeInfo {
let nodeInfo: azdata.NodeInfo = {
label: localize('dataServicesLabel', 'Data Services'),
isLeaf: false,
errorMessage: undefined,

View File

@@ -5,7 +5,7 @@
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { ITreeNode } from './types';
@@ -74,5 +74,5 @@ export abstract class TreeNode implements ITreeNode {
abstract getChildren(refreshChildren: boolean): TreeNode[] | Promise<TreeNode[]>;
abstract getTreeItem(): vscode.TreeItem | Promise<vscode.TreeItem>;
abstract getNodeInfo(): sqlops.NodeInfo;
abstract getNodeInfo(): azdata.NodeInfo;
}

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
/**
* A tree node in the object explorer tree
@@ -13,7 +13,7 @@ import * as sqlops from 'sqlops';
* @interface ITreeNode
*/
export interface ITreeNode {
getNodeInfo(): sqlops.NodeInfo;
getNodeInfo(): azdata.NodeInfo;
getChildren(refreshChildren: boolean): ITreeNode[] | Promise<ITreeNode[]>;
}

View File

@@ -5,7 +5,7 @@
'use strict';
import { RequestType } from 'vscode-languageclient';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
// ------------------------------- < Resource Events > ------------------------------------
export namespace CreateFirewallRuleRequest {
@@ -18,7 +18,7 @@ export namespace HandleFirewallRuleRequest {
// Firewall rule interfaces
export interface CreateFirewallRuleParams {
account: sqlops.Account;
account: azdata.Account;
serverName: string;
startIpAddress: string;
endIpAddress: string;

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import { IConfig, ServerProvider } from 'service-downloader';
import { SqlOpsDataClient, SqlOpsFeature, ClientOptions } from 'dataprotocol-client';
import { ServerCapabilities, ClientCapabilities, RPCMessageType, ServerOptions, TransportKind } from 'vscode-languageclient';
@@ -39,16 +39,16 @@ class FireWallFeature extends SqlOpsFeature<any> {
protected registerProvider(options: any): Disposable {
const client = this._client;
let createFirewallRule = (account: sqlops.Account, firewallruleInfo: sqlops.FirewallRuleInfo): Thenable<sqlops.CreateFirewallRuleResponse> => {
let createFirewallRule = (account: azdata.Account, firewallruleInfo: azdata.FirewallRuleInfo): Thenable<azdata.CreateFirewallRuleResponse> => {
return client.sendRequest(CreateFirewallRuleRequest.type, asCreateFirewallRuleParams(account, firewallruleInfo));
};
let handleFirewallRule = (errorCode: number, errorMessage: string, connectionTypeId: string): Thenable<sqlops.HandleFirewallRuleResponse> => {
let handleFirewallRule = (errorCode: number, errorMessage: string, connectionTypeId: string): Thenable<azdata.HandleFirewallRuleResponse> => {
let params: HandleFirewallRuleParams = { errorCode: errorCode, errorMessage: errorMessage, connectionTypeId: connectionTypeId };
return client.sendRequest(HandleFirewallRuleRequest.type, params);
};
return sqlops.resources.registerResourceProvider({
return azdata.resources.registerResourceProvider({
displayName: 'Azure SQL Resource Provider', // TODO Localize
id: 'Microsoft.Azure.SQL.ResourceProvider',
settings: {
@@ -61,7 +61,7 @@ class FireWallFeature extends SqlOpsFeature<any> {
}
}
function asCreateFirewallRuleParams(account: sqlops.Account, params: sqlops.FirewallRuleInfo): CreateFirewallRuleParams {
function asCreateFirewallRuleParams(account: azdata.Account, params: azdata.FirewallRuleInfo): CreateFirewallRuleParams {
return {
account: account,
serverName: params.serverName,

View File

@@ -5,7 +5,7 @@
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
const localize = nls.loadMessageBundle();
@@ -48,9 +48,9 @@ export class OpenSparkJobSubmissionDialogCommand extends Command {
}
private async selectConnection(): Promise<SqlClusterConnection> {
let connectionList: sqlops.connection.Connection[] = await this.apiWrapper.getActiveConnections();
let connectionList: azdata.connection.Connection[] = await this.apiWrapper.getActiveConnections();
let displayList: string[] = new Array();
let connectionMap: Map<string, sqlops.connection.Connection> = new Map();
let connectionMap: Map<string, azdata.connection.Connection> = new Map();
if (connectionList && connectionList.length > 0) {
connectionList.forEach(conn => {
if (conn.providerName === constants.sqlProviderName) {
@@ -125,7 +125,7 @@ export class OpenSparkJobSubmissionDialogTask {
constructor(private appContext: AppContext, private outputChannel: vscode.OutputChannel) {
}
async execute(profile: sqlops.IConnectionProfile, ...args: any[]): Promise<void> {
async execute(profile: azdata.IConnectionProfile, ...args: any[]): Promise<void> {
try {
let sqlClusterConnection = SqlClusterLookUp.findSqlClusterConnection(profile, this.appContext);
if (!sqlClusterConnection) {

View File

@@ -5,7 +5,7 @@
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
@@ -14,12 +14,12 @@ import { AppContext } from '../../../appContext';
import { ApiWrapper } from '../../../apiWrapper';
export class SparkAdvancedTab {
private _tab: sqlops.window.DialogTab;
public get tab(): sqlops.window.DialogTab { return this._tab; }
private _tab: azdata.window.DialogTab;
public get tab(): azdata.window.DialogTab { return this._tab; }
private _referenceFilesInputBox: sqlops.InputBoxComponent;
private _referenceJARFilesInputBox: sqlops.InputBoxComponent;
private _referencePyFilesInputBox: sqlops.InputBoxComponent;
private _referenceFilesInputBox: azdata.InputBoxComponent;
private _referenceJARFilesInputBox: azdata.InputBoxComponent;
private _referencePyFilesInputBox: azdata.InputBoxComponent;
private get apiWrapper(): ApiWrapper {
return this.appContext.apiWrapper;
@@ -30,7 +30,7 @@ export class SparkAdvancedTab {
this._tab.registerContent(async (modelView) => {
let builder = modelView.modelBuilder;
let parentLayout: sqlops.FormItemLayout = {
let parentLayout: azdata.FormItemLayout = {
horizontal: false,
componentWidth: '400px'
};

View File

@@ -5,7 +5,7 @@
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import * as fspath from 'path';
import * as fs from 'fs';
@@ -22,19 +22,19 @@ import { SparkFileSource } from './sparkJobSubmissionService';
const localize = nls.loadMessageBundle();
export class SparkConfigurationTab {
private _tab: sqlops.window.DialogTab;
public get tab(): sqlops.window.DialogTab { return this._tab; }
private _tab: azdata.window.DialogTab;
public get tab(): azdata.window.DialogTab { return this._tab; }
private _jobNameInputBox: sqlops.InputBoxComponent;
private _sparkContextLabel: sqlops.TextComponent;
private _fileSourceDropDown: sqlops.DropDownComponent;
private _sparkSourceFileInputBox: sqlops.InputBoxComponent;
private _filePickerButton: sqlops.ButtonComponent;
private _sourceFlexContainer: sqlops.FlexContainer;
private _sourceFlexContainerWithHint: sqlops.FlexContainer;
private _localUploadDestinationLabel: sqlops.TextComponent;
private _mainClassInputBox: sqlops.InputBoxComponent;
private _argumentsInputBox: sqlops.InputBoxComponent;
private _jobNameInputBox: azdata.InputBoxComponent;
private _sparkContextLabel: azdata.TextComponent;
private _fileSourceDropDown: azdata.DropDownComponent;
private _sparkSourceFileInputBox: azdata.InputBoxComponent;
private _filePickerButton: azdata.ButtonComponent;
private _sourceFlexContainer: azdata.FlexContainer;
private _sourceFlexContainerWithHint: azdata.FlexContainer;
private _localUploadDestinationLabel: azdata.TextComponent;
private _mainClassInputBox: azdata.InputBoxComponent;
private _argumentsInputBox: azdata.InputBoxComponent;
private get apiWrapper(): ApiWrapper {
return this.appContext.apiWrapper;
@@ -46,7 +46,7 @@ export class SparkConfigurationTab {
this._tab.registerContent(async (modelView) => {
let builder = modelView.modelBuilder;
let parentLayout: sqlops.FormItemLayout = {
let parentLayout: azdata.FormItemLayout = {
horizontal: false,
componentWidth: '400px'
};
@@ -72,7 +72,7 @@ export class SparkConfigurationTab {
title: localize('sparkJobSubmission_SparkCluster', 'Spark Cluster')
}, parentLayout);
this._fileSourceDropDown = builder.dropDown().withProperties<sqlops.DropDownProperties>({
this._fileSourceDropDown = builder.dropDown().withProperties<azdata.DropDownProperties>({
values: [SparkFileSource.Local.toString(), SparkFileSource.HDFS.toString()],
value: (this._path) ? SparkFileSource.HDFS.toString() : SparkFileSource.Local.toString()
}).component();

View File

@@ -5,7 +5,7 @@
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import * as utils from '../../../utils';
@@ -22,7 +22,7 @@ import { SqlClusterConnection } from '../../../objectExplorerNodeProvider/connec
const localize = nls.loadMessageBundle();
export class SparkJobSubmissionDialog {
private _dialog: sqlops.window.Dialog;
private _dialog: azdata.window.Dialog;
private _dataModel: SparkJobSubmissionModel;
private _sparkConfigTab: SparkConfigurationTab;
private _sparkAdvancedTab: SparkAdvancedTab;
@@ -76,7 +76,7 @@ export class SparkJobSubmissionDialog {
);
}
private async onSubmit(op: sqlops.BackgroundOperation): Promise<void> {
private async onSubmit(op: azdata.BackgroundOperation): Promise<void> {
try {
this.outputChannel.show();
let msg = localize('sparkJobSubmission_SubmissionStartMessage',
@@ -86,15 +86,15 @@ export class SparkJobSubmissionDialog {
if (this._dataModel.isMainSourceFromLocal) {
try {
this.outputChannel.appendLine(this.addInfoTag(LocalizedConstants.sparkJobSubmissionPrepareUploadingFile(this._dataModel.localFileSourcePath, this._dataModel.hdfsFolderDestinationPath)));
op.updateStatus(sqlops.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionPrepareUploadingFile(this._dataModel.localFileSourcePath, this._dataModel.hdfsFolderDestinationPath));
op.updateStatus(azdata.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionPrepareUploadingFile(this._dataModel.localFileSourcePath, this._dataModel.hdfsFolderDestinationPath));
await this._dataModel.uploadFile(this._dataModel.localFileSourcePath, this._dataModel.hdfsFolderDestinationPath);
vscode.window.showInformationMessage(LocalizedConstants.sparkJobSubmissionUploadingFileSucceeded);
this.outputChannel.appendLine(this.addInfoTag(LocalizedConstants.sparkJobSubmissionUploadingFileSucceeded));
op.updateStatus(sqlops.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionUploadingFileSucceeded);
op.updateStatus(azdata.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionUploadingFileSucceeded);
} catch (error) {
vscode.window.showErrorMessage(LocalizedConstants.sparkJobSubmissionUploadingFileFailed(utils.getErrorMessage(error)));
this.outputChannel.appendLine(this.addErrorTag(LocalizedConstants.sparkJobSubmissionUploadingFileFailed(utils.getErrorMessage(error))));
op.updateStatus(sqlops.TaskStatus.Failed, LocalizedConstants.sparkJobSubmissionUploadingFileFailed(utils.getErrorMessage(error)));
op.updateStatus(azdata.TaskStatus.Failed, LocalizedConstants.sparkJobSubmissionUploadingFileFailed(utils.getErrorMessage(error)));
this.outputChannel.appendLine(LocalizedConstants.sparkJobSubmissionEndMessage);
return;
}
@@ -103,11 +103,11 @@ export class SparkJobSubmissionDialog {
// 2. Submit job to cluster.
let submissionSettings: SparkJobSubmissionInput = this.getSubmissionInput();
this.outputChannel.appendLine(this.addInfoTag(LocalizedConstants.sparkJobSubmissionPrepareSubmitJob(submissionSettings.jobName)));
op.updateStatus(sqlops.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionPrepareSubmitJob(submissionSettings.jobName));
op.updateStatus(azdata.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionPrepareSubmitJob(submissionSettings.jobName));
let livyBatchId = await this._dataModel.submitBatchJobByLivy(submissionSettings);
vscode.window.showInformationMessage(LocalizedConstants.sparkJobSubmissionSparkJobHasBeenSubmitted);
this.outputChannel.appendLine(this.addInfoTag(LocalizedConstants.sparkJobSubmissionSparkJobHasBeenSubmitted));
op.updateStatus(sqlops.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionSparkJobHasBeenSubmitted);
op.updateStatus(azdata.TaskStatus.InProgress, LocalizedConstants.sparkJobSubmissionSparkJobHasBeenSubmitted);
// 3. Get SparkHistory/YarnUI Url.
try {
@@ -116,24 +116,24 @@ export class SparkJobSubmissionDialog {
let sparkHistoryUrl = this._dataModel.generateSparkHistoryUIUrl(submissionSettings, appId);
vscode.window.showInformationMessage(LocalizedConstants.sparkJobSubmissionSparkHistoryLinkMessage(sparkHistoryUrl));
this.outputChannel.appendLine(this.addInfoTag(LocalizedConstants.sparkJobSubmissionSparkHistoryLinkMessage(sparkHistoryUrl)));
op.updateStatus(sqlops.TaskStatus.Succeeded, LocalizedConstants.sparkJobSubmissionSparkHistoryLinkMessage(sparkHistoryUrl));
op.updateStatus(azdata.TaskStatus.Succeeded, LocalizedConstants.sparkJobSubmissionSparkHistoryLinkMessage(sparkHistoryUrl));
/*
// Spark Tracking URl is not working now.
let sparkTrackingUrl = this._dataModel.generateSparkTrackingUIUrl(submissionSettings, appId);
vscode.window.showInformationMessage(LocalizedConstants.sparkJobSubmissionTrackingLinkMessage(sparkTrackingUrl));
this.outputChannel.appendLine(this.addInfoTag(LocalizedConstants.sparkJobSubmissionTrackingLinkMessage(sparkTrackingUrl)));
op.updateStatus(sqlops.TaskStatus.Succeeded, LocalizedConstants.sparkJobSubmissionTrackingLinkMessage(sparkTrackingUrl));
op.updateStatus(azdata.TaskStatus.Succeeded, LocalizedConstants.sparkJobSubmissionTrackingLinkMessage(sparkTrackingUrl));
*/
let yarnUIUrl = this._dataModel.generateYarnUIUrl(submissionSettings, appId);
vscode.window.showInformationMessage(LocalizedConstants.sparkJobSubmissionYarnUIMessage(yarnUIUrl));
this.outputChannel.appendLine(this.addInfoTag(LocalizedConstants.sparkJobSubmissionYarnUIMessage(yarnUIUrl)));
op.updateStatus(sqlops.TaskStatus.Succeeded, LocalizedConstants.sparkJobSubmissionYarnUIMessage(yarnUIUrl));
op.updateStatus(azdata.TaskStatus.Succeeded, LocalizedConstants.sparkJobSubmissionYarnUIMessage(yarnUIUrl));
} catch (error) {
vscode.window.showErrorMessage(LocalizedConstants.sparkJobSubmissionGetApplicationIdFailed(utils.getErrorMessage(error)));
this.outputChannel.appendLine(this.addErrorTag(LocalizedConstants.sparkJobSubmissionGetApplicationIdFailed(utils.getErrorMessage(error))));
op.updateStatus(sqlops.TaskStatus.Failed, LocalizedConstants.sparkJobSubmissionGetApplicationIdFailed(utils.getErrorMessage(error)));
op.updateStatus(azdata.TaskStatus.Failed, LocalizedConstants.sparkJobSubmissionGetApplicationIdFailed(utils.getErrorMessage(error)));
this.outputChannel.appendLine(LocalizedConstants.sparkJobSubmissionEndMessage);
return;
}
@@ -142,7 +142,7 @@ export class SparkJobSubmissionDialog {
} catch (error) {
vscode.window.showErrorMessage(LocalizedConstants.sparkJobSubmissionSubmitJobFailed(utils.getErrorMessage(error)));
this.outputChannel.appendLine(this.addErrorTag(LocalizedConstants.sparkJobSubmissionSubmitJobFailed(utils.getErrorMessage(error))));
op.updateStatus(sqlops.TaskStatus.Failed, LocalizedConstants.sparkJobSubmissionSubmitJobFailed(utils.getErrorMessage(error)));
op.updateStatus(azdata.TaskStatus.Failed, LocalizedConstants.sparkJobSubmissionSubmitJobFailed(utils.getErrorMessage(error)));
this.outputChannel.appendLine(LocalizedConstants.sparkJobSubmissionEndMessage);
}
}

View File

@@ -5,7 +5,7 @@
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
import * as fs from 'fs';
@@ -39,7 +39,7 @@ export class SparkJobSubmissionModel {
constructor(
private readonly _sqlClusterConnection: SqlClusterConnection,
private readonly _dialog: sqlops.window.Dialog,
private readonly _dialog: azdata.window.Dialog,
private readonly _appContext: AppContext,
requestService?: (args: any) => any) {
@@ -54,7 +54,7 @@ export class SparkJobSubmissionModel {
public get connection(): SqlClusterConnection { return this._sqlClusterConnection; }
public get dialogService(): SparkJobSubmissionService { return this._dialogService; }
public get dialog(): sqlops.window.Dialog { return this._dialog; }
public get dialog(): azdata.window.Dialog { return this._dialog; }
public isJarFile(): boolean {
if (this.hdfsSubmitFilePath) {
@@ -65,15 +65,15 @@ export class SparkJobSubmissionModel {
}
public showDialogError(message: string): void {
let errorLevel = sqlops.window.MessageLevel ? sqlops.window.MessageLevel : 0;
let errorLevel = azdata.window.MessageLevel ? azdata.window.MessageLevel : 0;
this._dialog.message = {
text: message,
level: <sqlops.window.MessageLevel>errorLevel
level: <azdata.window.MessageLevel>errorLevel
};
}
public showDialogInfo(message: string): void {
let infoLevel = sqlops.window.MessageLevel ? sqlops.window.MessageLevel.Information : 2;
let infoLevel = azdata.window.MessageLevel ? azdata.window.MessageLevel.Information : 2;
this._dialog.message = {
text: message,
level: infoLevel

View File

@@ -5,7 +5,7 @@
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { AppContext } from '../appContext';
import { getErrorMessage } from '../utils';
@@ -15,7 +15,7 @@ export class OpenSparkYarnHistoryTask {
constructor(private appContext: AppContext) {
}
async execute(sqlConnProfile: sqlops.IConnectionProfile, isSpark: boolean): Promise<void> {
async execute(sqlConnProfile: azdata.IConnectionProfile, isSpark: boolean): Promise<void> {
try {
let sqlClusterConnection = SqlClusterLookUp.findSqlClusterConnection(sqlConnProfile, this.appContext);
if (!sqlClusterConnection)

View File

@@ -9,27 +9,27 @@ import * as childProcess from 'child_process';
import * as fs from 'fs-extra';
import * as nls from 'vscode-nls';
import * as path from 'path';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as which from 'which';
import * as Constants from '../constants';
const localize = nls.loadMessageBundle();
export function getDropdownValue(dropdownValue: string | sqlops.CategoryValue): string {
export function getDropdownValue(dropdownValue: string | azdata.CategoryValue): string {
if (typeof(dropdownValue) === 'string') {
return <string>dropdownValue;
} else {
return dropdownValue ? (<sqlops.CategoryValue>dropdownValue).name : undefined;
return dropdownValue ? (<azdata.CategoryValue>dropdownValue).name : undefined;
}
}
export function getServerAddressFromName(connection: sqlops.ConnectionInfo | string): string {
export function getServerAddressFromName(connection: azdata.ConnectionInfo | string): string {
// Strip TDS port number from the server URI
if ((<sqlops.ConnectionInfo>connection).options && (<sqlops.ConnectionInfo>connection).options['host']) {
return (<sqlops.ConnectionInfo>connection).options['host'].split(',')[0].split(':')[0];
} else if ((<sqlops.ConnectionInfo>connection).options && (<sqlops.ConnectionInfo>connection).options['server']) {
return (<sqlops.ConnectionInfo>connection).options['server'].split(',')[0].split(':')[0];
if ((<azdata.ConnectionInfo>connection).options && (<azdata.ConnectionInfo>connection).options['host']) {
return (<azdata.ConnectionInfo>connection).options['host'].split(',')[0].split(':')[0];
} else if ((<azdata.ConnectionInfo>connection).options && (<azdata.ConnectionInfo>connection).options['server']) {
return (<azdata.ConnectionInfo>connection).options['server'].split(',')[0].split(':')[0];
} else {
return (<string>connection).split(',')[0].split(':')[0];
}
@@ -141,7 +141,7 @@ export function executeStreamedCommand(cmd: string, outputChannel?: vscode.Outpu
});
}
export function isObjectExplorerContext(object: any): object is sqlops.ObjectExplorerContext {
export function isObjectExplorerContext(object: any): object is azdata.ObjectExplorerContext {
return 'connectionProfile' in object && 'isConnectionNode' in object;
}

View File

@@ -5,7 +5,7 @@
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as constants from './constants';
import * as UUID from 'vscode-languageclient/lib/utils/uuid';
import { AppContext } from './appContext';
@@ -15,12 +15,12 @@ import { MssqlObjectExplorerNodeProvider } from './objectExplorerNodeProvider/ob
export function findSqlClusterConnection(
obj: ICommandObjectExplorerContext | sqlops.IConnectionProfile,
obj: ICommandObjectExplorerContext | azdata.IConnectionProfile,
appContext: AppContext) : SqlClusterConnection {
if (!obj || !appContext) { return undefined; }
let sqlConnProfile: sqlops.IConnectionProfile;
let sqlConnProfile: azdata.IConnectionProfile;
if ('type' in obj && obj.type === constants.ObjectExplorerService
&& 'explorerContext' in obj && obj.explorerContext && obj.explorerContext.connectionProfile) {
sqlConnProfile = obj.explorerContext.connectionProfile;
@@ -35,7 +35,7 @@ export function findSqlClusterConnection(
return sqlClusterConnection;
}
function findSqlClusterConnectionBySqlConnProfile(sqlConnProfile: sqlops.IConnectionProfile, appContext: AppContext): SqlClusterConnection {
function findSqlClusterConnectionBySqlConnProfile(sqlConnProfile: azdata.IConnectionProfile, appContext: AppContext): SqlClusterConnection {
if (!sqlConnProfile || !appContext) { return undefined; }
let sqlOeNodeProvider = appContext.getService<MssqlObjectExplorerNodeProvider>(constants.ObjectExplorerService);
@@ -48,7 +48,7 @@ function findSqlClusterConnectionBySqlConnProfile(sqlConnProfile: sqlops.IConnec
}
export async function getSqlClusterConnection(
obj: sqlops.IConnectionProfile | sqlops.connection.Connection | ICommandObjectExplorerContext): Promise<ConnectionParam> {
obj: azdata.IConnectionProfile | azdata.connection.Connection | ICommandObjectExplorerContext): Promise<ConnectionParam> {
if (!obj) { return undefined; }
@@ -66,13 +66,13 @@ export async function getSqlClusterConnection(
return sqlClusterConnInfo;
}
async function createSqlClusterConnInfo(sqlConnInfo: sqlops.IConnectionProfile | sqlops.connection.Connection): Promise<ConnectionParam> {
async function createSqlClusterConnInfo(sqlConnInfo: azdata.IConnectionProfile | azdata.connection.Connection): Promise<ConnectionParam> {
if (!sqlConnInfo) { return undefined; }
let connectionId: string = 'id' in sqlConnInfo ? sqlConnInfo.id : sqlConnInfo.connectionId;
if (!connectionId) { return undefined; }
let serverInfo = await sqlops.connection.getServerInfo(connectionId);
let serverInfo = await azdata.connection.getServerInfo(connectionId);
if (!serverInfo || !serverInfo.options) { return undefined; }
let endpoints: IEndpoint[] = serverInfo.options[constants.clusterEndpointsProperty];
@@ -81,7 +81,7 @@ async function createSqlClusterConnInfo(sqlConnInfo: sqlops.IConnectionProfile |
let index = endpoints.findIndex(ep => ep.serviceName === constants.hadoopKnoxEndpointName);
if (index < 0) { return undefined; }
let credentials = await sqlops.connection.getCredentials(connectionId);
let credentials = await azdata.connection.getCredentials(connectionId);
if (!credentials) { return undefined; }
let clusterConnInfo = <ConnectionParam>{
@@ -99,12 +99,12 @@ async function createSqlClusterConnInfo(sqlConnInfo: sqlops.IConnectionProfile |
return clusterConnInfo;
}
function connProfileToConnectionParam(connectionProfile: sqlops.IConnectionProfile): ConnectionParam {
function connProfileToConnectionParam(connectionProfile: azdata.IConnectionProfile): ConnectionParam {
let result = Object.assign(connectionProfile, { connectionId: connectionProfile.id });
return <ConnectionParam>result;
}
function connToConnectionParam(connection: sqlops.connection.Connection): ConnectionParam {
function connToConnectionParam(connection: azdata.connection.Connection): ConnectionParam {
let connectionId = connection.connectionId;
let options = connection.options;
let result = Object.assign(connection,
@@ -124,7 +124,7 @@ interface IEndpoint {
port: number;
}
class ConnectionParam implements sqlops.connection.Connection, sqlops.IConnectionProfile, sqlops.ConnectionInfo
class ConnectionParam implements azdata.connection.Connection, azdata.IConnectionProfile, azdata.ConnectionInfo
{
public connectionName: string;
public serverName: string;

View File

@@ -5,4 +5,6 @@
/// <reference path='../../../../src/sql/sqlops.d.ts'/>
/// <reference path='../../../../src/sql/sqlops.proposed.d.ts'/>
/// <reference path='../../../../src/sql/azdata.d.ts'/>
/// <reference path='../../../../src/sql/azdata.proposed.d.ts'/>
/// <reference path='../../../../src/vs/vscode.d.ts'/>

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as path from 'path';
import * as crypto from 'crypto';
@@ -174,7 +174,7 @@ export function getErrorMessage(error: Error | string): string {
return (error instanceof Error) ? error.message : error;
}
export function isObjectExplorerContext(object: any): object is sqlops.ObjectExplorerContext {
export function isObjectExplorerContext(object: any): object is azdata.ObjectExplorerContext {
return 'connectionProfile' in object && 'isConnectionNode' in object;
}
@@ -184,7 +184,7 @@ export function getUserHome(): string {
export async function getClusterEndpoint(profileId: string, serviceName: string): Promise<IEndpoint> {
let serverInfo: sqlops.ServerInfo = await sqlops.connection.getServerInfo(profileId);
let serverInfo: azdata.ServerInfo = await azdata.connection.getServerInfo(profileId);
if (!serverInfo || !serverInfo.options) {
return undefined;
}