diff --git a/.eslintignore b/.eslintignore
index 1007fbc1a4..4bb33f1bd5 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -24,8 +24,6 @@
**/node_modules/**
**/extensions/**/out/**
**/extensions/**/build/**
-/extensions/big-data-cluster/src/bigDataCluster/controller/apiGenerated.ts
-/extensions/big-data-cluster/src/bigDataCluster/controller/clusterApiGenerated2.ts
**/extensions/**/colorize-fixtures/**
**/extensions/html-language-features/server/lib/jquery.d.ts
/extensions/markdown-language-features/media/**
diff --git a/.eslintrc.json b/.eslintrc.json
index 481e18997c..332639a702 100755
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1147,7 +1147,6 @@
"extensions/azuremonitor/src/prompts/**",
"extensions/azuremonitor/src/typings/findRemove.d.ts",
"extensions/kusto/src/prompts/**",
- "extensions/mssql/src/hdfs/webhdfs.ts",
"extensions/mssql/src/prompts/**",
"extensions/mssql/src/typings/bufferStreamReader.d.ts",
"extensions/mssql/src/typings/findRemove.d.ts",
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 489be31fe8..088411705a 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -6,7 +6,6 @@
/extensions/arc/ @Charles-Gagnon @swells @candiceye
/extensions/azcli/ @Charles-Gagnon @swells @candiceye
/extensions/azurecore/ @cssuh @cheenamalhotra
-/extensions/big-data-cluster/ @Charles-Gagnon
/extensions/dacpac/ @kisantia
/extensions/notebook @azure-data-studio-notebook-devs
/extensions/query-history/ @Charles-Gagnon
diff --git a/build/azure-pipelines/win32/sql-product-test-win32.yml b/build/azure-pipelines/win32/sql-product-test-win32.yml
index d5efdd4717..004023454e 100644
--- a/build/azure-pipelines/win32/sql-product-test-win32.yml
+++ b/build/azure-pipelines/win32/sql-product-test-win32.yml
@@ -41,7 +41,7 @@ steps:
inputs:
azureSubscription: 'ClientToolsInfra_670062 (88d5392f-a34f-4769-b405-f597fc533613)'
KeyVaultName: SqlToolsSecretStore
- SecretsFilter: 'ads-integration-test-azure-server,ads-integration-test-azure-server-password,ads-integration-test-azure-server-username,ads-integration-test-bdc-server,ads-integration-test-bdc-server-password,ads-integration-test-bdc-server-username,ads-integration-test-standalone-server,ads-integration-test-standalone-server-password,ads-integration-test-standalone-server-username,ads-integration-test-standalone-server-2019,ads-integration-test-standalone-server-password-2019,ads-integration-test-standalone-server-username-2019'
+ SecretsFilter: 'ads-integration-test-azure-server,ads-integration-test-azure-server-password,ads-integration-test-azure-server-username,ads-integration-test-standalone-server,ads-integration-test-standalone-server-password,ads-integration-test-standalone-server-username,ads-integration-test-standalone-server-2019,ads-integration-test-standalone-server-password-2019,ads-integration-test-standalone-server-username-2019'
- powershell: |
. build/azure-pipelines/win32/exec.ps1
@@ -54,9 +54,6 @@ steps:
condition: and(succeeded(), and(eq(variables['RUN_TESTS'], 'true'), ne(variables['RUN_INTEGRATION_TESTS'], 'false')))
displayName: Run stable tests
env:
- BDC_BACKEND_USERNAME: $(ads-integration-test-bdc-server-username)
- BDC_BACKEND_PWD: $(ads-integration-test-bdc-server-password)
- BDC_BACKEND_HOSTNAME: $(ads-integration-test-bdc-server)
STANDALONE_SQL_USERNAME: $(ads-integration-test-standalone-server-username)
STANDALONE_SQL_PWD: $(ads-integration-test-standalone-server-password)
STANDALONE_SQL: $(ads-integration-test-standalone-server)
diff --git a/build/filters.js b/build/filters.js
index 594741196f..708bf25078 100644
--- a/build/filters.js
+++ b/build/filters.js
@@ -152,8 +152,6 @@ module.exports.indentationFilter = [
'!extensions/sql-database-projects/src/test/baselines/*.json',
'!extensions/sql-database-projects/src/test/baselines/*.sqlproj',
'!extensions/sql-database-projects/BuildDirectory/SystemDacpacs/**',
- '!extensions/big-data-cluster/src/bigDataCluster/controller/apiGenerated.ts',
- '!extensions/big-data-cluster/src/bigDataCluster/controller/clusterApiGenerated2.ts',
'!resources/linux/snap/electron-launch',
'!extensions/markdown-language-features/media/*.js',
'!extensions/simple-browser/media/*.js',
@@ -202,7 +200,6 @@ module.exports.copyrightFilter = [
'!extensions/import/flatfileimportservice/**',
'!extensions/kusto/src/prompts/**',
'!extensions/mssql/sqltoolsservice/**',
- '!extensions/mssql/src/hdfs/webhdfs.ts',
'!extensions/mssql/src/prompts/**',
'!extensions/notebook/resources/jupyter_config/**',
'!extensions/notebook/src/intellisense/text.ts',
@@ -257,8 +254,6 @@ module.exports.tsFormattingFilter = [
'!extensions/html-language-features/server/lib/jquery.d.ts',
// {{SQL CARBON EDIT}}
- '!extensions/big-data-cluster/src/bigDataCluster/controller/apiGenerated.ts',
- '!extensions/big-data-cluster/src/bigDataCluster/controller/tokenApiGenerated.ts',
'!src/vs/workbench/services/themes/common/textMateScopeMatcher.ts', // skip this because we have no plans on touching this and its not ours
'!src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.ts', // skip this because known issue
'!build/**/*'
diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
index 45c216d03a..3a669fce9f 100644
--- a/build/gulpfile.reh.js
+++ b/build/gulpfile.reh.js
@@ -448,7 +448,7 @@ function packagePkgTask(platform, arch, pkgTarget) {
// rebuild extensions that contain native npm modules or have conditional webpack rules
// when building with the web .yarnrc settings (e.g. runtime=node, etc.)
// this is needed to have correct module set published with desired ABI
- const rebuildExtensions = ['big-data-cluster', 'mssql', 'notebook'];
+ const rebuildExtensions = ['mssql', 'notebook'];
const EXTENSIONS = path.join(REPO_ROOT, 'extensions');
function exec(cmdLine, cwd) {
console.log(cmdLine);
diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
index 6afe661808..dcb4277c5a 100644
--- a/build/gulpfile.vscode.js
+++ b/build/gulpfile.vscode.js
@@ -125,7 +125,6 @@ const extensionsFilter = filter([
'**/azcli.xlf',
'**/azurecore.xlf',
'**/azurehybridtoolkit.xlf',
- '**/big-data-cluster.xlf',
'**/cms.xlf',
'**/dacpac.xlf',
'**/git.xlf',
diff --git a/build/lib/extensions.ts b/build/lib/extensions.ts
index be2e1d7b30..f72cd0dea4 100644
--- a/build/lib/extensions.ts
+++ b/build/lib/extensions.ts
@@ -328,7 +328,6 @@ export const vscodeExternalExtensions = [
// extensions that require a rebuild since they have native parts
const rebuildExtensions = [
- 'big-data-cluster',
'mssql'
];
diff --git a/build/npm/dirs.js b/build/npm/dirs.js
index eda24d884a..d80d0c98b9 100644
--- a/build/npm/dirs.js
+++ b/build/npm/dirs.js
@@ -17,7 +17,6 @@ exports.dirs = [
'extensions/azurecore',
'extensions/azurehybridtoolkit',
'extensions/azuremonitor',
- 'extensions/big-data-cluster',
'extensions/cms',
'extensions/configuration-editing',
'extensions/dacpac',
diff --git a/extensions/big-data-cluster/.eslintrc.json b/extensions/big-data-cluster/.eslintrc.json
deleted file mode 100644
index 77cd8b61f8..0000000000
--- a/extensions/big-data-cluster/.eslintrc.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "parserOptions": {
- "project": "./extensions/big-data-cluster/tsconfig.json"
- },
- "rules": {
- // Disabled until the issues can be fixed
- "@typescript-eslint/explicit-function-return-type": ["off"]
- }
-}
diff --git a/extensions/big-data-cluster/.gitignore b/extensions/big-data-cluster/.gitignore
deleted file mode 100644
index dfacd4d5b4..0000000000
--- a/extensions/big-data-cluster/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*.vsix
\ No newline at end of file
diff --git a/extensions/big-data-cluster/.vscodeignore b/extensions/big-data-cluster/.vscodeignore
deleted file mode 100644
index 8c2a960c91..0000000000
--- a/extensions/big-data-cluster/.vscodeignore
+++ /dev/null
@@ -1,14 +0,0 @@
-.gitignore
-instructions.txt
-src/**
-out/**
-extension.webpack.config.js
-tsconfig.json
-yarn.lock
-
-node_modules
-!node_modules/@microsoft/ads-kerberos/package.json
-!node_modules/@microsoft/ads-kerberos/LICENSE
-!node_modules/@microsoft/ads-kerberos/lib
-!node_modules/@microsoft/ads-kerberos/index.js
-!node_modules/@microsoft/ads-kerberos/build/Release/kerberos.node
diff --git a/extensions/big-data-cluster/README.md b/extensions/big-data-cluster/README.md
deleted file mode 100644
index 1f8c185a2b..0000000000
--- a/extensions/big-data-cluster/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# Microsoft SQL Server Big Data Cluster Extension for Azure Data Studio
-
-Welcome to Microsoft SQL Server Big Data Cluster Extension for Azure Data Studio!
-
-## Code of Conduct
-
-This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
-
-## Privacy Statement
-
-The [Microsoft Enterprise and Developer Privacy Statement](https://privacy.microsoft.com/privacystatement) describes the privacy statement of this software.
-
-## License
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-
-Licensed under the [Source EULA](https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt).
diff --git a/extensions/big-data-cluster/extension.webpack.config.js b/extensions/big-data-cluster/extension.webpack.config.js
deleted file mode 100644
index 248726ff49..0000000000
--- a/extensions/big-data-cluster/extension.webpack.config.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-//@ts-check
-
-'use strict';
-
-const withDefaults = require('../shared.webpack.config');
-
-module.exports = withDefaults({
- context: __dirname,
- entry: {
- extension: './src/extension.ts'
- },
- externals: {
- '@microsoft/ads-kerberos': 'commonjs @microsoft/ads-kerberos'
- }
-});
diff --git a/extensions/big-data-cluster/images/extension.png b/extensions/big-data-cluster/images/extension.png
deleted file mode 100644
index c86d6d1e00..0000000000
Binary files a/extensions/big-data-cluster/images/extension.png and /dev/null differ
diff --git a/extensions/big-data-cluster/images/sql_bdc.svg b/extensions/big-data-cluster/images/sql_bdc.svg
deleted file mode 100644
index 07e4a1cca4..0000000000
--- a/extensions/big-data-cluster/images/sql_bdc.svg
+++ /dev/null
@@ -1,38 +0,0 @@
-
diff --git a/extensions/big-data-cluster/instructions.txt b/extensions/big-data-cluster/instructions.txt
deleted file mode 100644
index 98223b140c..0000000000
--- a/extensions/big-data-cluster/instructions.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-How to update the Swagger-generated API to contact the controller
-
-## BdcRouter API:
-1. You need to get the API specification. Long-term you should be able to get from the server,
-but for now go to the internal repository and find the checked in SwaggerClient.yaml there.
-
-2. Copy the content from there, and add into https://editor.swagger.io/
-3. Choose Generate Client, and choose Typescript-Node as the client to generate
-4. This will download a zip file. Open it and copy contents of api.ts
-5. Copy this content to apiGenerated.ts
-- keep the copyright header and everything above the let defaultBasePath = xyz line,
-- Override the rest of the file
-6. Format the apiGenerated.ts file so it passes gulp hygiene
-
-## TokenRouter and other APIs:
-1. Get the API spec. This is available from a cluster at the address https://:30080/docs/swagger.json, where is the controller IP address.
-2. Copy the content from there, and add convert from OpenApi 3.0 to Swagger 2.0 so we can use the Typescript-Node client generated by https://editor.swagger.io/.
-Various converter tools are online. Alternatively, we might be able to use a different generator that has this client type (e.g. npm package @openapitools/openapi-generator-cli) but some require Java install.
-3. Copy the converted Swagger 2.0 spec into https://editor.swagger.io/
-4. Choose Generate Client, and choose Typescript-Node as the client to generate
-5. This will download a zip file. Open it and copy contents of api.ts
-6. Copy this content to tokenApiGenerated.ts
-- keep the copyright header and everything above the let defaultBasePath = xyz line,
-- Override the rest of the file
-7. Format the tokenApiGenerated.ts file so it passes gulp hygiene
diff --git a/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-aks.ipynb b/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-aks.ipynb
deleted file mode 100644
index e5df66284a..0000000000
--- a/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-aks.ipynb
+++ /dev/null
@@ -1,430 +0,0 @@
-{
- "metadata": {
- "kernelspec": {
- "name": "python3",
- "display_name": "Python 3"
- },
- "language_info": {
- "name": "python",
- "version": "3.6.6",
- "mimetype": "text/x-python",
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "pygments_lexer": "ipython3",
- "nbconvert_exporter": "python",
- "file_extension": ".py"
- }
- },
- "nbformat_minor": 2,
- "nbformat": 4,
- "cells": [
- {
- "cell_type": "markdown",
- "source": [
- "\n",
- " \n",
- "## Create Azure Kubernetes Service cluster and deploy SQL Server 2019 Big Data Cluster\n",
- " \n",
- "This notebook walks through the process of creating a new Azure Kubernetes Service cluster first, and then deploys a SQL Server 2019 Big Data Cluster on the newly created AKS cluster.\n",
- " \n",
- "* Follow the instructions in the **Prerequisites** cell to install the tools if not already installed.\n",
- "* The **Required information** will check and prompt you for password if it is not set in the environment variable. The password will be used to access the cluster controller, SQL Server, and Knox.\n",
- "\n",
- "Please press the \"Run all\" button to run the notebook"
- ],
- "metadata": {
- "azdata_cell_guid": "4f6bc3bc-3592-420a-b534-384011189005"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Prerequisites**\n",
- "Ensure the following tools are installed and added to PATH before proceeding.\n",
- "\n",
- "|Tools|Description|Installation|\n",
- "|---|---|---|\n",
- "|Azure CLI |Command-line tool for managing Azure services. Used to create AKS cluster | [Installation](https://docs.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest) |\n",
- "|kubectl | Command-line tool for monitoring the underlying Kubernetes cluster | [Installation](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-using-native-package-management) |\n",
- "|azdata | Command-line tool for installing and managing a Big Data Cluster |[Installation](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-azdata?view=sqlallproducts-allversions) |"
- ],
- "metadata": {
- "azdata_cell_guid": "d949980e-ad3f-4d02-ae84-7e4fbb19a087"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Setup**"
- ],
- "metadata": {
- "azdata_cell_guid": "a56d3413-a730-4997-b5c2-c8abd972757e"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "import pandas,sys,os,json,html,getpass,time\n",
- "pandas_version = pandas.__version__.split('.')\n",
- "pandas_major = int(pandas_version[0])\n",
- "pandas_minor = int(pandas_version[1])\n",
- "pandas_patch = int(pandas_version[2])\n",
- "if not (pandas_major > 0 or (pandas_major == 0 and pandas_minor > 24) or (pandas_major == 0 and pandas_minor == 24 and pandas_patch >= 2)):\n",
- " sys.exit('Please upgrade the Notebook dependency before you can proceed, you can do it by running the \"Reinstall Notebook dependencies\" command in command palette (View menu -> Command Palette…).')\n",
- "def run_command(command):\n",
- " print(\"Executing: \" + command)\n",
- " !{command}\n",
- " if _exit_code != 0:\n",
- " sys.exit(f'Command execution failed with exit code: {str(_exit_code)}.\\n\\t{command}\\n')\n",
- " print(f'Successfully executed: {command}')"
- ],
- "metadata": {
- "azdata_cell_guid": "326645cf-022a-47f2-8aff-37de71da8955",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Set variables**\n",
- "Generated by Azure Data Studio using the values collected in the Deploy Big Data Cluster wizard"
- ],
- "metadata": {
- "azdata_cell_guid": "8716915b-1439-431b-ab0a-0221ef94cb7f"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Check dependencies**"
- ],
- "metadata": {
- "azdata_cell_guid": "db8b1e21-eb2c-4c35-b973-bc4ef38bb1d0"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command('kubectl version --client=true')\n",
- "run_command('azdata --version')\n",
- "run_command('az --version')"
- ],
- "metadata": {
- "azdata_cell_guid": "9361deaf-28b1-4d02-912d-2011cae97e8a",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Required information**"
- ],
- "metadata": {
- "azdata_cell_guid": "720c200c-322a-49dd-9aa3-8bf7946aa251"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "invoked_by_wizard = \"AZDATA_NB_VAR_BDC_ADMIN_PASSWORD\" in os.environ\n",
- "if invoked_by_wizard:\n",
- " mssql_password = os.environ[\"AZDATA_NB_VAR_BDC_ADMIN_PASSWORD\"]\n",
- "else:\n",
- " mssql_password = getpass.getpass(prompt = 'SQL Server 2019 Big Data Cluster controller password')\n",
- " if mssql_password == \"\":\n",
- " sys.exit(f'Password is required.')\n",
- " confirm_password = getpass.getpass(prompt = 'Confirm password')\n",
- " if mssql_password != confirm_password:\n",
- " sys.exit(f'Passwords do not match.')\n",
- "print('You can also use the controller password to access Knox and SQL Server.')"
- ],
- "metadata": {
- "azdata_cell_guid": "17e5d087-7128-4d02-8c16-fe1ddee675e5",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Login to Azure**\n",
- "\n",
- "This will open a web browser window to enable credentials to be entered. If this cells is hanging forever, it might be because your Web browser windows is waiting for you to enter your Azure credentials!\n",
- ""
- ],
- "metadata": {
- "azdata_cell_guid": "baddf2d9-93ee-4c42-aaf1-b42116bb1912"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'az login')"
- ],
- "metadata": {
- "azdata_cell_guid": "8f1404a6-216d-49fb-b6ad-81beeea50083",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "\n",
- "### **Set active Azure subscription**"
- ],
- "metadata": {
- "azdata_cell_guid": "230dc0f1-bf6e-474a-bfaa-aae6f8aad12e"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "if azure_subscription_id != \"\":\n",
- " run_command(f'az account set --subscription {azure_subscription_id}')\n",
- "else:\n",
- " print('Using the default Azure subscription', {azure_subscription_id})\n",
- "run_command(f'az account show')"
- ],
- "metadata": {
- "azdata_cell_guid": "ab230931-2e99-483b-a229-3847684a8c1c",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Create Azure resource group**"
- ],
- "metadata": {
- "azdata_cell_guid": "d51db914-f484-489f-990d-72edb3065068"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'az group create --name {azure_resource_group} --location {azure_region}')"
- ],
- "metadata": {
- "azdata_cell_guid": "7c53eb23-c327-41bf-8936-bd34a02ebdd5",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Create AKS cluster**"
- ],
- "metadata": {
- "azdata_cell_guid": "818eb705-71e2-4013-8420-44886a5468b2"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'az aks create --name {aks_cluster_name} --resource-group {azure_resource_group} --generate-ssh-keys --node-vm-size {azure_vm_size} --node-count {azure_vm_count}')"
- ],
- "metadata": {
- "azdata_cell_guid": "3cea1da0-0c18-4030-a5aa-79bc98a5a14d",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Set the new AKS cluster as current context**"
- ],
- "metadata": {
- "azdata_cell_guid": "5ade8453-5e71-478f-b6b6-83c55626243d"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'az aks get-credentials --resource-group {azure_resource_group} --name {aks_cluster_name} --admin --overwrite-existing')"
- ],
- "metadata": {
- "azdata_cell_guid": "9ccb9adf-1cf6-4dcb-8bd9-7ae9a85c2437",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Create deployment configuration files**"
- ],
- "metadata": {
- "azdata_cell_guid": "57eb69fb-c68f-4ba8-818d-ffbaa0bc7aec"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "mssql_target_profile = 'ads-bdc-custom-profile'\n",
- "if not os.path.exists(mssql_target_profile):\n",
- " os.mkdir(mssql_target_profile)\n",
- "bdcJsonObj = json.loads(bdc_json)\n",
- "controlJsonObj = json.loads(control_json)\n",
- "bdcJsonFile = open(f'{mssql_target_profile}/bdc.json', 'w')\n",
- "bdcJsonFile.write(json.dumps(bdcJsonObj, indent = 4))\n",
- "bdcJsonFile.close()\n",
- "controlJsonFile = open(f'{mssql_target_profile}/control.json', 'w')\n",
- "controlJsonFile.write(json.dumps(controlJsonObj, indent = 4))\n",
- "controlJsonFile.close()\n",
- "print(f'Created deployment configuration folder: {mssql_target_profile}')"
- ],
- "metadata": {
- "azdata_cell_guid": "3fd73c04-8a79-4d08-9049-1dad30265558",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Create SQL Server 2019 Big Data Cluster**"
- ],
- "metadata": {
- "azdata_cell_guid": "6e82fad8-0fd0-4952-87ce-3fea1edd98cb"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "print (f'Creating SQL Server 2019 Big Data Cluster: {mssql_cluster_name} using configuration {mssql_target_profile}')\n",
- "os.environ[\"ACCEPT_EULA\"] = 'yes'\n",
- "os.environ[\"AZDATA_USERNAME\"] = mssql_username\n",
- "os.environ[\"AZDATA_PASSWORD\"] = mssql_password\n",
- "if os.name == 'nt':\n",
- " print(f'If you don\\'t see output produced by azdata, you can run the following command in a terminal window to check the deployment status:\\n\\t{os.environ[\"AZDATA_NB_VAR_KUBECTL\"]} get pods -n {mssql_cluster_name} ')\n",
- "run_command(f'azdata bdc create -c {mssql_target_profile}')"
- ],
- "metadata": {
- "azdata_cell_guid": "c43ea026-ca5e-4e2a-8602-fcc786354168",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Login to SQL Server 2019 Big Data Cluster**"
- ],
- "metadata": {
- "azdata_cell_guid": "9c5428f4-08b9-4799-a35d-867c91dc29fb"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'azdata login --namespace {mssql_cluster_name}')"
- ],
- "metadata": {
- "azdata_cell_guid": "5120c387-1088-435b-856e-e59f147c45a2",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Show SQL Server 2019 Big Data Cluster endpoints**"
- ],
- "metadata": {
- "azdata_cell_guid": "97974eda-e108-4c21-a58e-c6bb58f14ef1"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "from IPython.display import *\n",
- "pandas.set_option('display.max_colwidth', -1)\n",
- "cmd = f'azdata bdc endpoint list'\n",
- "cmdOutput = !{cmd}\n",
- "endpoints = json.loads(''.join(cmdOutput))\n",
- "endpointsDataFrame = pandas.DataFrame(endpoints)\n",
- "endpointsDataFrame.columns = [' '.join(word[0].upper() + word[1:] for word in columnName.split()) for columnName in endpoints[0].keys()]\n",
- "display(HTML(endpointsDataFrame.to_html(index=False, render_links=True)))"
- ],
- "metadata": {
- "azdata_cell_guid": "9a5d0aef-a8da-4845-b470-d714435f0304",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Connect to SQL Server Master instance in Azure Data Studio**\n",
- "Click the link below to connect to the SQL Server Master instance of the SQL Server 2019 Big Data Cluster."
- ],
- "metadata": {
- "azdata_cell_guid": "4a49b629-bd7a-43ba-bf18-6cdc0737b0f9"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "sqlEndpoints = [x for x in endpoints if x['name'] == 'sql-server-master']\n",
- "if sqlEndpoints and len(sqlEndpoints) == 1:\n",
- " connectionParameter = '{\"serverName\":\"' + sqlEndpoints[0]['endpoint'] + '\",\"providerName\":\"MSSQL\",\"authenticationType\":\"SqlLogin\",\"userName\":' + json.dumps(mssql_username) + ',\"password\":' + json.dumps(mssql_password) + '}'\n",
- " display(HTML('
Click here to connect to SQL Server Master instance
'))\n",
- " display(HTML('
NOTE: The SQL Server password is included in this link, you may want to clear the results of this code cell before saving the notebook.'))\n",
- "else:\n",
- " sys.exit('Could not find the SQL Server Master instance endpoint.')"
- ],
- "metadata": {
- "azdata_cell_guid": "1c9d1f2c-62ba-4070-920a-d30b67bdcc7c",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- }
- ]
-}
diff --git a/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-existing-aks.ipynb b/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-existing-aks.ipynb
deleted file mode 100644
index 1ea0a78eb5..0000000000
--- a/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-existing-aks.ipynb
+++ /dev/null
@@ -1,329 +0,0 @@
-{
- "metadata": {
- "kernelspec": {
- "name": "python3",
- "display_name": "Python 3"
- },
- "language_info": {
- "name": "python",
- "version": "3.6.6",
- "mimetype": "text/x-python",
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "pygments_lexer": "ipython3",
- "nbconvert_exporter": "python",
- "file_extension": ".py"
- }
- },
- "nbformat_minor": 2,
- "nbformat": 4,
- "cells": [
- {
- "cell_type": "markdown",
- "source": [
- "\n",
- " \n",
- "## Deploy SQL Server 2019 Big Data Cluster on an existing Azure Kubernetes Service (AKS) cluster\n",
- " \n",
- "This notebook walks through the process of deploying a SQL Server 2019 Big Data Cluster on an existing AKS cluster.\n",
- " \n",
- "* Follow the instructions in the **Prerequisites** cell to install the tools if not already installed.\n",
- "* The **Required information** will check and prompt you for password if it is not set in the environment variable. The password can be used to access the cluster controller, SQL Server, and Knox.\n",
- "\n",
- "Please press the \"Run all\" button to run the notebook"
- ],
- "metadata": {
- "azdata_cell_guid": "82e60c1a-7acf-47ee-877f-9e85e92e11da"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Prerequisites** \n",
- "Ensure the following tools are installed and added to PATH before proceeding.\n",
- " \n",
- "|Tools|Description|Installation|\n",
- "|---|---|---|\n",
- "|kubectl | Command-line tool for monitoring the underlying Kubernetes cluster | [Installation](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-using-native-package-management) |\n",
- "|azdata | Command-line tool for installing and managing a Big Data Cluster |[Installation](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-azdata?view=sqlallproducts-allversions) |"
- ],
- "metadata": {
- "azdata_cell_guid": "714582b9-10ee-409e-ab12-15a4825c9471"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Setup**"
- ],
- "metadata": {
- "azdata_cell_guid": "e3dd8e75-e15f-44b4-81fc-1f54d6f0b1e2"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "import pandas,sys,os,json,html,getpass,time\n",
- "pandas_version = pandas.__version__.split('.')\n",
- "pandas_major = int(pandas_version[0])\n",
- "pandas_minor = int(pandas_version[1])\n",
- "pandas_patch = int(pandas_version[2])\n",
- "if not (pandas_major > 0 or (pandas_major == 0 and pandas_minor > 24) or (pandas_major == 0 and pandas_minor == 24 and pandas_patch >= 2)):\n",
- " sys.exit('Please upgrade the Notebook dependency before you can proceed, you can do it by running the \"Reinstall Notebook dependencies\" command in command palette (View menu -> Command Palette…).')\n",
- "def run_command(command):\n",
- " print(\"Executing: \" + command)\n",
- " !{command}\n",
- " if _exit_code != 0:\n",
- " sys.exit(f'Command execution failed with exit code: {str(_exit_code)}.\\n\\t{command}\\n')\n",
- " print(f'Successfully executed: {command}')"
- ],
- "metadata": {
- "azdata_cell_guid": "d973d5b4-7f0a-4a9d-b204-a16480f3940d",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Set variables**\n",
- "Generated by Azure Data Studio using the values collected in the Deploy Big Data Cluster wizard"
- ],
- "metadata": {
- "azdata_cell_guid": "4b266b2d-bd1b-4565-92c9-3fc146cdce6d"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Check dependencies**"
- ],
- "metadata": {
- "azdata_cell_guid": "2544648b-59c9-4ce5-a3b6-87086e214d4c"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command('kubectl version --client=true')\n",
- "run_command('azdata --version')"
- ],
- "metadata": {
- "azdata_cell_guid": "691671d7-3f05-406c-a183-4cff7d17f83d",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Required information**"
- ],
- "metadata": {
- "azdata_cell_guid": "0bb02e76-fee8-4dbc-a75b-d5b9d1b187d0"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "invoked_by_wizard = \"AZDATA_NB_VAR_BDC_ADMIN_PASSWORD\" in os.environ\n",
- "if invoked_by_wizard:\n",
- " mssql_password = os.environ[\"AZDATA_NB_VAR_BDC_ADMIN_PASSWORD\"]\n",
- "else:\n",
- " mssql_password = getpass.getpass(prompt = 'SQL Server 2019 Big Data Cluster controller password')\n",
- " if mssql_password == \"\":\n",
- " sys.exit(f'Password is required.')\n",
- " confirm_password = getpass.getpass(prompt = 'Confirm password')\n",
- " if mssql_password != confirm_password:\n",
- " sys.exit(f'Passwords do not match.')\n",
- "print('You can also use the controller password to access Knox and SQL Server.')"
- ],
- "metadata": {
- "azdata_cell_guid": "e7e10828-6cae-45af-8c2f-1484b6d4f9ac",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Set and show current context**"
- ],
- "metadata": {
- "azdata_cell_guid": "127c8042-181f-4862-a390-96e59c181d09"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'kubectl config use-context {mssql_cluster_context}')\n",
- "run_command('kubectl config current-context')"
- ],
- "metadata": {
- "azdata_cell_guid": "7d1a03d4-1df8-48eb-bff0-0042603b95b1",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Create deployment configuration files**"
- ],
- "metadata": {
- "azdata_cell_guid": "138536c3-1db6-428f-9e5c-8269a02fb52e"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "mssql_target_profile = 'ads-bdc-custom-profile'\n",
- "if not os.path.exists(mssql_target_profile):\n",
- " os.mkdir(mssql_target_profile)\n",
- "bdcJsonObj = json.loads(bdc_json)\n",
- "controlJsonObj = json.loads(control_json)\n",
- "bdcJsonFile = open(f'{mssql_target_profile}/bdc.json', 'w')\n",
- "bdcJsonFile.write(json.dumps(bdcJsonObj, indent = 4))\n",
- "bdcJsonFile.close()\n",
- "controlJsonFile = open(f'{mssql_target_profile}/control.json', 'w')\n",
- "controlJsonFile.write(json.dumps(controlJsonObj, indent = 4))\n",
- "controlJsonFile.close()\n",
- "print(f'Created deployment configuration folder: {mssql_target_profile}')"
- ],
- "metadata": {
- "azdata_cell_guid": "2ff82c8a-4bce-449c-9d91-3ac7dd272021",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Create SQL Server 2019 Big Data Cluster**"
- ],
- "metadata": {
- "azdata_cell_guid": "efe78cd3-ed73-4c9b-b586-fdd6c07dd37f"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "print (f'Creating SQL Server 2019 Big Data Cluster: {mssql_cluster_name} using configuration {mssql_target_profile}')\n",
- "os.environ[\"ACCEPT_EULA\"] = 'yes'\n",
- "os.environ[\"AZDATA_USERNAME\"] = mssql_username\n",
- "os.environ[\"AZDATA_PASSWORD\"] = mssql_password\n",
- "if os.name == 'nt':\n",
- " print(f'If you don\\'t see output produced by azdata, you can run the following command in a terminal window to check the deployment status:\\n\\t{os.environ[\"AZDATA_NB_VAR_KUBECTL\"]} get pods -n {mssql_cluster_name} ')\n",
- "run_command(f'azdata bdc create -c {mssql_target_profile}')"
- ],
- "metadata": {
- "azdata_cell_guid": "373947a1-90b9-49ee-86f4-17a4c7d4ca76",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Login to SQL Server 2019 Big Data Cluster**"
- ],
- "metadata": {
- "azdata_cell_guid": "4e026d39-12d4-4c80-8e30-de2b782f2110"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'azdata login --namespace {mssql_cluster_name}')"
- ],
- "metadata": {
- "azdata_cell_guid": "79adda27-371d-4dcb-b867-db025f8162a5",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Show SQL Server 2019 Big Data Cluster endpoints**"
- ],
- "metadata": {
- "azdata_cell_guid": "c1921288-ad11-40d8-9aea-127a722b3df8"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "from IPython.display import *\n",
- "pandas.set_option('display.max_colwidth', -1)\n",
- "cmd = f'azdata bdc endpoint list'\n",
- "cmdOutput = !{cmd}\n",
- "endpoints = json.loads(''.join(cmdOutput))\n",
- "endpointsDataFrame = pandas.DataFrame(endpoints)\n",
- "endpointsDataFrame.columns = [' '.join(word[0].upper() + word[1:] for word in columnName.split()) for columnName in endpoints[0].keys()]\n",
- "display(HTML(endpointsDataFrame.to_html(index=False, render_links=True)))"
- ],
- "metadata": {
- "azdata_cell_guid": "a2202494-fd6c-4534-987d-15c403a5096f",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Connect to SQL Server Master instance in Azure Data Studio**\n",
- "Click the link below to connect to the SQL Server Master instance of the SQL Server 2019 Big Data Cluster."
- ],
- "metadata": {
- "azdata_cell_guid": "621863a2-aa61-46f4-a9d0-717f41c009ee"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "sqlEndpoints = [x for x in endpoints if x['name'] == 'sql-server-master']\n",
- "if sqlEndpoints and len(sqlEndpoints) == 1:\n",
- " connectionParameter = '{\"serverName\":\"' + sqlEndpoints[0]['endpoint'] + '\",\"providerName\":\"MSSQL\",\"authenticationType\":\"SqlLogin\",\"userName\":' + json.dumps(mssql_username) + ',\"password\":' + json.dumps(mssql_password) + '}'\n",
- " display(HTML('
Click here to connect to SQL Server Master instance
'))\n",
- " display(HTML('
NOTE: The SQL Server password is included in this link, you may want to clear the results of this code cell before saving the notebook.'))\n",
- "else:\n",
- " sys.exit('Could not find the SQL Server Master instance endpoint.')"
- ],
- "metadata": {
- "azdata_cell_guid": "48342355-9d2b-4fa6-b1aa-3bc77d434dfa",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- }
- ]
-}
diff --git a/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-existing-aro.ipynb b/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-existing-aro.ipynb
deleted file mode 100644
index b8591d2b6f..0000000000
--- a/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-existing-aro.ipynb
+++ /dev/null
@@ -1,351 +0,0 @@
-{
- "metadata": {
- "kernelspec": {
- "name": "python3",
- "display_name": "Python 3"
- },
- "language_info": {
- "name": "python",
- "version": "3.6.6",
- "mimetype": "text/x-python",
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "pygments_lexer": "ipython3",
- "nbconvert_exporter": "python",
- "file_extension": ".py"
- }
- },
- "nbformat_minor": 2,
- "nbformat": 4,
- "cells": [
- {
- "cell_type": "markdown",
- "source": [
- "\n",
- " \n",
- "## Deploy SQL Server 2019 Big Data Cluster on an existing Azure Red Hat OpenShift cluster\n",
- " \n",
- "This notebook walks through the process of deploying a SQL Server 2019 Big Data Cluster on an existing Azure Red Hat OpenShift cluster.\n",
- " \n",
- "* Follow the instructions in the **Prerequisites** cell to install the tools if not already installed.\n",
- "* The **Required information** will check and prompt you for password if it is not set in the environment variable. The password can be used to access the cluster controller, SQL Server, and Knox.\n",
- "\n",
- "Please press the \"Run all\" button to run the notebook"
- ],
- "metadata": {
- "azdata_cell_guid": "23954d96-3932-4a8e-ab73-da605f99b1a4"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Prerequisites** \n",
- "Ensure the following tools are installed and added to PATH before proceeding.\n",
- " \n",
- "|Tools|Description|Installation|\n",
- "|---|---|---|\n",
- "|kubectl | Command-line tool for monitoring the underlying Kubernetes cluster | [Installation](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-using-native-package-management) |\n",
- "|azdata | Command-line tool for installing and managing a Big Data Cluster |[Installation](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-azdata?view=sqlallproducts-allversions) |"
- ],
- "metadata": {
- "azdata_cell_guid": "1d7f4c6a-0cb8-4ecc-81c8-544712253a3f"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Setup**"
- ],
- "metadata": {
- "azdata_cell_guid": "a31f9894-903f-4e19-a5a8-6fd888ff013b"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "import pandas,sys,os,json,html,getpass,time\n",
- "pandas_version = pandas.__version__.split('.')\n",
- "pandas_major = int(pandas_version[0])\n",
- "pandas_minor = int(pandas_version[1])\n",
- "pandas_patch = int(pandas_version[2])\n",
- "if not (pandas_major > 0 or (pandas_major == 0 and pandas_minor > 24) or (pandas_major == 0 and pandas_minor == 24 and pandas_patch >= 2)):\n",
- " sys.exit('Please upgrade the Notebook dependency before you can proceed, you can do it by running the \"Reinstall Notebook dependencies\" command in command palette (View menu -> Command Palette…).')\n",
- "def run_command(command):\n",
- " print(\"Executing: \" + command)\n",
- " !{command}\n",
- " if _exit_code != 0:\n",
- " sys.exit(f'Command execution failed with exit code: {str(_exit_code)}.\\n\\t{command}\\n')\n",
- " print(f'Successfully executed: {command}')"
- ],
- "metadata": {
- "azdata_cell_guid": "26fa8bc4-4b8e-4c31-ae11-50484821cea8",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Set variables**\n",
- "Generated by Azure Data Studio using the values collected in the Deploy Big Data Cluster wizard"
- ],
- "metadata": {
- "azdata_cell_guid": "e70640d0-6059-4cab-939e-e985a978c0da"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Check dependencies**"
- ],
- "metadata": {
- "azdata_cell_guid": "869d0397-a280-4dc4-be76-d652189b5131"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command('kubectl version --client=true')\n",
- "run_command('azdata --version')"
- ],
- "metadata": {
- "azdata_cell_guid": "c38afb67-1132-495e-9af1-35bf067acbeb",
- "tags": []
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Required information**"
- ],
- "metadata": {
- "azdata_cell_guid": "7b383b0d-5687-45b3-a16f-ba3b170c796e"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "invoked_by_wizard = \"AZDATA_NB_VAR_BDC_ADMIN_PASSWORD\" in os.environ\n",
- "if invoked_by_wizard:\n",
- " mssql_password = os.environ[\"AZDATA_NB_VAR_BDC_ADMIN_PASSWORD\"]\n",
- " if mssql_auth_mode == \"ad\":\n",
- " mssql_domain_service_account_password = os.environ[\"AZDATA_NB_VAR_BDC_AD_DOMAIN_SVC_PASSWORD\"]\n",
- "else:\n",
- " mssql_password = getpass.getpass(prompt = 'SQL Server 2019 Big Data Cluster controller password')\n",
- " if mssql_password == \"\":\n",
- " sys.exit(f'Password is required.')\n",
- " confirm_password = getpass.getpass(prompt = 'Confirm password')\n",
- " if mssql_password != confirm_password:\n",
- " sys.exit(f'Passwords do not match.')\n",
- " if mssql_auth_mode == \"ad\":\n",
- " mssql_domain_service_account_password = getpass.getpass(prompt = 'Domain service account password')\n",
- " if mssql_domain_service_account_password == \"\":\n",
- " sys.exit(f'Domain service account password is required.')\n",
- "print('You can also use the controller password to access Knox and SQL Server.')"
- ],
- "metadata": {
- "azdata_cell_guid": "b5970f2b-cf13-41af-b0a2-5133d840325e",
- "tags": []
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Set and show current context**"
- ],
- "metadata": {
- "azdata_cell_guid": "6456bd0c-5b64-4d76-be59-e3a5b32697f5"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'kubectl config use-context {mssql_cluster_context}')\n",
- "run_command('kubectl config current-context')"
- ],
- "metadata": {
- "azdata_cell_guid": "a38f8b3a-f93a-484c-b9e2-4eba3ed99cc2"
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Make sure the target namespace already exists**"
- ],
- "metadata": {
- "azdata_cell_guid": "3bf1d902-2217-4c99-b2d6-38e45de8e308"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'kubectl get namespace {mssql_cluster_name}')"
- ],
- "metadata": {
- "azdata_cell_guid": "6ca9bf71-049a-458e-8000-311d4c15b1ca"
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Create deployment configuration files**"
- ],
- "metadata": {
- "azdata_cell_guid": "6d78da36-6af5-4309-baad-bc81bb2cdb7f"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "mssql_target_profile = 'ads-bdc-custom-profile'\n",
- "if not os.path.exists(mssql_target_profile):\n",
- " os.mkdir(mssql_target_profile)\n",
- "bdcJsonObj = json.loads(bdc_json)\n",
- "controlJsonObj = json.loads(control_json)\n",
- "bdcJsonFile = open(f'{mssql_target_profile}/bdc.json', 'w')\n",
- "bdcJsonFile.write(json.dumps(bdcJsonObj, indent = 4))\n",
- "bdcJsonFile.close()\n",
- "controlJsonFile = open(f'{mssql_target_profile}/control.json', 'w')\n",
- "controlJsonFile.write(json.dumps(controlJsonObj, indent = 4))\n",
- "controlJsonFile.close()\n",
- "print(f'Created deployment configuration folder: {mssql_target_profile}')"
- ],
- "metadata": {
- "azdata_cell_guid": "3110ab23-ecfc-4e36-a1c5-28536b7edebf",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Create SQL Server 2019 Big Data Cluster**"
- ],
- "metadata": {
- "azdata_cell_guid": "7d56d262-8cd5-49e4-b745-332c6e7a3cb2"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "print (f'Creating SQL Server 2019 Big Data Cluster: {mssql_cluster_name} using configuration {mssql_target_profile}')\n",
- "os.environ[\"ACCEPT_EULA\"] = 'yes'\n",
- "os.environ[\"AZDATA_USERNAME\"] = mssql_username\n",
- "os.environ[\"AZDATA_PASSWORD\"] = mssql_password\n",
- "if mssql_auth_mode == \"ad\":\n",
- " os.environ[\"DOMAIN_SERVICE_ACCOUNT_USERNAME\"] = mssql_domain_service_account_username\n",
- " os.environ[\"DOMAIN_SERVICE_ACCOUNT_PASSWORD\"] = mssql_domain_service_account_password\n",
- "if os.name == 'nt':\n",
- " print(f'If you don\\'t see output produced by azdata, you can run the following command in a terminal window to check the deployment status:\\n\\t{os.environ[\"AZDATA_NB_VAR_KUBECTL\"]} get pods -n {mssql_cluster_name} ')\n",
- "run_command(f'azdata bdc create -c {mssql_target_profile}')"
- ],
- "metadata": {
- "azdata_cell_guid": "0a743e88-e7d0-4b41-b8a3-e43985d15f2b",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Login to SQL Server 2019 Big Data Cluster**"
- ],
- "metadata": {
- "azdata_cell_guid": "7929fd90-324d-482a-a101-ae29cb183691"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'azdata login --namespace {mssql_cluster_name}')"
- ],
- "metadata": {
- "azdata_cell_guid": "3a49909b-e09e-4e62-a825-c39de2cffc94",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Show SQL Server 2019 Big Data Cluster endpoints**"
- ],
- "metadata": {
- "azdata_cell_guid": "038e801a-a393-4f8d-8e2d-97bc3b740b0c"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "from IPython.display import *\n",
- "pandas.set_option('display.max_colwidth', -1)\n",
- "cmd = f'azdata bdc endpoint list'\n",
- "cmdOutput = !{cmd}\n",
- "endpoints = json.loads(''.join(cmdOutput))\n",
- "endpointsDataFrame = pandas.DataFrame(endpoints)\n",
- "endpointsDataFrame.columns = [' '.join(word[0].upper() + word[1:] for word in columnName.split()) for columnName in endpoints[0].keys()]\n",
- "display(HTML(endpointsDataFrame.to_html(index=False, render_links=True)))"
- ],
- "metadata": {
- "azdata_cell_guid": "2a8c8d5d-862c-4672-9309-38aa03afc4e6",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Connect to SQL Server Master instance in Azure Data Studio**\n",
- "Click the link below to connect to the SQL Server Master instance of the SQL Server 2019 Big Data Cluster."
- ],
- "metadata": {
- "azdata_cell_guid": "0bd809fa-8225-4954-a50c-da57ea167896"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "sqlEndpoints = [x for x in endpoints if x['name'] == 'sql-server-master']\n",
- "if sqlEndpoints and len(sqlEndpoints) == 1:\n",
- " connectionParameter = '{\"serverName\":\"' + sqlEndpoints[0]['endpoint'] + '\",\"providerName\":\"MSSQL\",\"authenticationType\":\"SqlLogin\",\"userName\":' + json.dumps(mssql_username) + ',\"password\":' + json.dumps(mssql_password) + '}'\n",
- " display(HTML('
Click here to connect to SQL Server Master instance
'))\n",
- " display(HTML('
NOTE: The SQL Server password is included in this link, you may want to clear the results of this code cell before saving the notebook.'))\n",
- "else:\n",
- " sys.exit('Could not find the SQL Server Master instance endpoint.')"
- ],
- "metadata": {
- "azdata_cell_guid": "d591785d-71aa-4c5d-9cbb-a7da79bca503",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- }
- ]
-}
diff --git a/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-existing-kubeadm.ipynb b/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-existing-kubeadm.ipynb
deleted file mode 100644
index c18435a68d..0000000000
--- a/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-existing-kubeadm.ipynb
+++ /dev/null
@@ -1,335 +0,0 @@
-{
- "metadata": {
- "kernelspec": {
- "name": "python3",
- "display_name": "Python 3"
- },
- "language_info": {
- "name": "python",
- "version": "3.6.6",
- "mimetype": "text/x-python",
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "pygments_lexer": "ipython3",
- "nbconvert_exporter": "python",
- "file_extension": ".py"
- }
- },
- "nbformat_minor": 2,
- "nbformat": 4,
- "cells": [
- {
- "cell_type": "markdown",
- "source": [
- "\n",
- " \n",
- "## Deploy SQL Server 2019 Big Data Cluster on an existing cluster deployed using kubeadm\n",
- " \n",
- "This notebook walks through the process of deploying a SQL Server 2019 Big Data Cluster on an existing kubeadm cluster.\n",
- " \n",
- "* Follow the instructions in the **Prerequisites** cell to install the tools if not already installed.\n",
- "* The **Required information** will check and prompt you for password if it is not set in the environment variable. The password can be used to access the cluster controller, SQL Server, and Knox.\n",
- "\n",
- "Please press the \"Run all\" button to run the notebook"
- ],
- "metadata": {
- "azdata_cell_guid": "23954d96-3932-4a8e-ab73-da605f99b1a4"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Prerequisites** \n",
- "Ensure the following tools are installed and added to PATH before proceeding.\n",
- " \n",
- "|Tools|Description|Installation|\n",
- "|---|---|---|\n",
- "|kubectl | Command-line tool for monitoring the underlying Kubernetes cluster | [Installation](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-using-native-package-management) |\n",
- "|azdata | Command-line tool for installing and managing a Big Data Cluster |[Installation](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-azdata?view=sqlallproducts-allversions) |"
- ],
- "metadata": {
- "azdata_cell_guid": "1d7f4c6a-0cb8-4ecc-81c8-544712253a3f"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Setup**"
- ],
- "metadata": {
- "azdata_cell_guid": "a31f9894-903f-4e19-a5a8-6fd888ff013b"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "import pandas,sys,os,json,html,getpass,time\n",
- "pandas_version = pandas.__version__.split('.')\n",
- "pandas_major = int(pandas_version[0])\n",
- "pandas_minor = int(pandas_version[1])\n",
- "pandas_patch = int(pandas_version[2])\n",
- "if not (pandas_major > 0 or (pandas_major == 0 and pandas_minor > 24) or (pandas_major == 0 and pandas_minor == 24 and pandas_patch >= 2)):\n",
- " sys.exit('Please upgrade the Notebook dependency before you can proceed, you can do it by running the \"Reinstall Notebook dependencies\" command in command palette (View menu -> Command Palette…).')\n",
- "def run_command(command):\n",
- " print(\"Executing: \" + command)\n",
- " !{command}\n",
- " if _exit_code != 0:\n",
- " sys.exit(f'Command execution failed with exit code: {str(_exit_code)}.\\n\\t{command}\\n')\n",
- " print(f'Successfully executed: {command}')"
- ],
- "metadata": {
- "azdata_cell_guid": "26fa8bc4-4b8e-4c31-ae11-50484821cea8",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Set variables**\n",
- "Generated by Azure Data Studio using the values collected in the Deploy Big Data Cluster wizard"
- ],
- "metadata": {
- "azdata_cell_guid": "e70640d0-6059-4cab-939e-e985a978c0da"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Check dependencies**"
- ],
- "metadata": {
- "azdata_cell_guid": "869d0397-a280-4dc4-be76-d652189b5131"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command('kubectl version --client=true')\n",
- "run_command('azdata --version')"
- ],
- "metadata": {
- "azdata_cell_guid": "c38afb67-1132-495e-9af1-35bf067acbeb",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Required information**"
- ],
- "metadata": {
- "azdata_cell_guid": "7b383b0d-5687-45b3-a16f-ba3b170c796e"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "invoked_by_wizard = \"AZDATA_NB_VAR_BDC_ADMIN_PASSWORD\" in os.environ\n",
- "if invoked_by_wizard:\n",
- " mssql_password = os.environ[\"AZDATA_NB_VAR_BDC_ADMIN_PASSWORD\"]\n",
- " if mssql_auth_mode == \"ad\":\n",
- " mssql_domain_service_account_password = os.environ[\"AZDATA_NB_VAR_BDC_AD_DOMAIN_SVC_PASSWORD\"]\n",
- "else:\n",
- " mssql_password = getpass.getpass(prompt = 'SQL Server 2019 Big Data Cluster controller password')\n",
- " if mssql_password == \"\":\n",
- " sys.exit(f'Password is required.')\n",
- " confirm_password = getpass.getpass(prompt = 'Confirm password')\n",
- " if mssql_password != confirm_password:\n",
- " sys.exit(f'Passwords do not match.')\n",
- " if mssql_auth_mode == \"ad\":\n",
- " mssql_domain_service_account_password = getpass.getpass(prompt = 'Domain service account password')\n",
- " if mssql_domain_service_account_password == \"\":\n",
- " sys.exit(f'Domain service account password is required.')\n",
- "print('You can also use the controller password to access Knox and SQL Server.')"
- ],
- "metadata": {
- "azdata_cell_guid": "b5970f2b-cf13-41af-b0a2-5133d840325e",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Set and show current context**"
- ],
- "metadata": {
- "azdata_cell_guid": "6456bd0c-5b64-4d76-be59-e3a5b32697f5"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'kubectl config use-context {mssql_cluster_context}')\n",
- "run_command('kubectl config current-context')"
- ],
- "metadata": {
- "azdata_cell_guid": "a38f8b3a-f93a-484c-b9e2-4eba3ed99cc2"
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Create deployment configuration files**"
- ],
- "metadata": {
- "azdata_cell_guid": "6d78da36-6af5-4309-baad-bc81bb2cdb7f"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "mssql_target_profile = 'ads-bdc-custom-profile'\n",
- "if not os.path.exists(mssql_target_profile):\n",
- " os.mkdir(mssql_target_profile)\n",
- "bdcJsonObj = json.loads(bdc_json)\n",
- "controlJsonObj = json.loads(control_json)\n",
- "bdcJsonFile = open(f'{mssql_target_profile}/bdc.json', 'w')\n",
- "bdcJsonFile.write(json.dumps(bdcJsonObj, indent = 4))\n",
- "bdcJsonFile.close()\n",
- "controlJsonFile = open(f'{mssql_target_profile}/control.json', 'w')\n",
- "controlJsonFile.write(json.dumps(controlJsonObj, indent = 4))\n",
- "controlJsonFile.close()\n",
- "print(f'Created deployment configuration folder: {mssql_target_profile}')"
- ],
- "metadata": {
- "azdata_cell_guid": "3110ab23-ecfc-4e36-a1c5-28536b7edebf",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Create SQL Server 2019 Big Data Cluster**"
- ],
- "metadata": {
- "azdata_cell_guid": "7d56d262-8cd5-49e4-b745-332c6e7a3cb2"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "print (f'Creating SQL Server 2019 Big Data Cluster: {mssql_cluster_name} using configuration {mssql_target_profile}')\n",
- "os.environ[\"ACCEPT_EULA\"] = 'yes'\n",
- "os.environ[\"AZDATA_USERNAME\"] = mssql_username\n",
- "os.environ[\"AZDATA_PASSWORD\"] = mssql_password\n",
- "if mssql_auth_mode == \"ad\":\n",
- " os.environ[\"DOMAIN_SERVICE_ACCOUNT_USERNAME\"] = mssql_domain_service_account_username\n",
- " os.environ[\"DOMAIN_SERVICE_ACCOUNT_PASSWORD\"] = mssql_domain_service_account_password\n",
- "if os.name == 'nt':\n",
- " print(f'If you don\\'t see output produced by azdata, you can run the following command in a terminal window to check the deployment status:\\n\\t{os.environ[\"AZDATA_NB_VAR_KUBECTL\"]} get pods -n {mssql_cluster_name} ')\n",
- "run_command(f'azdata bdc create -c {mssql_target_profile}')"
- ],
- "metadata": {
- "azdata_cell_guid": "0a743e88-e7d0-4b41-b8a3-e43985d15f2b",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Login to SQL Server 2019 Big Data Cluster**"
- ],
- "metadata": {
- "azdata_cell_guid": "7929fd90-324d-482a-a101-ae29cb183691"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'azdata login --namespace {mssql_cluster_name}')"
- ],
- "metadata": {
- "azdata_cell_guid": "3a49909b-e09e-4e62-a825-c39de2cffc94",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Show SQL Server 2019 Big Data Cluster endpoints**"
- ],
- "metadata": {
- "azdata_cell_guid": "038e801a-a393-4f8d-8e2d-97bc3b740b0c"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "from IPython.display import *\n",
- "pandas.set_option('display.max_colwidth', -1)\n",
- "cmd = f'azdata bdc endpoint list'\n",
- "cmdOutput = !{cmd}\n",
- "endpoints = json.loads(''.join(cmdOutput))\n",
- "endpointsDataFrame = pandas.DataFrame(endpoints)\n",
- "endpointsDataFrame.columns = [' '.join(word[0].upper() + word[1:] for word in columnName.split()) for columnName in endpoints[0].keys()]\n",
- "display(HTML(endpointsDataFrame.to_html(index=False, render_links=True)))"
- ],
- "metadata": {
- "azdata_cell_guid": "2a8c8d5d-862c-4672-9309-38aa03afc4e6",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Connect to SQL Server Master instance in Azure Data Studio**\n",
- "Click the link below to connect to the SQL Server Master instance of the SQL Server 2019 Big Data Cluster."
- ],
- "metadata": {
- "azdata_cell_guid": "0bd809fa-8225-4954-a50c-da57ea167896"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "sqlEndpoints = [x for x in endpoints if x['name'] == 'sql-server-master']\n",
- "if sqlEndpoints and len(sqlEndpoints) == 1:\n",
- " connectionParameter = '{\"serverName\":\"' + sqlEndpoints[0]['endpoint'] + '\",\"providerName\":\"MSSQL\",\"authenticationType\":\"SqlLogin\",\"userName\":' + json.dumps(mssql_username) + ',\"password\":' + json.dumps(mssql_password) + '}'\n",
- " display(HTML('
Click here to connect to SQL Server Master instance
'))\n",
- " display(HTML('
NOTE: The SQL Server password is included in this link, you may want to clear the results of this code cell before saving the notebook.'))\n",
- "else:\n",
- " sys.exit('Could not find the SQL Server Master instance endpoint.')"
- ],
- "metadata": {
- "azdata_cell_guid": "d591785d-71aa-4c5d-9cbb-a7da79bca503",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- }
- ]
-}
diff --git a/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-existing-openshift.ipynb b/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-existing-openshift.ipynb
deleted file mode 100644
index 59893d4796..0000000000
--- a/extensions/big-data-cluster/notebooks/deployment/2019/deploy-bdc-existing-openshift.ipynb
+++ /dev/null
@@ -1,353 +0,0 @@
-{
- "metadata": {
- "kernelspec": {
- "name": "python3",
- "display_name": "Python 3"
- },
- "language_info": {
- "name": "python",
- "version": "3.6.6",
- "mimetype": "text/x-python",
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "pygments_lexer": "ipython3",
- "nbconvert_exporter": "python",
- "file_extension": ".py"
- }
- },
- "nbformat_minor": 2,
- "nbformat": 4,
- "cells": [
- {
- "cell_type": "markdown",
- "source": [
- "\n",
- " \n",
- "## Deploy SQL Server 2019 Big Data Cluster on an existing OpenShift cluster\n",
- " \n",
- "This notebook walks through the process of deploying a SQL Server 2019 Big Data Cluster on an existing OpenShift cluster.\n",
- " \n",
- "* Follow the instructions in the **Prerequisites** cell to install the tools if not already installed.\n",
- "* The **Required information** will check and prompt you for password if it is not set in the environment variable. The password can be used to access the cluster controller, SQL Server, and Knox.\n",
- "\n",
- "Please press the \"Run all\" button to run the notebook"
- ],
- "metadata": {
- "azdata_cell_guid": "23954d96-3932-4a8e-ab73-da605f99b1a4"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Prerequisites** \n",
- "Ensure the following tools are installed and added to PATH before proceeding.\n",
- " \n",
- "|Tools|Description|Installation|\n",
- "|---|---|---|\n",
- "|kubectl | Command-line tool for monitoring the underlying Kubernetes cluster | [Installation](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-using-native-package-management) |\n",
- "|azdata | Command-line tool for installing and managing a Big Data Cluster |[Installation](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-azdata?view=sqlallproducts-allversions) |"
- ],
- "metadata": {
- "azdata_cell_guid": "1d7f4c6a-0cb8-4ecc-81c8-544712253a3f"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Setup**"
- ],
- "metadata": {
- "azdata_cell_guid": "a31f9894-903f-4e19-a5a8-6fd888ff013b"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "import pandas,sys,os,json,html,getpass,time\n",
- "pandas_version = pandas.__version__.split('.')\n",
- "pandas_major = int(pandas_version[0])\n",
- "pandas_minor = int(pandas_version[1])\n",
- "pandas_patch = int(pandas_version[2])\n",
- "if not (pandas_major > 0 or (pandas_major == 0 and pandas_minor > 24) or (pandas_major == 0 and pandas_minor == 24 and pandas_patch >= 2)):\n",
- " sys.exit('Please upgrade the Notebook dependency before you can proceed, you can do it by running the \"Reinstall Notebook dependencies\" command in command palette (View menu -> Command Palette…).')\n",
- "def run_command(command):\n",
- " print(\"Executing: \" + command)\n",
- " !{command}\n",
- " if _exit_code != 0:\n",
- " sys.exit(f'Command execution failed with exit code: {str(_exit_code)}.\\n\\t{command}\\n')\n",
- " print(f'Successfully executed: {command}')"
- ],
- "metadata": {
- "azdata_cell_guid": "26fa8bc4-4b8e-4c31-ae11-50484821cea8",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Set variables**\n",
- "Generated by Azure Data Studio using the values collected in the Deploy Big Data Cluster wizard"
- ],
- "metadata": {
- "azdata_cell_guid": "e70640d0-6059-4cab-939e-e985a978c0da"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Check dependencies**"
- ],
- "metadata": {
- "azdata_cell_guid": "869d0397-a280-4dc4-be76-d652189b5131"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command('kubectl version --client=true')\n",
- "run_command('azdata --version')"
- ],
- "metadata": {
- "azdata_cell_guid": "c38afb67-1132-495e-9af1-35bf067acbeb",
- "tags": []
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Required information**"
- ],
- "metadata": {
- "azdata_cell_guid": "7b383b0d-5687-45b3-a16f-ba3b170c796e"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "invoked_by_wizard = \"AZDATA_NB_VAR_BDC_ADMIN_PASSWORD\" in os.environ\n",
- "if invoked_by_wizard:\n",
- " mssql_password = os.environ[\"AZDATA_NB_VAR_BDC_ADMIN_PASSWORD\"]\n",
- " if mssql_auth_mode == \"ad\":\n",
- " mssql_domain_service_account_password = os.environ[\"AZDATA_NB_VAR_BDC_AD_DOMAIN_SVC_PASSWORD\"]\n",
- "else:\n",
- " mssql_password = getpass.getpass(prompt = 'SQL Server 2019 Big Data Cluster controller password')\n",
- " if mssql_password == \"\":\n",
- " sys.exit(f'Password is required.')\n",
- " confirm_password = getpass.getpass(prompt = 'Confirm password')\n",
- " if mssql_password != confirm_password:\n",
- " sys.exit(f'Passwords do not match.')\n",
- " if mssql_auth_mode == \"ad\":\n",
- " mssql_domain_service_account_password = getpass.getpass(prompt = 'Domain service account password')\n",
- " if mssql_domain_service_account_password == \"\":\n",
- " sys.exit(f'Domain service account password is required.')\n",
- "print('You can also use the controller password to access Knox and SQL Server.')"
- ],
- "metadata": {
- "azdata_cell_guid": "b5970f2b-cf13-41af-b0a2-5133d840325e",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Set and show current context**"
- ],
- "metadata": {
- "azdata_cell_guid": "6456bd0c-5b64-4d76-be59-e3a5b32697f5"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'kubectl config use-context {mssql_cluster_context}')\n",
- "run_command('kubectl config current-context')"
- ],
- "metadata": {
- "azdata_cell_guid": "a38f8b3a-f93a-484c-b9e2-4eba3ed99cc2"
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Make sure the target namespace already exists**"
- ],
- "metadata": {
- "azdata_cell_guid": "b903f09b-0eeb-45c0-8173-1741cce3790c"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'kubectl get namespace {mssql_cluster_name}')"
- ],
- "metadata": {
- "azdata_cell_guid": "174c02ea-8876-43be-bd93-3a39223e25ec"
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Create deployment configuration files**"
- ],
- "metadata": {
- "azdata_cell_guid": "6d78da36-6af5-4309-baad-bc81bb2cdb7f"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "mssql_target_profile = 'ads-bdc-custom-profile'\n",
- "if not os.path.exists(mssql_target_profile):\n",
- " os.mkdir(mssql_target_profile)\n",
- "bdcJsonObj = json.loads(bdc_json)\n",
- "controlJsonObj = json.loads(control_json)\n",
- "bdcJsonFile = open(f'{mssql_target_profile}/bdc.json', 'w')\n",
- "bdcJsonFile.write(json.dumps(bdcJsonObj, indent = 4))\n",
- "bdcJsonFile.close()\n",
- "controlJsonFile = open(f'{mssql_target_profile}/control.json', 'w')\n",
- "controlJsonFile.write(json.dumps(controlJsonObj, indent = 4))\n",
- "controlJsonFile.close()\n",
- "print(f'Created deployment configuration folder: {mssql_target_profile}')"
- ],
- "metadata": {
- "azdata_cell_guid": "3110ab23-ecfc-4e36-a1c5-28536b7edebf",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Create SQL Server 2019 Big Data Cluster**"
- ],
- "metadata": {
- "azdata_cell_guid": "7d56d262-8cd5-49e4-b745-332c6e7a3cb2"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "print (f'Creating SQL Server 2019 Big Data Cluster: {mssql_cluster_name} using configuration {mssql_target_profile}')\n",
- "os.environ[\"ACCEPT_EULA\"] = 'yes'\n",
- "os.environ[\"AZDATA_USERNAME\"] = mssql_username\n",
- "os.environ[\"AZDATA_PASSWORD\"] = mssql_password\n",
- "if mssql_auth_mode == \"ad\":\n",
- " os.environ[\"DOMAIN_SERVICE_ACCOUNT_USERNAME\"] = mssql_domain_service_account_username\n",
- " os.environ[\"DOMAIN_SERVICE_ACCOUNT_PASSWORD\"] = mssql_domain_service_account_password\n",
- "if os.name == 'nt':\n",
- " print(f'If you don\\'t see output produced by azdata, you can run the following command in a terminal window to check the deployment status:\\n\\t{os.environ[\"AZDATA_NB_VAR_KUBECTL\"]} get pods -n {mssql_cluster_name} ')\n",
- "run_command(f'azdata bdc create -c {mssql_target_profile}')"
- ],
- "metadata": {
- "azdata_cell_guid": "0a743e88-e7d0-4b41-b8a3-e43985d15f2b",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Login to SQL Server 2019 Big Data Cluster**"
- ],
- "metadata": {
- "azdata_cell_guid": "7929fd90-324d-482a-a101-ae29cb183691"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "run_command(f'azdata login --namespace {mssql_cluster_name}')"
- ],
- "metadata": {
- "azdata_cell_guid": "3a49909b-e09e-4e62-a825-c39de2cffc94",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Show SQL Server 2019 Big Data Cluster endpoints**"
- ],
- "metadata": {
- "azdata_cell_guid": "038e801a-a393-4f8d-8e2d-97bc3b740b0c"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "from IPython.display import *\n",
- "pandas.set_option('display.max_colwidth', -1)\n",
- "cmd = f'azdata bdc endpoint list'\n",
- "cmdOutput = !{cmd}\n",
- "endpoints = json.loads(''.join(cmdOutput))\n",
- "endpointsDataFrame = pandas.DataFrame(endpoints)\n",
- "endpointsDataFrame.columns = [' '.join(word[0].upper() + word[1:] for word in columnName.split()) for columnName in endpoints[0].keys()]\n",
- "display(HTML(endpointsDataFrame.to_html(index=False, render_links=True)))"
- ],
- "metadata": {
- "azdata_cell_guid": "2a8c8d5d-862c-4672-9309-38aa03afc4e6",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "markdown",
- "source": [
- "### **Connect to SQL Server Master instance in Azure Data Studio**\n",
- "Click the link below to connect to the SQL Server Master instance of the SQL Server 2019 Big Data Cluster."
- ],
- "metadata": {
- "azdata_cell_guid": "0bd809fa-8225-4954-a50c-da57ea167896"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "sqlEndpoints = [x for x in endpoints if x['name'] == 'sql-server-master']\n",
- "if sqlEndpoints and len(sqlEndpoints) == 1:\n",
- " connectionParameter = '{\"serverName\":\"' + sqlEndpoints[0]['endpoint'] + '\",\"providerName\":\"MSSQL\",\"authenticationType\":\"SqlLogin\",\"userName\":' + json.dumps(mssql_username) + ',\"password\":' + json.dumps(mssql_password) + '}'\n",
- " display(HTML('
Click here to connect to SQL Server Master instance
'))\n",
- " display(HTML('
NOTE: The SQL Server password is included in this link, you may want to clear the results of this code cell before saving the notebook.'))\n",
- "else:\n",
- " sys.exit('Could not find the SQL Server Master instance endpoint.')"
- ],
- "metadata": {
- "azdata_cell_guid": "d591785d-71aa-4c5d-9cbb-a7da79bca503",
- "tags": [
- "hide_input"
- ]
- },
- "outputs": [],
- "execution_count": null
- }
- ]
-}
diff --git a/extensions/big-data-cluster/package.json b/extensions/big-data-cluster/package.json
deleted file mode 100644
index cd39a7ac8d..0000000000
--- a/extensions/big-data-cluster/package.json
+++ /dev/null
@@ -1,369 +0,0 @@
-{
- "name": "big-data-cluster",
- "displayName": "%text.sqlServerBigDataClusters%",
- "description": "%description%",
- "version": "1.0.0",
- "publisher": "Microsoft",
- "preview": true,
- "license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt",
- "icon": "images/extension.png",
- "engines": {
- "vscode": "*",
- "azdata": "*"
- },
- "activationEvents": [
- "onCommand:azdata.resource.deploy",
- "onCommand:bigDataClusters.command.mount",
- "onCommand:bigDataClusters.command.refreshmount",
- "onCommand:bigDataClusters.command.deletemount",
- "onCommand:bigDataClusters.command.createController",
- "onCommand:bigDataClusters.command.connectController",
- "onCommand:bigDataClusters.command.removeController",
- "onCommand:bigDataClusters.command.manageController",
- "onCommand:bigDataClusters.command.refreshController",
- "onView:sqlBigDataCluster"
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/Microsoft/azuredatastudio.git"
- },
- "capabilities": {
- "virtualWorkspaces": false,
- "untrustedWorkspaces": {
- "supported": true
- }
- },
- "main": "./out/extension",
- "contributes": {
- "dataExplorer": {
- "sqlBigDataCluster": [
- {
- "id": "sqlBigDataCluster",
- "name": "%text.sqlServerBigDataClusters%"
- }
- ]
- },
- "menus": {
- "commandPalette": [
- {
- "command": "bigDataClusters.command.createController",
- "when": "false"
- },
- {
- "command": "bigDataClusters.command.connectController",
- "when": "false"
- },
- {
- "command": "bigDataClusters.command.removeController",
- "when": "false"
- },
- {
- "command": "bigDataClusters.command.refreshController",
- "when": "false"
- },
- {
- "command": "bigDataClusters.command.manageController",
- "when": "false"
- },
- {
- "command": "bigDataClusters.command.mount",
- "when": "false"
- },
- {
- "command": "bigDataClusters.command.refreshmount",
- "when": "false"
- },
- {
- "command": "bigDataClusters.command.deletemount",
- "when": "false"
- }
- ],
- "view/title": [
- {
- "command": "bigDataClusters.command.createController",
- "when": "view == sqlBigDataCluster",
- "group": "navigation@1"
- },
- {
- "command": "bigDataClusters.command.connectController",
- "when": "view == sqlBigDataCluster",
- "group": "navigation@2"
- }
- ],
- "view/item/context": [
- {
- "command": "bigDataClusters.command.manageController",
- "when": "view == sqlBigDataCluster && viewItem == bigDataClusters.itemType.controllerNode",
- "group": "navigation@1"
- },
- {
- "command": "bigDataClusters.command.refreshController",
- "when": "view == sqlBigDataCluster && viewItem == bigDataClusters.itemType.controllerNode",
- "group": "navigation@2"
- },
- {
- "command": "bigDataClusters.command.removeController",
- "when": "view == sqlBigDataCluster && viewItem == bigDataClusters.itemType.controllerNode",
- "group": "navigation@3"
- }
- ],
- "objectExplorer/item/context": [
- {
- "command": "bigDataClusters.command.mount",
- "when": "nodeType=~/^mssqlCluster/ && nodeType!=mssqlCluster:message && nodeSubType=~/^(?!:mount).*$/",
- "group": "1mssqlCluster@10"
- },
- {
- "command": "bigDataClusters.command.refreshmount",
- "when": "nodeType == mssqlCluster:folder && nodeSubType==:mount:",
- "group": "1mssqlCluster@11"
- },
- {
- "command": "bigDataClusters.command.deletemount",
- "when": "nodeType == mssqlCluster:folder && nodeSubType==:mount:",
- "group": "1mssqlCluster@12"
- }
- ]
- },
- "commands": [
- {
- "command": "bigDataClusters.command.createController",
- "title": "%command.createController.title%",
- "icon": "$(add)"
- },
- {
- "command": "bigDataClusters.command.connectController",
- "title": "%command.connectController.title%",
- "icon": "$(disconnect)"
- },
- {
- "command": "bigDataClusters.command.removeController",
- "title": "%command.removeController.title%",
- "when": "viewItem == bigDataClusters.itemType.controllerNode"
- },
- {
- "command": "bigDataClusters.command.refreshController",
- "title": "%command.refreshController.title%",
- "icon": "$(refresh)"
- },
- {
- "command": "bigDataClusters.command.manageController",
- "title": "%command.manageController.title%"
- },
- {
- "command": "bigDataClusters.command.mount",
- "title": "%command.mount.title%"
- },
- {
- "command": "bigDataClusters.command.refreshmount",
- "title": "%command.refreshmount.title%"
- },
- {
- "command": "bigDataClusters.command.deletemount",
- "title": "%command.deletemount.title%"
- }
- ],
- "configuration": {
- "type": "object",
- "title": "%bdc.configuration.title%",
- "properties": {
- "bigDataCluster.ignoreSslVerification": {
- "type": "boolean",
- "default": true,
- "description": "%bdc.ignoreSslVerification.desc%"
- }
- }
- },
- "viewsWelcome": [
- {
- "view": "sqlBigDataCluster",
- "contents": "%bdc.view.welcome.connect%",
- "when": "bdc.loaded"
- },
- {
- "view": "sqlBigDataCluster",
- "contents": "%bdc.view.welcome.loading%",
- "when": "!bdc.loaded"
- }
- ],
- "resourceDeploymentTypes": [
- {
- "name": "sql-bdc",
- "displayIndex": 3,
- "displayName": "%resource-type-sql-bdc-display-name%",
- "description": "%resource-type-sql-bdc-description%",
- "platforms": "*",
- "icon": "./images/sql_bdc.svg",
- "tags": [
- "On-premises",
- "SQL Server",
- "Cloud"
- ],
- "options": [
- {
- "name": "version",
- "displayName": "%version-display-name%",
- "values": [
- {
- "name": "bdc2019",
- "displayName": "%bdc-2019-display-name%"
- }
- ]
- },
- {
- "name": "target",
- "displayName": "%bdc-deployment-target%",
- "values": [
- {
- "name": "new-aks",
- "displayName": "%bdc-deployment-target-new-aks%"
- },
- {
- "name": "existing-aks",
- "displayName": "%bdc-deployment-target-existing-aks%"
- },
- {
- "name": "existing-kubeadm",
- "displayName": "%bdc-deployment-target-existing-kubeadm%"
- },
- {
- "name": "existing-aro",
- "displayName": "%bdc-deployment-target-existing-aro%"
- },
- {
- "name": "existing-openshift",
- "displayName": "%bdc-deployment-target-existing-openshift%"
- }
- ]
- }
- ],
- "providers": [
- {
- "name": "sql-bdc_new-aks_bdc2019",
- "bdcWizard": {
- "type": "new-aks",
- "notebook": "./notebooks/deployment/2019/deploy-bdc-aks.ipynb"
- },
- "requiredTools": [
- {
- "name": "kubectl",
- "version": "1.13.0"
- },
- {
- "name": "azure-cli"
- },
- {
- "name": "azdata",
- "version": "20.3.9"
- }
- ],
- "when": "target=new-aks&&version=bdc2019"
- },
- {
- "name": "sql-bdc_existing-aks_bdc2019",
- "bdcWizard": {
- "type": "existing-aks",
- "notebook": "./notebooks/deployment/2019/deploy-bdc-existing-aks.ipynb"
- },
- "requiredTools": [
- {
- "name": "kubectl",
- "version": "1.13.0"
- },
- {
- "name": "azdata",
- "version": "20.3.9"
- }
- ],
- "when": "target=existing-aks&&version=bdc2019"
- },
- {
- "name": "sql-bdc_existing-kubeadm_bdc2019",
- "bdcWizard": {
- "type": "existing-kubeadm",
- "notebook": "./notebooks/deployment/2019/deploy-bdc-existing-kubeadm.ipynb"
- },
- "requiredTools": [
- {
- "name": "kubectl",
- "version": "1.13.0"
- },
- {
- "name": "azdata",
- "version": "20.3.9"
- }
- ],
- "when": "target=existing-kubeadm&&version=bdc2019"
- },
- {
- "name": "sql-bdc_existing-aro_bdc2019",
- "bdcWizard": {
- "type": "existing-aro",
- "notebook": "./notebooks/deployment/2019/deploy-bdc-existing-aro.ipynb"
- },
- "requiredTools": [
- {
- "name": "kubectl",
- "version": "1.13.0"
- },
- {
- "name": "azdata",
- "version": "20.3.9"
- }
- ],
- "when": "target=existing-aro&&version=bdc2019"
- },
- {
- "name": "sql-bdc_existing-openshift_bdc2019",
- "bdcWizard": {
- "type": "existing-openshift",
- "notebook": "./notebooks/deployment/2019/deploy-bdc-existing-openshift.ipynb"
- },
- "requiredTools": [
- {
- "name": "kubectl",
- "version": "1.13.0"
- },
- {
- "name": "azdata",
- "version": "20.3.9"
- }
- ],
- "when": "target=existing-openshift&&version=bdc2019"
- }
- ],
- "agreements": [
- {
- "template": "%bdc-agreement%",
- "links": [
- {
- "text": "%microsoft-privacy-statement%",
- "url": "https://go.microsoft.com/fwlink/?LinkId=853010"
- },
- {
- "text": "%bdc-agreement-bdc-eula%",
- "url": "https://go.microsoft.com/fwlink/?LinkId=2002534"
- },
- {
- "text": "%bdc-agreement-azdata-eula%",
- "url": "https://aka.ms/eula-azdata-en"
- }
- ],
- "when": "true"
- }
- ]
- }
- ]
- },
- "dependencies": {
- "@microsoft/ads-kerberos": "^1.1.3",
- "request": "^2.88.0",
- "vscode-nls": "^4.0.0"
- },
- "devDependencies": {
- "@types/request": "^2.48.3"
- },
- "resolutions": {
- "json-schema": "0.4.0"
- }
-}
diff --git a/extensions/big-data-cluster/package.nls.json b/extensions/big-data-cluster/package.nls.json
deleted file mode 100644
index aee045d3ed..0000000000
--- a/extensions/big-data-cluster/package.nls.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "description": "Support for managing SQL Server Big Data Clusters",
- "text.sqlServerBigDataClusters": "SQL Server Big Data Clusters",
- "command.connectController.title": "Connect to Existing Controller",
- "command.createController.title": "Create New Controller",
- "command.removeController.title": "Remove Controller",
- "command.refreshController.title": "Refresh",
- "command.manageController.title": "Manage",
- "command.mount.title": "Mount HDFS",
- "command.refreshmount.title": "Refresh Mount",
- "command.deletemount.title": "Delete Mount",
- "bdc.configuration.title": "Big Data Cluster",
- "bdc.view.welcome.connect": "No SQL Big Data Cluster controllers registered. [Learn More](https://docs.microsoft.com/sql/big-data-cluster/big-data-cluster-overview)\n[Connect Controller](command:bigDataClusters.command.connectController)",
- "bdc.view.welcome.loading": "Loading controllers...",
- "bdc.ignoreSslVerification.desc": "Ignore SSL verification errors against SQL Server Big Data Cluster endpoints such as HDFS, Spark, and Controller if true",
- "resource-type-sql-bdc-display-name": "SQL Server Big Data Cluster",
- "resource-type-sql-bdc-description": "SQL Server Big Data Cluster allows you to deploy scalable clusters of SQL Server, Spark, and HDFS containers running on Kubernetes",
- "version-display-name": "Version",
- "bdc-2019-display-name": "SQL Server 2019",
- "bdc-deployment-target": "Deployment target",
- "bdc-deployment-target-new-aks": "New Azure Kubernetes Service Cluster",
- "bdc-deployment-target-existing-aks": "Existing Azure Kubernetes Service Cluster",
- "bdc-deployment-target-existing-kubeadm": "Existing Kubernetes Cluster (kubeadm)",
- "bdc-deployment-target-existing-aro": "Existing Azure Red Hat OpenShift cluster",
- "bdc-deployment-target-existing-openshift": "Existing OpenShift cluster",
- "bdc-cluster-settings-section-title": "SQL Server Big Data Cluster settings",
- "bdc-cluster-name-field": "Cluster name",
- "bdc-controller-username-field": "Controller username",
- "bdc-password-field": "Password",
- "bdc-confirm-password-field": "Confirm password",
- "bdc-azure-settings-section-title": "Azure settings",
- "bdc-azure-subscription-id-field": "Subscription id",
- "bdc-azure-subscription-id-placeholder": "Use my default Azure subscription",
- "bdc-azure-resource-group-field": "Resource group name",
- "bdc-azure-region-field": "Region",
- "bdc-azure-aks-name-field": "AKS cluster name",
- "bdc-azure-vm-size-field": "VM size",
- "bdc-azure-vm-count-field": "VM count",
- "bdc-storage-class-field": "Storage class name",
- "bdc-data-size-field": "Capacity for data (GB)",
- "bdc-log-size-field": "Capacity for logs (GB)",
- "bdc-agreement": "I accept {0}, {1} and {2}.",
- "microsoft-privacy-statement": "Microsoft Privacy Statement",
- "bdc-agreement-azdata-eula": "azdata License Terms",
- "bdc-agreement-bdc-eula": "SQL Server License Terms"
-}
diff --git a/extensions/big-data-cluster/resources/dark/bigDataCluster_controller.svg b/extensions/big-data-cluster/resources/dark/bigDataCluster_controller.svg
deleted file mode 100644
index 428b8af38c..0000000000
--- a/extensions/big-data-cluster/resources/dark/bigDataCluster_controller.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/extensions/big-data-cluster/resources/dark/copy_inverse.svg b/extensions/big-data-cluster/resources/dark/copy_inverse.svg
deleted file mode 100644
index fa65571127..0000000000
--- a/extensions/big-data-cluster/resources/dark/copy_inverse.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/extensions/big-data-cluster/resources/dark/notebook_inverse.svg b/extensions/big-data-cluster/resources/dark/notebook_inverse.svg
deleted file mode 100644
index 841199cf11..0000000000
--- a/extensions/big-data-cluster/resources/dark/notebook_inverse.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/extensions/big-data-cluster/resources/dark/refresh_inverse.svg b/extensions/big-data-cluster/resources/dark/refresh_inverse.svg
deleted file mode 100644
index d79fdaa4e8..0000000000
--- a/extensions/big-data-cluster/resources/dark/refresh_inverse.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/extensions/big-data-cluster/resources/dark/status_ok_dark.svg b/extensions/big-data-cluster/resources/dark/status_ok_dark.svg
deleted file mode 100644
index 776e1fd909..0000000000
--- a/extensions/big-data-cluster/resources/dark/status_ok_dark.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/extensions/big-data-cluster/resources/dark/status_warning_dark.svg b/extensions/big-data-cluster/resources/dark/status_warning_dark.svg
deleted file mode 100644
index a267963e58..0000000000
--- a/extensions/big-data-cluster/resources/dark/status_warning_dark.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/extensions/big-data-cluster/resources/light/bigDataCluster_controller.svg b/extensions/big-data-cluster/resources/light/bigDataCluster_controller.svg
deleted file mode 100644
index 428b8af38c..0000000000
--- a/extensions/big-data-cluster/resources/light/bigDataCluster_controller.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/extensions/big-data-cluster/resources/light/copy.svg b/extensions/big-data-cluster/resources/light/copy.svg
deleted file mode 100644
index 91692de258..0000000000
--- a/extensions/big-data-cluster/resources/light/copy.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/extensions/big-data-cluster/resources/light/notebook.svg b/extensions/big-data-cluster/resources/light/notebook.svg
deleted file mode 100644
index 2711d10b2a..0000000000
--- a/extensions/big-data-cluster/resources/light/notebook.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/extensions/big-data-cluster/resources/light/refresh.svg b/extensions/big-data-cluster/resources/light/refresh.svg
deleted file mode 100644
index e034574819..0000000000
--- a/extensions/big-data-cluster/resources/light/refresh.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/extensions/big-data-cluster/resources/light/status_ok_light.svg b/extensions/big-data-cluster/resources/light/status_ok_light.svg
deleted file mode 100644
index 776e1fd909..0000000000
--- a/extensions/big-data-cluster/resources/light/status_ok_light.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/extensions/big-data-cluster/resources/light/status_warning_light.svg b/extensions/big-data-cluster/resources/light/status_warning_light.svg
deleted file mode 100644
index f2e2aa741e..0000000000
--- a/extensions/big-data-cluster/resources/light/status_warning_light.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/extensions/big-data-cluster/resources/status_circle_blank.svg b/extensions/big-data-cluster/resources/status_circle_blank.svg
deleted file mode 100644
index af5badbac8..0000000000
--- a/extensions/big-data-cluster/resources/status_circle_blank.svg
+++ /dev/null
@@ -1,2 +0,0 @@
-
\ No newline at end of file
diff --git a/extensions/big-data-cluster/resources/status_circle_red.svg b/extensions/big-data-cluster/resources/status_circle_red.svg
deleted file mode 100644
index f73edde71c..0000000000
--- a/extensions/big-data-cluster/resources/status_circle_red.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/extensions/big-data-cluster/src/bdc.d.ts b/extensions/big-data-cluster/src/bdc.d.ts
deleted file mode 100644
index c1420a3bd2..0000000000
--- a/extensions/big-data-cluster/src/bdc.d.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-declare module 'bdc' {
-
- export const enum constants {
- extensionName = 'Microsoft.big-data-cluster'
- }
-
- export interface IExtension {
- getClusterController(url: string, authType: AuthType, username?: string, password?: string): IClusterController;
- }
-
- export interface IEndpointModel {
- name?: string;
- description?: string;
- endpoint?: string;
- protocol?: string;
- }
-
- export interface IHttpResponse {
- method?: string;
- url?: string;
- statusCode?: number;
- statusMessage?: string;
- }
-
- export interface IEndPointsResponse {
- response: IHttpResponse;
- endPoints: IEndpointModel[];
- }
-
- export type AuthType = 'integrated' | 'basic';
-
- export interface IClusterController {
- getClusterConfig(): Promise;
- getKnoxUsername(defaultUsername: string): Promise;
- getEndPoints(promptConnect?: boolean): Promise
- username: string;
- password: string;
- }
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/auth.ts b/extensions/big-data-cluster/src/bigDataCluster/auth.ts
deleted file mode 100644
index f35c282ba9..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/auth.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as kerberos from '@microsoft/ads-kerberos';
-import * as vscode from 'vscode';
-
-export async function authenticateKerberos(hostname: string): Promise {
- const service = 'HTTP' + (process.platform === 'win32' ? '/' : '@') + hostname;
- const mechOID = kerberos.GSS_MECH_OID_KRB5;
- let client = await kerberos.initializeClient(service, { mechOID });
- let response = await client.step('');
- return response;
-}
-
-
-type HostAndIp = { host: string, port: string };
-
-export function getHostAndPortFromEndpoint(endpoint: string): HostAndIp {
- let authority = vscode.Uri.parse(endpoint).authority;
- let hostAndPortRegex = /^(.*)([,:](\d+))/g;
- let match = hostAndPortRegex.exec(authority);
- if (match) {
- return {
- host: match[1],
- port: match[3]
- };
- }
- return {
- host: authority,
- port: undefined
- };
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/constants.ts b/extensions/big-data-cluster/src/bigDataCluster/constants.ts
deleted file mode 100644
index 26f9de0804..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/constants.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as vscode from 'vscode';
-
-export enum BdcItemType {
- controllerRoot = 'bigDataClusters.itemType.controllerRootNode',
- controller = 'bigDataClusters.itemType.controllerNode',
- loadingController = 'bigDataClusters.itemType.loadingControllerNode'
-}
-
-export interface IconPath {
- dark: string;
- light: string;
-}
-
-export class IconPathHelper {
- private static extensionContext: vscode.ExtensionContext;
-
- public static controllerNode: IconPath;
- public static copy: IconPath;
- public static refresh: IconPath;
- public static status_ok: IconPath;
- public static status_warning: IconPath;
- public static notebook: IconPath;
- public static status_circle_red: IconPath;
- public static status_circle_blank: IconPath;
-
- public static setExtensionContext(extensionContext: vscode.ExtensionContext) {
- IconPathHelper.extensionContext = extensionContext;
- IconPathHelper.controllerNode = {
- dark: IconPathHelper.extensionContext.asAbsolutePath('resources/dark/bigDataCluster_controller.svg'),
- light: IconPathHelper.extensionContext.asAbsolutePath('resources/light/bigDataCluster_controller.svg')
- };
- IconPathHelper.copy = {
- light: IconPathHelper.extensionContext.asAbsolutePath('resources/light/copy.svg'),
- dark: IconPathHelper.extensionContext.asAbsolutePath('resources/dark/copy_inverse.svg')
- };
- IconPathHelper.refresh = {
- light: IconPathHelper.extensionContext.asAbsolutePath('resources/light/refresh.svg'),
- dark: IconPathHelper.extensionContext.asAbsolutePath('resources/dark/refresh_inverse.svg')
- };
- IconPathHelper.status_ok = {
- light: IconPathHelper.extensionContext.asAbsolutePath('resources/light/status_ok_light.svg'),
- dark: IconPathHelper.extensionContext.asAbsolutePath('resources/dark/status_ok_dark.svg')
- };
- IconPathHelper.status_warning = {
- light: IconPathHelper.extensionContext.asAbsolutePath('resources/light/status_warning_light.svg'),
- dark: IconPathHelper.extensionContext.asAbsolutePath('resources/dark/status_warning_dark.svg')
- };
- IconPathHelper.notebook = {
- light: IconPathHelper.extensionContext.asAbsolutePath('resources/light/notebook.svg'),
- dark: IconPathHelper.extensionContext.asAbsolutePath('resources/dark/notebook_inverse.svg')
- };
- IconPathHelper.status_circle_red = {
- light: IconPathHelper.extensionContext.asAbsolutePath('resources/status_circle_red.svg'),
- dark: IconPathHelper.extensionContext.asAbsolutePath('resources/status_circle_red.svg')
- };
- IconPathHelper.status_circle_blank = {
- light: IconPathHelper.extensionContext.asAbsolutePath('resources/status_circle_blank.svg'),
- dark: IconPathHelper.extensionContext.asAbsolutePath('resources/status_circle_blank.svg')
- };
- }
-}
-
-export namespace cssStyles {
- export const title = { 'font-size': '14px', 'font-weight': '600' };
- export const tableHeader = { 'text-align': 'left', 'font-weight': 'bold', 'text-transform': 'uppercase', 'font-size': '10px', 'user-select': 'text' };
- export const text = { 'margin-block-start': '0px', 'margin-block-end': '0px' };
- export const lastUpdatedText = { ...text, 'color': '#595959' };
- export const errorText = { ...text, 'color': 'red' };
-}
-
-export const clusterEndpointsProperty = 'clusterEndpoints';
-export const controllerEndpointName = 'controller';
diff --git a/extensions/big-data-cluster/src/bigDataCluster/controller/apiGenerated.ts b/extensions/big-data-cluster/src/bigDataCluster/controller/apiGenerated.ts
deleted file mode 100644
index f2ce5d540e..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/controller/apiGenerated.ts
+++ /dev/null
@@ -1,1821 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-/* tslint:disable: no-unexternalized-strings */
-/* tslint:disable: semicolon */
-/* tslint:disable: triple-equals */
-/* tslint:disable: no-redundant-jsdoc */
-
-import localVarRequest = require('request');
-import http = require('http');
-import * as bdc from 'bdc';
-
-let defaultBasePath = 'https://localhost';
-
-// ===============================================
-// This file is autogenerated - Please do not edit
-// ===============================================
-
-/* tslint:disable:no-unused-variable */
-let primitives = [
- "string",
- "boolean",
- "double",
- "integer",
- "long",
- "float",
- "number",
- "any"
- ];
-
-class ObjectSerializer {
-
- public static findCorrectType(data: any, expectedType: string) {
- if (data == undefined) {
- return expectedType;
- } else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
- return expectedType;
- } else if (expectedType === "Date") {
- return expectedType;
- } else {
- if (enumsMap[expectedType]) {
- return expectedType;
- }
-
- if (!typeMap[expectedType]) {
- return expectedType; // w/e we don't know the type
- }
-
- // Check the discriminator
- let discriminatorProperty = typeMap[expectedType].discriminator;
- if (discriminatorProperty == null) {
- return expectedType; // the type does not have a discriminator. use it.
- } else {
- if (data[discriminatorProperty]) {
- return data[discriminatorProperty]; // use the type given in the discriminator
- } else {
- return expectedType; // discriminator was not present (or an empty string)
- }
- }
- }
- }
-
- public static serialize(data: any, type: string) {
- if (data == undefined) {
- return data;
- } else if (primitives.indexOf(type.toLowerCase()) !== -1) {
- return data;
- } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
- let subType: string = type.replace("Array<", ""); // Array => Type>
- subType = subType.substring(0, subType.length - 1); // Type> => Type
- let transformedData: any[] = [];
- for (let index in data) {
- let date = data[index];
- transformedData.push(ObjectSerializer.serialize(date, subType));
- }
- return transformedData;
- } else if (type === "Date") {
- return data.toString();
- } else {
- if (enumsMap[type]) {
- return data;
- }
- if (!typeMap[type]) { // in case we dont know the type
- return data;
- }
-
- // get the map for the correct type.
- let attributeTypes = typeMap[type].getAttributeTypeMap();
- let instance: {[index: string]: any} = {};
- for (let index in attributeTypes) {
- let attributeType = attributeTypes[index];
- instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
- }
- return instance;
- }
- }
-
- public static deserialize(data: any, type: string) {
- // polymorphism may change the actual type.
- type = ObjectSerializer.findCorrectType(data, type);
- if (data == undefined) {
- return data;
- } else if (primitives.indexOf(type.toLowerCase()) !== -1) {
- return data;
- } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
- let subType: string = type.replace("Array<", ""); // Array => Type>
- subType = subType.substring(0, subType.length - 1); // Type> => Type
- let transformedData: any[] = [];
- for (let index in data) {
- let date = data[index];
- transformedData.push(ObjectSerializer.deserialize(date, subType));
- }
- return transformedData;
- } else if (type === "Date") {
- return new Date(data);
- } else {
- if (enumsMap[type]) {// is Enum
- return data;
- }
-
- if (!typeMap[type]) { // dont know the type
- return data;
- }
- let instance = new typeMap[type]();
- let attributeTypes = typeMap[type].getAttributeTypeMap();
- for (let index in attributeTypes) {
- let attributeType = attributeTypes[index];
- instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
- }
- return instance;
- }
- }
-}
-
-export class BdcStatusModel {
- 'bdcName'?: string;
- 'state'?: string;
- 'healthStatus'?: string;
- 'details'?: string;
- 'services'?: Array;
-
- static discriminator: string | undefined = undefined;
-
- static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
- {
- "name": "bdcName",
- "baseName": "bdcName",
- "type": "string"
- },
- {
- "name": "state",
- "baseName": "state",
- "type": "string"
- },
- {
- "name": "healthStatus",
- "baseName": "healthStatus",
- "type": "string"
- },
- {
- "name": "details",
- "baseName": "details",
- "type": "string"
- },
- {
- "name": "services",
- "baseName": "services",
- "type": "Array"
- } ];
-
- static getAttributeTypeMap() {
- return BdcStatusModel.attributeTypeMap;
- }
-}
-
-export class Dashboards {
- 'nodeMetricsUrl'?: string;
- 'sqlMetricsUrl'?: string;
- 'logsUrl'?: string;
-
- static discriminator: string | undefined = undefined;
-
- static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
- {
- "name": "nodeMetricsUrl",
- "baseName": "nodeMetricsUrl",
- "type": "string"
- },
- {
- "name": "sqlMetricsUrl",
- "baseName": "sqlMetricsUrl",
- "type": "string"
- },
- {
- "name": "logsUrl",
- "baseName": "logsUrl",
- "type": "string"
- } ];
-
- static getAttributeTypeMap() {
- return Dashboards.attributeTypeMap;
- }
-}
-
-export class EndpointModel implements bdc.IEndpointModel {
- 'name'?: string;
- 'description'?: string;
- 'endpoint'?: string;
- 'protocol'?: string;
-
- static discriminator: string | undefined = undefined;
-
- static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
- {
- "name": "name",
- "baseName": "name",
- "type": "string"
- },
- {
- "name": "description",
- "baseName": "description",
- "type": "string"
- },
- {
- "name": "endpoint",
- "baseName": "endpoint",
- "type": "string"
- },
- {
- "name": "protocol",
- "baseName": "protocol",
- "type": "string"
- } ];
-
- static getAttributeTypeMap() {
- return EndpointModel.attributeTypeMap;
- }
-}
-
-export class InstanceStatusModel {
- 'instanceName'?: string;
- 'state'?: string;
- 'healthStatus'?: string;
- 'details'?: string;
- 'dashboards'?: Dashboards;
-
- static discriminator: string | undefined = undefined;
-
- static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
- {
- "name": "instanceName",
- "baseName": "instanceName",
- "type": "string"
- },
- {
- "name": "state",
- "baseName": "state",
- "type": "string"
- },
- {
- "name": "healthStatus",
- "baseName": "healthStatus",
- "type": "string"
- },
- {
- "name": "details",
- "baseName": "details",
- "type": "string"
- },
- {
- "name": "dashboards",
- "baseName": "dashboards",
- "type": "Dashboards"
- } ];
-
- static getAttributeTypeMap() {
- return InstanceStatusModel.attributeTypeMap;
- }
-}
-
-export class ResourceStatusModel {
- 'resourceName'?: string;
- 'state'?: string;
- 'healthStatus'?: string;
- 'details'?: string;
- 'instances'?: Array;
-
- static discriminator: string | undefined = undefined;
-
- static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
- {
- "name": "resourceName",
- "baseName": "resourceName",
- "type": "string"
- },
- {
- "name": "state",
- "baseName": "state",
- "type": "string"
- },
- {
- "name": "healthStatus",
- "baseName": "healthStatus",
- "type": "string"
- },
- {
- "name": "details",
- "baseName": "details",
- "type": "string"
- },
- {
- "name": "instances",
- "baseName": "instances",
- "type": "Array"
- } ];
-
- static getAttributeTypeMap() {
- return ResourceStatusModel.attributeTypeMap;
- }
-}
-
-export class ServiceStatusModel {
- 'serviceName'?: string;
- 'state'?: string;
- 'healthStatus'?: string;
- 'details'?: string;
- 'resources'?: Array;
-
- static discriminator: string | undefined = undefined;
-
- static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
- {
- "name": "serviceName",
- "baseName": "serviceName",
- "type": "string"
- },
- {
- "name": "state",
- "baseName": "state",
- "type": "string"
- },
- {
- "name": "healthStatus",
- "baseName": "healthStatus",
- "type": "string"
- },
- {
- "name": "details",
- "baseName": "details",
- "type": "string"
- },
- {
- "name": "resources",
- "baseName": "resources",
- "type": "Array"
- } ];
-
- static getAttributeTypeMap() {
- return ServiceStatusModel.attributeTypeMap;
- }
-}
-
-
-let enumsMap: {[index: string]: any} = {
-}
-
-let typeMap: {[index: string]: any} = {
- "BdcStatusModel": BdcStatusModel,
- "Dashboards": Dashboards,
- "EndpointModel": EndpointModel,
- "InstanceStatusModel": InstanceStatusModel,
- "ResourceStatusModel": ResourceStatusModel,
- "ServiceStatusModel": ServiceStatusModel,
-}
-
-export interface Authentication {
- /**
- * Apply authentication settings to header and query params.
- */
- applyToRequest(requestOptions: localVarRequest.Options): void;
-}
-
-export class HttpBasicAuth implements Authentication {
- public username: string = '';
- public password: string = '';
-
- applyToRequest(requestOptions: localVarRequest.Options): void {
- requestOptions.auth = {
- username: this.username, password: this.password
- }
- }
-}
-
-export class ApiKeyAuth implements Authentication {
- public apiKey: string = '';
-
- constructor(private location: string, private paramName: string) {
- }
-
- applyToRequest(requestOptions: localVarRequest.Options): void {
- if (this.location == "query") {
- (requestOptions.qs)[this.paramName] = this.apiKey;
- } else if (this.location == "header" && requestOptions && requestOptions.headers) {
- requestOptions.headers[this.paramName] = this.apiKey;
- }
- }
-}
-
-export class OAuth implements Authentication {
- public accessToken: string = '';
-
- applyToRequest(requestOptions: localVarRequest.Options): void {
- if (requestOptions && requestOptions.headers) {
- requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
- }
- }
-}
-
-export class VoidAuth implements Authentication {
- public username: string = '';
- public password: string = '';
-
- applyToRequest(_: localVarRequest.Options): void {
- // Do nothing
- }
-}
-
-export enum BdcRouterApiApiKeys {
-}
-
-export class BdcRouterApi {
- protected _basePath = defaultBasePath;
- protected defaultHeaders : any = {};
- protected _useQuerystring : boolean = false;
-
- protected authentications = {
- 'default': new VoidAuth(),
- 'basicAuth': new HttpBasicAuth(),
- }
-
- constructor(basePath?: string);
- constructor(username: string, password: string, basePath?: string);
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
- if (password) {
- this.username = basePathOrUsername;
- this.password = password
- if (basePath) {
- this.basePath = basePath;
- }
- } else {
- if (basePathOrUsername) {
- this.basePath = basePathOrUsername
- }
- }
- }
-
- set useQuerystring(value: boolean) {
- this._useQuerystring = value;
- }
-
- set basePath(basePath: string) {
- this._basePath = basePath;
- }
-
- get basePath() {
- return this._basePath;
- }
-
- public setDefaultAuthentication(auth: Authentication) {
- this.authentications.default = auth;
- }
-
- public setApiKey(key: BdcRouterApiApiKeys, value: string) {
- (this.authentications as any)[BdcRouterApiApiKeys[key]].apiKey = value;
- }
- set username(username: string) {
- this.authentications.basicAuth.username = username;
- }
-
- set password(password: string) {
- this.authentications.basicAuth.password = password;
- }
- /**
- *
- * @summary Create a cluster
- * @param xRequestId
- * @param connection
- * @param data Cluster configuration in JSON format
- * @param {*} [options] Override http request options.
- */
- public createCluster (xRequestId: string, connection: string, data: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: any; }> {
- const localVarPath = this.basePath + '/api/v1/bdc';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'xRequestId' is not null or undefined
- if (xRequestId === null || xRequestId === undefined) {
- throw new Error('Required parameter xRequestId was null or undefined when calling createCluster.');
- }
-
- // verify required parameter 'connection' is not null or undefined
- if (connection === null || connection === undefined) {
- throw new Error('Required parameter connection was null or undefined when calling createCluster.');
- }
-
- // verify required parameter 'data' is not null or undefined
- if (data === null || data === undefined) {
- throw new Error('Required parameter data was null or undefined when calling createCluster.');
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'POST',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- body: ObjectSerializer.serialize(data, "string")
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "any");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @param endpointName
- * @param {*} [options] Override http request options.
- */
- public endpointsByNameGet (endpointName: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: EndpointModel; }> {
- const localVarPath = this.basePath + '/api/v1/bdc/endpoints/{endpointName}'
- .replace('{' + 'endpointName' + '}', encodeURIComponent(String(endpointName)));
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'endpointName' is not null or undefined
- if (endpointName === null || endpointName === undefined) {
- throw new Error('Required parameter endpointName was null or undefined when calling endpointsByNameGet.');
- }
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: EndpointModel; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "EndpointModel");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @param {*} [options] Override http request options.
- */
- public endpointsGet (options: any = {}) : Promise<{ response: http.IncomingMessage; body: Array; }> {
- const localVarPath = this.basePath + '/api/v1/bdc/endpoints';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: Array; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "Array");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Get BDC status of services that contain this resource
- * @param resourceName The name of the resource you want the services for
- * @param xRequestId
- * @param connection
- * @param all Whether you want all of the instances within the given resource
- * @param {*} [options] Override http request options.
- */
- public getBdcResourceStatus (resourceName: string, xRequestId?: string, connection?: string, all?: boolean, options: any = {}) : Promise<{ response: http.IncomingMessage; body: BdcStatusModel; }> {
- const localVarPath = this.basePath + '/api/v1/bdc/resources/{resourceName}/status'
- .replace('{' + 'resourceName' + '}', encodeURIComponent(String(resourceName)));
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'resourceName' is not null or undefined
- if (resourceName === null || resourceName === undefined) {
- throw new Error('Required parameter resourceName was null or undefined when calling getBdcResourceStatus.');
- }
-
- if (all !== undefined) {
- localVarQueryParameters['all'] = ObjectSerializer.serialize(all, "boolean");
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: BdcStatusModel; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "BdcStatusModel");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Get resource status within this service
- * @param serviceName The name of the service in the BDC cluster that you want
- * @param resourceName The name of the resource in the service that you want
- * @param xRequestId
- * @param connection
- * @param all Whether you want all of the instances within the given resource
- * @param {*} [options] Override http request options.
- */
- public getBdcServiceResourceStatus (serviceName: string, resourceName: string, xRequestId?: string, connection?: string, all?: boolean, options: any = {}) : Promise<{ response: http.IncomingMessage; body: ResourceStatusModel; }> {
- const localVarPath = this.basePath + '/api/v1/bdc/services/{serviceName}/resources/{resourceName}/status'
- .replace('{' + 'serviceName' + '}', encodeURIComponent(String(serviceName)))
- .replace('{' + 'resourceName' + '}', encodeURIComponent(String(resourceName)));
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'serviceName' is not null or undefined
- if (serviceName === null || serviceName === undefined) {
- throw new Error('Required parameter serviceName was null or undefined when calling getBdcServiceResourceStatus.');
- }
-
- // verify required parameter 'resourceName' is not null or undefined
- if (resourceName === null || resourceName === undefined) {
- throw new Error('Required parameter resourceName was null or undefined when calling getBdcServiceResourceStatus.');
- }
-
- if (all !== undefined) {
- localVarQueryParameters['all'] = ObjectSerializer.serialize(all, "boolean");
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: ResourceStatusModel; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "ResourceStatusModel");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Get BDC status
- * @param xRequestId
- * @param connection
- * @param all Whether you want all of the instances within the given resource
- * @param {*} [options] Override http request options.
- */
- public getBdcStatus (xRequestId?: string, connection?: string, all?: boolean, options: any = {}) : Promise<{ response: http.IncomingMessage; body: BdcStatusModel; }> {
- const localVarPath = this.basePath + '/api/v1/bdc/status';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- if (all !== undefined) {
- localVarQueryParameters['all'] = ObjectSerializer.serialize(all, "boolean");
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: BdcStatusModel; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "BdcStatusModel");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
-
- /**
- *
- * @summary Get cluster config
- * @param xRequestId
- * @param connection
- * @param {*} [options] Override http request options.
- */
- public getCluster (xRequestId?: string, connection?: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: any; }> {
- const localVarPath = this.basePath + '/api/v1/bdc/';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "any");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Get console logs
- * @param xRequestId
- * @param connection
- * @param offset
- * @param {*} [options] Override http request options.
- */
- public getLogs (xRequestId: string, connection: string, offset: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: string; }> {
- const localVarPath = this.basePath + '/api/v1/bdc/log';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'xRequestId' is not null or undefined
- if (xRequestId === null || xRequestId === undefined) {
- throw new Error('Required parameter xRequestId was null or undefined when calling getLogs.');
- }
-
- // verify required parameter 'connection' is not null or undefined
- if (connection === null || connection === undefined) {
- throw new Error('Required parameter connection was null or undefined when calling getLogs.');
- }
-
- // verify required parameter 'offset' is not null or undefined
- if (offset === null || offset === undefined) {
- throw new Error('Required parameter offset was null or undefined when calling getLogs.');
- }
-
- if (offset !== undefined) {
- localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number");
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "string");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
-}
-export enum ControlRouterApiApiKeys {
-}
-
-export class ControlRouterApi {
- protected _basePath = defaultBasePath;
- protected defaultHeaders : any = {};
- protected _useQuerystring : boolean = false;
-
- protected authentications = {
- 'default': new VoidAuth(),
- 'basicAuth': new HttpBasicAuth(),
- }
-
- constructor(basePath?: string);
- constructor(username: string, password: string, basePath?: string);
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
- if (password) {
- this.username = basePathOrUsername;
- this.password = password
- if (basePath) {
- this.basePath = basePath;
- }
- } else {
- if (basePathOrUsername) {
- this.basePath = basePathOrUsername
- }
- }
- }
-
- set useQuerystring(value: boolean) {
- this._useQuerystring = value;
- }
-
- set basePath(basePath: string) {
- this._basePath = basePath;
- }
-
- get basePath() {
- return this._basePath;
- }
-
- public setDefaultAuthentication(auth: Authentication) {
- this.authentications.default = auth;
- }
-
- public setApiKey(key: ControlRouterApiApiKeys, value: string) {
- (this.authentications as any)[ControlRouterApiApiKeys[key]].apiKey = value;
- }
- set username(username: string) {
- this.authentications.basicAuth.username = username;
- }
-
- set password(password: string) {
- this.authentications.basicAuth.password = password;
- }
- /**
- *
- * @summary Get control status
- * @param xRequestId
- * @param connection
- * @param {*} [options] Override http request options.
- */
- public getControlStatus (xRequestId: string, connection: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: any; }> {
- const localVarPath = this.basePath + '/api/v1/control/status';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'xRequestId' is not null or undefined
- if (xRequestId === null || xRequestId === undefined) {
- throw new Error('Required parameter xRequestId was null or undefined when calling getControlStatus.');
- }
-
- // verify required parameter 'connection' is not null or undefined
- if (connection === null || connection === undefined) {
- throw new Error('Required parameter connection was null or undefined when calling getControlStatus.');
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "any");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
-}
-export enum DefaultApiApiKeys {
-}
-
-export class DefaultApi {
- protected _basePath = defaultBasePath;
- protected defaultHeaders : any = {};
- protected _useQuerystring : boolean = false;
-
- protected authentications = {
- 'default': new VoidAuth(),
- 'basicAuth': new HttpBasicAuth(),
- }
-
- constructor(basePath?: string);
- constructor(username: string, password: string, basePath?: string);
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
- if (password) {
- this.username = basePathOrUsername;
- this.password = password
- if (basePath) {
- this.basePath = basePath;
- }
- } else {
- if (basePathOrUsername) {
- this.basePath = basePathOrUsername
- }
- }
- }
-
- set useQuerystring(value: boolean) {
- this._useQuerystring = value;
- }
-
- set basePath(basePath: string) {
- this._basePath = basePath;
- }
-
- get basePath() {
- return this._basePath;
- }
-
- public setDefaultAuthentication(auth: Authentication) {
- this.authentications.default = auth;
- }
-
- public setApiKey(key: DefaultApiApiKeys, value: string) {
- (this.authentications as any)[DefaultApiApiKeys[key]].apiKey = value;
- }
- set username(username: string) {
- this.authentications.basicAuth.username = username;
- }
-
- set password(password: string) {
- this.authentications.basicAuth.password = password;
- }
- /**
- *
- * @summary Create a mount
- * @param xRequestId
- * @param connection
- * @param remote URI of remote store to mount
- * @param mount Local path to mount on
- * @param credentials Credentials to create the mount
- * @param {*} [options] Override http request options.
- */
- public createMount (xRequestId: string, connection: string, remote: string, mount: string, credentials?: any, options: any = {}) : Promise<{ response: http.IncomingMessage; body: any; }> {
- const localVarPath = this.basePath + '/api/v1/bdc/services/hdfs/mounts';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'xRequestId' is not null or undefined
- if (xRequestId === null || xRequestId === undefined) {
- throw new Error('Required parameter xRequestId was null or undefined when calling createMount.');
- }
-
- // verify required parameter 'connection' is not null or undefined
- if (connection === null || connection === undefined) {
- throw new Error('Required parameter connection was null or undefined when calling createMount.');
- }
-
- // verify required parameter 'remote' is not null or undefined
- if (remote === null || remote === undefined) {
- throw new Error('Required parameter remote was null or undefined when calling createMount.');
- }
-
- // verify required parameter 'mount' is not null or undefined
- if (mount === null || mount === undefined) {
- throw new Error('Required parameter mount was null or undefined when calling createMount.');
- }
-
- if (remote !== undefined) {
- localVarQueryParameters['remote'] = ObjectSerializer.serialize(remote, "string");
- }
-
- if (mount !== undefined) {
- localVarQueryParameters['mount'] = ObjectSerializer.serialize(mount, "string");
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'POST',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- body: ObjectSerializer.serialize(credentials, "any")
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "any");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Delete a cluster
- * @param xRequestId
- * @param connection
- * @param {*} [options] Override http request options.
- */
- public deleteCluster (xRequestId: string, connection: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: any; }> {
- const localVarPath = this.basePath + '/api/v1/bdc/';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'xRequestId' is not null or undefined
- if (xRequestId === null || xRequestId === undefined) {
- throw new Error('Required parameter xRequestId was null or undefined when calling deleteCluster.');
- }
-
- // verify required parameter 'connection' is not null or undefined
- if (connection === null || connection === undefined) {
- throw new Error('Required parameter connection was null or undefined when calling deleteCluster.');
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'DELETE',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "any");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Delete a mount
- * @param xRequestId
- * @param connection
- * @param mount Local HDFS mount path
- * @param {*} [options] Override http request options.
- */
- public deleteMount (xRequestId: string, connection: string, mount: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: any; }> {
- const localVarPath = this.basePath + '/api/v1/bdc/services/hdfs/mounts';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'xRequestId' is not null or undefined
- if (xRequestId === null || xRequestId === undefined) {
- throw new Error('Required parameter xRequestId was null or undefined when calling deleteMount.');
- }
-
- // verify required parameter 'connection' is not null or undefined
- if (connection === null || connection === undefined) {
- throw new Error('Required parameter connection was null or undefined when calling deleteMount.');
- }
-
- // verify required parameter 'mount' is not null or undefined
- if (mount === null || mount === undefined) {
- throw new Error('Required parameter mount was null or undefined when calling deleteMount.');
- }
-
- if (mount !== undefined) {
- localVarQueryParameters['mount'] = ObjectSerializer.serialize(mount, "string");
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'DELETE',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "any");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Get health properties with specific query
- * @param xRequestId
- * @param connection
- * @param query The query in the json format for the health properties
- * @param {*} [options] Override http request options.
- */
- public getHealthProperties (xRequestId: string, connection: string, query: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: any; }> {
- const localVarPath = this.basePath + '/api/v1/health';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'xRequestId' is not null or undefined
- if (xRequestId === null || xRequestId === undefined) {
- throw new Error('Required parameter xRequestId was null or undefined when calling getHealthProperties.');
- }
-
- // verify required parameter 'connection' is not null or undefined
- if (connection === null || connection === undefined) {
- throw new Error('Required parameter connection was null or undefined when calling getHealthProperties.');
- }
-
- // verify required parameter 'query' is not null or undefined
- if (query === null || query === undefined) {
- throw new Error('Required parameter query was null or undefined when calling getHealthProperties.');
- }
-
- if (query !== undefined) {
- localVarQueryParameters['query'] = ObjectSerializer.serialize(query, "string");
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "any");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Retrieve home page of Controller service
- * @param xRequestId
- * @param connection
- * @param {*} [options] Override http request options.
- */
- public getHome (xRequestId: string, connection: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/api/v1';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'xRequestId' is not null or undefined
- if (xRequestId === null || xRequestId === undefined) {
- throw new Error('Required parameter xRequestId was null or undefined when calling getHome.');
- }
-
- // verify required parameter 'connection' is not null or undefined
- if (connection === null || connection === undefined) {
- throw new Error('Required parameter connection was null or undefined when calling getHome.');
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Get resource status
- * @param bdcName The name of the BDC cluster from which you want the status
- * @param serviceName The name of the service in the BDC cluster that you want
- * @param xRequestId
- * @param connection
- * @param all Whether you want all of the instances within the given resource
- * @param {*} [options] Override http request options.
- */
- public getPoolStatus (bdcName: string, serviceName: string, xRequestId?: string, connection?: string, all?: boolean, options: any = {}) : Promise<{ response: http.IncomingMessage; body: ServiceStatusModel; }> {
- const localVarPath = this.basePath + '/api/v1/bdc/services/{serviceName}/status'
- .replace('{' + 'bdcName' + '}', encodeURIComponent(String(bdcName)))
- .replace('{' + 'serviceName' + '}', encodeURIComponent(String(serviceName)));
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'bdcName' is not null or undefined
- if (bdcName === null || bdcName === undefined) {
- throw new Error('Required parameter bdcName was null or undefined when calling getPoolStatus.');
- }
-
- // verify required parameter 'serviceName' is not null or undefined
- if (serviceName === null || serviceName === undefined) {
- throw new Error('Required parameter serviceName was null or undefined when calling getPoolStatus.');
- }
-
- if (all !== undefined) {
- localVarQueryParameters['all'] = ObjectSerializer.serialize(all, "boolean");
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: ServiceStatusModel; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "ServiceStatusModel");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Get list of all mounts
- * @param xRequestId
- * @param connection
- * @param mount
- * @param {*} [options] Override http request options.
- */
- public listMounts (xRequestId: string, connection: string, mount?: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: any; }> {
- const localVarPath = this.basePath + '/api/v1/bdc/services/hdfs/mounts';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'xRequestId' is not null or undefined
- if (xRequestId === null || xRequestId === undefined) {
- throw new Error('Required parameter xRequestId was null or undefined when calling listMounts.');
- }
-
- // verify required parameter 'connection' is not null or undefined
- if (connection === null || connection === undefined) {
- throw new Error('Required parameter connection was null or undefined when calling listMounts.');
- }
-
- if (mount !== undefined) {
- localVarQueryParameters['mount'] = ObjectSerializer.serialize(mount, "string");
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "any");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Refresh a mount
- * @param xRequestId
- * @param connection
- * @param mount Local path to mount on HDFS
- * @param {*} [options] Override http request options.
- */
- public refreshMount (xRequestId: string, connection: string, mount: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: any; }> {
- const localVarPath = this.basePath + '/api/v1/bdc/services/hdfs/mounts/refresh';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'xRequestId' is not null or undefined
- if (xRequestId === null || xRequestId === undefined) {
- throw new Error('Required parameter xRequestId was null or undefined when calling refreshMount.');
- }
-
- // verify required parameter 'connection' is not null or undefined
- if (connection === null || connection === undefined) {
- throw new Error('Required parameter connection was null or undefined when calling refreshMount.');
- }
-
- // verify required parameter 'mount' is not null or undefined
- if (mount === null || mount === undefined) {
- throw new Error('Required parameter mount was null or undefined when calling refreshMount.');
- }
-
- if (mount !== undefined) {
- localVarQueryParameters['mount'] = ObjectSerializer.serialize(mount, "string");
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'POST',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "any");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Update the password for the given service and user
- * @param xRequestId
- * @param connection
- * @param serviceName
- * @param serviceUsername
- * @param data Password and cluster name in JSON format
- * @param {*} [options] Override http request options.
- */
- public updatePassword (xRequestId: string, connection: string, serviceName: string, serviceUsername: string, data: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/api/v1/passwords/{serviceName}/{serviceUsername}'
- .replace('{' + 'serviceName' + '}', encodeURIComponent(String(serviceName)))
- .replace('{' + 'serviceUsername' + '}', encodeURIComponent(String(serviceUsername)));
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'xRequestId' is not null or undefined
- if (xRequestId === null || xRequestId === undefined) {
- throw new Error('Required parameter xRequestId was null or undefined when calling updatePassword.');
- }
-
- // verify required parameter 'connection' is not null or undefined
- if (connection === null || connection === undefined) {
- throw new Error('Required parameter connection was null or undefined when calling updatePassword.');
- }
-
- // verify required parameter 'serviceName' is not null or undefined
- if (serviceName === null || serviceName === undefined) {
- throw new Error('Required parameter serviceName was null or undefined when calling updatePassword.');
- }
-
- // verify required parameter 'serviceUsername' is not null or undefined
- if (serviceUsername === null || serviceUsername === undefined) {
- throw new Error('Required parameter serviceUsername was null or undefined when calling updatePassword.');
- }
-
- // verify required parameter 'data' is not null or undefined
- if (data === null || data === undefined) {
- throw new Error('Required parameter data was null or undefined when calling updatePassword.');
- }
-
- localVarHeaderParams['X-Request-Id'] = ObjectSerializer.serialize(xRequestId, "string");
- localVarHeaderParams['Connection'] = ObjectSerializer.serialize(connection, "string");
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'PUT',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- body: ObjectSerializer.serialize(data, "string")
- };
-
- this.authentications.basicAuth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/controller/clusterApiGenerated2.ts b/extensions/big-data-cluster/src/bigDataCluster/controller/clusterApiGenerated2.ts
deleted file mode 100644
index bd2bf7b84b..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/controller/clusterApiGenerated2.ts
+++ /dev/null
@@ -1,1510 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-// Note: this file will hopefully be merged with apiGenerated.ts at a later date, once the server-side code
-// is available from a single source of truth. Until then, keeping as separate files
-
-/* tslint:disable: no-unexternalized-strings */
-/* tslint:disable: semicolon */
-/* tslint:disable: triple-equals */
-/* tslint:disable: no-redundant-jsdoc */
-
-import localVarRequest = require('request');
-import http = require('http');
-
-let defaultBasePath = 'https://localhost';
-
-// ===============================================
-// This file is autogenerated - Please do not edit
-// ===============================================
-
-/* tslint:disable:no-unused-variable */
-let primitives = [
- "string",
- "boolean",
- "double",
- "integer",
- "long",
- "float",
- "number",
- "any"
-];
-
-class ObjectSerializer {
-
- public static findCorrectType(data: any, expectedType: string) {
- if (data == undefined) {
- return expectedType;
- } else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
- return expectedType;
- } else if (expectedType === "Date") {
- return expectedType;
- } else {
- if (enumsMap[expectedType]) {
- return expectedType;
- }
-
- if (!typeMap[expectedType]) {
- return expectedType; // w/e we don't know the type
- }
-
- // Check the discriminator
- let discriminatorProperty = typeMap[expectedType].discriminator;
- if (discriminatorProperty == null) {
- return expectedType; // the type does not have a discriminator. use it.
- } else {
- if (data[discriminatorProperty]) {
- return data[discriminatorProperty]; // use the type given in the discriminator
- } else {
- return expectedType; // discriminator was not present (or an empty string)
- }
- }
- }
- }
-
- public static serialize(data: any, type: string) {
- if (data == undefined) {
- return data;
- } else if (primitives.indexOf(type.toLowerCase()) !== -1) {
- return data;
- } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
- let subType: string = type.replace("Array<", ""); // Array => Type>
- subType = subType.substring(0, subType.length - 1); // Type> => Type
- let transformedData: any[] = [];
- for (let index in data) {
- let date = data[index];
- transformedData.push(ObjectSerializer.serialize(date, subType));
- }
- return transformedData;
- } else if (type === "Date") {
- return data.toString();
- } else {
- if (enumsMap[type]) {
- return data;
- }
- if (!typeMap[type]) { // in case we dont know the type
- return data;
- }
-
- // get the map for the correct type.
- let attributeTypes = typeMap[type].getAttributeTypeMap();
- let instance: { [index: string]: any } = {};
- for (let index in attributeTypes) {
- let attributeType = attributeTypes[index];
- instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
- }
- return instance;
- }
- }
-
- public static deserialize(data: any, type: string) {
- // polymorphism may change the actual type.
- type = ObjectSerializer.findCorrectType(data, type);
- if (data == undefined) {
- return data;
- } else if (primitives.indexOf(type.toLowerCase()) !== -1) {
- return data;
- } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
- let subType: string = type.replace("Array<", ""); // Array => Type>
- subType = subType.substring(0, subType.length - 1); // Type> => Type
- let transformedData: any[] = [];
- for (let index in data) {
- let date = data[index];
- transformedData.push(ObjectSerializer.deserialize(date, subType));
- }
- return transformedData;
- } else if (type === "Date") {
- return new Date(data);
- } else {
- if (enumsMap[type]) {// is Enum
- return data;
- }
-
- if (!typeMap[type]) { // dont know the type
- return data;
- }
- let instance = new typeMap[type]();
- let attributeTypes = typeMap[type].getAttributeTypeMap();
- for (let index in attributeTypes) {
- let attributeType = attributeTypes[index];
- instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
- }
- return instance;
- }
- }
-}
-
-export class AppModel {
- 'name'?: string;
- 'internalName'?: string;
- 'version'?: string;
- 'inputParamDefs'?: Array;
- 'outputParamDefs'?: Array;
- 'state'?: string;
- 'links'?: { [key: string]: string; };
-
- static discriminator: string | undefined = undefined;
-
- static attributeTypeMap: Array<{ name: string, baseName: string, type: string }> = [
- {
- "name": "name",
- "baseName": "name",
- "type": "string"
- },
- {
- "name": "internalName",
- "baseName": "internal_name",
- "type": "string"
- },
- {
- "name": "version",
- "baseName": "version",
- "type": "string"
- },
- {
- "name": "inputParamDefs",
- "baseName": "input_param_defs",
- "type": "Array"
- },
- {
- "name": "outputParamDefs",
- "baseName": "output_param_defs",
- "type": "Array"
- },
- {
- "name": "state",
- "baseName": "state",
- "type": "string"
- },
- {
- "name": "links",
- "baseName": "links",
- "type": "{ [key: string]: string; }"
- }];
-
- static getAttributeTypeMap() {
- return AppModel.attributeTypeMap;
- }
-}
-
-export class AppModelParameterDefinition {
- 'name'?: string;
- 'type'?: string;
-
- static discriminator: string | undefined = undefined;
-
- static attributeTypeMap: Array<{ name: string, baseName: string, type: string }> = [
- {
- "name": "name",
- "baseName": "name",
- "type": "string"
- },
- {
- "name": "type",
- "baseName": "type",
- "type": "string"
- }];
-
- static getAttributeTypeMap() {
- return AppModelParameterDefinition.attributeTypeMap;
- }
-}
-
-export class TokenModel {
- 'tokenType'?: string;
- 'accessToken'?: string;
- 'expiresIn'?: number;
- 'expiresOn'?: number;
- 'tokenId'?: string;
- 'namespace'?: string;
-
- static discriminator: string | undefined = undefined;
-
- static attributeTypeMap: Array<{ name: string, baseName: string, type: string }> = [
- {
- "name": "tokenType",
- "baseName": "token_type",
- "type": "string"
- },
- {
- "name": "accessToken",
- "baseName": "access_token",
- "type": "string"
- },
- {
- "name": "expiresIn",
- "baseName": "expires_in",
- "type": "number"
- },
- {
- "name": "expiresOn",
- "baseName": "expires_on",
- "type": "number"
- },
- {
- "name": "tokenId",
- "baseName": "token_id",
- "type": "string"
- },
- {
- "name": "namespace",
- "baseName": "namespace",
- "type": "string"
- }];
-
- static getAttributeTypeMap() {
- return TokenModel.attributeTypeMap;
- }
-}
-
-
-let enumsMap: { [index: string]: any } = {
-}
-
-let typeMap: { [index: string]: any } = {
- "AppModel": AppModel,
- "AppModelParameterDefinition": AppModelParameterDefinition,
- "TokenModel": TokenModel,
-}
-
-export interface Authentication {
- /**
- * Apply authentication settings to header and query params.
- */
- applyToRequest(requestOptions: localVarRequest.Options): void;
-}
-
-export class HttpBasicAuth implements Authentication {
- public username: string = '';
- public password: string = '';
-
- applyToRequest(requestOptions: localVarRequest.Options): void {
- requestOptions.auth = {
- username: this.username, password: this.password
- }
- }
-}
-
-export class ApiKeyAuth implements Authentication {
- public apiKey: string = '';
-
- constructor(private location: string, private paramName: string) {
- }
-
- applyToRequest(requestOptions: localVarRequest.Options): void {
- if (this.location == "query") {
- (requestOptions.qs)[this.paramName] = this.apiKey;
- } else if (this.location == "header" && requestOptions && requestOptions.headers) {
- requestOptions.headers[this.paramName] = this.apiKey;
- }
- }
-}
-
-export class OAuth implements Authentication {
- public accessToken: string = '';
-
- applyToRequest(requestOptions: localVarRequest.Options): void {
- if (requestOptions && requestOptions.headers) {
- requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
- }
- }
-}
-
-export class VoidAuth implements Authentication {
- public username: string = '';
- public password: string = '';
-
- applyToRequest(_: localVarRequest.Options): void {
- // Do nothing
- }
-}
-
-export enum AppRouterApiApiKeys {
-}
-
-export class AppRouterApi {
- protected _basePath = defaultBasePath;
- protected defaultHeaders: any = {};
- protected _useQuerystring: boolean = false;
-
- protected authentications = {
- 'default': new VoidAuth(),
- 'auth': new HttpBasicAuth(),
- }
-
- constructor(basePath?: string);
- constructor(username: string, password: string, basePath?: string);
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
- if (password) {
- this.username = basePathOrUsername;
- this.password = password
- if (basePath) {
- this.basePath = basePath;
- }
- } else {
- if (basePathOrUsername) {
- this.basePath = basePathOrUsername
- }
- }
- }
-
- set useQuerystring(value: boolean) {
- this._useQuerystring = value;
- }
-
- set basePath(basePath: string) {
- this._basePath = basePath;
- }
-
- get basePath() {
- return this._basePath;
- }
-
- public setDefaultAuthentication(auth: Authentication) {
- this.authentications.default = auth;
- }
-
- public setApiKey(key: AppRouterApiApiKeys, value: string) {
- (this.authentications as any)[AppRouterApiApiKeys[key]].apiKey = value;
- }
- set username(username: string) {
- this.authentications.auth.username = username;
- }
-
- set password(password: string) {
- this.authentications.auth.password = password;
- }
- /**
- *
- * @summary ApiV1AppByNameAndVersion_DELETE
- * @param name
- * @param version
- * @param {*} [options] Override http request options.
- */
- public apiV1AppByNameAndVersionDelete(name: string, version: string, options: any = {}): Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/api/v1/app/{name}/{version}'
- .replace('{' + 'name' + '}', encodeURIComponent(String(name)))
- .replace('{' + 'version' + '}', encodeURIComponent(String(version)));
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'name' is not null or undefined
- if (name === null || name === undefined) {
- throw new Error('Required parameter name was null or undefined when calling apiV1AppByNameAndVersionDelete.');
- }
-
- // verify required parameter 'version' is not null or undefined
- if (version === null || version === undefined) {
- throw new Error('Required parameter version was null or undefined when calling apiV1AppByNameAndVersionDelete.');
- }
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'DELETE',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary GetAppByNameVersion
- * @param name
- * @param version
- * @param {*} [options] Override http request options.
- */
- public apiV1AppByNameAndVersionGet(name: string, version: string, options: any = {}): Promise<{ response: http.IncomingMessage; body: AppModel; }> {
- const localVarPath = this.basePath + '/api/v1/app/{name}/{version}'
- .replace('{' + 'name' + '}', encodeURIComponent(String(name)))
- .replace('{' + 'version' + '}', encodeURIComponent(String(version)));
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'name' is not null or undefined
- if (name === null || name === undefined) {
- throw new Error('Required parameter name was null or undefined when calling apiV1AppByNameAndVersionGet.');
- }
-
- // verify required parameter 'version' is not null or undefined
- if (version === null || version === undefined) {
- throw new Error('Required parameter version was null or undefined when calling apiV1AppByNameAndVersionGet.');
- }
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: AppModel; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "AppModel");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary ApiV1AppByName_GET
- * @param name
- * @param {*} [options] Override http request options.
- */
- public apiV1AppByNameGet(name: string, options: any = {}): Promise<{ response: http.IncomingMessage; body: Array; }> {
- const localVarPath = this.basePath + '/api/v1/app/{name}'
- .replace('{' + 'name' + '}', encodeURIComponent(String(name)));
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'name' is not null or undefined
- if (name === null || name === undefined) {
- throw new Error('Required parameter name was null or undefined when calling apiV1AppByNameGet.');
- }
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: Array; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "Array");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary ApiV1App_GET
- * @param {*} [options] Override http request options.
- */
- public apiV1AppGet(options: any = {}): Promise<{ response: http.IncomingMessage; body: Array; }> {
- const localVarPath = this.basePath + '/api/v1/app';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: Array; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "Array");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary UpdateApp
- * @param spec
- * @param _package
- * @param {*} [options] Override http request options.
- */
- public apiV1AppPatch(spec?: Buffer, _package?: Buffer, options: any = {}): Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/api/v1/app';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- if (spec !== undefined) {
- localVarFormParams['Spec'] = spec;
- }
- localVarUseFormData = true;
-
- if (_package !== undefined) {
- localVarFormParams['Package'] = _package;
- }
- localVarUseFormData = true;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'PATCH',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary CreateApp
- * @param spec
- * @param _package
- * @param {*} [options] Override http request options.
- */
- public apiV1AppPost(spec?: Buffer, _package?: Buffer, options: any = {}): Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/api/v1/app';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- if (spec !== undefined) {
- localVarFormParams['Spec'] = spec;
- }
- localVarUseFormData = true;
-
- if (_package !== undefined) {
- localVarFormParams['Package'] = _package;
- }
- localVarUseFormData = true;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'POST',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary GetAppSwagger
- * @param name
- * @param version
- * @param {*} [options] Override http request options.
- */
- public apiV1AppSwaggerJsonByNameAndVersionGet(name: string, version: string, options: any = {}): Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/api/v1/app/{name}/{version}/swagger.json'
- .replace('{' + 'name' + '}', encodeURIComponent(String(name)))
- .replace('{' + 'version' + '}', encodeURIComponent(String(version)));
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'name' is not null or undefined
- if (name === null || name === undefined) {
- throw new Error('Required parameter name was null or undefined when calling apiV1AppSwaggerJsonByNameAndVersionGet.');
- }
-
- // verify required parameter 'version' is not null or undefined
- if (version === null || version === undefined) {
- throw new Error('Required parameter version was null or undefined when calling apiV1AppSwaggerJsonByNameAndVersionGet.');
- }
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
-}
-export enum FileRouterApiApiKeys {
-}
-
-export class FileRouterApi {
- protected _basePath = defaultBasePath;
- protected defaultHeaders: any = {};
- protected _useQuerystring: boolean = false;
-
- protected authentications = {
- 'default': new VoidAuth(),
- 'auth': new HttpBasicAuth(),
- }
-
- constructor(basePath?: string);
- constructor(username: string, password: string, basePath?: string);
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
- if (password) {
- this.username = basePathOrUsername;
- this.password = password
- if (basePath) {
- this.basePath = basePath;
- }
- } else {
- if (basePathOrUsername) {
- this.basePath = basePathOrUsername
- }
- }
- }
-
- set useQuerystring(value: boolean) {
- this._useQuerystring = value;
- }
-
- set basePath(basePath: string) {
- this._basePath = basePath;
- }
-
- get basePath() {
- return this._basePath;
- }
-
- public setDefaultAuthentication(auth: Authentication) {
- this.authentications.default = auth;
- }
-
- public setApiKey(key: FileRouterApiApiKeys, value: string) {
- (this.authentications as any)[FileRouterApiApiKeys[key]].apiKey = value;
- }
- set username(username: string) {
- this.authentications.auth.username = username;
- }
-
- set password(password: string) {
- this.authentications.auth.password = password;
- }
- /**
- *
- * @summary ApiV1FilesByFilePath_GET
- * @param filePath
- * @param {*} [options] Override http request options.
- */
- public apiV1FilesByFilePathGet(filePath: string, options: any = {}): Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/api/v1/files/{filePath}'
- .replace('{' + 'filePath' + '}', encodeURIComponent(String(filePath)));
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'filePath' is not null or undefined
- if (filePath === null || filePath === undefined) {
- throw new Error('Required parameter filePath was null or undefined when calling apiV1FilesByFilePathGet.');
- }
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary ApiV1FilesFilelistByPodName_GET
- * @param podName
- * @param containerName
- * @param {*} [options] Override http request options.
- */
- public apiV1FilesFilelistByPodNameAndContainerNameGet(podName: string, containerName: string, options: any = {}): Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/api/v1/files/filelist/{podName}/{containerName}'
- .replace('{' + 'podName' + '}', encodeURIComponent(String(podName)))
- .replace('{' + 'containerName' + '}', encodeURIComponent(String(containerName)));
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'podName' is not null or undefined
- if (podName === null || podName === undefined) {
- throw new Error('Required parameter podName was null or undefined when calling apiV1FilesFilelistByPodNameAndContainerNameGet.');
- }
-
- // verify required parameter 'containerName' is not null or undefined
- if (containerName === null || containerName === undefined) {
- throw new Error('Required parameter containerName was null or undefined when calling apiV1FilesFilelistByPodNameAndContainerNameGet.');
- }
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary FilesByFilePath_GET
- * @param filePath
- * @param {*} [options] Override http request options.
- */
- public filesByFilePathGet(filePath: string, options: any = {}): Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/files/{filePath}'
- .replace('{' + 'filePath' + '}', encodeURIComponent(String(filePath)));
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'filePath' is not null or undefined
- if (filePath === null || filePath === undefined) {
- throw new Error('Required parameter filePath was null or undefined when calling filesByFilePathGet.');
- }
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary FilesFilelistByPodNameAndContainerName_GET
- * @param podName
- * @param containerName
- * @param {*} [options] Override http request options.
- */
- public filesFilelistByPodNameAndContainerNameGet(podName: string, containerName: string, options: any = {}): Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/files/filelist/{podName}/{containerName}'
- .replace('{' + 'podName' + '}', encodeURIComponent(String(podName)))
- .replace('{' + 'containerName' + '}', encodeURIComponent(String(containerName)));
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- // verify required parameter 'podName' is not null or undefined
- if (podName === null || podName === undefined) {
- throw new Error('Required parameter podName was null or undefined when calling filesFilelistByPodNameAndContainerNameGet.');
- }
-
- // verify required parameter 'containerName' is not null or undefined
- if (containerName === null || containerName === undefined) {
- throw new Error('Required parameter containerName was null or undefined when calling filesFilelistByPodNameAndContainerNameGet.');
- }
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
-}
-export enum HealthRouterApiApiKeys {
-}
-
-export class HealthRouterApi {
- protected _basePath = defaultBasePath;
- protected defaultHeaders: any = {};
- protected _useQuerystring: boolean = false;
-
- protected authentications = {
- 'default': new VoidAuth(),
- 'auth': new HttpBasicAuth(),
- }
-
- constructor(basePath?: string);
- constructor(username: string, password: string, basePath?: string);
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
- if (password) {
- this.username = basePathOrUsername;
- this.password = password
- if (basePath) {
- this.basePath = basePath;
- }
- } else {
- if (basePathOrUsername) {
- this.basePath = basePathOrUsername
- }
- }
- }
-
- set useQuerystring(value: boolean) {
- this._useQuerystring = value;
- }
-
- set basePath(basePath: string) {
- this._basePath = basePath;
- }
-
- get basePath() {
- return this._basePath;
- }
-
- public setDefaultAuthentication(auth: Authentication) {
- this.authentications.default = auth;
- }
-
- public setApiKey(key: HealthRouterApiApiKeys, value: string) {
- (this.authentications as any)[HealthRouterApiApiKeys[key]].apiKey = value;
- }
- set username(username: string) {
- this.authentications.auth.username = username;
- }
-
- set password(password: string) {
- this.authentications.auth.password = password;
- }
- /**
- *
- * @summary ApiV1Health_GET
- * @param query
- * @param {*} [options] Override http request options.
- */
- public apiV1HealthGet(query?: string, options: any = {}): Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/api/v1/health';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- if (query !== undefined) {
- localVarQueryParameters['query'] = ObjectSerializer.serialize(query, "string");
- }
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary ApiV1Health_POST
- * @param {*} [options] Override http request options.
- */
- public apiV1HealthPost(options: any = {}): Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/api/v1/health';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'POST',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Health_GET
- * @param query
- * @param {*} [options] Override http request options.
- */
- public healthGet(query?: string, options: any = {}): Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/health';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- if (query !== undefined) {
- localVarQueryParameters['query'] = ObjectSerializer.serialize(query, "string");
- }
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Health_POST
- * @param {*} [options] Override http request options.
- */
- public healthPost(options: any = {}): Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/health';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'POST',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
-}
-export enum TokenRouterApiApiKeys {
-}
-
-export class TokenRouterApi {
- protected _basePath = defaultBasePath;
- protected defaultHeaders: any = {};
- protected _useQuerystring: boolean = false;
-
- protected authentications = {
- 'default': new VoidAuth(),
- 'auth': new HttpBasicAuth(),
- }
-
- constructor(basePath?: string);
- constructor(username: string, password: string, basePath?: string);
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
- if (password) {
- this.username = basePathOrUsername;
- this.password = password
- if (basePath) {
- this.basePath = basePath;
- }
- } else {
- if (basePathOrUsername) {
- this.basePath = basePathOrUsername
- }
- }
- }
-
- set useQuerystring(value: boolean) {
- this._useQuerystring = value;
- }
-
- set basePath(basePath: string) {
- this._basePath = basePath;
- }
-
- get basePath() {
- return this._basePath;
- }
-
- public setDefaultAuthentication(auth: Authentication) {
- this.authentications.default = auth;
- }
-
- public setApiKey(key: TokenRouterApiApiKeys, value: string) {
- (this.authentications as any)[TokenRouterApiApiKeys[key]].apiKey = value;
- }
- set username(username: string) {
- this.authentications.auth.username = username;
- }
-
- set password(password: string) {
- this.authentications.auth.password = password;
- }
- /**
- *
- * @summary ApiV1Token_POST
- * @param {*} [options] Override http request options.
- */
- public apiV1TokenPost(options: any = {}): Promise<{ response: http.IncomingMessage; body: TokenModel; }> {
- const localVarPath = this.basePath + '/api/v1/token';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'POST',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: TokenModel; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "TokenModel");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
- /**
- *
- * @summary Token_POST
- * @param {*} [options] Override http request options.
- */
- public tokenPost(options: any = {}): Promise<{ response: http.IncomingMessage; body: TokenModel; }> {
- const localVarPath = this.basePath + '/token';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders);
- let localVarFormParams: any = {};
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'POST',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- this.authentications.auth.applyToRequest(localVarRequestOptions);
-
- this.authentications.default.applyToRequest(localVarRequestOptions);
-
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: TokenModel; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- body = ObjectSerializer.deserialize(body, "TokenModel");
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- resolve({ response: response, body: body });
- } else {
- reject({ response: response, body: body });
- }
- }
- });
- });
- }
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/controller/clusterControllerApi.ts b/extensions/big-data-cluster/src/bigDataCluster/controller/clusterControllerApi.ts
deleted file mode 100644
index 104dbda87b..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/controller/clusterControllerApi.ts
+++ /dev/null
@@ -1,455 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as request from 'request';
-import { authenticateKerberos, getHostAndPortFromEndpoint } from '../auth';
-import { BdcRouterApi, Authentication, EndpointModel, BdcStatusModel, DefaultApi } from './apiGenerated';
-import { TokenRouterApi } from './clusterApiGenerated2';
-import * as nls from 'vscode-nls';
-import { ConnectControllerDialog, ConnectControllerModel } from '../dialog/connectControllerDialog';
-import { getIgnoreSslVerificationConfigSetting } from '../utils';
-import { IClusterController, AuthType, IEndPointsResponse, IHttpResponse } from 'bdc';
-
-const localize = nls.loadMessageBundle();
-
-const DEFAULT_KNOX_USERNAME = 'root';
-
-class SslAuth implements Authentication {
- constructor() { }
-
- applyToRequest(requestOptions: request.Options): void {
- requestOptions.rejectUnauthorized = !getIgnoreSslVerificationConfigSetting();
- }
-}
-
-export class KerberosAuth extends SslAuth implements Authentication {
-
- constructor(public kerberosToken: string) {
- super();
- }
-
- override applyToRequest(requestOptions: request.Options): void {
- super.applyToRequest(requestOptions);
- if (requestOptions && requestOptions.headers) {
- requestOptions.headers['Authorization'] = `Negotiate ${this.kerberosToken}`;
- }
- requestOptions.auth = undefined;
- }
-}
-export class BasicAuth extends SslAuth implements Authentication {
- constructor(public username: string, public password: string) {
- super();
- }
-
- override applyToRequest(requestOptions: request.Options): void {
- super.applyToRequest(requestOptions);
- requestOptions.auth = {
- username: this.username, password: this.password
- };
- }
-}
-
-export class OAuthWithSsl extends SslAuth implements Authentication {
- public accessToken: string = '';
-
- override applyToRequest(requestOptions: request.Options): void {
- super.applyToRequest(requestOptions);
- if (requestOptions && requestOptions.headers) {
- requestOptions.headers['Authorization'] = `Bearer ${this.accessToken}`;
- }
- requestOptions.auth = undefined;
- }
-}
-
-class BdcApiWrapper extends BdcRouterApi {
- constructor(basePathOrUsername: string, password: string, basePath: string, auth: Authentication) {
- if (password) {
- super(basePathOrUsername, password, basePath);
- } else {
- super(basePath, undefined, undefined);
- }
- this.authentications.default = auth;
- }
-}
-class DefaultApiWrapper extends DefaultApi {
- constructor(basePathOrUsername: string, password: string, basePath: string, auth: Authentication) {
- if (password) {
- super(basePathOrUsername, password, basePath);
- } else {
- super(basePath, undefined, undefined);
- }
- this.authentications.default = auth;
- }
-}
-
-export class ClusterController implements IClusterController {
-
- private _authPromise: Promise;
- private _url: string;
- private readonly _dialog: ConnectControllerDialog;
- private _connectionPromise: Promise;
-
- constructor(url: string,
- private _authType: AuthType,
- private _username?: string,
- private _password?: string
- ) {
- if (!url || (_authType === 'basic' && (!_username || !_password))) {
- throw new Error('Missing required inputs for Cluster controller API (URL, username, password)');
- }
- this._url = adjustUrl(url);
- if (this._authType === 'basic') {
- this._authPromise = Promise.resolve(new BasicAuth(_username, _password));
- } else {
- this._authPromise = this.requestTokenUsingKerberos();
- }
- this._dialog = new ConnectControllerDialog(new ConnectControllerModel(
- {
- url: this._url,
- auth: this._authType,
- username: this._username,
- password: this._password
- }));
- }
-
- public get url(): string {
- return this._url;
- }
-
- public get authType(): AuthType {
- return this._authType;
- }
-
- public get username(): string | undefined {
- return this._username;
- }
-
- public get password(): string | undefined {
- return this._password;
- }
-
- private async requestTokenUsingKerberos(): Promise {
- let supportsKerberos = await this.verifyKerberosSupported();
- if (!supportsKerberos) {
- throw new Error(localize('error.no.activedirectory', "This cluster does not support Windows authentication"));
- }
-
- try {
-
- // AD auth is available, login to keberos and convert to token auth for all future calls
- let host = getHostAndPortFromEndpoint(this._url).host;
- let kerberosToken = await authenticateKerberos(host);
- let tokenApi = new TokenRouterApi(this._url);
- tokenApi.setDefaultAuthentication(new KerberosAuth(kerberosToken));
- let result = await tokenApi.apiV1TokenPost();
- let auth = new OAuthWithSsl();
- auth.accessToken = result.body.accessToken;
- return auth;
- } catch (error) {
- let controllerErr = new ControllerError(error, localize('bdc.error.tokenPost', "Error during authentication"));
- if (controllerErr.code === 401) {
- throw new Error(localize('bdc.error.unauthorized', "You do not have permission to log into this cluster using Windows Authentication"));
- }
- // Else throw the error as-is
- throw controllerErr;
- }
- }
-
- /**
- * Verify that this cluster supports Kerberos authentication. It does this by sending a request to the Token API route
- * without any credentials and verifying that it gets a 401 response back with a Negotiate www-authenticate header.
- */
- private async verifyKerberosSupported(): Promise {
- let tokenApi = new TokenRouterApi(this._url);
- tokenApi.setDefaultAuthentication(new SslAuth());
- try {
- await tokenApi.apiV1TokenPost();
- console.warn(`Token API returned success without any auth while verifying Kerberos support for BDC Cluster ${this._url}`);
- // If we get to here, the route for tokens doesn't require auth which is an unexpected error state
- return false;
- }
- catch (error) {
- if (!error.response) {
- console.warn(`No response when verifying Kerberos support for BDC Cluster ${this._url} - ${error}`);
- return false;
- }
-
- if (error.response.statusCode !== 401) {
- console.warn(`Got unexpected status code ${error.response.statusCode} when verifying Kerberos support for BDC Cluster ${this._url}`);
- return false;
- }
-
- const auths = error.response.headers['www-authenticate'] as string[] ?? [];
- if (auths.includes('Negotiate')) {
- return true;
- }
- console.warn(`Didn't get expected Negotiate auth type when verifying Kerberos support for BDC Cluster ${this.url}. Supported types : ${auths.join(', ')}`);
- return false;
- }
- }
-
- public async getKnoxUsername(defaultUsername: string): Promise {
- // This all is necessary because prior to CU5 BDC deployments all had the same default username for
- // accessing the Knox gateway. But in the allowRunAsRoot setting was added and defaulted to false - so
- // if that exists and is false then we use the username instead.
- // Note that the SQL username may not necessarily be correct here either - but currently this is what
- // we're requiring to run Notebooks in a BDC
- const config = await this.getClusterConfig();
- return config.spec?.spec?.security?.allowRunAsRoot === false ? defaultUsername : DEFAULT_KNOX_USERNAME;
- }
-
- public async getClusterConfig(promptConnect: boolean = false): Promise {
- return await this.withConnectRetry(
- this.getClusterConfigImpl,
- promptConnect,
- localize('bdc.error.getClusterConfig', "Error retrieving cluster config from {0}", this._url));
- }
-
- private async getClusterConfigImpl(self: ClusterController): Promise {
- let auth = await self._authPromise;
- let endPointApi = new BdcApiWrapper(self._username, self._password, self._url, auth);
- let options: any = {};
-
- let result = await endPointApi.getCluster(options);
- return {
- response: result.response as IHttpResponse,
- spec: JSON.parse(result.body.spec)
- };
- }
-
- public async getEndPoints(promptConnect: boolean = false): Promise {
- return await this.withConnectRetry(
- this.getEndpointsImpl,
- promptConnect,
- localize('bdc.error.getEndPoints', "Error retrieving endpoints from {0}", this._url));
- }
-
- private async getEndpointsImpl(self: ClusterController): Promise {
- let auth = await self._authPromise;
- let endPointApi = new BdcApiWrapper(self._username, self._password, self._url, auth);
- let options: any = {};
-
- let result = await endPointApi.endpointsGet(options);
- return {
- response: result.response as IHttpResponse,
- endPoints: result.body as EndpointModel[]
- };
- }
-
- public async getBdcStatus(promptConnect: boolean = false): Promise {
- return await this.withConnectRetry(
- this.getBdcStatusImpl,
- promptConnect,
- localize('bdc.error.getBdcStatus', "Error retrieving BDC status from {0}", this._url));
- }
-
- private async getBdcStatusImpl(self: ClusterController): Promise {
- let auth = await self._authPromise;
- const bdcApi = new BdcApiWrapper(self._username, self._password, self._url, auth);
-
- const bdcStatus = await bdcApi.getBdcStatus('', '', /*all*/ true);
- return {
- response: bdcStatus.response,
- bdcStatus: bdcStatus.body
- };
- }
-
- public async mountHdfs(mountPath: string, remoteUri: string, credentials: {}, promptConnection: boolean = false): Promise {
- return await this.withConnectRetry(
- this.mountHdfsImpl,
- promptConnection,
- localize('bdc.error.mountHdfs', "Error creating mount"),
- mountPath,
- remoteUri,
- credentials);
- }
-
- private async mountHdfsImpl(self: ClusterController, mountPath: string, remoteUri: string, credentials: {}): Promise {
- let auth = await self._authPromise;
- const api = new DefaultApiWrapper(self._username, self._password, self._url, auth);
-
- const mountStatus = await api.createMount('', '', remoteUri, mountPath, credentials);
- return {
- response: mountStatus.response,
- status: mountStatus.body
- };
- }
-
- public async getMountStatus(mountPath?: string, promptConnect: boolean = false): Promise {
- return await this.withConnectRetry(
- this.getMountStatusImpl,
- promptConnect,
- localize('bdc.error.statusHdfs', "Error getting mount status"),
- mountPath);
- }
-
- private async getMountStatusImpl(self: ClusterController, mountPath?: string): Promise {
- const auth = await self._authPromise;
- const api = new DefaultApiWrapper(self._username, self._password, self._url, auth);
-
- const mountStatus = await api.listMounts('', '', mountPath);
- return {
- response: mountStatus.response,
- mount: mountStatus.body ? JSON.parse(mountStatus.body) : undefined
- };
- }
-
- public async refreshMount(mountPath: string, promptConnect: boolean = false): Promise {
- return await this.withConnectRetry(
- this.refreshMountImpl,
- promptConnect,
- localize('bdc.error.refreshHdfs', "Error refreshing mount"),
- mountPath);
- }
-
- private async refreshMountImpl(self: ClusterController, mountPath: string): Promise {
- const auth = await self._authPromise;
- const api = new DefaultApiWrapper(self._username, self._password, self._url, auth);
-
- const mountStatus = await api.refreshMount('', '', mountPath);
- return {
- response: mountStatus.response,
- status: mountStatus.body
- };
- }
-
- public async deleteMount(mountPath: string, promptConnect: boolean = false): Promise {
- return await this.withConnectRetry(
- this.deleteMountImpl,
- promptConnect,
- localize('bdc.error.deleteHdfs', "Error deleting mount"),
- mountPath);
- }
-
- private async deleteMountImpl(self: ClusterController, mountPath: string): Promise {
- let auth = await self._authPromise;
- const api = new DefaultApiWrapper(self._username, self._password, self._url, auth);
-
- const mountStatus = await api.deleteMount('', '', mountPath);
- return {
- response: mountStatus.response,
- status: mountStatus.body
- };
- }
-
- /**
- * Helper function that wraps a function call in a try/catch and if promptConnect is true
- * will prompt the user to re-enter connection information and if that succeeds updates
- * this with the new information.
- * @param f The API function we're wrapping
- * @param promptConnect Whether to actually prompt for connection on failure
- * @param errorMessage The message to include in the wrapped error thrown
- * @param args The args to pass to the function
- */
- private async withConnectRetry(f: (...args: any[]) => Promise, promptConnect: boolean, errorMessage: string, ...args: any[]): Promise {
- try {
- try {
- return await f(this, ...args);
- } catch (error) {
- if (promptConnect) {
- // We don't want to open multiple dialogs here if multiple calls come in the same time so check
- // and see if we have are actively waiting on an open dialog to return and if so then just wait
- // on that promise.
- if (!this._connectionPromise) {
- this._connectionPromise = this._dialog.showDialog();
- }
- const controller = await this._connectionPromise;
- if (controller) {
- this._username = controller._username;
- this._password = controller._password;
- this._url = controller._url;
- this._authType = controller._authType;
- this._authPromise = controller._authPromise;
- }
- return await f(this, args);
- }
- throw error;
- }
- } catch (error) {
- throw new ControllerError(error, errorMessage);
- } finally {
- this._connectionPromise = undefined;
- }
- }
-}
-
-/**
- * Fixes missing protocol and wrong character for port entered by user
- */
-function adjustUrl(url: string): string {
- if (!url) {
- return undefined;
- }
-
- url = url.trim().replace(/ /g, '').replace(/,(\d+)$/, ':$1');
- if (!url.includes('://')) {
- url = `https://${url}`;
- }
- return url;
-}
-
-export interface IClusterRequest {
- url: string;
- username: string;
- password?: string;
- method?: string;
-}
-
-export interface IBdcStatusResponse {
- response: IHttpResponse;
- bdcStatus: BdcStatusModel;
-}
-
-export enum MountState {
- Creating = 'Creating',
- Ready = 'Ready',
- Error = 'Error'
-}
-
-export interface MountInfo {
- mount: string;
- remote: string;
- state: MountState;
- error?: string;
-}
-
-export interface MountResponse {
- response: IHttpResponse;
- status: any;
-}
-export interface MountStatusResponse {
- response: IHttpResponse;
- mount: MountInfo[];
-}
-
-export class ControllerError extends Error {
- public code?: number;
- public reason?: string;
- public address?: string;
- public statusMessage?: string;
- /**
- *
- * @param error The original error to wrap
- * @param messagePrefix Optional text to prefix the error message with
- */
- constructor(error: any, messagePrefix?: string) {
- super(messagePrefix);
- // Pull out the response information containing details about the failure
- if (error.response) {
- this.code = error.response.statusCode;
- this.message += `${error.response.statusMessage ? ` - ${error.response.statusMessage}` : ''}` || '';
- this.address = error.response.url || '';
- this.statusMessage = error.response.statusMessage;
- }
- else if (error.message) {
- this.message += ` - ${error.message}`;
- }
-
- // The body message contains more specific information about the failure
- if (error.body && error.body.reason) {
- this.message += ` - ${error.body.reason}`;
- }
- }
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/dialog/addControllerDialog.ts b/extensions/big-data-cluster/src/bigDataCluster/dialog/addControllerDialog.ts
deleted file mode 100644
index dd9b0d473e..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/dialog/addControllerDialog.ts
+++ /dev/null
@@ -1,229 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as azdata from 'azdata';
-import * as vscode from 'vscode';
-import { ClusterController, ControllerError } from '../controller/clusterControllerApi';
-import { ControllerTreeDataProvider } from '../tree/controllerTreeDataProvider';
-import { BdcDashboardOptions } from './bdcDashboardModel';
-import { ControllerNode } from '../tree/controllerTreeNode';
-import { ManageControllerCommand } from '../../commands';
-import * as loc from '../localizedConstants';
-import { AuthType } from 'bdc';
-
-function getAuthCategory(name: AuthType): azdata.CategoryValue {
- if (name === 'basic') {
- return { name: name, displayName: loc.basic };
- }
- return { name: name, displayName: loc.windowsAuth };
-}
-
-export class AddControllerDialogModel {
-
- private _canceled = false;
- private _authTypes: azdata.CategoryValue[];
- constructor(
- public treeDataProvider: ControllerTreeDataProvider,
- public node?: ControllerNode,
- public prefilledUrl?: string,
- public prefilledAuth?: azdata.CategoryValue,
- public prefilledUsername?: string,
- public prefilledPassword?: string,
- public prefilledRememberPassword?: boolean
- ) {
- this.prefilledUrl = prefilledUrl || (node && node['url']);
- this.prefilledAuth = prefilledAuth;
- if (!prefilledAuth) {
- let auth = (node && node['auth']) || 'basic';
- this.prefilledAuth = getAuthCategory(auth);
- }
- this.prefilledUsername = prefilledUsername || (node && node['username']);
- this.prefilledPassword = prefilledPassword || (node && node['password']);
- this.prefilledRememberPassword = prefilledRememberPassword || (node && node['rememberPassword']);
- }
-
- public get authCategories(): azdata.CategoryValue[] {
- if (!this._authTypes) {
- this._authTypes = [getAuthCategory('basic'), getAuthCategory('integrated')];
- }
- return this._authTypes;
- }
-
- public async onComplete(url: string, auth: AuthType, username: string, password: string, rememberPassword: boolean): Promise {
- try {
-
- if (auth === 'basic') {
- // Verify username and password as we can't make them required in the UI
- if (!username) {
- throw new Error(loc.usernameRequired);
- } else if (!password) {
- throw new Error(loc.passwordRequired);
- }
- }
- // We pre-fetch the endpoints here to verify that the information entered is correct (the user is able to connect)
- let controller = new ClusterController(url, auth, username, password);
- let response = await controller.getEndPoints();
- if (response && response.endPoints) {
- if (this._canceled) {
- return;
- }
- this.treeDataProvider.addOrUpdateController(url, auth, username, password, rememberPassword);
- vscode.commands.executeCommand(ManageControllerCommand, { url: url, auth: auth, username: username, password: password });
- await this.treeDataProvider.saveControllers();
- }
- } catch (error) {
- // Ignore the error if we cancelled the request since we can't stop the actual request from completing
- if (!this._canceled) {
- throw error;
- }
- }
-
- }
-
- public async onError(error: ControllerError): Promise {
- // implement
- }
-
- public async onCancel(): Promise {
- this._canceled = true;
- if (this.node) {
- this.node.refresh();
- }
- }
-}
-
-export class AddControllerDialog {
-
- private dialog: azdata.window.Dialog;
- private uiModelBuilder: azdata.ModelBuilder;
-
- private urlInputBox: azdata.InputBoxComponent;
- private authDropdown: azdata.DropDownComponent;
- private usernameInputBox: azdata.InputBoxComponent;
- private passwordInputBox: azdata.InputBoxComponent;
- private rememberPwCheckBox: azdata.CheckBoxComponent;
-
- constructor(private model: AddControllerDialogModel) {
- }
-
- public showDialog(): void {
- this.createDialog();
- azdata.window.openDialog(this.dialog);
- }
-
- private createDialog(): void {
- this.dialog = azdata.window.createModelViewDialog(loc.addNewController);
- this.dialog.registerContent(async view => {
- this.uiModelBuilder = view.modelBuilder;
-
- this.urlInputBox = this.uiModelBuilder.inputBox()
- .withProps({
- placeHolder: loc.url.toLocaleLowerCase(),
- value: this.model.prefilledUrl
- }).component();
- this.authDropdown = this.uiModelBuilder.dropDown().withProps({
- values: this.model.authCategories,
- value: this.model.prefilledAuth,
- editable: false,
- }).component();
- this.authDropdown.onValueChanged(e => this.onAuthChanged());
- this.usernameInputBox = this.uiModelBuilder.inputBox()
- .withProps({
- placeHolder: loc.usernameRequired.toLocaleLowerCase(),
- value: this.model.prefilledUsername
- }).component();
- this.passwordInputBox = this.uiModelBuilder.inputBox()
- .withProps({
- placeHolder: loc.password,
- inputType: 'password',
- value: this.model.prefilledPassword
- })
- .component();
- this.rememberPwCheckBox = this.uiModelBuilder.checkBox()
- .withProps({
- label: loc.rememberPassword,
- checked: this.model.prefilledRememberPassword
- }).component();
-
- let formModel = this.uiModelBuilder.formContainer()
- .withFormItems([{
- components: [
- {
- component: this.urlInputBox,
- title: loc.clusterUrl,
- required: true
- }, {
- component: this.authDropdown,
- title: loc.authType,
- required: true
- }, {
- component: this.usernameInputBox,
- title: loc.username,
- required: false
- }, {
- component: this.passwordInputBox,
- title: loc.password,
- required: false
- }, {
- component: this.rememberPwCheckBox,
- title: ''
- }
- ],
- title: ''
- }]).withLayout({ width: '100%' }).component();
- this.onAuthChanged();
- await view.initializeModel(formModel);
- this.urlInputBox.focus();
- });
-
- this.dialog.registerCloseValidator(async () => await this.validate());
- this.dialog.cancelButton.onClick(async () => await this.cancel());
- this.dialog.okButton.label = loc.add;
- this.dialog.cancelButton.label = loc.cancel;
- }
-
- private get authValue(): AuthType {
- return (this.authDropdown.value).name as AuthType;
- }
-
- private onAuthChanged(): void {
- let isBasic = this.authValue === 'basic';
- this.usernameInputBox.enabled = isBasic;
- this.passwordInputBox.enabled = isBasic;
- this.rememberPwCheckBox.enabled = isBasic;
- if (!isBasic) {
- this.usernameInputBox.value = '';
- this.passwordInputBox.value = '';
- }
- }
-
- private async validate(): Promise {
- let url = this.urlInputBox && this.urlInputBox.value;
- let auth = this.authValue;
- let username = this.usernameInputBox && this.usernameInputBox.value;
- let password = this.passwordInputBox && this.passwordInputBox.value;
- let rememberPassword = this.passwordInputBox && !!this.rememberPwCheckBox.checked;
-
- try {
- await this.model.onComplete(url, auth, username, password, rememberPassword);
- return true;
- } catch (error) {
- this.dialog.message = {
- text: (typeof error === 'string') ? error : error.message,
- level: azdata.window.MessageLevel.Error
- };
- if (this.model && this.model.onError) {
- await this.model.onError(error as ControllerError);
- }
- return false;
- }
- }
-
- private async cancel(): Promise {
- if (this.model && this.model.onCancel) {
- await this.model.onCancel();
- }
- }
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboard.ts b/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboard.ts
deleted file mode 100644
index 2efc98e1c7..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboard.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as azdata from 'azdata';
-import { BdcDashboardModel, BdcErrorEvent } from './bdcDashboardModel';
-import { BdcServiceStatusPage } from './bdcServiceStatusPage';
-import { BdcDashboardOverviewPage } from './bdcDashboardOverviewPage';
-import { BdcStatusModel, ServiceStatusModel } from '../controller/apiGenerated';
-import { getServiceNameDisplayText, showErrorMessage, getHealthStatusDotIcon } from '../utils';
-import { HdfsDialogCancelledError } from './hdfsDialogBase';
-import { InitializingComponent } from './intializingComponent';
-import * as loc from '../localizedConstants';
-
-export class BdcDashboard extends InitializingComponent {
-
- private dashboard: azdata.window.ModelViewDashboard;
-
- private modelView: azdata.ModelView;
-
- private createdServicePages: Map = new Map();
- private overviewTab: azdata.DashboardTab;
-
- constructor(private title: string, private model: BdcDashboardModel) {
- super();
- model.onDidUpdateBdcStatus(bdcStatus => this.eventuallyRunOnInitialized(() => this.handleBdcStatusUpdate(bdcStatus)));
- model.onBdcError(errorEvent => this.eventuallyRunOnInitialized(() => this.handleError(errorEvent)));
- }
-
- public async showDashboard(): Promise {
- await this.createDashboard();
- await this.dashboard.open();
- }
-
- private async createDashboard(): Promise {
- this.dashboard = azdata.window.createModelViewDashboard(this.title, 'BdcDashboard', { alwaysShowTabs: true });
- this.dashboard.registerTabs(async (modelView: azdata.ModelView) => {
- this.modelView = modelView;
-
- const overviewPage = new BdcDashboardOverviewPage(this.model, modelView, this.dashboard);
- this.overviewTab = {
- title: loc.bdcOverview,
- id: 'overview-tab',
- content: overviewPage.container,
- toolbar: overviewPage.toolbarContainer
- };
- return [
- this.overviewTab
- ];
- });
- this.initialized = true;
-
- // Now that we've created the UI load data from the model in case it already had data
- this.handleBdcStatusUpdate(this.model.bdcStatus);
- }
-
- private handleBdcStatusUpdate(bdcStatus?: BdcStatusModel): void {
- if (!bdcStatus) {
- return;
- }
- this.updateServicePages(bdcStatus.services);
- }
-
- private handleError(errorEvent: BdcErrorEvent): void {
- if (errorEvent.errorType !== 'general') {
- return;
- }
- // We don't want to show an error for the connection dialog being
- // canceled since that's a normal case.
- if (!(errorEvent.error instanceof HdfsDialogCancelledError)) {
- showErrorMessage(errorEvent.error.message);
- }
- }
-
- /**
- * Update the service tab pages, creating any new ones as necessary
- */
- private updateServicePages(services?: ServiceStatusModel[]): void {
- if (services) {
- // Create a service page for each new service. We currently don't support services being removed.
- services.forEach(s => {
- const existingPage = this.createdServicePages.get(s.serviceName);
- if (existingPage) {
- existingPage.icon = getHealthStatusDotIcon(s.healthStatus);
- } else {
- const serviceStatusPage = new BdcServiceStatusPage(s.serviceName, this.model, this.modelView);
- const newTab = {
- title: getServiceNameDisplayText(s.serviceName),
- id: s.serviceName,
- icon: getHealthStatusDotIcon(s.healthStatus),
- content: serviceStatusPage.container,
- toolbar: serviceStatusPage.toolbarContainer
- };
- this.createdServicePages.set(s.serviceName, newTab);
- }
- });
- this.dashboard.updateTabs([
- this.overviewTab,
- {
- title: loc.clusterDetails,
- tabs: Array.from(this.createdServicePages.values())
- }]);
- }
- }
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboardModel.ts b/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboardModel.ts
deleted file mode 100644
index 5e2c1ae852..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboardModel.ts
+++ /dev/null
@@ -1,182 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as azdata from 'azdata';
-import * as vscode from 'vscode';
-import { ClusterController } from '../controller/clusterControllerApi';
-import { EndpointModel, BdcStatusModel } from '../controller/apiGenerated';
-import { Endpoint, Service } from '../utils';
-import { ConnectControllerDialog, ConnectControllerModel } from './connectControllerDialog';
-import { ControllerTreeDataProvider } from '../tree/controllerTreeDataProvider';
-import { AuthType } from 'bdc';
-
-export type BdcDashboardOptions = { url: string, auth: AuthType, username: string, password: string, rememberPassword: boolean };
-
-type BdcErrorType = 'bdcStatus' | 'bdcEndpoints' | 'general';
-export type BdcErrorEvent = { error: Error, errorType: BdcErrorType };
-
-export class BdcDashboardModel {
-
- private _clusterController: ClusterController;
- private _bdcStatus: BdcStatusModel | undefined;
- private _endpoints: EndpointModel[] | undefined;
- private _bdcStatusLastUpdated: Date | undefined;
- private _endpointsLastUpdated: Date | undefined;
- private readonly _onDidUpdateEndpoints = new vscode.EventEmitter();
- private readonly _onDidUpdateBdcStatus = new vscode.EventEmitter();
- private readonly _onBdcError = new vscode.EventEmitter();
- public onDidUpdateEndpoints = this._onDidUpdateEndpoints.event;
- public onDidUpdateBdcStatus = this._onDidUpdateBdcStatus.event;
- public onBdcError = this._onBdcError.event;
-
- constructor(private _options: BdcDashboardOptions, private _treeDataProvider: ControllerTreeDataProvider) {
- try {
- this._clusterController = new ClusterController(_options.url, _options.auth, _options.username, _options.password);
- this.refresh().catch(e => console.log(`Unexpected error refreshing BdcModel ${e instanceof Error ? e.message : e}`));
- } catch {
- this.promptReconnect().then(async () => {
- await this.refresh();
- }).catch(error => {
- this._onBdcError.fire({ error: error, errorType: 'general' });
- });
- }
- }
-
- public get bdcStatus(): BdcStatusModel | undefined {
- return this._bdcStatus;
- }
-
- public get serviceEndpoints(): EndpointModel[] | undefined {
- return this._endpoints;
- }
-
- public get bdcStatusLastUpdated(): Date | undefined {
- return this._bdcStatusLastUpdated;
- }
-
- public get endpointsLastUpdated(): Date | undefined {
- return this._endpointsLastUpdated;
- }
-
- public async refresh(): Promise {
- try {
- if (!this._clusterController) {
- // If this succeeds without error we know we have a clusterController at this point
- await this.promptReconnect();
- }
-
- await Promise.all([
- this._clusterController.getBdcStatus(true).then(response => {
- this._bdcStatus = response.bdcStatus;
- this._bdcStatusLastUpdated = new Date();
- this._onDidUpdateBdcStatus.fire(this.bdcStatus);
- }).catch(error => this._onBdcError.fire({ error: error, errorType: 'bdcStatus' })),
- this._clusterController.getEndPoints(true).then(response => {
- this._endpoints = response.endPoints;
- fixEndpoints(this._endpoints);
- this._endpointsLastUpdated = new Date();
- this._onDidUpdateEndpoints.fire(this.serviceEndpoints);
- }).catch(error => this._onBdcError.fire({ error: error, errorType: 'bdcEndpoints' }))
- ]);
- } catch (error) {
- this._onBdcError.fire({ error: error, errorType: 'general' });
- }
- }
-
- /**
- * Gets a partially filled connection profile for the SQL Server Master Instance endpoint
- * associated with this cluster.
- * @returns The IConnectionProfile - or undefined if the endpoints haven't been loaded yet
- */
- public getSqlServerMasterConnectionProfile(): azdata.IConnectionProfile | undefined {
- const sqlServerMasterEndpoint = this.serviceEndpoints && this.serviceEndpoints.find(e => e.name === Endpoint.sqlServerMaster);
- if (!sqlServerMasterEndpoint) {
- return undefined;
- }
-
- // We default to sa - if that doesn't work then callers of this should open up a connection
- // dialog so the user can enter in the correct connection information
- return {
- connectionName: undefined,
- serverName: sqlServerMasterEndpoint.endpoint,
- databaseName: undefined,
- userName: 'sa',
- password: this._options.password,
- authenticationType: '',
- savePassword: true,
- groupFullName: undefined,
- groupId: undefined,
- providerName: 'MSSQL',
- saveProfile: true,
- id: undefined,
- options: {}
- };
- }
-
- /**
- * Opens up a dialog prompting the user to re-enter credentials for the controller
- */
- private async promptReconnect(): Promise {
- this._clusterController = await new ConnectControllerDialog(new ConnectControllerModel(this._options)).showDialog();
- await this.updateController();
- }
-
- private async updateController(): Promise {
- if (!this._clusterController) {
- return;
- }
- this._treeDataProvider.addOrUpdateController(
- this._clusterController.url,
- this._clusterController.authType,
- this._clusterController.username,
- this._clusterController.password,
- this._options.rememberPassword);
- await this._treeDataProvider.saveControllers();
- }
-}
-
-/**
- * Retrieves the troubleshoot book URL for the specified service, defaulting to the BDC
- * troubleshoot notebook if the service name is unknown.
- * @param service The service name to get the troubleshoot notebook URL for
- */
-export function getTroubleshootNotebookUrl(service?: string): string {
- service = service || '';
- switch (service.toLowerCase()) {
- case Service.sql:
- return 'troubleshooters/tsg101-troubleshoot-sql-server';
- case Service.hdfs:
- return 'troubleshooters/tsg102-troubleshoot-hdfs';
- case Service.spark:
- return 'troubleshooters/tsg103-troubleshoot-spark';
- case Service.control:
- return 'troubleshooters/tsg104-troubleshoot-control';
- case Service.gateway:
- return 'troubleshooters/tsg105-troubleshoot-gateway';
- case Service.app:
- return 'troubleshooters/tsg106-troubleshoot-app';
- }
- return 'troubleshooters/tsg100-troubleshoot-bdc';
-}
-
-/**
- * Applies fixes to the endpoints received so they are displayed correctly
- * @param endpoints The endpoints received to modify
- */
-function fixEndpoints(endpoints?: EndpointModel[]): void {
- if (!endpoints) {
- return;
- }
- endpoints.forEach(e => {
- if (e.name === Endpoint.metricsui && e.endpoint && e.endpoint.indexOf('/d/wZx3OUdmz') === -1) {
- // Update to have correct URL
- e.endpoint += '/d/wZx3OUdmz';
- }
- if (e.name === Endpoint.logsui && e.endpoint && e.endpoint.indexOf('/app/kibana#/discover') === -1) {
- // Update to have correct URL
- e.endpoint += '/app/kibana#/discover';
- }
- });
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboardOverviewPage.ts b/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboardOverviewPage.ts
deleted file mode 100644
index 94a5d20950..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboardOverviewPage.ts
+++ /dev/null
@@ -1,468 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as azdata from 'azdata';
-import * as vscode from 'vscode';
-import { BdcDashboardModel, BdcErrorEvent } from './bdcDashboardModel';
-import { IconPathHelper, cssStyles } from '../constants';
-import { getStateDisplayText, getHealthStatusDisplayText, getEndpointDisplayText, getHealthStatusIcon, getServiceNameDisplayText, Endpoint, getBdcStatusErrorMessage } from '../utils';
-import { EndpointModel, BdcStatusModel } from '../controller/apiGenerated';
-import { createViewDetailsButton } from './commonControls';
-import { HdfsDialogCancelledError } from './hdfsDialogBase';
-import { BdcDashboardPage } from './bdcDashboardPage';
-import * as loc from '../localizedConstants';
-
-const hyperlinkedEndpoints = [Endpoint.metricsui, Endpoint.logsui, Endpoint.sparkHistory, Endpoint.yarnUi];
-
-export class BdcDashboardOverviewPage extends BdcDashboardPage {
- private rootContainer: azdata.FlexContainer;
- private lastUpdatedLabel: azdata.TextComponent;
- private propertiesContainerLoadingComponent: azdata.LoadingComponent;
-
- private serviceStatusTable: azdata.DeclarativeTableComponent;
- private endpointsTable: azdata.DeclarativeTableComponent;
- private endpointsLoadingComponent: azdata.LoadingComponent;
- private endpointsDisplayContainer: azdata.FlexContainer;
- private serviceStatusLoadingComponent: azdata.LoadingComponent;
- private serviceStatusDisplayContainer: azdata.FlexContainer;
- private propertiesErrorMessage: azdata.TextComponent;
- private endpointsErrorMessage: azdata.TextComponent;
- private serviceStatusErrorMessage: azdata.TextComponent;
-
- constructor(model: BdcDashboardModel, modelView: azdata.ModelView, private dashboard: azdata.window.ModelViewDashboard) {
- super(model, modelView);
- this.model.onDidUpdateEndpoints(endpoints => this.eventuallyRunOnInitialized(() => this.handleEndpointsUpdate(endpoints)));
- this.model.onDidUpdateBdcStatus(bdcStatus => this.eventuallyRunOnInitialized(() => this.handleBdcStatusUpdate(bdcStatus)));
- this.model.onBdcError(error => this.eventuallyRunOnInitialized(() => this.handleBdcError(error)));
- }
-
- public get container(): azdata.FlexContainer {
- // Lazily create the container only when needed
- if (!this.rootContainer) {
- this.rootContainer = this.createContainer();
- }
- return this.rootContainer;
- }
-
- public createContainer(): azdata.FlexContainer {
- const rootContainer = this.modelView.modelBuilder.flexContainer().withLayout(
- {
- flexFlow: 'column',
- width: '100%',
- height: '100%'
- }).component();
-
- // ##############
- // # PROPERTIES #
- // ##############
-
- const propertiesLabel = this.modelView.modelBuilder.text()
- .withProps({ value: loc.clusterProperties, CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '10px' } })
- .component();
- rootContainer.addItem(propertiesLabel, { CSSStyles: { 'margin-top': '15px', 'padding-left': '10px', ...cssStyles.title } });
-
- const propertiesContainer = this.modelView.modelBuilder.propertiesContainer().component();
-
- this.propertiesContainerLoadingComponent = this.modelView.modelBuilder.loadingComponent().withItem(propertiesContainer).component();
- rootContainer.addItem(this.propertiesContainerLoadingComponent, { flex: '0 0 auto', CSSStyles: { 'padding-left': '10px' } });
-
- // ############
- // # OVERVIEW #
- // ############
-
- const overviewHeaderContainer = this.modelView.modelBuilder.flexContainer().withLayout({ flexFlow: 'row', height: '20px' }).component();
- rootContainer.addItem(overviewHeaderContainer, { CSSStyles: { 'padding-left': '10px', 'padding-top': '15px' } });
-
- const overviewLabel = this.modelView.modelBuilder.text()
- .withProps({
- value: loc.clusterOverview,
- CSSStyles: { ...cssStyles.text }
- })
- .component();
-
- overviewHeaderContainer.addItem(overviewLabel, { CSSStyles: { ...cssStyles.title } });
-
- this.lastUpdatedLabel = this.modelView.modelBuilder.text()
- .withProps({
- value: loc.lastUpdated(),
- CSSStyles: { ...cssStyles.lastUpdatedText }
- }).component();
-
- overviewHeaderContainer.addItem(this.lastUpdatedLabel, { CSSStyles: { 'margin-left': '45px' } });
-
- const overviewContainer = this.modelView.modelBuilder.flexContainer().withLayout({ flexFlow: 'column', width: '100%', height: '100%' }).component();
-
- this.serviceStatusTable = this.modelView.modelBuilder.declarativeTable()
- .withProps(
- {
- columns: [
- { // status icon
- displayName: '',
- ariaLabel: loc.statusIcon,
- valueType: azdata.DeclarativeDataType.component,
- isReadOnly: true,
- width: 25,
- headerCssStyles: {
- 'border': 'none'
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- },
- },
- { // service
- displayName: loc.serviceName,
- valueType: azdata.DeclarativeDataType.component,
- isReadOnly: true,
- width: 175,
- headerCssStyles: {
- 'border': 'none',
- ...cssStyles.tableHeader
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- },
- },
- { // state
- displayName: loc.state,
- valueType: azdata.DeclarativeDataType.string,
- isReadOnly: true,
- width: 150,
- headerCssStyles: {
- 'border': 'none',
- ...cssStyles.tableHeader
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- },
- },
- { // health status
- displayName: loc.healthStatus,
- valueType: azdata.DeclarativeDataType.string,
- isReadOnly: true,
- width: 100,
- headerCssStyles: {
- 'border': 'none',
- 'text-align': 'left',
- ...cssStyles.tableHeader
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- }
- },
- { // view details button
- displayName: '',
- ariaLabel: loc.viewErrorDetails,
- valueType: azdata.DeclarativeDataType.component,
- isReadOnly: true,
- width: 150,
- headerCssStyles: {
- 'border': 'none',
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- },
- },
- ],
- data: [],
- ariaLabel: loc.clusterOverview
- })
- .component();
-
- this.serviceStatusDisplayContainer = this.modelView.modelBuilder.flexContainer().withLayout({ flexFlow: 'column' }).component();
- this.serviceStatusDisplayContainer.addItem(this.serviceStatusTable);
-
- // Note we don't make the table a child of the loading component since making the loading component align correctly
- // messes up the layout for the table that we display after loading is finished. Instead we'll just remove the loading
- // component once it's finished loading the content
- this.serviceStatusLoadingComponent = this.modelView.modelBuilder.loadingComponent()
- .withProps({ CSSStyles: { 'padding-top': '0px', 'padding-bottom': '0px' } })
- .component();
-
- this.serviceStatusDisplayContainer.addItem(this.serviceStatusLoadingComponent, { flex: '0 0 auto', CSSStyles: { 'padding-left': '150px', width: '30px' } });
-
- this.serviceStatusErrorMessage = this.modelView.modelBuilder.text().withProps({ display: 'none', CSSStyles: { ...cssStyles.errorText } }).component();
- overviewContainer.addItem(this.serviceStatusErrorMessage);
-
- overviewContainer.addItem(this.serviceStatusDisplayContainer);
-
- rootContainer.addItem(overviewContainer, { flex: '0 0 auto' });
-
- // #####################
- // # SERVICE ENDPOINTS #
- // #####################
-
- const endpointsLabel = this.modelView.modelBuilder.text()
- .withProps({ value: loc.serviceEndpoints, CSSStyles: { 'margin-block-start': '20px', 'margin-block-end': '0px' } })
- .component();
- rootContainer.addItem(endpointsLabel, { CSSStyles: { 'padding-left': '10px', ...cssStyles.title } });
-
- this.endpointsErrorMessage = this.modelView.modelBuilder.text().withProps({ display: 'none', CSSStyles: { ...cssStyles.errorText } }).component();
-
- const endpointsContainer = this.modelView.modelBuilder.flexContainer().withLayout({ flexFlow: 'column', width: '100%', height: '100%' }).component();
-
- this.endpointsTable = this.modelView.modelBuilder.declarativeTable()
- .withProps(
- {
- columns: [
- { // service
- displayName: loc.service,
- valueType: azdata.DeclarativeDataType.string,
- isReadOnly: true,
- width: 200,
- headerCssStyles: {
- 'border': 'none',
- ...cssStyles.tableHeader
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- },
- },
- { // endpoint
- displayName: loc.endpoint,
- valueType: azdata.DeclarativeDataType.component,
- isReadOnly: true,
- width: 350,
- headerCssStyles: {
- 'border': 'none',
- ...cssStyles.tableHeader
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none',
- 'overflow': 'hidden',
- 'text-overflow': 'ellipsis'
- },
- },
- { // copy
- displayName: '',
- ariaLabel: loc.copy,
- valueType: azdata.DeclarativeDataType.component,
- isReadOnly: true,
- width: 50,
- headerCssStyles: {
- 'border': 'none',
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- }
- }
- ],
- data: [],
- ariaLabel: loc.serviceEndpoints
- }).component();
-
- this.endpointsDisplayContainer = this.modelView.modelBuilder.flexContainer().withLayout({ flexFlow: 'column' }).component();
- this.endpointsDisplayContainer.addItem(this.endpointsTable);
-
- // Note we don't make the table a child of the loading component since making the loading component align correctly
- // messes up the layout for the table that we display after loading is finished. Instead we'll just remove the loading
- // component once it's finished loading the content
- this.endpointsLoadingComponent = this.modelView.modelBuilder.loadingComponent()
- .withProps({ CSSStyles: { 'padding-top': '0px', 'padding-bottom': '0px' } })
- .component();
- this.endpointsDisplayContainer.addItem(this.endpointsLoadingComponent, { flex: '0 0 auto', CSSStyles: { 'padding-left': '150px', width: '30px' } });
-
- endpointsContainer.addItem(this.endpointsErrorMessage);
- endpointsContainer.addItem(this.endpointsDisplayContainer);
- rootContainer.addItem(endpointsContainer, { flex: '0 0 auto' });
-
- this.initialized = true;
-
- // Now that we've created the UI load data from the model in case it already had data
- this.handleEndpointsUpdate(this.model.serviceEndpoints);
- this.handleBdcStatusUpdate(this.model.bdcStatus);
-
- return rootContainer;
- }
-
- public onRefreshStarted(): void {
- this.propertiesErrorMessage.display = 'none';
- this.serviceStatusErrorMessage.display = 'none';
- this.endpointsErrorMessage.display = 'none';
-
- this.serviceStatusDisplayContainer.display = undefined;
- this.propertiesContainerLoadingComponent.display = undefined;
- this.endpointsDisplayContainer.display = undefined;
- }
-
- private handleBdcStatusUpdate(bdcStatus?: BdcStatusModel): void {
- if (!bdcStatus) {
- return;
- }
- this.lastUpdatedLabel.value = loc.lastUpdated(this.model.bdcStatusLastUpdated);
-
- this.propertiesContainerLoadingComponent.loading = false;
-
- (this.propertiesContainerLoadingComponent.component).propertyItems = [
- { displayName: loc.clusterState, value: getStateDisplayText(bdcStatus.state) },
- { displayName: loc.healthStatus, value: getHealthStatusDisplayText(bdcStatus.healthStatus) }
- ];
-
- if (bdcStatus.services) {
- this.serviceStatusTable.data = bdcStatus.services.map(serviceStatus => {
- const statusIconCell = this.modelView.modelBuilder.text()
- .withProps({
- value: getHealthStatusIcon(serviceStatus.healthStatus),
- ariaRole: 'img',
- title: getHealthStatusDisplayText(serviceStatus.healthStatus),
- CSSStyles: { 'user-select': 'none', ...cssStyles.text }
- }).component();
- const nameCell = this.modelView.modelBuilder.hyperlink()
- .withProps({
- label: getServiceNameDisplayText(serviceStatus.serviceName),
- url: '',
- CSSStyles: { ...cssStyles.text }
- }).component();
- nameCell.onDidClick(() => {
- this.dashboard.selectTab(serviceStatus.serviceName);
- });
-
- const viewDetailsButton = serviceStatus.healthStatus !== 'healthy' && serviceStatus.details && serviceStatus.details.length > 0 ? createViewDetailsButton(this.modelView.modelBuilder, serviceStatus.details) : undefined;
- return [
- statusIconCell,
- nameCell,
- getStateDisplayText(serviceStatus.state),
- getHealthStatusDisplayText(serviceStatus.healthStatus),
- viewDetailsButton];
- });
- this.serviceStatusDisplayContainer.removeItem(this.serviceStatusLoadingComponent);
- }
- }
-
- private handleEndpointsUpdate(endpoints?: EndpointModel[]): void {
- if (!endpoints) {
- return;
- }
- // Sort the endpoints. The sort method is that SQL Server Master is first - followed by all
- // others in alphabetical order by endpoint
- const sqlServerMasterEndpoints = endpoints.filter(e => e.name === Endpoint.sqlServerMaster);
- endpoints = endpoints.filter(e => e.name !== Endpoint.sqlServerMaster)
- .sort((e1, e2) => {
- if (e1.endpoint < e2.endpoint) { return -1; }
- if (e1.endpoint > e2.endpoint) { return 1; }
- return 0;
- });
- endpoints.unshift(...sqlServerMasterEndpoints);
-
- this.endpointsTable.dataValues = endpoints.map(e => {
- const copyValueCell = this.modelView.modelBuilder.button().withProps({ title: loc.copy }).component();
- copyValueCell.iconPath = IconPathHelper.copy;
- copyValueCell.onDidClick(() => {
- vscode.env.clipboard.writeText(e.endpoint);
- vscode.window.showInformationMessage(loc.copiedEndpoint(getEndpointDisplayText(e.name, e.description)));
- });
- return [{ value: getEndpointDisplayText(e.name, e.description) },
- { value: createEndpointComponent(this.modelView.modelBuilder, e, this.model, hyperlinkedEndpoints.some(he => he === e.name)) },
- { value: copyValueCell }];
- });
-
- this.endpointsDisplayContainer.removeItem(this.endpointsLoadingComponent);
- }
-
- private handleBdcError(errorEvent: BdcErrorEvent): void {
- if (errorEvent.errorType === 'bdcEndpoints') {
- const errorMessage = loc.endpointsError(errorEvent.error.message);
- this.showEndpointsError(errorMessage);
- } else if (errorEvent.errorType === 'bdcStatus') {
- this.showBdcStatusError(getBdcStatusErrorMessage(errorEvent.error));
- } else {
- this.handleGeneralError(errorEvent.error);
- }
- }
-
- private showBdcStatusError(errorMessage: string): void {
- this.serviceStatusDisplayContainer.display = 'none';
- this.propertiesContainerLoadingComponent.display = 'none';
- this.serviceStatusErrorMessage.value = errorMessage;
- this.serviceStatusErrorMessage.display = undefined;
- this.propertiesErrorMessage.value = errorMessage;
- this.propertiesErrorMessage.display = undefined;
- }
-
- private showEndpointsError(errorMessage: string): void {
- this.endpointsDisplayContainer.display = 'none';
- this.endpointsErrorMessage.display = undefined;
- this.endpointsErrorMessage.value = errorMessage;
- }
-
- private handleGeneralError(error: Error): void {
- if (error instanceof HdfsDialogCancelledError) {
- const errorMessage = loc.noConnectionError;
- this.showBdcStatusError(errorMessage);
- this.showEndpointsError(errorMessage);
- } else {
- const errorMessage = loc.unexpectedError(error);
- this.showBdcStatusError(errorMessage);
- this.showEndpointsError(errorMessage);
- }
- }
-}
-
-function createEndpointComponent(modelBuilder: azdata.ModelBuilder, endpoint: EndpointModel, bdcModel: BdcDashboardModel, isHyperlink: boolean): azdata.HyperlinkComponent | azdata.TextComponent {
- if (isHyperlink) {
- return modelBuilder.hyperlink()
- .withProps({
- label: endpoint.endpoint,
- title: endpoint.endpoint,
- url: endpoint.endpoint
- })
- .component();
- }
- else if (endpoint.name === Endpoint.sqlServerMaster) {
- const endpointCell = modelBuilder.hyperlink()
- .withProps({
- title: endpoint.endpoint,
- label: endpoint.endpoint,
- url: '',
- CSSStyles: { ...cssStyles.text }
- }).component();
- endpointCell.onDidClick(async () => {
- const connProfile = bdcModel.getSqlServerMasterConnectionProfile();
- const result = await azdata.connection.connect(connProfile, true, true);
- if (!result.connected) {
- if (result.errorMessage && result.errorMessage.length > 0) {
- vscode.window.showErrorMessage(result.errorMessage);
- }
- // Clear out the password and username before connecting since those being wrong are likely the issue
- connProfile.userName = undefined;
- connProfile.password = undefined;
- azdata.connection.openConnectionDialog(undefined, connProfile);
- }
- });
- return endpointCell;
- }
- else {
- return modelBuilder.text()
- .withProps({
- value: endpoint.endpoint,
- title: endpoint.endpoint,
- CSSStyles: { ...cssStyles.text }
- })
- .component();
- }
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboardPage.ts b/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboardPage.ts
deleted file mode 100644
index 951ba88324..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboardPage.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import { IconPathHelper } from '../constants';
-import { BdcDashboardModel, getTroubleshootNotebookUrl } from './bdcDashboardModel';
-import * as loc from '../localizedConstants';
-import * as azdata from 'azdata';
-import * as vscode from 'vscode';
-import { InitializingComponent } from './intializingComponent';
-
-export abstract class BdcDashboardPage extends InitializingComponent {
-
- private _toolbarContainer: azdata.ToolbarContainer;
- private _refreshButton: azdata.ButtonComponent;
-
- constructor(protected model: BdcDashboardModel, protected modelView: azdata.ModelView, protected serviceName?: string) {
- super();
- }
-
- public get toolbarContainer(): azdata.ToolbarContainer {
- // Lazily create the container only when needed
- if (!this._toolbarContainer) {
- this._toolbarContainer = this.createToolbarContainer();
- }
- return this._toolbarContainer;
- }
-
- protected createToolbarContainer(): azdata.ToolbarContainer {
- // Refresh button
- this._refreshButton = this.modelView.modelBuilder.button()
- .withProps({
- label: loc.refresh,
- iconPath: IconPathHelper.refresh
- }).component();
-
- this._refreshButton.onDidClick(async () => {
- await this.doRefresh();
- });
-
- const openTroubleshootNotebookButton = this.modelView.modelBuilder.button()
- .withProps({
- label: loc.troubleshoot,
- iconPath: IconPathHelper.notebook
- }).component();
-
- openTroubleshootNotebookButton.onDidClick(() => {
- vscode.commands.executeCommand('books.sqlserver2019', getTroubleshootNotebookUrl(this.serviceName));
- });
-
- return this.modelView.modelBuilder.toolbarContainer()
- .withToolbarItems(
- [
- { component: this._refreshButton },
- { component: openTroubleshootNotebookButton }
- ]
- ).component();
- }
-
- private async doRefresh(): Promise {
- try {
- this._refreshButton.enabled = false;
- await this.model.refresh();
- } finally {
- this._refreshButton.enabled = true;
- }
- }
-}
-
diff --git a/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboardResourceStatusPage.ts b/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboardResourceStatusPage.ts
deleted file mode 100644
index 3b7c52eb89..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcDashboardResourceStatusPage.ts
+++ /dev/null
@@ -1,358 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as azdata from 'azdata';
-import { BdcDashboardModel } from './bdcDashboardModel';
-import { BdcStatusModel, InstanceStatusModel, ResourceStatusModel } from '../controller/apiGenerated';
-import { getHealthStatusDisplayText, getHealthStatusIcon, getStateDisplayText, Service } from '../utils';
-import { cssStyles } from '../constants';
-import { isNullOrUndefined } from 'util';
-import { createViewDetailsButton } from './commonControls';
-import { BdcDashboardPage } from './bdcDashboardPage';
-import * as loc from '../localizedConstants';
-
-export class BdcDashboardResourceStatusPage extends BdcDashboardPage {
-
- private resourceStatusModel: ResourceStatusModel;
- private rootContainer: azdata.FlexContainer;
- private instanceHealthStatusTable: azdata.DeclarativeTableComponent;
- private metricsAndLogsRowsTable: azdata.DeclarativeTableComponent;
- private lastUpdatedLabel: azdata.TextComponent;
-
- constructor(model: BdcDashboardModel, modelView: azdata.ModelView, serviceName: string, private resourceName: string) {
- super(model, modelView, serviceName);
- this.model.onDidUpdateBdcStatus(bdcStatus => this.eventuallyRunOnInitialized(() => this.handleBdcStatusUpdate(bdcStatus)));
- }
-
- public get container(): azdata.FlexContainer {
- // Lazily create the container only when needed
- if (!this.rootContainer) {
- // We do this here so that we can have the resource model to use for populating the data
- // in the tables. This is to get around a timing issue with ModelView tables
- this.updateResourceStatusModel(this.model.bdcStatus);
- this.createContainer();
- }
- return this.rootContainer;
- }
-
- private createContainer(): void {
- this.rootContainer = this.modelView.modelBuilder.flexContainer().withLayout(
- {
- flexFlow: 'column',
- width: '100%',
- height: '100%'
- }).component();
-
- // ##############################
- // # INSTANCE HEALTH AND STATUS #
- // ##############################
-
- const healthStatusHeaderContainer = this.modelView.modelBuilder.flexContainer().withLayout({ flexFlow: 'row', height: '20px' }).component();
- this.rootContainer.addItem(healthStatusHeaderContainer, { CSSStyles: { 'padding-left': '10px', 'padding-top': '15px' } });
-
- // Header label
- const healthStatusHeaderLabel = this.modelView.modelBuilder.text()
- .withProps({
- value: loc.healthStatusDetails,
- CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '10px' }
- })
- .component();
-
- healthStatusHeaderContainer.addItem(healthStatusHeaderLabel, { CSSStyles: { ...cssStyles.title } });
-
- // Last updated label
- this.lastUpdatedLabel = this.modelView.modelBuilder.text()
- .withProps({
- value: loc.lastUpdated(this.model.bdcStatusLastUpdated),
- CSSStyles: { ...cssStyles.lastUpdatedText }
- }).component();
-
- healthStatusHeaderContainer.addItem(this.lastUpdatedLabel, { CSSStyles: { 'margin-left': '45px' } });
-
- this.instanceHealthStatusTable = this.modelView.modelBuilder.declarativeTable()
- .withProps(
- {
- columns: [
- { // status icon
- displayName: '',
- ariaLabel: loc.statusIcon,
- valueType: azdata.DeclarativeDataType.component,
- isReadOnly: true,
- width: 25,
- headerCssStyles: {
- 'border': 'none'
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- },
- },
- { // instance
- displayName: loc.instance,
- valueType: azdata.DeclarativeDataType.string,
- isReadOnly: true,
- width: 100,
- headerCssStyles: {
- 'border': 'none',
- ...cssStyles.tableHeader
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- },
- },
- { // state
- displayName: loc.state,
- valueType: azdata.DeclarativeDataType.string,
- isReadOnly: true,
- width: 150,
- headerCssStyles: {
- 'border': 'none',
- ...cssStyles.tableHeader
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- },
- },
- { // health status
- displayName: loc.healthStatus,
- valueType: azdata.DeclarativeDataType.string,
- isReadOnly: true,
- width: 100,
- headerCssStyles: {
- 'border': 'none',
- 'text-align': 'left',
- ...cssStyles.tableHeader
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- }
- },
- { // view details button
- displayName: '',
- ariaLabel: loc.viewErrorDetails,
- valueType: azdata.DeclarativeDataType.component,
- isReadOnly: true,
- width: 150,
- headerCssStyles: {
- 'border': 'none'
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- },
- },
- ],
- data: this.createHealthStatusRows(),
- ariaLabel: loc.healthStatusDetails
- }).component();
- this.rootContainer.addItem(this.instanceHealthStatusTable, { flex: '0 0 auto' });
-
- // ####################
- // # METRICS AND LOGS #
- // ####################
-
- // Title label
- const endpointsLabel = this.modelView.modelBuilder.text()
- .withProps({ value: loc.metricsAndLogs, CSSStyles: { 'margin-block-start': '20px', 'margin-block-end': '0px' } })
- .component();
- this.rootContainer.addItem(endpointsLabel, { CSSStyles: { 'padding-left': '10px', ...cssStyles.title } });
-
- let metricsAndLogsColumns: azdata.DeclarativeTableColumn[] =
- [
- { // instance
- displayName: loc.instance,
- valueType: azdata.DeclarativeDataType.string,
- isReadOnly: true,
- width: 125,
- headerCssStyles: {
- 'border': 'none',
- ...cssStyles.tableHeader
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- }
- },
- { // node metrics
- displayName: loc.nodeMetrics,
- valueType: azdata.DeclarativeDataType.component,
- isReadOnly: true,
- width: 100,
- headerCssStyles: {
- 'border': 'none',
- ...cssStyles.tableHeader
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- }
- }
- ];
-
- // Only show SQL metrics column for SQL resource instances
- if (this.serviceName.toLowerCase() === Service.sql) {
- metricsAndLogsColumns.push(
- { // sql metrics
- displayName: loc.sqlMetrics,
- valueType: azdata.DeclarativeDataType.component,
- isReadOnly: true,
- width: 100,
- headerCssStyles: {
- 'border': 'none',
- 'text-align': 'left',
- ...cssStyles.tableHeader
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- }
- });
- }
-
- metricsAndLogsColumns.push(
- { // logs
- displayName: loc.logs,
- valueType: azdata.DeclarativeDataType.component,
- isReadOnly: true,
- width: 100,
- headerCssStyles: {
- 'border': 'none',
- 'text-align': 'left',
- ...cssStyles.tableHeader
- },
- rowCssStyles: {
- 'border-top': 'solid 1px #ccc',
- 'border-bottom': 'solid 1px #ccc',
- 'border-left': 'none',
- 'border-right': 'none'
- }
- });
-
- this.metricsAndLogsRowsTable = this.modelView.modelBuilder.declarativeTable()
- .withProps(
- {
- columns: metricsAndLogsColumns,
- data: this.createMetricsAndLogsRows(),
- ariaLabel: loc.metricsAndLogs
- }).component();
- this.rootContainer.addItem(this.metricsAndLogsRowsTable, { flex: '0 0 auto' });
- this.initialized = true;
- }
-
- private updateResourceStatusModel(bdcStatus?: BdcStatusModel): void {
- // If we can't find the resource model for this resource then just
- // default to keeping what we had originally
- if (!bdcStatus) {
- return;
- }
- const service = bdcStatus.services ? bdcStatus.services.find(s => s.serviceName === this.serviceName) : undefined;
- this.resourceStatusModel = service ? service.resources.find(r => r.resourceName === this.resourceName) : this.resourceStatusModel;
- }
-
- private handleBdcStatusUpdate(bdcStatus?: BdcStatusModel): void {
- this.updateResourceStatusModel(bdcStatus);
-
- if (!this.resourceStatusModel || isNullOrUndefined(this.resourceStatusModel.instances)) {
- return;
- }
-
- this.lastUpdatedLabel.value = loc.lastUpdated(this.model.bdcStatusLastUpdated);
-
- this.instanceHealthStatusTable.data = this.createHealthStatusRows();
-
- this.metricsAndLogsRowsTable.data = this.createMetricsAndLogsRows();
- }
-
- private createMetricsAndLogsRows(): any[][] {
- return this.resourceStatusModel ? this.resourceStatusModel.instances.map(instanceStatus => this.createMetricsAndLogsRow(instanceStatus)) : [];
- }
-
- private createHealthStatusRows(): any[][] {
- return this.resourceStatusModel ? this.resourceStatusModel.instances.map(instanceStatus => this.createHealthStatusRow(instanceStatus)) : [];
- }
-
- private createMetricsAndLogsRow(instanceStatus: InstanceStatusModel): any[] {
- const row: any[] = [instanceStatus.instanceName];
-
- // Not all instances have all logs available - in that case just display N/A instead of a link
- if (isNullOrUndefined(instanceStatus.dashboards) || isNullOrUndefined(instanceStatus.dashboards.nodeMetricsUrl)) {
- row.push(this.modelView.modelBuilder.text().withProps({ value: loc.notAvailable, CSSStyles: { ...cssStyles.text } }).component());
- } else {
- row.push(this.modelView.modelBuilder.hyperlink().withProps({
- label: loc.view,
- url: instanceStatus.dashboards.nodeMetricsUrl,
- title: instanceStatus.dashboards.nodeMetricsUrl,
- ariaLabel: loc.viewNodeMetrics(instanceStatus.dashboards.nodeMetricsUrl),
- CSSStyles: { ...cssStyles.text }
- }).component());
- }
-
- // Only show SQL metrics column for SQL resource instances
- if (this.serviceName === Service.sql) {
- // Not all instances have all logs available - in that case just display N/A instead of a link
- if (isNullOrUndefined(instanceStatus.dashboards) || isNullOrUndefined(instanceStatus.dashboards.sqlMetricsUrl)) {
- row.push(this.modelView.modelBuilder.text().withProps({ value: loc.notAvailable, CSSStyles: { ...cssStyles.text } }).component());
- } else {
- row.push(this.modelView.modelBuilder.hyperlink().withProps({
- label: loc.view,
- url: instanceStatus.dashboards.sqlMetricsUrl,
- title: instanceStatus.dashboards.sqlMetricsUrl,
- ariaLabel: loc.viewSqlMetrics(instanceStatus.dashboards.sqlMetricsUrl),
- CSSStyles: { ...cssStyles.text }
- }).component());
- }
- }
-
- if (isNullOrUndefined(instanceStatus.dashboards) || isNullOrUndefined(instanceStatus.dashboards.logsUrl)) {
- row.push(this.modelView.modelBuilder.text().withProps({ value: loc.notAvailable, CSSStyles: { ...cssStyles.text } }).component());
- } else {
- row.push(this.modelView.modelBuilder.hyperlink().withProps({
- label: loc.view,
- url: instanceStatus.dashboards.logsUrl,
- title: instanceStatus.dashboards.logsUrl,
- ariaLabel: loc.viewLogs(instanceStatus.dashboards.logsUrl),
- CSSStyles: { ...cssStyles.text }
- }).component());
- }
- return row;
- }
-
- private createHealthStatusRow(instanceStatus: InstanceStatusModel): any[] {
- const statusIconCell = this.modelView.modelBuilder.text()
- .withProps({
- value: getHealthStatusIcon(instanceStatus.healthStatus),
- ariaRole: 'img',
- title: getHealthStatusDisplayText(instanceStatus.healthStatus),
- CSSStyles: { 'user-select': 'none', ...cssStyles.text }
- }).component();
-
- const viewDetailsButton = instanceStatus.healthStatus !== 'healthy' && instanceStatus.details && instanceStatus.details.length > 0 ? createViewDetailsButton(this.modelView.modelBuilder, instanceStatus.details) : undefined;
- return [
- statusIconCell,
- instanceStatus.instanceName,
- getStateDisplayText(instanceStatus.state),
- getHealthStatusDisplayText(instanceStatus.healthStatus),
- viewDetailsButton];
- }
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcServiceStatusPage.ts b/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcServiceStatusPage.ts
deleted file mode 100644
index 118c2ab3de..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/dialog/bdcServiceStatusPage.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as azdata from 'azdata';
-import { BdcStatusModel, ResourceStatusModel } from '../controller/apiGenerated';
-import { BdcDashboardResourceStatusPage } from './bdcDashboardResourceStatusPage';
-import { BdcDashboardModel } from './bdcDashboardModel';
-import { BdcDashboardPage } from './bdcDashboardPage';
-import { getHealthStatusDotIcon } from '../utils';
-
-export class BdcServiceStatusPage extends BdcDashboardPage {
-
- private createdResourceTabs: Map = new Map();
- private tabbedPanel: azdata.TabbedPanelComponent;
-
- constructor(serviceName: string, model: BdcDashboardModel, modelView: azdata.ModelView) {
- super(model, modelView, serviceName);
- this.model.onDidUpdateBdcStatus(bdcStatus => this.eventuallyRunOnInitialized(() => this.handleBdcStatusUpdate(bdcStatus)));
- }
-
- public get container(): azdata.TabbedPanelComponent {
- // Lazily create the container only when needed
- if (!this.tabbedPanel) {
- this.createPage();
- }
- return this.tabbedPanel;
- }
-
- private createPage(): void {
- this.tabbedPanel = this.modelView.modelBuilder.tabbedPanel()
- .withLayout({ showIcon: true, alwaysShowTabs: true }).component();
-
- // Initialize our set of tab pages
- this.handleBdcStatusUpdate(this.model.bdcStatus);
-
- this.initialized = true;
- }
-
- private handleBdcStatusUpdate(bdcStatus: BdcStatusModel): void {
- if (!bdcStatus) {
- return;
- }
- const service = bdcStatus.services.find(s => s.serviceName === this.serviceName);
- if (service && service.resources) {
- this.updateResourcePages(service.resources);
- }
- }
-
- /**
- * Update the resource tab pages, creating any new ones as necessary
- */
- private updateResourcePages(resources: ResourceStatusModel[]): void {
- resources.forEach(resource => {
- const existingTab = this.createdResourceTabs.get(resource.resourceName);
- if (existingTab) {
- existingTab.icon = getHealthStatusDotIcon(resource.healthStatus);
- } else {
- const resourceStatusPage = new BdcDashboardResourceStatusPage(this.model, this.modelView, this.serviceName, resource.resourceName);
- const newTab: azdata.Tab = {
- title: resource.resourceName,
- id: resource.resourceName,
- content: resourceStatusPage.container,
- icon: getHealthStatusDotIcon(resource.healthStatus)
- };
- this.createdResourceTabs.set(resource.resourceName, newTab);
- }
- });
- this.tabbedPanel.updateTabs(Array.from(this.createdResourceTabs.values()));
- }
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/dialog/commonControls.ts b/extensions/big-data-cluster/src/bigDataCluster/dialog/commonControls.ts
deleted file mode 100644
index 2b8515858c..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/dialog/commonControls.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as azdata from 'azdata';
-import * as vscode from 'vscode';
-import * as loc from '../localizedConstants';
-
-export function createViewDetailsButton(modelBuilder: azdata.ModelBuilder, text: string): azdata.ButtonComponent {
- const viewDetailsButton = modelBuilder.button().withProps({
- label: loc.viewDetails,
- ariaLabel: loc.viewErrorDetails,
- secondary: true
- }).component();
- viewDetailsButton.onDidClick(() => {
- vscode.window.showErrorMessage(text, { modal: true });
- });
- return viewDetailsButton;
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/dialog/connectControllerDialog.ts b/extensions/big-data-cluster/src/bigDataCluster/dialog/connectControllerDialog.ts
deleted file mode 100644
index a7b99acfb4..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/dialog/connectControllerDialog.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as azdata from 'azdata';
-import { HdfsDialogBase, HdfsDialogModelBase, HdfsDialogProperties } from './hdfsDialogBase';
-import { ClusterController } from '../controller/clusterControllerApi';
-import * as loc from '../localizedConstants';
-
-
-export class ConnectControllerDialog extends HdfsDialogBase {
- constructor(model: ConnectControllerModel) {
- super(loc.connectToController, model);
- }
-
- protected getMainSectionComponents(): (azdata.FormComponentGroup | azdata.FormComponent)[] {
- return [];
- }
-
- protected async validate(): Promise<{ validated: boolean, value?: ClusterController }> {
- try {
- const controller = await this.model.onComplete({
- url: this.urlInputBox && this.urlInputBox.value,
- auth: this.authValue,
- username: this.usernameInputBox && this.usernameInputBox.value,
- password: this.passwordInputBox && this.passwordInputBox.value
- });
- return { validated: true, value: controller };
- } catch (error) {
- await this.reportError(error);
- return { validated: false, value: undefined };
- }
- }
-}
-
-export class ConnectControllerModel extends HdfsDialogModelBase {
-
- constructor(props: HdfsDialogProperties) {
- super(props);
- }
-
- protected async handleCompleted(): Promise {
- this.throwIfMissingUsernamePassword();
-
- // We pre-fetch the endpoints here to verify that the information entered is correct (the user is able to connect)
- return await this.createAndVerifyControllerConnection();
- }
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/dialog/hdfsDialogBase.ts b/extensions/big-data-cluster/src/bigDataCluster/dialog/hdfsDialogBase.ts
deleted file mode 100644
index a92b17281e..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/dialog/hdfsDialogBase.ts
+++ /dev/null
@@ -1,240 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as azdata from 'azdata';
-import { ClusterController, ControllerError } from '../controller/clusterControllerApi';
-import { Deferred } from '../../common/promise';
-import * as loc from '../localizedConstants';
-import { AuthType, IEndPointsResponse } from 'bdc';
-
-function getAuthCategory(name: AuthType): azdata.CategoryValue {
- if (name === 'basic') {
- return { name: name, displayName: loc.basic };
- }
- return { name: name, displayName: loc.windowsAuth };
-}
-
-export interface HdfsDialogProperties {
- url?: string;
- auth?: AuthType;
- username?: string;
- password?: string;
-}
-
-export class HdfsDialogCancelledError extends Error {
- constructor(message: string = 'Dialog cancelled') {
- super(message);
- }
-}
-
-export abstract class HdfsDialogModelBase {
- protected _canceled = false;
- private _authTypes: azdata.CategoryValue[];
- constructor(
- public props: T
- ) {
- if (!props.auth) {
- this.props.auth = 'basic';
- }
- }
-
- public get authCategories(): azdata.CategoryValue[] {
- if (!this._authTypes) {
- this._authTypes = [getAuthCategory('basic'), getAuthCategory('integrated')];
- }
- return this._authTypes;
- }
-
- public get authCategory(): azdata.CategoryValue {
- return getAuthCategory(this.props.auth);
- }
-
- public async onComplete(props: T): Promise {
- try {
- this.props = props;
- return await this.handleCompleted();
- } catch (error) {
- // Ignore the error if we cancelled the request since we can't stop the actual request from completing
- if (!this._canceled) {
- throw error;
- }
- return undefined;
- }
- }
-
- protected abstract handleCompleted(): Promise;
-
- public async onError(error: ControllerError): Promise {
- // implement
- }
-
- public async onCancel(): Promise {
- this._canceled = true;
- }
-
- protected createController(): ClusterController {
- return new ClusterController(this.props.url, this.props.auth, this.props.username, this.props.password);
- }
-
- protected async createAndVerifyControllerConnection(): Promise {
- // We pre-fetch the endpoints here to verify that the information entered is correct (the user is able to connect)
- let controller = this.createController();
- let response: IEndPointsResponse;
- try {
- response = await controller.getEndPoints();
- if (!response || !response.endPoints) {
- throw new Error(loc.loginFailed);
- }
- } catch (err) {
- throw new Error(loc.loginFailedWithError(err));
- }
- return controller;
- }
-
- protected throwIfMissingUsernamePassword(): void {
- if (this.props.auth === 'basic') {
- // Verify username and password as we can't make them required in the UI
- if (!this.props.username) {
- throw new Error(loc.usernameRequired);
- } else if (!this.props.password) {
- throw new Error(loc.passwordRequired);
- }
- }
- }
-}
-
-export abstract class HdfsDialogBase {
-
- protected dialog: azdata.window.Dialog;
- protected uiModelBuilder!: azdata.ModelBuilder;
-
- protected urlInputBox!: azdata.InputBoxComponent;
- protected authDropdown!: azdata.DropDownComponent;
- protected usernameInputBox!: azdata.InputBoxComponent;
- protected passwordInputBox!: azdata.InputBoxComponent;
-
- private returnPromise: Deferred;
-
- constructor(private title: string, protected model: HdfsDialogModelBase) {
- }
-
- public async showDialog(): Promise {
- this.returnPromise = new Deferred();
- this.createDialog();
- azdata.window.openDialog(this.dialog);
- return this.returnPromise.promise;
- }
-
- private createDialog(): void {
- this.dialog = azdata.window.createModelViewDialog(this.title);
- this.dialog.registerContent(async view => {
- this.uiModelBuilder = view.modelBuilder;
-
- this.urlInputBox = this.uiModelBuilder.inputBox()
- .withProps({
- placeHolder: loc.url.toLocaleLowerCase(),
- value: this.model.props.url,
- enabled: false
- }).component();
-
- this.authDropdown = this.uiModelBuilder.dropDown().withProps({
- values: this.model.authCategories,
- value: this.model.authCategory,
- editable: false,
- }).component();
- this.authDropdown.onValueChanged(e => this.onAuthChanged());
- this.usernameInputBox = this.uiModelBuilder.inputBox()
- .withProps({
- placeHolder: loc.username.toLocaleLowerCase(),
- value: this.model.props.username
- }).component();
- this.passwordInputBox = this.uiModelBuilder.inputBox()
- .withProps({
- placeHolder: loc.password.toLocaleLowerCase(),
- inputType: 'password',
- value: this.model.props.password
- })
- .component();
-
- let connectionSection: azdata.FormComponentGroup = {
- components: [
- {
- component: this.urlInputBox,
- title: loc.clusterUrl,
- required: true
- }, {
- component: this.authDropdown,
- title: loc.authType,
- required: true
- }, {
- component: this.usernameInputBox,
- title: loc.username,
- required: false
- }, {
- component: this.passwordInputBox,
- title: loc.password,
- required: false
- }
- ],
- title: loc.clusterConnection
- };
- let formModel = this.uiModelBuilder.formContainer()
- .withFormItems(
- this.getMainSectionComponents().concat(
- connectionSection)
- ).withLayout({ width: '100%' }).component();
-
- await view.initializeModel(formModel);
- this.onAuthChanged();
- });
-
- this.dialog.registerCloseValidator(async () => {
- const result = await this.validate();
- if (result.validated) {
- this.returnPromise.resolve(result.value);
- this.returnPromise = undefined;
- }
- return result.validated;
- });
- this.dialog.cancelButton.onClick(async () => await this.cancel());
- this.dialog.okButton.label = loc.ok;
- this.dialog.cancelButton.label = loc.cancel;
- }
-
- protected abstract getMainSectionComponents(): (azdata.FormComponentGroup | azdata.FormComponent)[];
-
- protected get authValue(): AuthType {
- return (this.authDropdown.value).name as AuthType;
- }
-
- private onAuthChanged(): void {
- let isBasic = this.authValue === 'basic';
- this.usernameInputBox.enabled = isBasic;
- this.passwordInputBox.enabled = isBasic;
- if (!isBasic) {
- this.usernameInputBox.value = '';
- this.passwordInputBox.value = '';
- }
- }
-
- protected abstract validate(): Promise<{ validated: boolean, value?: R }>;
-
- private async cancel(): Promise {
- if (this.model && this.model.onCancel) {
- await this.model.onCancel();
- }
- this.returnPromise.reject(new HdfsDialogCancelledError());
- }
-
- protected async reportError(error: any): Promise {
- this.dialog.message = {
- text: (typeof error === 'string') ? error : error.message,
- level: azdata.window.MessageLevel.Error
- };
- if (this.model && this.model.onError) {
- await this.model.onError(error as ControllerError);
- }
- }
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/dialog/intializingComponent.ts b/extensions/big-data-cluster/src/bigDataCluster/dialog/intializingComponent.ts
deleted file mode 100644
index 046ebe7cf8..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/dialog/intializingComponent.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import { Deferred } from '../../common/promise';
-
-export abstract class InitializingComponent {
-
- private _initialized: boolean = false;
-
- private _onInitializedPromise: Deferred = new Deferred();
-
- constructor() { }
-
- protected get initialized(): boolean {
- return this._initialized;
- }
-
- protected set initialized(value: boolean) {
- if (!this._initialized && value) {
- this._initialized = true;
- this._onInitializedPromise.resolve();
- }
- }
-
- /**
- * Runs the specified action when the component is initialized. If already initialized just runs
- * the action immediately.
- * @param action The action to be ran when the page is initialized
- */
- protected eventuallyRunOnInitialized(action: () => void): void {
- if (!this._initialized) {
- this._onInitializedPromise.promise.then(() => action()).catch(error => console.error(`Unexpected error running onInitialized action for BDC Page : ${error}`));
- } else {
- action();
- }
- }
-}
-
diff --git a/extensions/big-data-cluster/src/bigDataCluster/dialog/mountHdfsDialog.ts b/extensions/big-data-cluster/src/bigDataCluster/dialog/mountHdfsDialog.ts
deleted file mode 100644
index fa0a48eaf1..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/dialog/mountHdfsDialog.ts
+++ /dev/null
@@ -1,378 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as vscode from 'vscode';
-import * as azdata from 'azdata';
-import { ClusterController, MountInfo, MountState } from '../controller/clusterControllerApi';
-import { HdfsDialogBase, HdfsDialogModelBase, HdfsDialogProperties } from './hdfsDialogBase';
-import * as loc from '../localizedConstants';
-
-/**
- * Converts a comma-delimited set of key value pair credentials to a JSON object.
- * This code is taken from the azdata implementation written in Python
- */
-function convertCredsToJson(creds: string): { credentials: {} } {
- if (!creds) {
- return undefined;
- }
- let credObj: { 'credentials': { [key: string]: any } } = { 'credentials': {} };
- let pairs = creds.split(',');
- let validPairs: string[] = [];
- for (let i = 0; i < pairs.length; i++) {
- // handle escaped commas in a browser-agnostic way using regex:
- // this matches a string ending in a single escape character \, but not \\.
- // In this case we split on ',` when we should've ignored it as it was a \, instead.
- // Restore the escaped comma by combining the 2 split strings
- if (i < (pairs.length - 1) && pairs[i].match(/(?!\\).*\\$/)) {
- pairs[i + 1] = `${pairs[i]},${pairs[i + 1]}`;
- } else {
- validPairs.push(pairs[i]);
- }
- }
-
- validPairs.forEach(pair => {
- const formattingErr = loc.badCredentialsFormatting(pair);
- try {
- // # remove escaped characters for ,
- pair = pair.replace('\\,', ',').trim();
- let firstEquals = pair.indexOf('=');
- if (firstEquals <= 0 || firstEquals >= pair.length) {
- throw new Error(formattingErr);
- }
- let key = pair.substring(0, firstEquals);
- let value = pair.substring(firstEquals + 1);
- credObj.credentials[key] = value;
- } catch (err) {
- throw new Error(formattingErr);
- }
- });
- return credObj;
-}
-
-export interface MountHdfsProperties extends HdfsDialogProperties {
- hdfsPath?: string;
- remoteUri?: string;
- credentials?: string;
-}
-
-export class MountHdfsDialogModel extends HdfsDialogModelBase {
- private credentials: {};
-
- constructor(props: MountHdfsProperties) {
- super(props);
- }
-
- protected async handleCompleted(): Promise {
- this.throwIfMissingUsernamePassword();
- // Validate credentials
- this.credentials = convertCredsToJson(this.props.credentials);
-
- // We pre-fetch the endpoints here to verify that the information entered is correct (the user is able to connect)
- let controller = await this.createAndVerifyControllerConnection();
- if (this._canceled) {
- return;
- }
- azdata.tasks.startBackgroundOperation(
- {
- connection: undefined,
- displayName: loc.mountTask(this.props.hdfsPath),
- description: '',
- isCancelable: false,
- operation: op => {
- this.onSubmit(controller, op);
- }
- }
- );
- }
-
- private async onSubmit(controller: ClusterController, op: azdata.BackgroundOperation): Promise {
- try {
- await controller.mountHdfs(this.props.hdfsPath, this.props.remoteUri, this.credentials);
- op.updateStatus(azdata.TaskStatus.InProgress, loc.mountTaskSubmitted);
-
- // Wait until status has changed or some sensible time expired. If it goes over 2 minutes we assume it's "working"
- // as there's no other API that'll give us this for now
- let result = await this.waitOnMountStatusChange(controller);
- let msg = result.state === MountState.Ready ? loc.mountCompleted : loc.mountInProgress;
- op.updateStatus(azdata.TaskStatus.Succeeded, msg);
- } catch (error) {
- const errMsg = loc.mountError(error);
- vscode.window.showErrorMessage(errMsg);
- op.updateStatus(azdata.TaskStatus.Failed, errMsg);
- }
- }
-
- private waitOnMountStatusChange(controller: ClusterController): Promise {
- return new Promise((resolve, reject) => {
- const waitTime = 5 * 1000; // 5 seconds
- const maxRetries = 30; // 5 x 30 = 150 seconds. After this time, can assume things are "working" as 2 min timeout passed
- let waitOnChange = async (retries: number) => {
- try {
- let mountInfo = await this.getMountStatus(controller, this.props.hdfsPath);
- if (mountInfo && mountInfo.error || mountInfo.state === MountState.Error) {
- reject(new Error(mountInfo.error ? mountInfo.error : loc.mountErrorUnknown));
- } else if (mountInfo.state === MountState.Ready || retries <= 0) {
- resolve(mountInfo);
- } else {
- setTimeout(() => {
- waitOnChange(retries - 1).catch(e => reject(e));
- }, waitTime);
- }
- } catch (err) {
- reject(err);
- }
- };
- waitOnChange(maxRetries);
- });
- }
-
- private async getMountStatus(controller: ClusterController, path: string): Promise {
- let statusResponse = await controller.getMountStatus(path);
- if (statusResponse.mount) {
- return Array.isArray(statusResponse.mount) ? statusResponse.mount[0] : statusResponse.mount;
- }
- return undefined;
- }
-}
-
-export class MountHdfsDialog extends HdfsDialogBase {
- private pathInputBox: azdata.InputBoxComponent;
- private remoteUriInputBox: azdata.InputBoxComponent;
- private credentialsInputBox: azdata.InputBoxComponent;
-
- constructor(model: MountHdfsDialogModel) {
- super(loc.mountFolder, model);
- }
-
- protected getMainSectionComponents(): (azdata.FormComponentGroup | azdata.FormComponent)[] {
- const newMountName = '/mymount';
- let pathVal = this.model.props.hdfsPath;
- pathVal = (!pathVal || pathVal === '/') ? newMountName : (pathVal + newMountName);
- this.pathInputBox = this.uiModelBuilder.inputBox()
- .withProps({
- value: pathVal
- }).component();
- this.remoteUriInputBox = this.uiModelBuilder.inputBox()
- .withProps({
- value: this.model.props.remoteUri
- })
- .component();
- this.credentialsInputBox = this.uiModelBuilder.inputBox()
- .withProps({
- inputType: 'password',
- value: this.model.props.credentials
- })
- .component();
-
- return [
- {
- components: [
- {
- component: this.pathInputBox,
- title: loc.hdfsPath,
- required: true,
- layout: {
- info: loc.hdfsPathInfo
- }
- }, {
- component: this.remoteUriInputBox,
- title: loc.remoteUri,
- required: true,
- layout: {
- info: loc.remoteUriInfo
- }
- }, {
- component: this.credentialsInputBox,
- title: loc.credentials,
- required: false,
- layout: {
- info: loc.credentialsInfo
- }
- }
- ],
- title: loc.mountConfiguration
- }];
- }
-
- protected async validate(): Promise<{ validated: boolean }> {
- try {
- await this.model.onComplete({
- url: this.urlInputBox && this.urlInputBox.value,
- auth: this.authValue,
- username: this.usernameInputBox && this.usernameInputBox.value,
- password: this.passwordInputBox && this.passwordInputBox.value,
- hdfsPath: this.pathInputBox && this.pathInputBox.value,
- remoteUri: this.remoteUriInputBox && this.remoteUriInputBox.value,
- credentials: this.credentialsInputBox && this.credentialsInputBox.value
- });
- return { validated: true };
- } catch (error) {
- await this.reportError(error);
- return { validated: false };
- }
- }
-}
-
-export class RefreshMountDialog extends HdfsDialogBase {
- private pathInputBox: azdata.InputBoxComponent;
-
- constructor(model: RefreshMountModel) {
- super(loc.refreshMount, model);
- }
-
- protected getMainSectionComponents(): (azdata.FormComponentGroup | azdata.FormComponent)[] {
- this.pathInputBox = this.uiModelBuilder.inputBox()
- .withProps({
- value: this.model.props.hdfsPath
- }).component();
- return [
- {
- components: [
- {
- component: this.pathInputBox,
- title: loc.hdfsPath,
- required: true
- }
- ],
- title: loc.mountConfiguration
- }];
- }
-
- protected async validate(): Promise<{ validated: boolean }> {
- try {
- await this.model.onComplete({
- url: this.urlInputBox && this.urlInputBox.value,
- auth: this.authValue,
- username: this.usernameInputBox && this.usernameInputBox.value,
- password: this.passwordInputBox && this.passwordInputBox.value,
- hdfsPath: this.pathInputBox && this.pathInputBox.value
- });
- return { validated: true };
- } catch (error) {
- await this.reportError(error);
- return { validated: false };
- }
- }
-}
-
-export class RefreshMountModel extends HdfsDialogModelBase {
-
- constructor(props: MountHdfsProperties) {
- super(props);
- }
-
- protected async handleCompleted(): Promise {
- this.throwIfMissingUsernamePassword();
-
- // We pre-fetch the endpoints here to verify that the information entered is correct (the user is able to connect)
- let controller = await this.createAndVerifyControllerConnection();
- if (this._canceled) {
- return;
- }
- azdata.tasks.startBackgroundOperation(
- {
- connection: undefined,
- displayName: loc.refreshMountTask(this.props.hdfsPath),
- description: '',
- isCancelable: false,
- operation: op => {
- this.onSubmit(controller, op);
- }
- }
- );
- }
-
- private async onSubmit(controller: ClusterController, op: azdata.BackgroundOperation): Promise {
- try {
- await controller.refreshMount(this.props.hdfsPath);
- op.updateStatus(azdata.TaskStatus.Succeeded, loc.refreshMountTaskSubmitted);
- } catch (error) {
- const errMsg = (error instanceof Error) ? error.message : error;
- vscode.window.showErrorMessage(errMsg);
- op.updateStatus(azdata.TaskStatus.Failed, errMsg);
- }
- }
-}
-
-export class DeleteMountDialog extends HdfsDialogBase {
- private pathInputBox: azdata.InputBoxComponent;
-
- constructor(model: DeleteMountModel) {
- super(loc.deleteMount, model);
- }
-
- protected getMainSectionComponents(): (azdata.FormComponentGroup | azdata.FormComponent)[] {
- this.pathInputBox = this.uiModelBuilder.inputBox()
- .withProps({
- value: this.model.props.hdfsPath
- }).component();
- return [
- {
- components: [
- {
- component: this.pathInputBox,
- title: loc.hdfsPath,
- required: true
- }
- ],
- title: loc.mountConfiguration
- }];
- }
-
- protected async validate(): Promise<{ validated: boolean }> {
- try {
- await this.model.onComplete({
- url: this.urlInputBox && this.urlInputBox.value,
- auth: this.authValue,
- username: this.usernameInputBox && this.usernameInputBox.value,
- password: this.passwordInputBox && this.passwordInputBox.value,
- hdfsPath: this.pathInputBox && this.pathInputBox.value
- });
- return { validated: true };
- } catch (error) {
- await this.reportError(error);
- return { validated: false };
- }
- }
-}
-
-export class DeleteMountModel extends HdfsDialogModelBase {
-
- constructor(props: MountHdfsProperties) {
- super(props);
- }
-
- protected async handleCompleted(): Promise {
- this.throwIfMissingUsernamePassword();
-
- // We pre-fetch the endpoints here to verify that the information entered is correct (the user is able to connect)
- let controller = await this.createAndVerifyControllerConnection();
- if (this._canceled) {
- return;
- }
- azdata.tasks.startBackgroundOperation(
- {
- connection: undefined,
- displayName: loc.deleteMountTask(this.props.hdfsPath),
- description: '',
- isCancelable: false,
- operation: op => {
- this.onSubmit(controller, op);
- }
- }
- );
- }
-
- private async onSubmit(controller: ClusterController, op: azdata.BackgroundOperation): Promise {
- try {
- await controller.deleteMount(this.props.hdfsPath);
- op.updateStatus(azdata.TaskStatus.Succeeded, loc.deleteMountTaskSubmitted);
- } catch (error) {
- const errMsg = (error instanceof Error) ? error.message : error;
- vscode.window.showErrorMessage(errMsg);
- op.updateStatus(azdata.TaskStatus.Failed, errMsg);
- }
- }
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/localizedConstants.ts b/extensions/big-data-cluster/src/bigDataCluster/localizedConstants.ts
deleted file mode 100644
index 902764f285..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/localizedConstants.ts
+++ /dev/null
@@ -1,91 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as nls from 'vscode-nls';
-import { ControllerError } from './controller/clusterControllerApi';
-const localize = nls.loadMessageBundle();
-
-// Labels
-export const statusIcon = localize('bdc.dashboard.status', "Status Icon");
-export const instance = localize('bdc.dashboard.instance', "Instance");
-export const state = localize('bdc.dashboard.state', "State");
-export const view = localize('bdc.dashboard.view', "View");
-export const notAvailable = localize('bdc.dashboard.notAvailable', "N/A");
-export const healthStatusDetails = localize('bdc.dashboard.healthStatusDetails', "Health Status Details");
-export const metricsAndLogs = localize('bdc.dashboard.metricsAndLogs', "Metrics and Logs");
-export const healthStatus = localize('bdc.dashboard.healthStatus', "Health Status");
-export const nodeMetrics = localize('bdc.dashboard.nodeMetrics', "Node Metrics");
-export const sqlMetrics = localize('bdc.dashboard.sqlMetrics', "SQL Metrics");
-export const logs = localize('bdc.dashboard.logs', "Logs");
-export function viewNodeMetrics(uri: string): string { return localize('bdc.dashboard.viewNodeMetrics', "View Node Metrics {0}", uri); }
-export function viewSqlMetrics(uri: string): string { return localize('bdc.dashboard.viewSqlMetrics', "View SQL Metrics {0}", uri); }
-export function viewLogs(uri: string): string { return localize('bdc.dashboard.viewLogs', "View Kibana Logs {0}", uri); }
-export function lastUpdated(date?: Date): string {
- return localize('bdc.dashboard.lastUpdated', "Last Updated : {0}",
- date ?
- `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`
- : '-');
-}
-export const basic = localize('basicAuthName', "Basic");
-export const windowsAuth = localize('integratedAuthName', "Windows Authentication");
-export const addNewController = localize('addNewController', "Add New Controller");
-export const url = localize('url', "URL");
-export const username = localize('username', "Username");
-export const password = localize('password', "Password");
-export const rememberPassword = localize('rememberPassword', "Remember Password");
-export const clusterUrl = localize('clusterManagementUrl', "Cluster Management URL");
-export const authType = localize('textAuthCapital', "Authentication type");
-export const clusterConnection = localize('hdsf.dialog.connection.section', "Cluster Connection");
-export const add = localize('add', "Add");
-export const cancel = localize('cancel', "Cancel");
-export const ok = localize('ok', "OK");
-export const refresh = localize('bdc.dashboard.refresh', "Refresh");
-export const troubleshoot = localize('bdc.dashboard.troubleshoot', "Troubleshoot");
-export const bdcOverview = localize('bdc.dashboard.bdcOverview', "Big Data Cluster overview");
-export const clusterDetails = localize('bdc.dashboard.clusterDetails', "Cluster Details");
-export const clusterOverview = localize('bdc.dashboard.clusterOverview', "Cluster Overview");
-export const serviceEndpoints = localize('bdc.dashboard.serviceEndpoints', "Service Endpoints");
-export const clusterProperties = localize('bdc.dashboard.clusterProperties', "Cluster Properties");
-export const clusterState = localize('bdc.dashboard.clusterState', "Cluster State");
-export const serviceName = localize('bdc.dashboard.serviceName', "Service Name");
-export const service = localize('bdc.dashboard.service', "Service");
-export const endpoint = localize('bdc.dashboard.endpoint', "Endpoint");
-export function copiedEndpoint(endpointName: string): string { return localize('copiedEndpoint', "Endpoint '{0}' copied to clipboard", endpointName); }
-export const copy = localize('bdc.dashboard.copy', "Copy");
-export const viewDetails = localize('bdc.dashboard.viewDetails', "View Details");
-export const viewErrorDetails = localize('bdc.dashboard.viewErrorDetails', "View Error Details");
-export const connectToController = localize('connectController.dialog.title', "Connect to Controller");
-export const mountConfiguration = localize('mount.main.section', "Mount Configuration");
-export function mountTask(path: string): string { return localize('mount.task.name', "Mounting HDFS folder on path {0}", path); }
-export function refreshMountTask(path: string): string { return localize('refreshmount.task.name', "Refreshing HDFS Mount on path {0}", path); }
-export function deleteMountTask(path: string): string { return localize('deletemount.task.name', "Deleting HDFS Mount on path {0}", path); }
-export const mountTaskSubmitted = localize('mount.task.submitted', "Mount creation has started");
-export const refreshMountTaskSubmitted = localize('refreshmount.task.submitted', "Refresh mount request submitted");
-export const deleteMountTaskSubmitted = localize('deletemount.task.submitted', "Delete mount request submitted");
-export const mountCompleted = localize('mount.task.complete', "Mounting HDFS folder is complete");
-export const mountInProgress = localize('mount.task.inprogress', "Mounting is likely to complete, check back later to verify");
-export const mountFolder = localize('mount.dialog.title', "Mount HDFS Folder");
-export const hdfsPath = localize('mount.hdfsPath.title', "HDFS Path");
-export const hdfsPathInfo = localize('mount.hdfsPath.info', "Path to a new (non-existing) directory which you want to associate with the mount");
-export const remoteUri = localize('mount.remoteUri.title', "Remote URI");
-export const remoteUriInfo = localize('mount.remoteUri.info', "The URI to the remote data source. Example for ADLS: abfs://fs@saccount.dfs.core.windows.net/");
-export const credentials = localize('mount.credentials.title', "Credentials");
-export const credentialsInfo = localize('mount.credentials.info', "Mount credentials for authentication to remote data source for reads");
-export const refreshMount = localize('refreshmount.dialog.title', "Refresh Mount");
-export const deleteMount = localize('deleteMount.dialog.title', "Delete Mount");
-export const loadingClusterStateCompleted = localize('bdc.dashboard.loadingClusterStateCompleted', "Loading cluster state completed");
-export const loadingHealthStatusCompleted = localize('bdc.dashboard.loadingHealthStatusCompleted', "Loading health status completed");
-
-// Errors
-export const usernameRequired = localize('err.controller.username.required', "Username is required");
-export const passwordRequired = localize('err.controller.password.required', "Password is required");
-export function endpointsError(msg: string): string { return localize('endpointsError', "Unexpected error retrieving BDC Endpoints: {0}", msg); }
-export const noConnectionError = localize('bdc.dashboard.noConnection', "The dashboard requires a connection. Please click retry to enter your credentials.");
-export function unexpectedError(error: Error): string { return localize('bdc.dashboard.unexpectedError', "Unexpected error occurred: {0}", error.message); }
-export const loginFailed = localize('mount.hdfs.loginerror1', "Login to controller failed");
-export function loginFailedWithError(error: ControllerError): string { return localize('mount.hdfs.loginerror2', "Login to controller failed: {0}", error.statusMessage || error.message); }
-export function badCredentialsFormatting(pair: string): string { return localize('mount.err.formatting', "Bad formatting of credentials at {0}", pair); }
-export function mountError(error: any): string { return localize('mount.task.error', "Error mounting folder: {0}", (error instanceof Error ? error.message : error)); }
-export const mountErrorUnknown = localize('mount.error.unknown', "Unknown error occurred during the mount process");
diff --git a/extensions/big-data-cluster/src/bigDataCluster/tree/controllerTreeChangeHandler.ts b/extensions/big-data-cluster/src/bigDataCluster/tree/controllerTreeChangeHandler.ts
deleted file mode 100644
index a220148d94..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/tree/controllerTreeChangeHandler.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import { TreeNode } from './treeNode';
-
-export interface IControllerTreeChangeHandler {
- notifyNodeChanged(node?: TreeNode): void;
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/tree/controllerTreeDataProvider.ts b/extensions/big-data-cluster/src/bigDataCluster/tree/controllerTreeDataProvider.ts
deleted file mode 100644
index b6111d0b6d..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/tree/controllerTreeDataProvider.ts
+++ /dev/null
@@ -1,209 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as vscode from 'vscode';
-import * as azdata from 'azdata';
-import * as nls from 'vscode-nls';
-import { TreeNode } from './treeNode';
-import { IControllerTreeChangeHandler } from './controllerTreeChangeHandler';
-import { ControllerRootNode, ControllerNode } from './controllerTreeNode';
-import { showErrorMessage } from '../utils';
-import { AuthType } from 'bdc';
-
-const localize = nls.loadMessageBundle();
-
-const CredentialNamespace = 'clusterControllerCredentials';
-
-interface IControllerInfoSlim {
- url: string;
- auth: AuthType;
- username: string;
- password?: string;
- rememberPassword: boolean;
-}
-
-export class ControllerTreeDataProvider implements vscode.TreeDataProvider, IControllerTreeChangeHandler {
-
- private _onDidChangeTreeData: vscode.EventEmitter = new vscode.EventEmitter();
- public readonly onDidChangeTreeData: vscode.Event = this._onDidChangeTreeData.event;
- private root: ControllerRootNode;
- private credentialProvider: azdata.CredentialProvider;
- private initialized: boolean = false;
-
- constructor(private memento: vscode.Memento) {
- this.root = new ControllerRootNode(this);
- }
-
- public async getChildren(element?: TreeNode): Promise {
- if (element) {
- return element.getChildren();
- }
-
- if (!this.initialized) {
- try {
- await this.loadSavedControllers();
- } catch (err) {
- void vscode.window.showErrorMessage(localize('bdc.controllerTreeDataProvider.error', "Unexpected error loading saved controllers: {0}", err));
- }
- }
-
- return this.root.getChildren();
- }
-
- public getTreeItem(element: TreeNode): vscode.TreeItem | Thenable {
- return element.getTreeItem();
- }
-
- public notifyNodeChanged(node?: TreeNode): void {
- this._onDidChangeTreeData.fire(node);
- }
-
- /**
- * Creates or updates a node in the tree with the specified connection information
- * @param url The URL for the BDC management endpoint
- * @param auth The type of auth to use
- * @param username The username (if basic auth)
- * @param password The password (if basic auth)
- * @param rememberPassword Whether to store the password in the password store when saving
- */
- public addOrUpdateController(
- url: string,
- auth: AuthType,
- username: string,
- password: string,
- rememberPassword: boolean
- ): void {
- this.removeNonControllerNodes();
- this.root.addOrUpdateControllerNode(url, auth, username, password, rememberPassword);
- this.notifyNodeChanged();
- }
-
- public removeController(url: string, auth: AuthType, username: string): ControllerNode[] {
- let removed = this.root.removeControllerNode(url, auth, username);
- if (removed) {
- this.notifyNodeChanged();
- }
- return removed;
- }
-
- private removeNonControllerNodes(): void {
- this.removeDefectiveControllerNodes(this.root.children);
- }
-
- private removeDefectiveControllerNodes(nodes: TreeNode[]): void {
- if (nodes.length > 0) {
- for (let i = 0; i < nodes.length; ++i) {
- if (nodes[i] instanceof ControllerNode) {
- let controller = nodes[i] as ControllerNode;
- if (!controller.url || !controller.id) {
- nodes.splice(i--, 1);
- }
- }
- }
- }
- }
-
- private async loadSavedControllers(): Promise {
- // Optimistically set to true so we don't double-load the tree
- this.initialized = true;
- try {
- let controllers: IControllerInfoSlim[] = this.memento.get('controllers');
- let treeNodes: TreeNode[] = [];
- if (controllers) {
- for (const c of controllers) {
- let password = undefined;
- if (c.rememberPassword) {
- password = await this.getPassword(c.url, c.username);
- }
- if (!c.auth) {
- // Added before we had added authentication
- c.auth = 'basic';
- }
- treeNodes.push(new ControllerNode(
- c.url, c.auth, c.username, password, c.rememberPassword,
- undefined, this.root, this, undefined
- ));
- }
- this.removeDefectiveControllerNodes(treeNodes);
- }
-
- this.root.clearChildren();
- treeNodes.forEach(node => this.root.addChild(node));
- await vscode.commands.executeCommand('setContext', 'bdc.loaded', true);
- } catch (err) {
- // Reset so we can try again if the tree refreshes
- this.initialized = false;
- throw err;
- }
- }
-
- public async saveControllers(): Promise {
- const controllers = this.root.children.map((e): IControllerInfoSlim => {
- const controller = e as ControllerNode;
- return {
- url: controller.url,
- auth: controller.auth,
- username: controller.username,
- password: controller.password,
- rememberPassword: controller.rememberPassword
- };
- });
-
- const controllersWithoutPassword = controllers.map((e): IControllerInfoSlim => {
- return {
- url: e.url,
- auth: e.auth,
- username: e.username,
- rememberPassword: e.rememberPassword
- };
- });
-
- try {
- await this.memento.update('controllers', controllersWithoutPassword);
- } catch (error) {
- showErrorMessage(error);
- }
-
- for (const e of controllers) {
- if (e.rememberPassword) {
- await this.savePassword(e.url, e.username, e.password);
- } else {
- await this.deletePassword(e.url, e.username);
- }
- }
- }
-
- private async savePassword(url: string, username: string, password: string): Promise {
- let provider = await this.getCredentialProvider();
- let id = this.createId(url, username);
- let result = await provider.saveCredential(id, password);
- return result;
- }
-
- private async deletePassword(url: string, username: string): Promise {
- let provider = await this.getCredentialProvider();
- let id = this.createId(url, username);
- let result = await provider.deleteCredential(id);
- return result;
- }
-
- private async getPassword(url: string, username: string): Promise {
- let provider = await this.getCredentialProvider();
- let id = this.createId(url, username);
- let credential = await provider.readCredential(id);
- return credential ? credential.password : undefined;
- }
-
- private async getCredentialProvider(): Promise {
- if (!this.credentialProvider) {
- this.credentialProvider = await azdata.credentials.getProvider(CredentialNamespace);
- }
- return this.credentialProvider;
- }
-
- private createId(url: string, username: string): string {
- return `${url}::${username}`;
- }
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/tree/controllerTreeNode.ts b/extensions/big-data-cluster/src/bigDataCluster/tree/controllerTreeNode.ts
deleted file mode 100644
index f34e41aa21..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/tree/controllerTreeNode.ts
+++ /dev/null
@@ -1,247 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as vscode from 'vscode';
-import * as azdata from 'azdata';
-import { IControllerTreeChangeHandler } from './controllerTreeChangeHandler';
-import { TreeNode } from './treeNode';
-import { IconPathHelper, BdcItemType, IconPath } from '../constants';
-import { AuthType } from 'bdc';
-
-abstract class ControllerTreeNode extends TreeNode {
-
- constructor(
- label: string,
- parent: ControllerTreeNode,
- private _treeChangeHandler: IControllerTreeChangeHandler,
- private _description?: string,
- private _nodeType?: string,
- private _iconPath?: IconPath
- ) {
- super(label, parent);
- this._description = this._description || this.label;
- }
-
- public async getChildren(): Promise {
- return this.children as ControllerTreeNode[];
- }
-
- public override refresh(): void {
- super.refresh();
- this.treeChangeHandler.notifyNodeChanged(this);
- }
-
- public getTreeItem(): vscode.TreeItem {
- let item: vscode.TreeItem = {};
- item.id = this.id;
- item.label = this.label;
- item.collapsibleState = vscode.TreeItemCollapsibleState.None;
- item.iconPath = this._iconPath;
- item.contextValue = this._nodeType;
- item.tooltip = this._description;
- item.iconPath = this._iconPath;
- return item;
- }
-
- public getNodeInfo(): azdata.NodeInfo {
- return {
- label: this.label,
- isLeaf: this.isLeaf,
- errorMessage: undefined,
- metadata: undefined,
- nodePath: this.nodePath,
- nodeStatus: undefined,
- nodeType: this._nodeType,
- iconType: this._nodeType,
- nodeSubType: undefined
- };
- }
-
- public get description(): string {
- return this._description;
- }
-
- public set description(description: string) {
- this._description = description;
- }
-
- public get nodeType(): string {
- return this._nodeType;
- }
-
- public set nodeType(nodeType: string) {
- this._nodeType = nodeType;
- }
-
- public set iconPath(iconPath: IconPath) {
- this._iconPath = iconPath;
- }
-
- public get iconPath(): IconPath {
- return this._iconPath;
- }
-
- public set treeChangeHandler(treeChangeHandler: IControllerTreeChangeHandler) {
- this._treeChangeHandler = treeChangeHandler;
- }
-
- public get treeChangeHandler(): IControllerTreeChangeHandler {
- return this._treeChangeHandler;
- }
-}
-
-export class ControllerRootNode extends ControllerTreeNode {
-
- constructor(treeChangeHandler: IControllerTreeChangeHandler) {
- super('root', undefined, treeChangeHandler, undefined, BdcItemType.controllerRoot);
- }
-
- public override async getChildren(): Promise {
- return this.children as ControllerNode[];
- }
-
- /**
- * Creates or updates a node in the tree with the specified connection information
- * @param url The URL for the BDC management endpoint
- * @param auth The type of auth to use
- * @param username The username (if basic auth)
- * @param password The password (if basic auth)
- * @param rememberPassword Whether to store the password in the password store when saving
- */
- public addOrUpdateControllerNode(
- url: string,
- auth: AuthType,
- username: string,
- password: string,
- rememberPassword: boolean
- ): void {
- let controllerNode = this.getExistingControllerNode(url, auth, username);
- if (controllerNode) {
- controllerNode.password = password;
- controllerNode.rememberPassword = rememberPassword;
- controllerNode.clearChildren();
- } else {
- controllerNode = new ControllerNode(url, auth, username, password, rememberPassword, undefined, this, this.treeChangeHandler, undefined);
- this.addChild(controllerNode);
- }
- }
-
- public removeControllerNode(url: string, auth: AuthType, username: string): ControllerNode[] | undefined {
- if (!url || (auth === 'basic' && !username)) {
- return undefined;
- }
- let nodes = this.children as ControllerNode[];
- let index = nodes.findIndex(e => isControllerMatch(e, url, auth, username));
- let deleted: ControllerNode[] | undefined;
- if (index >= 0) {
- deleted = nodes.splice(index, 1);
- }
- return deleted;
- }
-
- private getExistingControllerNode(url: string, auth: AuthType, username: string): ControllerNode | undefined {
- if (!url || !username) {
- return undefined;
- }
- let nodes = this.children as ControllerNode[];
- return nodes.find(e => isControllerMatch(e, url, auth, username));
- }
-}
-
-export class ControllerNode extends ControllerTreeNode {
-
- constructor(
- private _url: string,
- private _auth: AuthType,
- private _username: string,
- private _password: string,
- private _rememberPassword: boolean,
- label: string,
- parent: ControllerTreeNode,
- treeChangeHandler: IControllerTreeChangeHandler,
- description?: string,
- ) {
- super(label, parent, treeChangeHandler, description, BdcItemType.controller, IconPathHelper.controllerNode);
- this.label = label;
- this.description = description;
- }
-
- public override async getChildren(): Promise {
- if (this.children && this.children.length > 0) {
- this.clearChildren();
- }
-
- if (!this._password) {
- vscode.commands.executeCommand('bigDataClusters.command.connectController', this);
- return this.children as ControllerTreeNode[];
- }
- return undefined;
- }
-
- public static toIpAndPort(url: string): string | undefined {
- if (!url) {
- return undefined;
- }
- return url.trim().replace(/ /g, '').replace(/^.+\:\/\//, '');
- }
-
- public get url(): string {
- return this._url;
- }
-
-
- public get auth(): AuthType {
- return this._auth;
- }
-
-
- public get username(): string {
- return this._username;
- }
-
- public get password(): string {
- return this._password;
- }
-
- public set password(pw: string) {
- this._password = pw;
- }
-
- public override set label(label: string) {
- super.label = label || this.generateLabel();
- }
-
- public get rememberPassword() {
- return this._rememberPassword;
- }
-
- public set rememberPassword(rememberPassword: boolean) {
- this._rememberPassword = rememberPassword;
- }
-
- private generateLabel(): string {
- let label = `controller: ${ControllerNode.toIpAndPort(this._url)}`;
- if (this._auth === 'basic') {
- label += ` (${this._username})`;
- }
- return label;
- }
-
- public override get label(): string {
- return super.label;
- }
-
- public override set description(description: string) {
- super.description = description || super.label;
- }
-
- public override get description(): string {
- return super.description;
- }
-}
-
-function isControllerMatch(node: ControllerNode, url: string, auth: string, username: string): unknown {
- return node.url === url && node.auth === auth && node.username === username;
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/tree/treeNode.ts b/extensions/big-data-cluster/src/bigDataCluster/tree/treeNode.ts
deleted file mode 100644
index 5fdccdc65e..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/tree/treeNode.ts
+++ /dev/null
@@ -1,193 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as azdata from 'azdata';
-import * as vscode from 'vscode';
-import { generateGuid } from '../utils';
-
-export abstract class TreeNode {
-
- private _id: string;
- private _children: TreeNode[];
- private _isLeaf: boolean;
-
- constructor(private _label: string, private _parent?: TreeNode) {
- this.resetId();
- }
-
- public resetId(): void {
- this._id = (this._label || '_') + `::${generateGuid()}`;
- }
-
- public get id(): string {
- return this._id;
- }
-
- public set label(label: string) {
- if (!this._label) {
- this._label = label;
- this.resetId();
- } else {
- this._label = label;
- }
- }
-
- public get label(): string {
- return this._label;
- }
-
- public set parent(parent: TreeNode) {
- this._parent = parent;
- }
-
- public get parent(): TreeNode {
- return this._parent;
- }
-
- public get children(): TreeNode[] {
- if (!this._children) {
- this._children = [];
- }
- return this._children;
- }
-
- public get hasChildren(): boolean {
- return this.children && this.children.length > 0;
- }
-
- public set isLeaf(isLeaf: boolean) {
- this._isLeaf = isLeaf;
- }
-
- public get isLeaf(): boolean {
- return this._isLeaf;
- }
-
- public get root(): TreeNode {
- return TreeNode.getRoot(this);
- }
-
- public equals(node: TreeNode): boolean {
- if (!node) {
- return undefined;
- }
- return this.nodePath === node.nodePath;
- }
-
- public refresh(): void {
- this.resetId();
- }
-
- public static getRoot(node: TreeNode): TreeNode {
- if (!node) {
- return undefined;
- }
- let current: TreeNode = node;
- while (current.parent) {
- current = current.parent;
- }
- return current;
- }
-
- public get nodePath(): string {
- return TreeNode.getNodePath(this);
- }
-
- public static getNodePath(node: TreeNode): string {
- if (!node) {
- return undefined;
- }
-
- let current: TreeNode = node;
- let path = current._id;
- while (current.parent) {
- current = current.parent;
- path = `${current._id}/${path}`;
- }
- return path;
- }
-
- public async findNode(condition: (node: TreeNode) => boolean, expandIfNeeded?: boolean): Promise {
- return TreeNode.findNode(this, condition, expandIfNeeded);
- }
-
- public static async findNode(node: TreeNode, condition: (node: TreeNode) => boolean, expandIfNeeded?: boolean): Promise {
- if (!node || !condition) {
- return undefined;
- }
- let result: TreeNode = undefined;
- let nodesToCheck: TreeNode[] = [node];
- while (nodesToCheck.length > 0) {
- let current = nodesToCheck.shift();
- if (condition(current)) {
- result = current;
- break;
- }
- if (current.hasChildren) {
- nodesToCheck = nodesToCheck.concat(current.children);
- } else if (expandIfNeeded) {
- let children = await current.getChildren();
- if (children && children.length > 0) {
- nodesToCheck = nodesToCheck.concat(children);
- }
- }
- }
- return result;
- }
-
- public async filterNode(condition: (node: TreeNode) => boolean, expandIfNeeded?: boolean): Promise {
- return TreeNode.filterNode(this, condition, expandIfNeeded);
- }
-
- public static async filterNode(node: TreeNode, condition: (node: TreeNode) => boolean, expandIfNeeded?: boolean): Promise {
- if (!node || !condition) {
- return undefined;
- }
- let result: TreeNode[] = [];
- let nodesToCheck: TreeNode[] = [node];
- while (nodesToCheck.length > 0) {
- let current = nodesToCheck.shift();
- if (condition(current)) {
- result.push(current);
- }
- if (current.hasChildren) {
- nodesToCheck = nodesToCheck.concat(current.children);
- } else if (expandIfNeeded) {
- let children = await current.getChildren();
- if (children && children.length > 0) {
- nodesToCheck = nodesToCheck.concat(children);
- }
- }
- }
- return result;
- }
-
- public async findNodeByPath(path: string, expandIfNeeded?: boolean): Promise {
- return TreeNode.findNodeByPath(this, path, expandIfNeeded);
- }
-
- public static async findNodeByPath(node: TreeNode, path: string, expandIfNeeded?: boolean): Promise {
- return TreeNode.findNode(node, node => {
- return node.nodePath && (node.nodePath === path || node.nodePath.startsWith(path));
- }, expandIfNeeded);
- }
-
- public addChild(node: TreeNode): void {
- if (!this._children) {
- this._children = [];
- }
- this._children.push(node);
- }
-
- public clearChildren(): void {
- if (this._children) {
- this._children = [];
- }
- }
-
- public abstract getChildren(): Promise;
- public abstract getTreeItem(): vscode.TreeItem;
- public abstract getNodeInfo(): azdata.NodeInfo;
-}
diff --git a/extensions/big-data-cluster/src/bigDataCluster/utils.ts b/extensions/big-data-cluster/src/bigDataCluster/utils.ts
deleted file mode 100644
index 20ff0e81ee..0000000000
--- a/extensions/big-data-cluster/src/bigDataCluster/utils.ts
+++ /dev/null
@@ -1,289 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as vscode from 'vscode';
-import * as azdata from 'azdata';
-import * as nls from 'vscode-nls';
-import * as constants from './constants';
-const localize = nls.loadMessageBundle();
-
-export enum Endpoint {
- gateway = 'gateway',
- sparkHistory = 'spark-history',
- yarnUi = 'yarn-ui',
- appProxy = 'app-proxy',
- mgmtproxy = 'mgmtproxy',
- managementProxy = 'management-proxy',
- logsui = 'logsui',
- metricsui = 'metricsui',
- controller = 'controller',
- sqlServerMaster = 'sql-server-master',
- webhdfs = 'webhdfs',
- livy = 'livy'
-}
-
-export enum Service {
- sql = 'sql',
- hdfs = 'hdfs',
- spark = 'spark',
- control = 'control',
- gateway = 'gateway',
- app = 'app'
-}
-
-export function generateGuid(): string {
- let hexValues: string[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];
- let oct: string = '';
- let tmp: number;
- for (let a: number = 0; a < 4; a++) {
- tmp = (4294967296 * Math.random()) | 0;
- oct += hexValues[tmp & 0xF] +
- hexValues[tmp >> 4 & 0xF] +
- hexValues[tmp >> 8 & 0xF] +
- hexValues[tmp >> 12 & 0xF] +
- hexValues[tmp >> 16 & 0xF] +
- hexValues[tmp >> 20 & 0xF] +
- hexValues[tmp >> 24 & 0xF] +
- hexValues[tmp >> 28 & 0xF];
- }
- let clockSequenceHi: string = hexValues[8 + (Math.random() * 4) | 0];
- return oct.substr(0, 8) + '-' + oct.substr(9, 4) + '-4' + oct.substr(13, 3) + '-' + clockSequenceHi + oct.substr(16, 3) + '-' + oct.substr(19, 12);
-}
-
-export function showErrorMessage(error: any, prefixText?: string): void {
- if (error) {
- let text: string = prefixText || '';
- if (typeof error === 'string') {
- text += error as string;
- } else if (typeof error === 'object' && error !== null) {
- text += error.message;
- if (error.code && error.code > 0) {
- text += ` (${error.code})`;
- }
- } else {
- text += `${error}`;
- }
- vscode.window.showErrorMessage(text);
- }
-}
-
-/**
- * Mappings of the different expected state values to their localized friendly names.
- * These are defined in aris/projects/controller/src/Microsoft.SqlServer.Controller/StateMachines
- */
-const stateToDisplayTextMap: { [key: string]: string } = {
- // K8sScaledSetStateMachine
- 'creating': localize('state.creating', "Creating"),
- 'waiting': localize('state.waiting', "Waiting"),
- 'ready': localize('state.ready', "Ready"),
- 'deleting': localize('state.deleting', "Deleting"),
- 'deleted': localize('state.deleted', "Deleted"),
- 'applyingupgrade': localize('state.applyingUpgrade', "Applying Upgrade"),
- 'upgrading': localize('state.upgrading', "Upgrading"),
- 'applyingmanagedupgrade': localize('state.applyingmanagedupgrade', "Applying Managed Upgrade"),
- 'managedupgrading': localize('state.managedUpgrading', "Managed Upgrading"),
- 'rollback': localize('state.rollback', "Rollback"),
- 'rollbackinprogress': localize('state.rollbackInProgress', "Rollback In Progress"),
- 'rollbackcomplete': localize('state.rollbackComplete', "Rollback Complete"),
- 'error': localize('state.error', "Error"),
-
- // BigDataClusterStateMachine
- 'creatingsecrets': localize('state.creatingSecrets', "Creating Secrets"),
- 'waitingforsecrets': localize('state.waitingForSecrets', "Waiting For Secrets"),
- 'creatinggroups': localize('state.creatingGroups', "Creating Groups"),
- 'waitingforgroups': localize('state.waitingForGroups', "Waiting For Groups"),
- 'creatingresources': localize('state.creatingResources', "Creating Resources"),
- 'waitingforresources': localize('state.waitingForResources', "Waiting For Resources"),
- 'creatingkerberosdelegationsetup': localize('state.creatingKerberosDelegationSetup', "Creating Kerberos Delegation Setup"),
- 'waitingforkerberosdelegationsetup': localize('state.waitingForKerberosDelegationSetup', "Waiting For Kerberos Delegation Setup"),
- 'waitingfordeletion': localize('state.waitingForDeletion', "Waiting For Deletion"),
- 'waitingforupgrade': localize('state.waitingForUpgrade', "Waiting For Upgrade"),
- 'upgradePaused': localize('state.upgradePaused', "Upgrade Paused"),
-
- // Other
- 'running': localize('state.running', "Running"),
-};
-
-/**
- * Gets the localized text to display for a corresponding state
- * @param state The state to get the display text for
- */
-export function getStateDisplayText(state?: string): string {
- state = state || '';
- return stateToDisplayTextMap[state.toLowerCase()] || state;
-}
-
-/**
- * Gets the localized text to display for a corresponding endpoint
- * @param endpointName The endpoint name to get the display text for
- * @param description The backup description to use if we don't have our own
- */
-export function getEndpointDisplayText(endpointName?: string, description?: string): string {
- endpointName = endpointName || '';
- switch (endpointName.toLowerCase()) {
- case Endpoint.appProxy:
- return localize('endpoint.appproxy', "Application Proxy");
- case Endpoint.controller:
- return localize('endpoint.controller', "Cluster Management Service");
- case Endpoint.gateway:
- return localize('endpoint.gateway', "Gateway to access HDFS files, Spark");
- case Endpoint.managementProxy:
- return localize('endpoint.managementproxy', "Management Proxy");
- case Endpoint.mgmtproxy:
- return localize('endpoint.mgmtproxy', "Management Proxy");
- case Endpoint.sqlServerMaster:
- return localize('endpoint.sqlServerEndpoint', "SQL Server Master Instance Front-End");
- case Endpoint.metricsui:
- return localize('endpoint.grafana', "Metrics Dashboard");
- case Endpoint.logsui:
- return localize('endpoint.kibana', "Log Search Dashboard");
- case Endpoint.yarnUi:
- return localize('endpoint.yarnHistory', "Spark Diagnostics and Monitoring Dashboard");
- case Endpoint.sparkHistory:
- return localize('endpoint.sparkHistory', "Spark Jobs Management and Monitoring Dashboard");
- case Endpoint.webhdfs:
- return localize('endpoint.webhdfs', "HDFS File System Proxy");
- case Endpoint.livy:
- return localize('endpoint.livy', "Proxy for running Spark statements, jobs, applications");
- default:
- // Default is to use the description if one was given, otherwise worst case just fall back to using the
- // original endpoint name
- return description && description.length > 0 ? description : endpointName;
- }
-}
-
-/**
- * Gets the localized text to display for a corresponding service
- * @param serviceName The service name to get the display text for
- */
-export function getServiceNameDisplayText(serviceName?: string): string {
- serviceName = serviceName || '';
- switch (serviceName.toLowerCase()) {
- case Service.sql:
- return localize('service.sql', "SQL Server");
- case Service.hdfs:
- return localize('service.hdfs', "HDFS");
- case Service.spark:
- return localize('service.spark', "Spark");
- case Service.control:
- return localize('service.control', "Control");
- case Service.gateway:
- return localize('service.gateway', "Gateway");
- case Service.app:
- return localize('service.app', "App");
- default:
- return serviceName;
- }
-}
-
-/**
- * Gets the localized text to display for a corresponding health status
- * @param healthStatus The health status to get the display text for
- */
-export function getHealthStatusDisplayText(healthStatus?: string) {
- healthStatus = healthStatus || '';
- switch (healthStatus.toLowerCase()) {
- case 'healthy':
- return localize('bdc.healthy', "Healthy");
- case 'unhealthy':
- return localize('bdc.unhealthy', "Unhealthy");
- default:
- return healthStatus;
- }
-}
-
-/**
- * Returns the status icon for the corresponding health status
- * @param healthStatus The status to check
- */
-export function getHealthStatusIcon(healthStatus?: string): string {
- healthStatus = healthStatus || '';
- switch (healthStatus.toLowerCase()) {
- case 'healthy':
- return '✔️';
- default:
- // Consider all non-healthy status' as errors
- return '⚠️';
- }
-}
-
-/**
- * Returns the status dot icon which will be a • for all non-healthy states
- * @param healthStatus The status to check
- */
-export function getHealthStatusDotIcon(healthStatus?: string): constants.IconPath {
- healthStatus = healthStatus || '';
- switch (healthStatus.toLowerCase()) {
- case 'healthy':
- return constants.IconPathHelper.status_circle_blank;
- default:
- // Display status dot for all non-healthy status'
- return constants.IconPathHelper.status_circle_red;
- }
-}
-
-
-interface RawEndpoint {
- serviceName: string;
- description?: string;
- endpoint?: string;
- protocol?: string;
- ipAddress?: string;
- port?: number;
-}
-
-interface IEndpoint {
- serviceName: string;
- description: string;
- endpoint: string;
- protocol: string;
-}
-
-function getClusterEndpoints(serverInfo: azdata.ServerInfo): IEndpoint[] {
- let endpoints: RawEndpoint[] = serverInfo.options[constants.clusterEndpointsProperty];
- if (!endpoints || endpoints.length === 0) { return []; }
-
- return endpoints.map(e => {
- // If endpoint is missing, we're on CTP bits. All endpoints from the CTP serverInfo should be treated as HTTPS
- let endpoint = e.endpoint ? e.endpoint : `https://${e.ipAddress}:${e.port}`;
- let updatedEndpoint: IEndpoint = {
- serviceName: e.serviceName,
- description: e.description,
- endpoint: endpoint,
- protocol: e.protocol
- };
- return updatedEndpoint;
- });
-}
-
-export function getControllerEndpoint(serverInfo: azdata.ServerInfo): string | undefined {
- let endpoints = getClusterEndpoints(serverInfo);
- if (endpoints) {
- let index = endpoints.findIndex(ep => ep.serviceName.toLowerCase() === constants.controllerEndpointName.toLowerCase());
- if (index < 0) { return undefined; }
- return endpoints[index].endpoint;
- }
- return undefined;
-}
-
-export function getBdcStatusErrorMessage(error: Error): string {
- return localize('endpointsError', "Unexpected error retrieving BDC Endpoints: {0}", error.message);
-}
-
-const bdcConfigSectionName = 'bigDataCluster';
-const ignoreSslConfigName = 'ignoreSslVerification';
-
-/**
- * Retrieves the current setting for whether to ignore SSL verification errors
- */
-export function getIgnoreSslVerificationConfigSetting(): boolean {
- try {
- const config = vscode.workspace.getConfiguration(bdcConfigSectionName);
- return config.get(ignoreSslConfigName, true);
- } catch (error) {
- console.error(`Unexpected error retrieving ${bdcConfigSectionName}.${ignoreSslConfigName} setting : ${error}`);
- }
- return true;
-}
diff --git a/extensions/big-data-cluster/src/commands.ts b/extensions/big-data-cluster/src/commands.ts
deleted file mode 100644
index af540ea899..0000000000
--- a/extensions/big-data-cluster/src/commands.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-export const ManageControllerCommand = 'bigDataClusters.command.manageController';
-export const CreateControllerCommand = 'bigDataClusters.command.createController';
-export const ConnectControllerCommand = 'bigDataClusters.command.connectController';
-export const RemoveControllerCommand = 'bigDataClusters.command.removeController';
-export const RefreshControllerCommand = 'bigDataClusters.command.refreshController';
-export const MountHdfsCommand = 'bigDataClusters.command.mount';
-export const RefreshMountCommand = 'bigDataClusters.command.refreshmount';
-export const DeleteMountCommand = 'bigDataClusters.command.deletemount';
diff --git a/extensions/big-data-cluster/src/common/promise.ts b/extensions/big-data-cluster/src/common/promise.ts
deleted file mode 100644
index 68f39d4dcd..0000000000
--- a/extensions/big-data-cluster/src/common/promise.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the Source EULA. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-/**
- * Deferred promise
- */
-export class Deferred {
- promise: Promise;
- resolve: (value?: T | PromiseLike) => void;
- reject: (reason?: any) => void;
- constructor() {
- this.promise = new Promise((resolve, reject) => {
- this.resolve = resolve;
- this.reject = reject;
- });
- }
-
- then