mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 01:25:38 -05:00
* Changed azdata to az in azcli extension and resource-deployment, and some arc. Removed user, pass, url from controller connect blade. Commented out tests. Ported over work from old branch. * Changed unit tests, all unit tests passing. Changed parameters to new ones, fixed some Controller Connect issues. * Connect data controller and create dc working. * Changed az back to azdata in necessary places in resource-deployment. * Changed notebook values and added namespace to some params. * Added some changes from PR to this branch * Changed azdata.ts to az.ts and changed subscription parameter * Brought over changes from azcli PR into this branch. * added endpoint, username, password to getIsPassword * Changed notebooks to use proper az params, hard coded in some values to verify it is working, removed some variableNames from package.json. * Changed -sc to --storage-class in notebook * Added namespace to SQL deploy, deleted dc create in api * Deleted more dc create code and uncommented findAz() with unfinished work on Do Not Ask Again. * Removed (preview) from extensions/arc and extensions/azcli excluding preview:true in package.json * Commented out install/update prompts until DoNotAskAgain is implemented * Fixed bugs: JSON Output errors are now being caught, --infrastructure now has a required UI component with dropdown options, config page loads properly, SQL create flags use full names instead of shortnames. * Adds validation to pg extensions and bug fixes (#16486) * Extensions * Server parameters * Change locaiton of postgres extensions, pr fixes * Change location of list * List spacing * Commented out Don't Ask Again prompt implementation. * Uncommented header of a test file. * Added Azure CLI arcdata extension to Prerequisites * Reverted package.json and yarn.lock * Took away casting of stderr and stdout in executeCommand. * Deleted override function for initializeFields in connectControllerDialog.ts * Removed fakeAzApi for testing and added back in (Preview) * Removed en-us from python notebook links. * Deleted azdata tool from tool tests in resource-deployment * Deleted another instance of azdata in tool test * Add back in azdata tooltype * Remove en-us * Replaced AzdataTool in typings * Reverting adding azdata tool back in * Changed Azdata to AzdataToolOld * Added back azdata tool type * Added AzdataToolOld to tool types * fix test Co-authored-by: Candice Ye <canye@microsoft.com> Co-authored-by: nasc17 <nasc@microsoft.com> Co-authored-by: nasc17 <69922333+nasc17@users.noreply.github.com> Co-authored-by: chgagnon <chgagnon@microsoft.com>
140 lines
4.7 KiB
TypeScript
140 lines
4.7 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import * as azExt from 'az-ext';
|
|
import { IAzTool } from './az';
|
|
import Logger from './common/logger';
|
|
import { NoAzureCLIError } from './common/utils';
|
|
import * as loc from './localizedConstants';
|
|
import { AzToolService } from './services/azToolService';
|
|
|
|
/**
|
|
* Validates that :
|
|
* - Az is installed
|
|
* @param az The az tool to check
|
|
*/
|
|
export function validateAz(az: IAzTool | undefined) {
|
|
throwIfNoAz(az);
|
|
}
|
|
|
|
export function throwIfNoAz(localAz: IAzTool | undefined): asserts localAz {
|
|
if (!localAz) {
|
|
Logger.log(loc.noAzureCLI);
|
|
throw new NoAzureCLIError();
|
|
}
|
|
}
|
|
|
|
export function getExtensionApi(azToolService: AzToolService): azExt.IExtension {
|
|
return {
|
|
az: getAzApi(azToolService)
|
|
};
|
|
}
|
|
|
|
export function getAzApi(azToolService: AzToolService): azExt.IAzApi {
|
|
return {
|
|
arcdata: {
|
|
dc: {
|
|
endpoint: {
|
|
list: async (namespace: string, additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
|
validateAz(azToolService.localAz);
|
|
return azToolService.localAz!.arcdata.dc.endpoint.list(namespace, additionalEnvVars);
|
|
}
|
|
},
|
|
config: {
|
|
list: async (additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
|
validateAz(azToolService.localAz);
|
|
return azToolService.localAz!.arcdata.dc.config.list(additionalEnvVars);
|
|
},
|
|
show: async (namespace: string, additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
|
validateAz(azToolService.localAz);
|
|
return azToolService.localAz!.arcdata.dc.config.show(namespace, additionalEnvVars);
|
|
}
|
|
}
|
|
}
|
|
},
|
|
postgres: {
|
|
arcserver: {
|
|
delete: async (name: string, namespace: string, additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
|
validateAz(azToolService.localAz);
|
|
return azToolService.localAz!.postgres.arcserver.delete(name, namespace, additionalEnvVars);
|
|
},
|
|
list: async (namespace: string, additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
|
validateAz(azToolService.localAz);
|
|
return azToolService.localAz!.postgres.arcserver.list(namespace, additionalEnvVars);
|
|
},
|
|
show: async (name: string, namespace: string, additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
|
validateAz(azToolService.localAz);
|
|
return azToolService.localAz!.postgres.arcserver.show(name, namespace, additionalEnvVars);
|
|
},
|
|
edit: async (
|
|
name: string,
|
|
args: {
|
|
adminPassword?: boolean;
|
|
coresLimit?: string;
|
|
coresRequest?: string;
|
|
coordinatorEngineSettings?: string;
|
|
engineSettings?: string;
|
|
extensions?: string;
|
|
memoryLimit?: string;
|
|
memoryRequest?: string;
|
|
noWait?: boolean;
|
|
port?: number;
|
|
replaceEngineSettings?: boolean;
|
|
workerEngineSettings?: string;
|
|
workers?: number;
|
|
},
|
|
namespace: string,
|
|
additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
|
validateAz(azToolService.localAz);
|
|
return azToolService.localAz!.postgres.arcserver.edit(name, args, namespace, additionalEnvVars);
|
|
}
|
|
}
|
|
},
|
|
sql: {
|
|
miarc: {
|
|
delete: async (name: string, namespace: string, additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
|
validateAz(azToolService.localAz);
|
|
return azToolService.localAz!.sql.miarc.delete(name, namespace, additionalEnvVars);
|
|
},
|
|
list: async (namespace: string, additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
|
validateAz(azToolService.localAz);
|
|
return azToolService.localAz!.sql.miarc.list(namespace, additionalEnvVars);
|
|
},
|
|
show: async (name: string, namespace: string, additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
|
validateAz(azToolService.localAz);
|
|
return azToolService.localAz!.sql.miarc.show(name, namespace, additionalEnvVars);
|
|
},
|
|
edit: async (
|
|
name: string,
|
|
args: {
|
|
coresLimit?: string;
|
|
coresRequest?: string;
|
|
memoryLimit?: string;
|
|
memoryRequest?: string;
|
|
noWait?: boolean;
|
|
},
|
|
namespace: string,
|
|
additionalEnvVars?: azExt.AdditionalEnvVars
|
|
) => {
|
|
validateAz(azToolService.localAz);
|
|
return azToolService.localAz!.sql.miarc.edit(name, args, namespace, additionalEnvVars);
|
|
}
|
|
}
|
|
},
|
|
getPath: async () => {
|
|
throwIfNoAz(azToolService.localAz);
|
|
return azToolService.localAz.getPath();
|
|
},
|
|
getSemVersion: async () => {
|
|
throwIfNoAz(azToolService.localAz);
|
|
return azToolService.localAz.getSemVersion();
|
|
},
|
|
version: async () => {
|
|
throwIfNoAz(azToolService.localAz);
|
|
return azToolService.localAz.version();
|
|
}
|
|
};
|
|
}
|