mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 09:35:41 -05:00
Changing Postgres Hyperscale to Postgres Azure Arc in ADS (#20445)
* Hard code enginer ver to 14 and remove extension from wizard field and notebook * Removed hyperscale text from everywhere but links * Made PostgreSQL into PostgreSQL server and other text changes. Removed worker nodes * Removed coordinator node text * Removed worker nodes from compute + storage. Changed az arc-server to server-arc. postgresParameters.ts may need * Removed tabs for extensions, coord nodes, worker nodes, resource health, diagnose and solve * Removed node configuation and pg version from overview and properties. Edited arialabels * Change server group nodes to server * Removed type from overview table and aded Preview tags * Removed info bubble and added padding to top of title * Removed checkbox from PG create wizard. Added link and text * Remove engine version * Changed naming conventions * Removed coord and server group from variables * Removed properties * Removed Server table, admin username, reset password * Removed function from notebook * Change wording * bump version Co-authored-by: Candice Ye <canye@microsoft.com>
This commit is contained in:
@@ -10,7 +10,7 @@ This extension adds the following features to Azure Data Studio.
|
||||
|
||||
A gui-based experience to deploy an Azure Arc data controller as well as resources on an existing Azure Arc data controller. Current list of supported resources:
|
||||
* SQL Managed Instance
|
||||
* PostgreSQL server groups
|
||||
* PostgreSQL server
|
||||
|
||||
### Management Dashboards
|
||||
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
url: /postgres/readme
|
||||
not_numbered: true
|
||||
sections:
|
||||
- title: TSG100 - The Azure Arc-enabled PostgreSQL Hyperscale troubleshooter
|
||||
- title: TSG100 - The Azure Arc-enabled PostgreSQL server troubleshooter
|
||||
url: postgres/tsg100-troubleshoot-postgres
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
|
||||
## Notebooks in this Chapter
|
||||
|
||||
- [TSG100 - The Azure Arc-enabled PostgreSQL Hyperscale troubleshooter](../postgres/tsg100-troubleshoot-postgres.ipynb)
|
||||
- [TSG100 - The Azure Arc-enabled PostgreSQL server troubleshooter](../postgres/tsg100-troubleshoot-postgres.ipynb)
|
||||
|
||||
@@ -2,20 +2,17 @@
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"TSG100 - The Azure Arc-enabled PostgreSQL Hyperscale troubleshooter\n",
|
||||
"TSG100 - The Azure Arc-enabled PostgreSQL server troubleshooter\n",
|
||||
"===================================================================\n",
|
||||
"\n",
|
||||
"Description\n",
|
||||
"-----------\n",
|
||||
"\n",
|
||||
"Follow these steps to troubleshoot an Azure Arc-enabled PostgreSQL\n",
|
||||
"Hyperscale Server.\n",
|
||||
"Follow these steps to troubleshoot an Azure Arc-enabled PostgreSQL Server.\n",
|
||||
"\n",
|
||||
"Steps\n",
|
||||
"-----\n",
|
||||
@@ -29,7 +26,10 @@
|
||||
"metadata": {
|
||||
"tags": [
|
||||
"parameters"
|
||||
]
|
||||
],
|
||||
"vscode": {
|
||||
"languageId": "python"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -45,11 +45,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"### Common functions\n",
|
||||
"\n",
|
||||
@@ -62,7 +60,10 @@
|
||||
"metadata": {
|
||||
"tags": [
|
||||
"hide_input"
|
||||
]
|
||||
],
|
||||
"vscode": {
|
||||
"languageId": "python"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -279,7 +280,7 @@
|
||||
" if user_provided_exe_name in retry_hints:\n",
|
||||
" for retry_hint in retry_hints[user_provided_exe_name]:\n",
|
||||
" if line_decoded.find(retry_hint) != -1:\n",
|
||||
" if retry_count \u003c MAX_RETRIES:\n",
|
||||
" if retry_count < MAX_RETRIES:\n",
|
||||
" print(f\"RETRY: {retry_count} (due to: {retry_hint})\")\n",
|
||||
" retry_count = retry_count + 1\n",
|
||||
" output = run(cmd, return_output=return_output, retry_count=retry_count)\n",
|
||||
@@ -326,11 +327,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"### Get Postgres server"
|
||||
]
|
||||
@@ -341,7 +340,10 @@
|
||||
"metadata": {
|
||||
"tags": [
|
||||
"hide_input"
|
||||
]
|
||||
],
|
||||
"vscode": {
|
||||
"languageId": "python"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -364,7 +366,7 @@
|
||||
"\n",
|
||||
" pad = math.floor(math.log10(len(servers)) + 1) + 3\n",
|
||||
" for i, s in enumerate(servers):\n",
|
||||
" print(f'{f\"[{i+1}]\":\u003c{pad}}{full_name(s)}')\n",
|
||||
" print(f'{f\"[{i+1}]\":<{pad}}{full_name(s)}')\n",
|
||||
"\n",
|
||||
" while True:\n",
|
||||
" try:\n",
|
||||
@@ -372,7 +374,7 @@
|
||||
" except ValueError:\n",
|
||||
" continue\n",
|
||||
"\n",
|
||||
" if i \u003e= 1 and i \u003c= len(servers):\n",
|
||||
" if i >= 1 and i <= len(servers):\n",
|
||||
" server = servers[i-1]\n",
|
||||
" namespace = server['metadata']['namespace']\n",
|
||||
" name = server['metadata']['name']\n",
|
||||
@@ -383,11 +385,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"### Summarize all resources"
|
||||
]
|
||||
@@ -396,7 +396,10 @@
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
"tags": [],
|
||||
"vscode": {
|
||||
"languageId": "python"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -411,11 +414,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"### Troubleshoot the server"
|
||||
]
|
||||
@@ -424,7 +425,10 @@
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
"tags": [],
|
||||
"vscode": {
|
||||
"languageId": "python"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -434,11 +438,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"### Troubleshoot the pods"
|
||||
]
|
||||
@@ -447,7 +449,10 @@
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
"tags": [],
|
||||
"vscode": {
|
||||
"languageId": "python"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -471,11 +476,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"### Troubleshoot the containers"
|
||||
]
|
||||
@@ -484,7 +487,10 @@
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
"tags": [],
|
||||
"vscode": {
|
||||
"languageId": "python"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -493,7 +499,7 @@
|
||||
" pod_name = pod['metadata']['name']\n",
|
||||
" cons = pod['spec']['containers']\n",
|
||||
" con_statuses = pod['status'].get('containerStatuses', [])\n",
|
||||
" display(Markdown(f'#### Troubleshooting {len(cons)} container{\"\" if len(cons) \u003c 2 else \"s\"} '\n",
|
||||
" display(Markdown(f'#### Troubleshooting {len(cons)} container{\"\" if len(cons) < 2 else \"s\"} '\n",
|
||||
" f'containers for pod {namespace}.{pod_name}'))\n",
|
||||
"\n",
|
||||
" for i, con in enumerate(cons):\n",
|
||||
@@ -509,18 +515,16 @@
|
||||
" run(f'kubectl logs -n {namespace} {pod_name} {con_name} --tail {tail_lines}')\n",
|
||||
"\n",
|
||||
" # Get logs from the previous terminated container if one exists\n",
|
||||
" if con_restarts \u003e 0:\n",
|
||||
" if con_restarts > 0:\n",
|
||||
" display(Markdown(f'#### Logs from previous terminated container {namespace}.{pod_name}/{con_name}'))\n",
|
||||
" run(f'kubectl logs -n {namespace} {pod_name} {con_name} --tail {tail_lines} --previous')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"### Troubleshoot the PersistentVolumeClaims"
|
||||
]
|
||||
@@ -529,7 +533,10 @@
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
"tags": [],
|
||||
"vscode": {
|
||||
"languageId": "python"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -541,7 +548,10 @@
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
"tags": [],
|
||||
"vscode": {
|
||||
"languageId": "python"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -549,33 +559,10 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5,
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
},
|
||||
"pansop": {
|
||||
"related": "",
|
||||
"test": {
|
||||
"strategy": "",
|
||||
"types": null,
|
||||
"disable": {
|
||||
"reason": "",
|
||||
"workitems": null,
|
||||
"types": null
|
||||
}
|
||||
},
|
||||
"target": {
|
||||
"current": "public",
|
||||
"final": "public"
|
||||
},
|
||||
"internal": {
|
||||
"parameters": null,
|
||||
"symlink": false
|
||||
},
|
||||
"timeout": "0"
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": "{ Name: \"\", Version: \"\"}",
|
||||
@@ -586,6 +573,29 @@
|
||||
"pygments_lexer": "",
|
||||
"version": ""
|
||||
},
|
||||
"pansop": {
|
||||
"internal": {
|
||||
"parameters": null,
|
||||
"symlink": false
|
||||
},
|
||||
"related": "",
|
||||
"target": {
|
||||
"current": "public",
|
||||
"final": "public"
|
||||
},
|
||||
"test": {
|
||||
"disable": {
|
||||
"reason": "",
|
||||
"types": null,
|
||||
"workitems": null
|
||||
},
|
||||
"strategy": "",
|
||||
"types": null
|
||||
},
|
||||
"timeout": "0"
|
||||
},
|
||||
"widgets": []
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
|
||||
@@ -1,46 +1,28 @@
|
||||
{
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3",
|
||||
"language": "python"
|
||||
},
|
||||
"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",
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "e4ed0892-7b5a-4d95-bd0d-a6c3eb0b2c99"
|
||||
},
|
||||
"source": [
|
||||
"\n",
|
||||
" \n",
|
||||
"## Create a PostgreSQL Hyperscale - Azure Arc on an existing Azure Arc Data Controller\n",
|
||||
"## Create a PostgreSQL server - Azure Arc on an existing Azure Arc Data Controller\n",
|
||||
" \n",
|
||||
"This notebook walks through the process of creating a PostgreSQL Hyperscale - Azure Arc on an existing Azure Arc Data Controller.\n",
|
||||
"This notebook walks through the process of creating a PostgreSQL server - Azure Arc on an existing Azure Arc Data Controller.\n",
|
||||
" \n",
|
||||
"* Follow the instructions in the **Prerequisites** cell to install the tools if not already installed.\n",
|
||||
"* Make sure you have the target Azure Arc Data Controller already created.\n",
|
||||
"\n",
|
||||
"<span style=\"color:red\"><font size=\"3\">Please press the \"Run All\" button to run the notebook</font></span>"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "e4ed0892-7b5a-4d95-bd0d-a6c3eb0b2c99"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "20fe3985-a01e-461c-bce0-235f7606cc3c"
|
||||
},
|
||||
"source": [
|
||||
"### **Prerequisites** \n",
|
||||
"Ensure the following tools are installed and added to PATH before proceeding.\n",
|
||||
@@ -49,23 +31,25 @@
|
||||
"|---|---|---|\n",
|
||||
"|Azure CLI (az) | Command-line tool for installing and managing resources in an Azure Arc cluster |[Installation](https://docs.microsoft.com/cli/azure/install-azure-cli-windows?tabs=azure-cli) |\n",
|
||||
"|Azure CLI arcdata extension | Commands for using Azure Arc for Azure data services. | [Installation](https://docs.microsoft.com/azure/azure-arc/data/install-arcdata-extension)"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "20fe3985-a01e-461c-bce0-235f7606cc3c"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"### **Setup and Check Prerequisites**"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "68531b91-ddce-47d7-a1d8-2ddc3d17f3e7"
|
||||
}
|
||||
},
|
||||
"source": [
|
||||
"### **Setup and Check Prerequisites**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "749d8dba-3da8-46e9-ae48-2b38056ab7a2",
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import sys,os,json,subprocess\n",
|
||||
"def run_command():\n",
|
||||
@@ -80,81 +64,74 @@
|
||||
" return output.stdout.decode(\"utf-8\")\n",
|
||||
"cmd = 'az --version'\n",
|
||||
"out = run_command()\n"
|
||||
],
|
||||
"outputs": [],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "749d8dba-3da8-46e9-ae48-2b38056ab7a2",
|
||||
"tags": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "68ec0760-27d1-4ded-9a9f-89077c40b8bb"
|
||||
},
|
||||
"source": [
|
||||
"### **Set variables**\n",
|
||||
"\n",
|
||||
"#### \n",
|
||||
"\n",
|
||||
"Generated by Azure Data Studio using the values collected in the 'Deploy PostgreSQL Hyperscale - Azure Arc instance' wizard"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "68ec0760-27d1-4ded-9a9f-89077c40b8bb"
|
||||
}
|
||||
"Generated by Azure Data Studio using the values collected in the 'Deploy a PostgreSQL server - Azure Arc instance' wizard"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"### **Creating the PostgreSQL Hyperscale - Azure Arc instance**"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "90b0e162-2987-463f-9ce6-12dda1267189"
|
||||
}
|
||||
},
|
||||
"source": [
|
||||
"### **Creating the PostgreSQL server - Azure Arc instance**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"print (f'Creating the PostgreSQL Hyperscale - Azure Arc instance')\n",
|
||||
"\n",
|
||||
"workers = f' --workers {postgres_server_group_workers}' if postgres_server_group_workers else \"\"\n",
|
||||
"port = f' --port \"{postgres_server_group_port}\"' if postgres_server_group_port else \"\"\n",
|
||||
"engine_version = f' --engine-version {postgres_server_group_engine_version}' if postgres_server_group_engine_version else \"\"\n",
|
||||
"extensions = f' --extensions \"{postgres_server_group_extensions}\"' if postgres_server_group_extensions else \"\"\n",
|
||||
"volume_size_data = f' --volume-size-data {postgres_server_group_volume_size_data}Gi' if postgres_server_group_volume_size_data else \"\"\n",
|
||||
"volume_size_logs = f' --volume-size-logs {postgres_server_group_volume_size_logs}Gi' if postgres_server_group_volume_size_logs else \"\"\n",
|
||||
"volume_size_backups = f' --volume-size-backups {postgres_server_group_volume_size_backups}Gi' if postgres_server_group_volume_size_backups else \"\"\n",
|
||||
"\n",
|
||||
"def get_per_role_argument(argument, roles, unit=''):\n",
|
||||
" value = ','.join(f'{role}={value}{unit}' for role,value in roles.items() if value not in (None, ''))\n",
|
||||
" return f' {argument} {value}' if value else ''\n",
|
||||
"\n",
|
||||
"cores_request = get_per_role_argument('--cores-request', {\n",
|
||||
" 'c': postgres_server_group_coordinator_cores_request,\n",
|
||||
" 'w': postgres_server_group_workers_cores_request\n",
|
||||
"})\n",
|
||||
"\n",
|
||||
"cores_limit = get_per_role_argument('--cores-limit', {\n",
|
||||
" 'c': postgres_server_group_coordinator_cores_limit,\n",
|
||||
" 'w': postgres_server_group_workers_cores_limit\n",
|
||||
"})\n",
|
||||
"\n",
|
||||
"memory_request = get_per_role_argument('--memory-request', {\n",
|
||||
" 'c': postgres_server_group_coordinator_memory_request,\n",
|
||||
" 'w': postgres_server_group_workers_memory_request\n",
|
||||
"}, 'Gi')\n",
|
||||
"\n",
|
||||
"memory_limit = get_per_role_argument('--memory-limit', {\n",
|
||||
" 'c': postgres_server_group_coordinator_memory_limit,\n",
|
||||
" 'w': postgres_server_group_workers_memory_limit\n",
|
||||
"}, 'Gi')\n",
|
||||
"\n",
|
||||
"os.environ[\"AZDATA_PASSWORD\"] = os.environ[\"AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_PASSWORD\"]\n",
|
||||
"cmd = f'az postgres arc-server create --name {postgres_server_group_name} --k8s-namespace {arc_data_controller_namespace} --use-k8s --storage-class-data {postgres_storage_class_data} --storage-class-logs {postgres_storage_class_logs} --storage-class-backups {postgres_storage_class_backups}{workers}{port}{engine_version}{extensions}{volume_size_data}{volume_size_logs}{volume_size_backups}{cores_request}{cores_limit}{memory_request}{memory_limit}'\n",
|
||||
"out=run_command()"
|
||||
],
|
||||
"outputs": [],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "4fbaf071-55a1-40bc-be7e-7b9b5547b886"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"print (f'Creating the PostgreSQL server - Azure Arc instance')\n",
|
||||
"\n",
|
||||
"port = f' --port \"{postgres_server_port}\"' if postgres_server_port else \"\"\n",
|
||||
"volume_size_data = f' --volume-size-data {postgres_server_volume_size_data}Gi' if postgres_server_volume_size_data else \"\"\n",
|
||||
"volume_size_logs = f' --volume-size-logs {postgres_server_volume_size_logs}Gi' if postgres_server_volume_size_logs else \"\"\n",
|
||||
"\n",
|
||||
"cores_request = f' --cores-request {postgres_server_cores_request}' if postgres_server_cores_request else \"\"\n",
|
||||
"cores_limit = f' --cores-limit {postgres_server_cores_limit}' if postgres_server_cores_limit else \"\"\n",
|
||||
"memory_request = f' --memory-request {postgres_server_memory_request}Gi' if postgres_server_memory_request else \"\"\n",
|
||||
"memory_limit = f' --memory-limit {postgres_server_memory_limit}Gi' if postgres_server_memory_limit else \"\"\n",
|
||||
"\n",
|
||||
"os.environ[\"AZDATA_PASSWORD\"] = os.environ[\"AZDATA_NB_VAR_POSTGRES_SERVER_PASSWORD\"]\n",
|
||||
"cmd = f'az postgres server-arc create --name {postgres_server_name} --k8s-namespace {arc_data_controller_namespace} --use-k8s --storage-class-data {postgres_storage_class_data} --storage-class-logs {postgres_storage_class_logs}{port}{volume_size_data}{volume_size_logs}{cores_request}{cores_limit}{memory_request}{memory_limit}'\n",
|
||||
"out=run_command()"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.6"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "arc",
|
||||
"displayName": "%arc.displayName%",
|
||||
"description": "%arc.description%",
|
||||
"version": "1.5.1",
|
||||
"version": "1.5.2",
|
||||
"publisher": "Microsoft",
|
||||
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt",
|
||||
"icon": "images/extension.png",
|
||||
@@ -1253,7 +1253,7 @@
|
||||
"fieldHeight": "10px",
|
||||
"links": [
|
||||
{
|
||||
"text": "%arc.agreement.sql.help.text.learn.more%",
|
||||
"text": "%arc.agreement.help.text.learn.more%",
|
||||
"url": "https://docs.microsoft.com/azure/azure-arc/data/point-in-time-restore"
|
||||
}
|
||||
]
|
||||
@@ -1290,22 +1290,22 @@
|
||||
"template": "%arc.agreement.sql.help.text%",
|
||||
"links": [
|
||||
{
|
||||
"text": "%arc.agreement.sql.help.text.learn.more%",
|
||||
"text": "%arc.agreement.help.text.learn.more%",
|
||||
"accessibilityInformation": {
|
||||
"label": "%arc.agreement.sql.help.text.learn.more.ariaLabel%"
|
||||
},
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2141849"
|
||||
},
|
||||
{
|
||||
"text": "%arc.agreement.sql.help.text.azure.marketplace.terms%",
|
||||
"text": "%arc.agreement.help.text.azure.marketplace.terms%",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2045624"
|
||||
},
|
||||
{
|
||||
"text": "%arc.agreement.sql.help.text.terms.of.use%",
|
||||
"text": "%arc.agreement.help.text.terms.of.use%",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2045708"
|
||||
},
|
||||
{
|
||||
"text": "%arc.agreement.sql.help.text.privacy.policy%",
|
||||
"text": "%arc.agreement.help.text.privacy.policy%",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=512132"
|
||||
}
|
||||
],
|
||||
@@ -1367,22 +1367,22 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "%arc.postgres.server.group.name%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_NAME",
|
||||
"label": "%arc.postgres.server.name%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_NAME",
|
||||
"type": "text",
|
||||
"description": "%arc.postgres.server.group.name.validation.description%",
|
||||
"description": "%arc.postgres.server.name.validation.description%",
|
||||
"validations": [
|
||||
{
|
||||
"type": "regex_match",
|
||||
"regex": "^[a-z]([-a-z0-9]{0,9}[a-z0-9])?$",
|
||||
"description": "%arc.postgres.server.group.name.validation.description%"
|
||||
"description": "%arc.postgres.server.name.validation.description%"
|
||||
}
|
||||
],
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"label": "%arc.password%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_PASSWORD",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_PASSWORD",
|
||||
"type": "password",
|
||||
"confirmationRequired": true,
|
||||
"confirmationLabel": "%arc.confirm.password%",
|
||||
@@ -1390,27 +1390,8 @@
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"label": "%arc.postgres.server.group.workers.label%",
|
||||
"description": "%arc.postgres.server.group.workers.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_WORKERS",
|
||||
"type": "number",
|
||||
"validations": [
|
||||
{
|
||||
"type": "is_integer",
|
||||
"description": "%should.be.integer%"
|
||||
},
|
||||
{
|
||||
"type": "!=",
|
||||
"target": "1",
|
||||
"description": "%worker.node.count.should.not.be.one%"
|
||||
}
|
||||
],
|
||||
"defaultValue": "2",
|
||||
"min": 0
|
||||
},
|
||||
{
|
||||
"label": "%arc.postgres.server.group.port%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_PORT",
|
||||
"label": "%arc.postgres.server.port%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_PORT",
|
||||
"type": "number",
|
||||
"validations": [
|
||||
{
|
||||
@@ -1421,141 +1402,64 @@
|
||||
"defaultValue": "5432",
|
||||
"min": 1,
|
||||
"max": 65535
|
||||
},
|
||||
{
|
||||
"label": "%arc.postgres.server.group.engine.version%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_ENGINE_VERSION",
|
||||
"type": "options",
|
||||
"options": [
|
||||
"11",
|
||||
"12"
|
||||
],
|
||||
"defaultValue": "12"
|
||||
},
|
||||
{
|
||||
"label": "%arc.postgres.server.group.extensions.label%",
|
||||
"description": "%arc.postgres.server.group.extensions.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_EXTENSIONS",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "%arc.postgres.settings.resource.worker.title%",
|
||||
"title": "%arc.postgres.settings.resource.compute.config.title%",
|
||||
"fields": [
|
||||
{
|
||||
"label": "%arc.postgres.server.group.workers.cores.request.label%",
|
||||
"description": "%arc.postgres.server.group.workers.cores.request.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_WORKERS_CORES_REQUEST",
|
||||
"label": "%arc.postgres.server.cores.request.label%",
|
||||
"description": "%arc.postgres.server.cores.request.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_CORES_REQUEST",
|
||||
"type": "number",
|
||||
"min": 1,
|
||||
"validations": [
|
||||
{
|
||||
"type": "<=",
|
||||
"target": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_WORKERS_CORES_LIMIT",
|
||||
"target": "AZDATA_NB_VAR_POSTGRES_SERVER_CORES_LIMIT",
|
||||
"description": "%requested.cores.less.than.or.equal.to.cores.limit%"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "%arc.postgres.server.group.workers.cores.limit.label%",
|
||||
"description": "%arc.postgres.server.group.workers.cores.limit.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_WORKERS_CORES_LIMIT",
|
||||
"label": "%arc.postgres.server.cores.limit.label%",
|
||||
"description": "%arc.postgres.server.cores.limit.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_CORES_LIMIT",
|
||||
"type": "number",
|
||||
"min": 1,
|
||||
"validations": [
|
||||
{
|
||||
"type": ">=",
|
||||
"target": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_WORKERS_CORES_REQUEST",
|
||||
"target": "AZDATA_NB_VAR_POSTGRES_SERVER_CORES_REQUEST",
|
||||
"description": "%cores.limit.greater.than.or.equal.to.requested.cores%"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "%arc.postgres.server.group.workers.memory.request.label%",
|
||||
"description": "%arc.postgres.server.group.workers.memory.request.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_WORKERS_MEMORY_REQUEST",
|
||||
"label": "%arc.postgres.server.memory.request.label%",
|
||||
"description": "%arc.postgres.server.memory.request.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_MEMORY_REQUEST",
|
||||
"type": "number",
|
||||
"min": 0.25,
|
||||
"validations": [
|
||||
{
|
||||
"type": "<=",
|
||||
"target": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_WORKERS_MEMORY_LIMIT",
|
||||
"target": "AZDATA_NB_VAR_POSTGRES_SERVER_MEMORY_LIMIT",
|
||||
"description": "%requested.memory.less.than.or.equal.to.memory.limit%"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "%arc.postgres.server.group.workers.memory.limit.label%",
|
||||
"description": "%arc.postgres.server.group.workers.memory.limit.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_WORKERS_MEMORY_LIMIT",
|
||||
"label": "%arc.postgres.server.memory.limit.label%",
|
||||
"description": "%arc.postgres.server.memory.limit.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_MEMORY_LIMIT",
|
||||
"type": "number",
|
||||
"min": 0.25,
|
||||
"validations": [
|
||||
{
|
||||
"type": ">=",
|
||||
"target": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_WORKERS_MEMORY_REQUEST",
|
||||
"description": "%memory.limit.greater.than.or.equal.to.requested.memory%"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "%arc.postgres.settings.resource.coordinator.title%",
|
||||
"fields": [
|
||||
{
|
||||
"label": "%arc.postgres.server.group.coordinator.cores.request.label%",
|
||||
"description": "%arc.postgres.server.group.coordinator.cores.request.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_COORDINATOR_CORES_REQUEST",
|
||||
"type": "number",
|
||||
"min": 1,
|
||||
"validations": [
|
||||
{
|
||||
"type": "<=",
|
||||
"target": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_COORDINATOR_CORES_LIMIT",
|
||||
"description": "%requested.cores.less.than.or.equal.to.cores.limit%"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "%arc.postgres.server.group.coordinator.cores.limit.label%",
|
||||
"description": "%arc.postgres.server.group.coordinator.cores.limit.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_COORDINATOR_CORES_LIMIT",
|
||||
"type": "number",
|
||||
"min": 1,
|
||||
"validations": [
|
||||
{
|
||||
"type": ">=",
|
||||
"target": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_COORDINATOR_CORES_REQUEST",
|
||||
"description": "%cores.limit.greater.than.or.equal.to.requested.cores%"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "%arc.postgres.server.group.coordinator.memory.request.label%",
|
||||
"description": "%arc.postgres.server.group.coordinator.memory.request.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_COORDINATOR_MEMORY_REQUEST",
|
||||
"type": "number",
|
||||
"min": 0.25,
|
||||
"validations": [
|
||||
{
|
||||
"type": "<=",
|
||||
"target": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_COORDINATOR_MEMORY_LIMIT",
|
||||
"description": "%requested.memory.less.than.or.equal.to.memory.limit%"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "%arc.postgres.server.group.coordinator.memory.limit.label%",
|
||||
"description": "%arc.postgres.server.group.coordinator.memory.limit.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_COORDINATOR_MEMORY_LIMIT",
|
||||
"type": "number",
|
||||
"min": 0.25,
|
||||
"validations": [
|
||||
{
|
||||
"type": ">=",
|
||||
"target": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_COORDINATOR_MEMORY_REQUEST",
|
||||
"target": "AZDATA_NB_VAR_POSTGRES_SERVER_MEMORY_REQUEST",
|
||||
"description": "%memory.limit.greater.than.or.equal.to.requested.memory%"
|
||||
}
|
||||
]
|
||||
@@ -1573,9 +1477,9 @@
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"label": "%arc.postgres.server.group.volume.size.data.label%",
|
||||
"description": "%arc.postgres.server.group.volume.size.data.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_VOLUME_SIZE_DATA",
|
||||
"label": "%arc.postgres.server.volume.size.data.label%",
|
||||
"description": "%arc.postgres.server.volume.size.data.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_VOLUME_SIZE_DATA",
|
||||
"type": "number",
|
||||
"defaultValue": "5",
|
||||
"min": 1
|
||||
@@ -1588,9 +1492,9 @@
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"label": "%arc.postgres.server.group.volume.size.logs.label%",
|
||||
"description": "%arc.postgres.server.group.volume.size.logs.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_VOLUME_SIZE_LOGS",
|
||||
"label": "%arc.postgres.server.volume.size.logs.label%",
|
||||
"description": "%arc.postgres.server.volume.size.logs.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_VOLUME_SIZE_LOGS",
|
||||
"type": "number",
|
||||
"defaultValue": "5",
|
||||
"min": 1
|
||||
@@ -1603,9 +1507,9 @@
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"label": "%arc.postgres.server.group.volume.size.backups.label%",
|
||||
"description": "%arc.postgres.server.group.volume.size.backups.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_GROUP_VOLUME_SIZE_BACKUPS",
|
||||
"label": "%arc.postgres.server.volume.size.backups.label%",
|
||||
"description": "%arc.postgres.server.volume.size.backups.description%",
|
||||
"variableName": "AZDATA_NB_VAR_POSTGRES_SERVER_VOLUME_SIZE_BACKUPS",
|
||||
"type": "number",
|
||||
"defaultValue": "5",
|
||||
"min": 1
|
||||
@@ -1627,20 +1531,31 @@
|
||||
"when": "true"
|
||||
}
|
||||
],
|
||||
"agreements": [
|
||||
"helpTexts": [
|
||||
{
|
||||
"template": "%arc.agreement%",
|
||||
"template": "%arc.agreement.postgres.help.text%",
|
||||
"links": [
|
||||
{
|
||||
"text": "%microsoft.agreement.privacy.statement%",
|
||||
"url": "https://go.microsoft.com/fwlink/?LinkId=853010"
|
||||
"text": "%arc.agreement.help.text.learn.more%",
|
||||
"accessibilityInformation": {
|
||||
"label": "%arc.agreement.postgres.help.text.learn.more.ariaLabel%"
|
||||
},
|
||||
"url": "https://docs.microsoft.com/azure/azure-arc/data/what-is-azure-arc-enabled-postgres-hyperscale"
|
||||
},
|
||||
{
|
||||
"text": "%arc.agreement.postgres.terms.conditions%",
|
||||
"text": "%arc.agreement.help.text.azure.marketplace.terms%",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2045624"
|
||||
},
|
||||
{
|
||||
"text": "%arc.agreement.help.text.terms.of.use%",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2045708"
|
||||
},
|
||||
{
|
||||
"text": "%arc.agreement.help.text.privacy.policy%",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=512132"
|
||||
}
|
||||
],
|
||||
"when": "true"
|
||||
"when": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -91,9 +91,9 @@
|
||||
"deploy.done.action":"Deploy",
|
||||
|
||||
"resource.type.arc.sql.display.name": "Azure SQL managed instance - Azure Arc",
|
||||
"resource.type.arc.postgres.display.name": "PostgreSQL Hyperscale server groups - Azure Arc",
|
||||
"resource.type.arc.postgres.display.name": "PostgreSQL Server - Azure Arc (Preview)",
|
||||
"resource.type.arc.sql.description": "Managed SQL Instance service for app developers in a customer-managed environment",
|
||||
"resource.type.arc.postgres.description": "Deploy PostgreSQL Hyperscale server groups into an Azure Arc environment",
|
||||
"resource.type.arc.postgres.description": "Deploy a PostgreSQL server into an Azure Arc environment",
|
||||
"arc.controller": "Target Azure Arc Controller",
|
||||
|
||||
|
||||
@@ -189,58 +189,49 @@
|
||||
"arc.azure.subscription": "Azure subscription",
|
||||
"arc.azure.resource.group": "Azure resource group",
|
||||
"arc.azure.location": "Azure location",
|
||||
"arc.postgres.wizard.title": "Deploy an Azure Arc-enabled PostgreSQL Hyperscale server group",
|
||||
"arc.postgres.wizard.page1.title": "Provide Azure enabled PostgreSQL Hyperscale server group parameters",
|
||||
"arc.postgres.wizard.title": "Deploy a PostgreSQL Server - Azure Arc (Preview)",
|
||||
"arc.postgres.wizard.page1.title": "Provide PostgreSQL server parameters",
|
||||
"arc.postgres.settings.section.title": "General settings",
|
||||
"arc.postgres.settings.resource.worker.title": "Worker Nodes Compute Configuration",
|
||||
"arc.postgres.settings.resource.coordinator.title": "Coordinator Node Compute Configuration",
|
||||
"arc.postgres.settings.resource.compute.config.title": "Compute Configuration",
|
||||
"arc.postgres.settings.storage.title": "Storage settings",
|
||||
"arc.postgres.server.group.name": "Server group name",
|
||||
"arc.postgres.server.group.name.validation.description": "Server group name must consist of lower case alphanumeric characters or '-', start with a letter, end with an alphanumeric character, and be 11 characters or fewer in length.",
|
||||
"arc.postgres.server.group.workers.label": "Number of workers",
|
||||
"arc.postgres.server.group.workers.description": "The number of worker nodes to provision in a sharded cluster, or zero (the default) for single-node Postgres.",
|
||||
"arc.postgres.server.group.port": "Port",
|
||||
"arc.postgres.server.group.engine.version": "Engine Version",
|
||||
"arc.postgres.server.group.extensions.label": "Extensions",
|
||||
"arc.postgres.server.group.extensions.description": "A comma-separated list of the Postgres extensions that should be loaded on startup. Please refer to the postgres documentation for supported values.",
|
||||
"arc.postgres.server.group.volume.size.data.label": "Volume Size GB (Data)",
|
||||
"arc.postgres.server.group.volume.size.data.description": "The size of the storage volume to be used for data in GB.",
|
||||
"arc.postgres.server.group.volume.size.logs.label": "Volume Size GB (Logs)",
|
||||
"arc.postgres.server.group.volume.size.logs.description": "The size of the storage volume to be used for logs in GB.",
|
||||
"arc.postgres.server.group.volume.size.backups.label": "Volume Size GB (Backups)",
|
||||
"arc.postgres.server.group.volume.size.backups.description": "The size of the storage volume to be used for backups in GB.",
|
||||
"arc.postgres.server.group.workers.cores.request.label": "CPU request (cores per node)",
|
||||
"arc.postgres.server.group.workers.cores.request.description": "The minimum number of CPU cores that must be available per node to schedule the service. Fractional cores are supported.",
|
||||
"arc.postgres.server.group.workers.cores.limit.label": "CPU limit (cores per node)",
|
||||
"arc.postgres.server.group.workers.cores.limit.description": "The maximum number of CPU cores for the Postgres instance that can be used per node. Fractional cores are supported.",
|
||||
"arc.postgres.server.group.workers.memory.request.label": "Memory request (GB per node)",
|
||||
"arc.postgres.server.group.workers.memory.request.description": "The memory request of the Postgres instance per node in GB.",
|
||||
"arc.postgres.server.group.workers.memory.limit.label": "Memory limit (GB per node)",
|
||||
"arc.postgres.server.group.workers.memory.limit.description": "The memory limit of the Postgres instance per node in GB.",
|
||||
"arc.postgres.server.group.coordinator.cores.request.label": "CPU request",
|
||||
"arc.postgres.server.group.coordinator.cores.request.description": "The minimum number of CPU cores that must be available on the coordinator node to schedule the service. Fractional cores are supported.",
|
||||
"arc.postgres.server.group.coordinator.cores.limit.label": "CPU limit",
|
||||
"arc.postgres.server.group.coordinator.cores.limit.description": "The maximum number of CPU cores for the Postgres instance that can be used on the coordinator node. Fractional cores are supported.",
|
||||
"arc.postgres.server.group.coordinator.memory.request.label": "Memory request (GB)",
|
||||
"arc.postgres.server.group.coordinator.memory.request.description": "The memory request of the Postgres instance on the coordinator node in GB.",
|
||||
"arc.postgres.server.group.coordinator.memory.limit.label": "Memory limit (GB)",
|
||||
"arc.postgres.server.group.coordinator.memory.limit.description": "The memory limit of the Postgres instance on the coordinator node in GB.",
|
||||
"arc.postgres.server.name": "Server name",
|
||||
"arc.postgres.server.name.validation.description": "Server name must consist of lower case alphanumeric characters or '-', start with a letter, end with an alphanumeric character, and be 11 characters or fewer in length.",
|
||||
"arc.postgres.server.port": "Port",
|
||||
"arc.postgres.server.engine.version": "Engine Version",
|
||||
"arc.postgres.server.extensions.label": "Extensions",
|
||||
"arc.postgres.server.extensions.description": "A comma-separated list of the Postgres extensions that should be loaded on startup. Please refer to the postgres documentation for supported values.",
|
||||
"arc.postgres.server.volume.size.data.label": "Volume Size GB (Data)",
|
||||
"arc.postgres.server.volume.size.data.description": "The size of the storage volume to be used for data in GB.",
|
||||
"arc.postgres.server.volume.size.logs.label": "Volume Size GB (Logs)",
|
||||
"arc.postgres.server.volume.size.logs.description": "The size of the storage volume to be used for logs in GB.",
|
||||
"arc.postgres.server.volume.size.backups.label": "Volume Size GB (Backups)",
|
||||
"arc.postgres.server.volume.size.backups.description": "The size of the storage volume to be used for backups in GB.",
|
||||
"arc.postgres.server.cores.request.label": "CPU request",
|
||||
"arc.postgres.server.cores.request.description": "The minimum number of CPU cores that must be available on the coordinator node to schedule the service. Fractional cores are supported.",
|
||||
"arc.postgres.server.cores.limit.label": "CPU limit",
|
||||
"arc.postgres.server.cores.limit.description": "The maximum number of CPU cores for the Postgres instance that can be used on the coordinator node. Fractional cores are supported.",
|
||||
"arc.postgres.server.memory.request.label": "Memory request (GB)",
|
||||
"arc.postgres.server.memory.request.description": "The memory request of the Postgres instance on the coordinator node in GB.",
|
||||
"arc.postgres.server.memory.limit.label": "Memory limit (GB)",
|
||||
"arc.postgres.server.memory.limit.description": "The memory limit of the Postgres instance on the coordinator node in GB.",
|
||||
"arc.agreement": "I accept {0} and {1}.",
|
||||
"arc.agreement.sql.terms.conditions": "Azure SQL managed instance - Azure Arc terms and conditions",
|
||||
"arc.agreement.postgres.terms.conditions": "Azure Arc-enabled PostgreSQL Hyperscale terms and conditions",
|
||||
"arc.agreement.postgres.terms.conditions": "PostgreSQL Server - Azure Arc terms and conditions",
|
||||
"should.be.integer": "Value must be an integer",
|
||||
"worker.node.count.should.not.be.one": "Value of 1 is not supported.",
|
||||
"requested.cores.less.than.or.equal.to.cores.limit": "Requested cores must be less than or equal to cores limit",
|
||||
"cores.limit.greater.than.or.equal.to.requested.cores": "Cores limit must be greater than or equal to requested cores",
|
||||
"requested.memory.less.than.or.equal.to.memory.limit": "Requested memory must be less than or equal to memory limit",
|
||||
"memory.limit.greater.than.or.equal.to.requested.memory": "Memory limit must be greater than or equal to requested memory",
|
||||
"arc.agreement.sql.help.text": "Azure Arc enabled Managed Instance provides SQL Server access and feature compatibility that can be deployed on the infrastructure of your choice. {0}. \n \n By clicking 'Script to notebook' or 'Deploy', I (a) agree to the legal terms and privacy statement(s) associated with the Marketplace offering(s) listed below; (b) authorize Microsoft to bill my current payment method for the fees associated with the offering(s), with the same billing frequency as my Azure subscription; and (c) agree that Microsoft may share my contact, usage and transactional information with the provider(s) of the offering(s) for support, billing and other transactional activities. Microsoft does not provide rights for third-party offerings. For additional details see {1}, {2}, and {3}.",
|
||||
"arc.agreement.sql.help.text.learn.more": "Learn more",
|
||||
"arc.agreement.sql.help.text.learn.more.ariaLabel": "Learn more about Azure Arc enabled Managed Instance",
|
||||
"arc.agreement.sql.help.text": "Azure Arc-enabled Managed Instance provides SQL Server access and feature compatibility that can be deployed on the infrastructure of your choice. {0}. \n \n By clicking 'Script to notebook' or 'Deploy', I (a) agree to the legal terms and privacy statement(s) associated with the Marketplace offering(s) listed below; (b) authorize Microsoft to bill my current payment method for the fees associated with the offering(s), with the same billing frequency as my Azure subscription; and (c) agree that Microsoft may share my contact, usage and transactional information with the provider(s) of the offering(s) for support, billing and other transactional activities. Microsoft does not provide rights for third-party offerings. For additional details see {1}, {2}, and {3}.",
|
||||
"arc.agreement.help.text.learn.more": "Learn more",
|
||||
"arc.agreement.sql.help.text.learn.more.ariaLabel": "Learn more about Azure Arc-enabled Managed Instance",
|
||||
"arc.sql.pitr.retention.description": "Configure retention for point-in-time backups. {0}",
|
||||
"arc.data.controller.help.text": "The Kubernetes cluster must already be arc-enabled with the az connectedk8s connect command. Please use our {0} to learn more.",
|
||||
"arc.data.controller.help.text.documentation.page": "documentation page",
|
||||
"arc.agreement.sql.help.text.terms.of.use": "Terms of use",
|
||||
"arc.agreement.sql.help.text.privacy.policy": "Privacy policy",
|
||||
"arc.agreement.sql.help.text.azure.marketplace.terms": "Azure Marketplace Terms"
|
||||
"arc.agreement.help.text.terms.of.use": "Terms of use",
|
||||
"arc.agreement.help.text.privacy.policy": "Privacy policy",
|
||||
"arc.agreement.help.text.azure.marketplace.terms": "Azure Marketplace Terms",
|
||||
"arc.agreement.postgres.help.text": "PostgreSQL Server - Azure Arc is one of the database engines available as part of Azure Arc-enabled data services and it can be deployed on the infrastructure of your choice. {0}. \n \n By clicking 'Script to notebook' or 'Deploy', I (a) agree to the legal terms and privacy statement(s) associated with the Marketplace offering(s) listed below; (b) authorize Microsoft to bill my current payment method for the fees associated with the offering(s), with the same billing frequency as my Azure subscription; and (c) agree that Microsoft may share my contact, usage and transactional information with the provider(s) of the offering(s) for support, billing and other transactional activities. Microsoft does not provide rights for third-party offerings. For additional details see {1}, {2}, and {3}.",
|
||||
"arc.agreement.postgres.help.text.learn.more.ariaLabel": "Learn more about PostgreSQL Server - Azure Arc"
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@ const localize = nls.loadMessageBundle();
|
||||
export const arcDeploymentDeprecation = localize('arc.arcDeploymentDeprecation', "The Arc Deployment extension has been replaced by the Arc extension and has been uninstalled.");
|
||||
export function arcControllerDashboard(name: string): string { return localize('arc.controllerDashboard', "Azure Arc Data Controller Dashboard - {0}", name); }
|
||||
export function miaaDashboard(name: string): string { return localize('arc.miaaDashboard', "SQL managed instance - Azure Arc Dashboard - {0}", name); }
|
||||
export function postgresDashboard(name: string): string { return localize('arc.postgresDashboard', "PostgreSQL Hyperscale - Azure Arc Dashboard - {0}", name); }
|
||||
export function postgresDashboard(name: string): string { return localize('arc.postgresDashboard', "PostgreSQL server - Azure Arc Dashboard (Preview) - {0}", name); }
|
||||
|
||||
export const dataControllersType = localize('arc.dataControllersType', "Azure Arc Data Controller");
|
||||
export const pgSqlType = localize('arc.pgSqlType', "PostgreSQL Hyperscale - Azure Arc");
|
||||
export const pgSqlType = localize('arc.pgSqlType', "PostgreSQL server - Azure Arc");
|
||||
export const miaaType = localize('arc.miaaType', "SQL managed instance - Azure Arc");
|
||||
|
||||
export const overview = localize('arc.overview', "Overview");
|
||||
@@ -130,7 +130,7 @@ export const noInstancesAvailable = localize('arc.noInstancesAvailable', "No ins
|
||||
export const connectToServer = localize('arc.connectToServer', "Connect to Server");
|
||||
export const connectToController = localize('arc.connectToController', "Connect to Existing Controller");
|
||||
export function connectToMSSql(name: string): string { return localize('arc.connectToMSSql', "Connect to SQL managed instance - Azure Arc ({0})", name); }
|
||||
export function connectToPGSql(name: string): string { return localize('arc.connectToPGSql', "Connect to PostgreSQL Hyperscale - Azure Arc ({0})", name); }
|
||||
export function connectToPGSql(name: string): string { return localize('arc.connectToPGSql', "Connect to PostgreSQL server - Azure Arc ({0})", name); }
|
||||
export const passwordToController = localize('arc.passwordToController', "Provide Password to Controller");
|
||||
export const controllerUrl = localize('arc.controllerUrl', "Controller URL");
|
||||
export const controllerUrlPlaceholder = localize('arc.controllerUrlPlaceholder', "https://<IP or hostname>:<port>");
|
||||
@@ -171,7 +171,7 @@ export const postgresAdminUsername = localize('arc.postgresAdminUsername', "Admi
|
||||
export const nodeConfiguration = localize('arc.nodeConfiguration', "Node configuration");
|
||||
export const postgresVersion = localize('arc.postgresVersion', "PostgreSQL version");
|
||||
export const serverGroupType = localize('arc.serverGroupType', "Server group type");
|
||||
export const serverGroupNodes = localize('arc.serverGroupNodes', "Server group nodes");
|
||||
export const server = localize('arc.server', "Server");
|
||||
export const fullyQualifiedDomain = localize('arc.fullyQualifiedDomain', "Fully qualified domain");
|
||||
export const postgresArcProductName = localize('arc.postgresArcProductName', "Azure Database for PostgreSQL - Azure Arc");
|
||||
export const coordinator = localize('arc.coordinator', "Coordinator");
|
||||
@@ -183,10 +183,10 @@ export const newDatabase = localize('arc.newDatabase', "New Database");
|
||||
export const databaseName = localize('arc.databaseName', "Database name");
|
||||
export const enterNewPassword = localize('arc.enterNewPassword', "Enter a new password");
|
||||
export const confirmNewPassword = localize('arc.confirmNewPassword', "Confirm the new password");
|
||||
export const learnAboutPostgresClients = localize('arc.learnAboutPostgresClients', "Learn more about Azure PostgreSQL Hyperscale client interfaces");
|
||||
export const learnAboutPostgresClients = localize('arc.learnAboutPostgresClients', "Learn more about Azure PostgreSQL client interfaces");
|
||||
export const coordinatorNodeParametersDescription = localize('arc.coordinatorNodeParametersDescription', " These server parameters of the Coordinator node can be set to custom (non-default) values. Search to find parameters.");
|
||||
export const workerNodesParametersDescription = localize('arc.workerNodesParametersDescription', " These server parameters of the Worker nodes can be set to custom (non-default) values. Search to find parameters.");
|
||||
export const learnAboutNodeParameters = localize('arc.learnAboutNodeParameters', "Learn more about database engine settings for Azure Arc-enabled PostgreSQL Hyperscale");
|
||||
export const learnAboutNodeParameters = localize('arc.learnAboutNodeParameters', "Learn more about database engine settings for Azure Arc-enabled PostgreSQL");
|
||||
export const noNodeParametersFound = localize('arc.noNodeParametersFound', "No worker server parameters found...");
|
||||
export const searchToFilter = localize('arc.searchToFilter', "Search to filter items...");
|
||||
export const scalingCompute = localize('arc.scalingCompute', "scaling compute vCores and memory.");
|
||||
@@ -196,7 +196,7 @@ export const miaaBackupsDatabasesDescription = localize('arc.miaaBackupsDatabase
|
||||
export const pitrInfo = localize('arc.pitrInfo', "Specify how long you want to keep your point-in-time backups. Customize this for backup availability.");
|
||||
export const restoreInfo = localize('arc.restoreInfo', "Restore a database to an Azure Arc enabled SQL Managed Instance.");
|
||||
export const restorePointText = localize('arc.restorePointText', "Enter a restore point in the specified time format within given range of earliest and latest restore time.");
|
||||
export const postgresComputeAndStorageDescriptionPartTwo = localize('arc.postgres.computeAndStorageDescriptionPartTwo', "PostgreSQL Hyperscale server group by");
|
||||
export const postgresComputeAndStorageDescriptionPartTwo = localize('arc.postgres.computeAndStorageDescriptionPartTwo', "PostgreSQL by");
|
||||
export const computeAndStorageDescriptionPartThree = localize('arc.computeAndStorageDescriptionPartThree', "without downtime and by");
|
||||
export const computeAndStorageDescriptionPartFour = localize('arc.computeAndStorageDescriptionPartFour', "Before doing so, you need to ensure");
|
||||
export const computeAndStorageDescriptionPartFive = localize('arc.computeAndStorageDescriptionPartFive', "there are sufficient resources available");
|
||||
@@ -205,24 +205,16 @@ export const computeAndStorageDescriptionPartSix = localize('arc.computeAndStora
|
||||
export const node = localize('arc.node', "node");
|
||||
export const nodes = localize('arc.nodes', "nodes");
|
||||
export const workerNodes = localize('arc.workerNodes', "Worker Nodes");
|
||||
export const coordinatorNode = localize('arc.coordinatorNode', "Coordinator Node");
|
||||
export const storagePerNode = localize('arc.storagePerNode', "storage per node");
|
||||
export const workerNodeCount = localize('arc.workerNodeCount', "Worker node count");
|
||||
export const configurationPerNode = localize('arc.configurationPerNode', "Configuration (per node)");
|
||||
export const configuration = localize('arc.configurationCoordinatorNode', "Configuration");
|
||||
export const computeConfiguration = localize('arc.computeConfiguration', "Compute Configuration");
|
||||
export const configurationPerNode = localize('arc.configurationPerNode', "Configuration");
|
||||
export const configuration = localize('arc.configurationCoordinatorNode', "Node Configuration");
|
||||
export const coresLimit = localize('arc.coresLimit', "CPU limit");
|
||||
export const workerCoresLimit = localize('arc.workerCoresLimit', "Worker Nodes CPU limit");
|
||||
export const coordinatorCoresLimit = localize('arc.coordinatorCoresLimit', "Coordinator Node CPU limit");
|
||||
export const coresRequest = localize('arc.coresRequest', "CPU request");
|
||||
export const workerCoresRequest = localize('arc.workerCoresRequest', "Worker Nodes CPU request");
|
||||
export const coordinatorCoresRequest = localize('arc.coordinatorCoresRequest', "Coordinator Node CPU request");
|
||||
export const memoryLimit = localize('arc.memoryLimit', "Memory limit (in GB)");
|
||||
export const retentionDays = localize('arc.retentionDays', "Point-In-Time Recovery retention (days)");
|
||||
export const workerMemoryLimit = localize('arc.workerMemoryLimit', "Worker Nodes Memory limit (in GB)");
|
||||
export const coordinatorMemoryLimit = localize('arc.coordinatorMemoryLimit', "Coordinator Node Memory limit (in GB)");
|
||||
export const memoryRequest = localize('arc.memoryRequest', "Memory request (in GB)");
|
||||
export const workerMemoryRequest = localize('arc.workerMemoryRequest', "Worker Nodes Memory request (in GB)");
|
||||
export const coordinatorMemoryRequest = localize('arc.coordinatorMemoryRequest', "Coordinator Node Memory request (in GB)");
|
||||
export const syncSecondaryToCommit = localize('arc.syncSecondaryToCommit', "Sync Secondary To Commit");
|
||||
export const arcResources = localize('arc.arcResources', "Azure Arc Resources");
|
||||
export const enterANonEmptyPassword = localize('arc.enterANonEmptyPassword', "Enter a non empty password or press escape to exit.");
|
||||
@@ -242,7 +234,7 @@ export const connectToPostgresDescription = localize('arc.connectToPostgresDescr
|
||||
export const postgresExtension = localize('arc.postgresExtension', "microsoft.azuredatastudio-postgresql");
|
||||
export const podInitialized = localize('arc.podInitialized', "Pod is initialized.");
|
||||
export const podReady = localize('arc.podReady', "Pod is ready.");
|
||||
export const noPodIssuesDetected = localize('arc.noPodIssuesDetected', "There aren’t any known issues affecting this PostgreSQL Hyperscale instance.");
|
||||
export const noPodIssuesDetected = localize('arc.noPodIssuesDetected', "There aren’t any known issues affecting this PostgreSQL instance.");
|
||||
export const podIssuesDetected = localize('arc.podIssuesDetected', "The pods listed below are experiencing issues that may affect performance or availability.");
|
||||
export const containerReady = localize('arc.containerReady', "Pod containers are ready.");
|
||||
export const podScheduled = localize('arc.podScheduled', "Pod is schedulable.");
|
||||
@@ -306,7 +298,7 @@ export function pageDiscardFailed(error: any): string { return localize('arc.pag
|
||||
export function databaseCreationFailed(name: string, error: any): string { return localize('arc.databaseCreationFailed', "Failed to create database {0}. {1}", name, getErrorMessage(error)); }
|
||||
export function connectToControllerFailed(url: string, error: any): string { return localize('arc.connectToControllerFailed', "Could not connect to controller {0}. {1}", url, getErrorMessage(error)); }
|
||||
export function connectToMSSqlFailed(serverName: string, error: any): string { return localize('arc.connectToMSSqlFailed', "Could not connect to SQL managed instance - Azure Arc Instance {0}. {1}", serverName, getErrorMessage(error)); }
|
||||
export function connectToPGSqlFailed(serverName: string, error: any): string { return localize('arc.connectToPGSqlFailed', "Could not connect to PostgreSQL Hyperscale - Azure Arc Instance {0}. {1}", serverName, getErrorMessage(error)); }
|
||||
export function connectToPGSqlFailed(serverName: string, error: any): string { return localize('arc.connectToPGSqlFailed', "Could not connect to PostgreSQL server - Azure Arc Instance {0}. {1}", serverName, getErrorMessage(error)); }
|
||||
export function missingExtension(extensionName: string): string { return localize('arc.missingExtension', "The {0} extension is required to view engine settings. Do you wish to install it now?", extensionName); }
|
||||
export function extensionInstallationFailed(extensionName: string): string { return localize('arc.extensionInstallationFailed', "Failed to install extension {0}.", extensionName); }
|
||||
export function fetchConfigFailed(name: string, error: any): string { return localize('arc.fetchConfigFailed', "An unexpected error occurred retrieving the config for '{0}'. {1}", name, getErrorMessage(error)); }
|
||||
|
||||
@@ -101,7 +101,7 @@ export class ControllerModel {
|
||||
]);
|
||||
const newRegistrations: Registration[] = [];
|
||||
await Promise.all([
|
||||
this._azApi.az.postgres.arcserver.list(namespace, this.azAdditionalEnvVars).then(result => {
|
||||
this._azApi.az.postgres.serverarc.list(namespace, this.azAdditionalEnvVars).then(result => {
|
||||
newRegistrations.push(...result.stdout.map(r => {
|
||||
return {
|
||||
instanceName: r.name,
|
||||
|
||||
@@ -118,7 +118,7 @@ export class PostgresModel extends ResourceModel {
|
||||
}
|
||||
this._refreshPromise = new Deferred();
|
||||
try {
|
||||
this._config = (await this._azApi.az.postgres.arcserver.show(this.info.name, this.controllerModel.info.namespace, this.controllerModel.azAdditionalEnvVars)).stdout;
|
||||
this._config = (await this._azApi.az.postgres.serverarc.show(this.info.name, this.controllerModel.info.namespace, this.controllerModel.azAdditionalEnvVars)).stdout;
|
||||
this.configLastUpdated = new Date();
|
||||
this._onConfigUpdated.fire(this._config);
|
||||
this._refreshPromise.resolve();
|
||||
|
||||
@@ -13,7 +13,6 @@ import { PostgresModel } from '../../../models/postgresModel';
|
||||
import { convertToGibibyteString } from '../../../common/utils';
|
||||
|
||||
export type RoleSpecifier = {
|
||||
workers?: string,
|
||||
coordinator?: string
|
||||
};
|
||||
|
||||
@@ -28,12 +27,6 @@ export type ConfigurationSpecModel = {
|
||||
export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
private userInputContainer!: azdata.DivContainer;
|
||||
|
||||
private workerCountBox!: azdata.InputBoxComponent;
|
||||
private workerCoresLimitBox!: azdata.InputBoxComponent;
|
||||
private workerCoresRequestBox!: azdata.InputBoxComponent;
|
||||
private workerMemoryLimitBox!: azdata.InputBoxComponent;
|
||||
private workerMemoryRequestBox!: azdata.InputBoxComponent;
|
||||
|
||||
private coordinatorCoresLimitBox!: azdata.InputBoxComponent;
|
||||
private coordinatorCoresRequestBox!: azdata.InputBoxComponent;
|
||||
private coordinatorMemoryLimitBox!: azdata.InputBoxComponent;
|
||||
@@ -88,12 +81,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
CSSStyles: { ...cssStyles.text, 'margin-block-start': '0px', 'margin-block-end': '0px' }
|
||||
}).component();
|
||||
|
||||
const workerNodeslink = this.modelView.modelBuilder.hyperlink().withProps({
|
||||
label: loc.addingWorkerNodes,
|
||||
url: 'https://docs.microsoft.com/azure/azure-arc/data/scale-up-down-postgresql-hyperscale-server-group-using-cli',
|
||||
CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px' }
|
||||
}).component();
|
||||
|
||||
const infoComputeStorage_p3 = this.modelView.modelBuilder.text().withProps({
|
||||
value: loc.computeAndStorageDescriptionPartThree,
|
||||
CSSStyles: { ...cssStyles.text, 'margin-block-start': '0px', 'margin-block-end': '0px' }
|
||||
@@ -125,7 +112,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
.withItems([
|
||||
infoComputeStorage_p1,
|
||||
infoComputeStorage_p2,
|
||||
workerNodeslink,
|
||||
infoComputeStorage_p3,
|
||||
memoryVCoreslink,
|
||||
infoComputeStorage_p4,
|
||||
@@ -165,10 +151,9 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
},
|
||||
async (_progress, _token): Promise<void> => {
|
||||
try {
|
||||
await this._azApi.az.postgres.arcserver.edit(
|
||||
await this._azApi.az.postgres.serverarc.update(
|
||||
this._postgresModel.info.name,
|
||||
{
|
||||
workers: this.saveArgs.workers,
|
||||
coresRequest: this.schedulingParamsToEdit(this.saveArgs.coresRequest!),
|
||||
coresLimit: this.schedulingParamsToEdit(this.saveArgs.coresLimit!),
|
||||
memoryRequest: this.schedulingParamsToEdit(this.saveArgs.memoryRequest!),
|
||||
@@ -210,11 +195,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
this.discardButton.onDidClick(async () => {
|
||||
this.discardButton.enabled = false;
|
||||
try {
|
||||
this.workerCountBox.value = this.currentConfiguration.workers!.toString();
|
||||
this.workerCoresRequestBox.value = this.currentConfiguration.coresRequest!.workers;
|
||||
this.workerCoresLimitBox.value = this.currentConfiguration.coresLimit!.workers;
|
||||
this.workerMemoryRequestBox.value = this.currentConfiguration.memoryRequest!.workers;
|
||||
this.workerMemoryLimitBox.value = this.currentConfiguration.memoryLimit!.workers;
|
||||
this.coordinatorCoresRequestBox.value = this.currentConfiguration.coresRequest!.coordinator;
|
||||
this.coordinatorCoresLimitBox.value = this.currentConfiguration.coresLimit!.coordinator;
|
||||
this.coordinatorMemoryRequestBox.value = this.currentConfiguration.memoryRequest!.coordinator;
|
||||
@@ -234,131 +214,21 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
|
||||
private schedulingParamsToEdit(arg: RoleSpecifier): string | undefined {
|
||||
// A comma-separated list of roles with values can be specified in format <role>=<value>.
|
||||
if (arg.workers && arg.coordinator) {
|
||||
return `"${arg.workers},${arg.coordinator}"`;
|
||||
if (arg.coordinator) {
|
||||
return `"${arg.coordinator}"`;
|
||||
} else {
|
||||
return arg.workers ?? arg.coordinator ?? undefined;
|
||||
return arg.coordinator ?? undefined;
|
||||
}
|
||||
}
|
||||
|
||||
private initializeConfigurationBoxes(): void {
|
||||
// Worker node count
|
||||
this.workerCountBox = this.modelView.modelBuilder.inputBox().withProps({
|
||||
readOnly: false,
|
||||
min: 0,
|
||||
inputType: 'number',
|
||||
placeHolder: loc.loading,
|
||||
required: true,
|
||||
ariaLabel: loc.workerNodeCount,
|
||||
validationErrorMessage: loc.workerOneNodeValidationMessage
|
||||
}).withValidation((component) => {
|
||||
if (component.value === '1') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}).component();
|
||||
|
||||
this.disposables.push(
|
||||
this.workerCountBox.onTextChanged(() => {
|
||||
if (!this.saveValueToEdit(this.workerCountBox, this.currentConfiguration.workers!.toString())) {
|
||||
this.saveArgs.workers = undefined;
|
||||
} else {
|
||||
this.saveArgs.workers = parseInt(this.workerCountBox.value!);
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
// Worker nodes cores request
|
||||
this.workerCoresRequestBox = this.modelView.modelBuilder.inputBox().withProps({
|
||||
readOnly: false,
|
||||
min: 1,
|
||||
inputType: 'number',
|
||||
placeHolder: loc.loading,
|
||||
ariaLabel: loc.workerCoresRequest
|
||||
}).component();
|
||||
|
||||
this.disposables.push(
|
||||
this.workerCoresRequestBox.onTextChanged(() => {
|
||||
if (!(this.saveValueToEdit(this.workerCoresRequestBox, this.currentConfiguration.coresRequest!.workers!))) {
|
||||
this.saveArgs.coresRequest!.workers = undefined;
|
||||
} else if (this.workerCoresRequestBox.value === '') {
|
||||
this.saveArgs.coresRequest!.workers = 'w=';
|
||||
} else {
|
||||
this.saveArgs.coresRequest!.workers = `w=${this.workerCoresRequestBox.value}`;
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
// Worker nodes cores limit
|
||||
this.workerCoresLimitBox = this.modelView.modelBuilder.inputBox().withProps({
|
||||
readOnly: false,
|
||||
min: 1,
|
||||
inputType: 'number',
|
||||
placeHolder: loc.loading,
|
||||
ariaLabel: loc.workerCoresLimit
|
||||
}).component();
|
||||
|
||||
this.disposables.push(
|
||||
this.workerCoresLimitBox.onTextChanged(() => {
|
||||
if (!(this.saveValueToEdit(this.workerCoresLimitBox, this.currentConfiguration.coresLimit!.workers!))) {
|
||||
this.saveArgs.coresLimit!.workers = undefined;
|
||||
} else if (this.workerCoresLimitBox.value === '') {
|
||||
this.saveArgs.coresLimit!.workers = 'w=';
|
||||
} else {
|
||||
this.saveArgs.coresLimit!.workers = `w=${this.workerCoresLimitBox.value}`;
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
// Worker nodes memory request
|
||||
this.workerMemoryRequestBox = this.modelView.modelBuilder.inputBox().withProps({
|
||||
readOnly: false,
|
||||
min: 0.25,
|
||||
inputType: 'number',
|
||||
placeHolder: loc.loading,
|
||||
ariaLabel: loc.workerMemoryRequest
|
||||
}).component();
|
||||
|
||||
this.disposables.push(
|
||||
this.workerMemoryRequestBox.onTextChanged(() => {
|
||||
if (!(this.saveValueToEdit(this.workerMemoryRequestBox, this.currentConfiguration.memoryRequest!.workers!))) {
|
||||
this.saveArgs.memoryRequest!.workers = undefined;
|
||||
} else if (this.workerMemoryRequestBox.value === '') {
|
||||
this.saveArgs.memoryRequest!.workers = 'w=';
|
||||
} else {
|
||||
this.saveArgs.memoryRequest!.workers = `w=${this.workerMemoryRequestBox.value}Gi`;
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
// Worker nodes memory limit
|
||||
this.workerMemoryLimitBox = this.modelView.modelBuilder.inputBox().withProps({
|
||||
readOnly: false,
|
||||
min: 0.25,
|
||||
inputType: 'number',
|
||||
placeHolder: loc.loading,
|
||||
ariaLabel: loc.workerMemoryLimit
|
||||
}).component();
|
||||
|
||||
this.disposables.push(
|
||||
this.workerMemoryLimitBox.onTextChanged(() => {
|
||||
if (!(this.saveValueToEdit(this.workerMemoryLimitBox, this.currentConfiguration.memoryLimit!.workers!))) {
|
||||
this.saveArgs.memoryLimit!.workers = undefined;
|
||||
} else if (this.workerMemoryLimitBox.value === '') {
|
||||
this.saveArgs.memoryLimit!.workers = 'w=';
|
||||
} else {
|
||||
this.saveArgs.memoryLimit!.workers = `w=${this.workerMemoryLimitBox.value}Gi`;
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
// Coordinator node cores request
|
||||
this.coordinatorCoresRequestBox = this.modelView.modelBuilder.inputBox().withProps({
|
||||
readOnly: false,
|
||||
min: 1,
|
||||
inputType: 'number',
|
||||
placeHolder: loc.loading,
|
||||
ariaLabel: loc.coordinatorCoresRequest
|
||||
ariaLabel: loc.coresRequest
|
||||
}).component();
|
||||
|
||||
this.disposables.push(
|
||||
@@ -379,7 +249,7 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
min: 1,
|
||||
inputType: 'number',
|
||||
placeHolder: loc.loading,
|
||||
ariaLabel: loc.coordinatorCoresLimit
|
||||
ariaLabel: loc.coresLimit
|
||||
}).component();
|
||||
|
||||
this.disposables.push(
|
||||
@@ -400,7 +270,7 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
min: 0.25,
|
||||
inputType: 'number',
|
||||
placeHolder: loc.loading,
|
||||
ariaLabel: loc.coordinatorMemoryRequest
|
||||
ariaLabel: loc.memoryRequest
|
||||
}).component();
|
||||
|
||||
this.disposables.push(
|
||||
@@ -421,7 +291,7 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
min: 0.25,
|
||||
inputType: 'number',
|
||||
placeHolder: loc.loading,
|
||||
ariaLabel: loc.coordinatorMemoryLimit
|
||||
ariaLabel: loc.memoryLimit
|
||||
}).component();
|
||||
|
||||
this.disposables.push(
|
||||
@@ -439,7 +309,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
|
||||
private createUserInputWorkerSection(): azdata.Component[] {
|
||||
if (this._postgresModel.configLastUpdated) {
|
||||
this.editWorkerNodeCount();
|
||||
this.refreshCoresRequest();
|
||||
this.refreshCoresLimit();
|
||||
this.refreshMemoryRequest();
|
||||
@@ -447,21 +316,7 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
}
|
||||
|
||||
return [
|
||||
this.modelView.modelBuilder.text().withProps({
|
||||
value: loc.workerNodes,
|
||||
CSSStyles: { ...cssStyles.title, 'margin-top': '25px' }
|
||||
}).component(),
|
||||
this.createWorkerNodesSectionContainer(),
|
||||
this.createCoresMemorySection(loc.configurationPerNode, loc.workerNodesConfigurationInformation),
|
||||
this.createConfigurationSectionContainer(loc.coresRequest, this.workerCoresRequestBox),
|
||||
this.createConfigurationSectionContainer(loc.coresLimit, this.workerCoresLimitBox),
|
||||
this.createConfigurationSectionContainer(loc.memoryRequest, this.workerMemoryRequestBox),
|
||||
this.createConfigurationSectionContainer(loc.memoryLimit, this.workerMemoryLimitBox),
|
||||
this.modelView.modelBuilder.text().withProps({
|
||||
value: loc.coordinatorNode,
|
||||
CSSStyles: { ...cssStyles.title, 'margin-top': '25px' }
|
||||
}).component(),
|
||||
this.createCoresMemorySection(loc.configuration, loc.coordinatorNodeConfigurationInformation),
|
||||
this.createCoresMemorySection(loc.configuration),
|
||||
this.createConfigurationSectionContainer(loc.coresRequest, this.coordinatorCoresRequestBox),
|
||||
this.createConfigurationSectionContainer(loc.coresLimit, this.coordinatorCoresLimitBox),
|
||||
this.createConfigurationSectionContainer(loc.memoryRequest, this.coordinatorMemoryRequestBox),
|
||||
@@ -469,34 +324,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
];
|
||||
}
|
||||
|
||||
private createWorkerNodesSectionContainer(): azdata.FlexContainer {
|
||||
const inputFlex = { flex: '0 1 150px' };
|
||||
const keyFlex = { flex: `0 1 250px` };
|
||||
|
||||
const flexContainer = this.modelView.modelBuilder.flexContainer().withLayout({
|
||||
flexWrap: 'wrap',
|
||||
alignItems: 'center'
|
||||
}).component();
|
||||
|
||||
const keyComponent = this.modelView.modelBuilder.text().withProps({
|
||||
value: loc.workerNodeCount,
|
||||
requiredIndicator: true,
|
||||
description: loc.workerNodesInformation,
|
||||
CSSStyles: { ...cssStyles.text, 'margin-block-start': '0px', 'margin-block-end': '0px' }
|
||||
}).component();
|
||||
|
||||
const keyContainer = this.modelView.modelBuilder.flexContainer().withLayout({ alignItems: 'center' }).component();
|
||||
keyContainer.addItem(keyComponent, { CSSStyles: { 'margin-right': '0px', 'margin-bottom': '15px' } });
|
||||
|
||||
flexContainer.addItem(keyContainer, keyFlex);
|
||||
|
||||
const inputContainer = this.modelView.modelBuilder.flexContainer().withLayout({ alignItems: 'center' }).component();
|
||||
inputContainer.addItem(this.workerCountBox, { CSSStyles: { 'margin-bottom': '15px', 'min-width': '50px', 'max-width': '225px' } });
|
||||
|
||||
flexContainer.addItem(inputContainer, inputFlex);
|
||||
|
||||
return flexContainer;
|
||||
}
|
||||
|
||||
private createConfigurationSectionContainer(key: string, input: azdata.Component): azdata.FlexContainer {
|
||||
const inputFlex = { flex: '0 1 150px' };
|
||||
@@ -550,17 +377,7 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
}
|
||||
}
|
||||
|
||||
private editWorkerNodeCount(): void {
|
||||
// scale.shards was renamed to scale.workers. Check both for backwards compatibility.
|
||||
let scale = this._postgresModel.config?.spec.scale;
|
||||
this.currentConfiguration.workers = scale?.workers ?? scale?.shards ?? 0;
|
||||
|
||||
this.workerCountBox.placeHolder = '';
|
||||
this.workerCountBox.value = this.currentConfiguration.workers.toString();
|
||||
this.saveArgs.workers = undefined;
|
||||
}
|
||||
|
||||
private createCoresMemorySection(title: string, description: string): azdata.DivContainer {
|
||||
private createCoresMemorySection(title: string): azdata.DivContainer {
|
||||
const titleFlex = { flex: `0 1 250px` };
|
||||
|
||||
const flexContainer = this.modelView.modelBuilder.flexContainer().withLayout({
|
||||
@@ -570,12 +387,11 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
|
||||
const titleComponent = this.modelView.modelBuilder.text().withProps({
|
||||
value: title,
|
||||
description: description,
|
||||
CSSStyles: { ...cssStyles.title, 'font-weight': 'bold', 'margin-block-start': '0px', 'margin-block-end': '0px' }
|
||||
}).component();
|
||||
|
||||
const titleContainer = this.modelView.modelBuilder.flexContainer().withLayout({ alignItems: 'center' }).component();
|
||||
titleContainer.addItem(titleComponent, { CSSStyles: { 'margin-right': '0px', 'margin-bottom': '15px' } });
|
||||
titleContainer.addItem(titleComponent, { CSSStyles: { 'margin-right': '0px', 'margin-bottom': '15px', 'margin-top': '15px' } });
|
||||
|
||||
flexContainer.addItem(titleContainer, titleFlex);
|
||||
|
||||
@@ -586,15 +402,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
}
|
||||
|
||||
private refreshCoresRequest(): void {
|
||||
// Workers
|
||||
let workersCR = this._postgresModel.config?.spec.scheduling?.roles?.worker?.resources?.requests?.cpu ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.requests?.cpu;
|
||||
if (!workersCR) {
|
||||
workersCR = '';
|
||||
}
|
||||
|
||||
this.workerCoresRequestBox.placeHolder = '';
|
||||
this.workerCoresRequestBox.value = workersCR;
|
||||
|
||||
// Coordinator
|
||||
let coordinatorCR = this._postgresModel.config?.spec.scheduling?.roles?.coordinator?.resources?.requests?.cpu ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.requests?.cpu;
|
||||
if (!coordinatorCR) {
|
||||
@@ -606,7 +413,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
|
||||
// Update saved current configuration
|
||||
this.currentConfiguration.coresRequest = {
|
||||
workers: workersCR,
|
||||
coordinator: coordinatorCR
|
||||
};
|
||||
|
||||
@@ -615,15 +421,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
}
|
||||
|
||||
private refreshCoresLimit(): void {
|
||||
// Workers
|
||||
let workersCL = this._postgresModel.config?.spec.scheduling?.roles?.worker?.resources?.limits?.cpu ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.limits?.cpu;
|
||||
if (!workersCL) {
|
||||
workersCL = '';
|
||||
}
|
||||
|
||||
this.workerCoresLimitBox.placeHolder = '';
|
||||
this.workerCoresLimitBox.value = workersCL;
|
||||
|
||||
// Coordinator
|
||||
let coordinatorCL = this._postgresModel.config?.spec.scheduling?.roles?.coordinator?.resources?.limits?.cpu ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.limits?.cpu;
|
||||
if (!coordinatorCL) {
|
||||
@@ -635,7 +432,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
|
||||
// Update saved current configuration
|
||||
this.currentConfiguration.coresLimit = {
|
||||
workers: workersCL,
|
||||
coordinator: coordinatorCL
|
||||
};
|
||||
|
||||
@@ -644,16 +440,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
}
|
||||
|
||||
private refreshMemoryRequest(): void {
|
||||
// Workers
|
||||
let currentWorkersMemoryRequest = this._postgresModel.config?.spec.scheduling?.roles?.worker?.resources?.requests?.memory ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.requests?.memory;
|
||||
let workersMR = '';
|
||||
if (currentWorkersMemoryRequest) {
|
||||
workersMR = convertToGibibyteString(currentWorkersMemoryRequest);
|
||||
}
|
||||
|
||||
this.workerMemoryRequestBox.placeHolder = '';
|
||||
this.workerMemoryRequestBox.value = workersMR;
|
||||
|
||||
// Coordinator
|
||||
let currentCoordinatorMemoryRequest = this._postgresModel.config?.spec.scheduling?.roles?.coordinator?.resources?.requests?.memory ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.requests?.memory;
|
||||
let coordinatorMR = '';
|
||||
@@ -666,7 +452,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
|
||||
// Update saved current configuration
|
||||
this.currentConfiguration.memoryRequest = {
|
||||
workers: workersMR,
|
||||
coordinator: coordinatorMR
|
||||
};
|
||||
|
||||
@@ -675,16 +460,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
}
|
||||
|
||||
private refreshMemoryLimit(): void {
|
||||
// Workers
|
||||
let currentWorkersMemoryLimit = this._postgresModel.config?.spec.scheduling?.roles?.worker?.resources?.limits?.memory ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.limits?.memory;
|
||||
let workersML = '';
|
||||
if (currentWorkersMemoryLimit) {
|
||||
workersML = convertToGibibyteString(currentWorkersMemoryLimit);
|
||||
}
|
||||
|
||||
this.workerMemoryLimitBox.placeHolder = '';
|
||||
this.workerMemoryLimitBox.value = workersML;
|
||||
|
||||
// Coordinator
|
||||
let currentCoordinatorMemoryLimit = this._postgresModel.config?.spec.scheduling?.roles?.coordinator?.resources?.limits?.memory ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.limits?.memory;
|
||||
let coordinatorML = '';
|
||||
@@ -697,7 +472,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
|
||||
// Update saved current configuration
|
||||
this.currentConfiguration.memoryLimit = {
|
||||
workers: workersML,
|
||||
coordinator: coordinatorML
|
||||
};
|
||||
|
||||
@@ -706,7 +480,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
|
||||
}
|
||||
|
||||
private handleServiceUpdated(): void {
|
||||
this.editWorkerNodeCount();
|
||||
this.refreshCoresRequest();
|
||||
this.refreshCoresLimit();
|
||||
this.refreshMemoryRequest();
|
||||
|
||||
@@ -35,28 +35,4 @@ export class PostgresCoordinatorNodeParametersPage extends PostgresParametersPag
|
||||
return this._postgresModel.coordinatorNodeEngineSettings;
|
||||
}
|
||||
|
||||
protected async saveParameterEdits(engineSettings: string): Promise<void> {
|
||||
await this._azApi.az.postgres.arcserver.edit(
|
||||
this._postgresModel.info.name,
|
||||
{ coordinatorEngineSettings: engineSettings },
|
||||
this._postgresModel.controllerModel.info.namespace,
|
||||
this._postgresModel.controllerModel.azAdditionalEnvVars);
|
||||
|
||||
}
|
||||
|
||||
protected async resetAllParameters(): Promise<void> {
|
||||
await this._azApi.az.postgres.arcserver.edit(
|
||||
this._postgresModel.info.name,
|
||||
{ coordinatorEngineSettings: `''`, replaceEngineSettings: true },
|
||||
this._postgresModel.controllerModel.info.namespace,
|
||||
this._postgresModel.controllerModel.azAdditionalEnvVars);
|
||||
}
|
||||
|
||||
protected async resetParameter(parameterName: string): Promise<void> {
|
||||
await this._azApi.az.postgres.arcserver.edit(
|
||||
this._postgresModel.info.name,
|
||||
{ coordinatorEngineSettings: parameterName + '=' },
|
||||
this._postgresModel.controllerModel.info.namespace,
|
||||
this._postgresModel.controllerModel.azAdditionalEnvVars);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* 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 loc from '../../../localizedConstants';
|
||||
import { ControllerModel } from '../../../models/controllerModel';
|
||||
@@ -11,17 +10,11 @@ import { PostgresModel } from '../../../models/postgresModel';
|
||||
import { PostgresOverviewPage } from './postgresOverviewPage';
|
||||
import { PostgresConnectionStringsPage } from './postgresConnectionStringsPage';
|
||||
import { Dashboard } from '../../components/dashboard';
|
||||
import { PostgresDiagnoseAndSolveProblemsPage } from './postgresDiagnoseAndSolveProblemsPage';
|
||||
import { PostgresSupportRequestPage } from './postgresSupportRequestPage';
|
||||
import { PostgresComputeAndStoragePage } from './postgresComputeAndStoragePage';
|
||||
import { PostgresWorkerNodeParametersPage } from './postgresWorkerNodeParametersPage';
|
||||
import { PostgresPropertiesPage } from './postgresPropertiesPage';
|
||||
import { PostgresResourceHealthPage } from './postgresResourceHealthPage';
|
||||
import { PostgresCoordinatorNodeParametersPage } from './postgresCoordinatorNodeParametersPage';
|
||||
import { PostgresExtensionsPage } from './postgresExtensionsPage';
|
||||
|
||||
export class PostgresDashboard extends Dashboard {
|
||||
constructor(private _context: vscode.ExtensionContext, private _controllerModel: ControllerModel, private _postgresModel: PostgresModel) {
|
||||
constructor(private _controllerModel: ControllerModel, private _postgresModel: PostgresModel) {
|
||||
super(loc.postgresDashboard(_postgresModel.info.name), 'ArcPgDashboard');
|
||||
}
|
||||
|
||||
@@ -35,34 +28,22 @@ export class PostgresDashboard extends Dashboard {
|
||||
|
||||
protected async registerTabs(modelView: azdata.ModelView): Promise<(azdata.DashboardTab | azdata.DashboardTabGroup)[]> {
|
||||
const overviewPage = new PostgresOverviewPage(modelView, this.dashboard, this._controllerModel, this._postgresModel);
|
||||
const extensionsPage = new PostgresExtensionsPage(modelView, this.dashboard, this._postgresModel);
|
||||
const connectionStringsPage = new PostgresConnectionStringsPage(modelView, this.dashboard, this._postgresModel);
|
||||
const computeAndStoragePage = new PostgresComputeAndStoragePage(modelView, this.dashboard, this._postgresModel);
|
||||
const propertiesPage = new PostgresPropertiesPage(modelView, this.dashboard, this._controllerModel, this._postgresModel);
|
||||
const coordinatorNodeParametersPage = new PostgresCoordinatorNodeParametersPage(modelView, this.dashboard, this._postgresModel);
|
||||
const workerNodeParametersPage = new PostgresWorkerNodeParametersPage(modelView, this.dashboard, this._postgresModel);
|
||||
const diagnoseAndSolveProblemsPage = new PostgresDiagnoseAndSolveProblemsPage(modelView, this.dashboard, this._context, this._controllerModel, this._postgresModel);
|
||||
const supportRequestPage = new PostgresSupportRequestPage(modelView, this.dashboard, this._controllerModel, this._postgresModel);
|
||||
const resourceHealthPage = new PostgresResourceHealthPage(modelView, this.dashboard, this._postgresModel);
|
||||
|
||||
return [
|
||||
overviewPage.tab,
|
||||
{
|
||||
title: loc.settings,
|
||||
tabs: [
|
||||
propertiesPage.tab,
|
||||
extensionsPage.tab,
|
||||
connectionStringsPage.tab,
|
||||
computeAndStoragePage.tab,
|
||||
coordinatorNodeParametersPage.tab,
|
||||
workerNodeParametersPage.tab
|
||||
computeAndStoragePage.tab
|
||||
]
|
||||
},
|
||||
{
|
||||
title: loc.supportAndTroubleshooting,
|
||||
tabs: [
|
||||
resourceHealthPage.tab,
|
||||
diagnoseAndSolveProblemsPage.tab,
|
||||
supportRequestPage.tab
|
||||
]
|
||||
}
|
||||
|
||||
@@ -129,7 +129,6 @@ export class PostgresExtensionsPage extends DashboardPage {
|
||||
try {
|
||||
this.addExtensionsButton.enabled = false;
|
||||
this.dropExtensionsButton.enabled = false;
|
||||
let extensionList = this.extensionNames.length ? this.extensionNames.join() + ',' + extArg : extArg;
|
||||
await vscode.window.withProgress(
|
||||
{
|
||||
location: vscode.ProgressLocation.Notification,
|
||||
@@ -138,11 +137,9 @@ export class PostgresExtensionsPage extends DashboardPage {
|
||||
},
|
||||
async (_progress, _token): Promise<void> => {
|
||||
|
||||
await this._azApi.az.postgres.arcserver.edit(
|
||||
await this._azApi.az.postgres.serverarc.update(
|
||||
this._postgresModel.info.name,
|
||||
{
|
||||
extensions: extensionList
|
||||
},
|
||||
{},
|
||||
this._postgresModel.controllerModel.info.namespace,
|
||||
this._postgresModel.controllerModel.azAdditionalEnvVars);
|
||||
|
||||
@@ -272,11 +269,9 @@ export class PostgresExtensionsPage extends DashboardPage {
|
||||
cancellable: false
|
||||
},
|
||||
async (_progress, _token): Promise<void> => {
|
||||
await this._azApi.az.postgres.arcserver.edit(
|
||||
await this._azApi.az.postgres.serverarc.update(
|
||||
this._postgresModel.info.name,
|
||||
{
|
||||
extensions: this.extensionNames.join()
|
||||
},
|
||||
{},
|
||||
this._postgresModel.controllerModel.info.namespace,
|
||||
this._postgresModel.controllerModel.azAdditionalEnvVars
|
||||
);
|
||||
|
||||
@@ -7,16 +7,15 @@ import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
import * as azExt from 'az-ext';
|
||||
import * as loc from '../../../localizedConstants';
|
||||
import { IconPathHelper, cssStyles, iconSize } from '../../../constants';
|
||||
import { IconPathHelper, cssStyles } from '../../../constants';
|
||||
import { DashboardPage } from '../../components/dashboardPage';
|
||||
import { ControllerModel } from '../../../models/controllerModel';
|
||||
import { PostgresModel } from '../../../models/postgresModel';
|
||||
import { promptAndConfirmPassword, promptForInstanceDeletion } from '../../../common/utils';
|
||||
import { promptForInstanceDeletion } from '../../../common/utils';
|
||||
import { ResourceType } from 'arc';
|
||||
|
||||
export type PodStatusModel = {
|
||||
podName: azdata.Component,
|
||||
type: string,
|
||||
status: string
|
||||
};
|
||||
|
||||
@@ -32,9 +31,6 @@ export class PostgresOverviewPage extends DashboardPage {
|
||||
private grafanaLink!: azdata.HyperlinkComponent;
|
||||
private deleteButton!: azdata.ButtonComponent;
|
||||
|
||||
private podStatusTable!: azdata.DeclarativeTableComponent;
|
||||
private podStatusData: PodStatusModel[] = [];
|
||||
|
||||
private readonly _azApi: azExt.IExtension;
|
||||
|
||||
constructor(modelView: azdata.ModelView, dashboard: azdata.window.ModelViewDashboard, private _controllerModel: ControllerModel, private _postgresModel: PostgresModel) {
|
||||
@@ -147,99 +143,11 @@ export class PostgresOverviewPage extends DashboardPage {
|
||||
}).component();
|
||||
content.addItem(endpointsTable);
|
||||
|
||||
// Server Group Nodes
|
||||
content.addItem(this.modelView.modelBuilder.text().withProps({
|
||||
value: loc.serverGroupNodes,
|
||||
CSSStyles: titleCSS,
|
||||
headingLevel: 1
|
||||
}).component());
|
||||
|
||||
|
||||
|
||||
this.podStatusTable = this.modelView.modelBuilder.declarativeTable().withProps({
|
||||
width: '100%',
|
||||
ariaLabel: loc.serverGroupNodes,
|
||||
columns: [
|
||||
{
|
||||
displayName: loc.name,
|
||||
valueType: azdata.DeclarativeDataType.component,
|
||||
isReadOnly: true,
|
||||
width: '35%',
|
||||
headerCssStyles: cssStyles.tableHeader,
|
||||
rowCssStyles: {
|
||||
...cssStyles.tableRow,
|
||||
'overflow': 'hidden',
|
||||
'text-overflow': 'ellipsis',
|
||||
'white-space': 'nowrap',
|
||||
'max-width': '0'
|
||||
}
|
||||
},
|
||||
{
|
||||
displayName: loc.type,
|
||||
valueType: azdata.DeclarativeDataType.string,
|
||||
isReadOnly: true,
|
||||
width: '35%',
|
||||
headerCssStyles: cssStyles.tableHeader,
|
||||
rowCssStyles: cssStyles.tableRow
|
||||
},
|
||||
{
|
||||
displayName: loc.status,
|
||||
valueType: azdata.DeclarativeDataType.string,
|
||||
isReadOnly: true,
|
||||
width: '30%',
|
||||
headerCssStyles: cssStyles.tableHeader,
|
||||
rowCssStyles: cssStyles.tableRow
|
||||
}
|
||||
],
|
||||
dataValues: this.createPodStatusDataValues()
|
||||
}).component();
|
||||
|
||||
|
||||
|
||||
this.serverGroupNodesLoading = this.modelView.modelBuilder.loadingComponent()
|
||||
.withItem(this.podStatusTable)
|
||||
.withProps({
|
||||
loading: !this._postgresModel.configLastUpdated
|
||||
}).component();
|
||||
|
||||
this.refreshServerNodes();
|
||||
|
||||
content.addItem(this.serverGroupNodesLoading, { CSSStyles: cssStyles.text });
|
||||
|
||||
this.initialized = true;
|
||||
return root;
|
||||
}
|
||||
|
||||
protected get toolbarContainer(): azdata.ToolbarContainer {
|
||||
// Reset password
|
||||
const resetPasswordButton = this.modelView.modelBuilder.button().withProps({
|
||||
label: loc.resetPassword,
|
||||
iconPath: IconPathHelper.edit
|
||||
}).component();
|
||||
|
||||
this.disposables.push(
|
||||
resetPasswordButton.onDidClick(async () => {
|
||||
resetPasswordButton.enabled = false;
|
||||
try {
|
||||
const password = await promptAndConfirmPassword(input => !input ? loc.enterANonEmptyPassword : '');
|
||||
if (password) {
|
||||
await this._azApi.az.postgres.arcserver.edit(
|
||||
this._postgresModel.info.name,
|
||||
{
|
||||
adminPassword: true,
|
||||
noWait: true
|
||||
},
|
||||
this._postgresModel.controllerModel.info.namespace,
|
||||
Object.assign({ 'AZDATA_PASSWORD': password }, this._controllerModel.azAdditionalEnvVars));
|
||||
vscode.window.showInformationMessage(loc.passwordReset);
|
||||
}
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(loc.passwordResetFailed(error));
|
||||
} finally {
|
||||
resetPasswordButton.enabled = true;
|
||||
}
|
||||
}));
|
||||
|
||||
// Delete service
|
||||
this.deleteButton = this.modelView.modelBuilder.button().withProps({
|
||||
label: loc.deleteText,
|
||||
@@ -258,7 +166,7 @@ export class PostgresOverviewPage extends DashboardPage {
|
||||
cancellable: false
|
||||
},
|
||||
async (_progress, _token) => {
|
||||
return await this._azApi.az.postgres.arcserver.delete(this._postgresModel.info.name, this._postgresModel.controllerModel.info.namespace, this._controllerModel.azAdditionalEnvVars);
|
||||
return await this._azApi.az.postgres.serverarc.delete(this._postgresModel.info.name, this._postgresModel.controllerModel.info.namespace, this._controllerModel.azAdditionalEnvVars);
|
||||
}
|
||||
);
|
||||
await this._controllerModel.refreshTreeNode();
|
||||
@@ -323,7 +231,6 @@ export class PostgresOverviewPage extends DashboardPage {
|
||||
}));
|
||||
|
||||
return this.modelView.modelBuilder.toolbarContainer().withToolbarItems([
|
||||
{ component: resetPasswordButton },
|
||||
{ component: this.deleteButton },
|
||||
{ component: refreshButton, toolbarSeparatorAfter: true },
|
||||
{ component: openInAzurePortalButton }
|
||||
@@ -341,70 +248,10 @@ export class PostgresOverviewPage extends DashboardPage {
|
||||
{ displayName: loc.namespace, value: this._postgresModel.config?.metadata.namespace || '-' },
|
||||
{ displayName: loc.subscriptionId, value: azure?.subscription || '-' },
|
||||
{ displayName: loc.externalEndpoint, value: this._postgresModel.config?.status.primaryEndpoint || '-' },
|
||||
{ displayName: loc.status, value: status ? `${status.state} (${status.readyPods} ${loc.podsReady})` : '-' },
|
||||
{ displayName: loc.postgresAdminUsername, value: 'postgres' },
|
||||
{ displayName: loc.postgresVersion, value: this._postgresModel.engineVersion ?? '-' },
|
||||
{ displayName: loc.nodeConfiguration, value: this._postgresModel.scaleConfiguration || '-' }
|
||||
{ displayName: loc.status, value: status ? `${status.state} (${status.readyPods} ${loc.podsReady})` : '-' }
|
||||
];
|
||||
}
|
||||
|
||||
private getPodStatus(): PodStatusModel[] {
|
||||
let podModels: PodStatusModel[] = [];
|
||||
const podStatus = this._postgresModel.config?.status.podsStatus;
|
||||
|
||||
podStatus?.forEach((p: { conditions: any[]; name: any; role: string; }) => {
|
||||
// If a condition of the pod has a status of False, pod is not Ready
|
||||
const status = p.conditions.find(c => c.status === 'False') ? loc.notReady : loc.ready;
|
||||
|
||||
const podLabelContainer = this.modelView.modelBuilder.flexContainer().withProps({
|
||||
CSSStyles: { 'alignItems': 'center', 'height': '15px' }
|
||||
}).component();
|
||||
|
||||
const imageComponent = this.modelView.modelBuilder.image().withProps({
|
||||
iconPath: IconPathHelper.postgres,
|
||||
width: iconSize,
|
||||
height: iconSize,
|
||||
iconHeight: '15px',
|
||||
iconWidth: '15px'
|
||||
}).component();
|
||||
|
||||
let podLabel = this.modelView.modelBuilder.text().withProps({
|
||||
value: p.name,
|
||||
}).component();
|
||||
|
||||
if (p.role.toUpperCase() === loc.worker.toUpperCase()) {
|
||||
podLabelContainer.addItem(imageComponent, { CSSStyles: { 'margin-left': '15px', 'margin-right': '0px' } });
|
||||
podLabelContainer.addItem(podLabel);
|
||||
let pod: PodStatusModel = {
|
||||
podName: podLabelContainer,
|
||||
type: loc.worker,
|
||||
status: status
|
||||
};
|
||||
podModels.push(pod);
|
||||
} else {
|
||||
podLabelContainer.addItem(imageComponent, { CSSStyles: { 'margin-right': '0px' } });
|
||||
podLabelContainer.addItem(podLabel);
|
||||
let pod: PodStatusModel = {
|
||||
podName: podLabelContainer,
|
||||
type: loc.coordinator,
|
||||
status: status
|
||||
};
|
||||
podModels.unshift(pod);
|
||||
}
|
||||
});
|
||||
|
||||
return podModels;
|
||||
}
|
||||
|
||||
private createPodStatusDataValues(): azdata.DeclarativeTableCellValue[][] {
|
||||
let podDataValue: (string | azdata.Component)[][] = this.podStatusData.map(p => [p.podName, p.type, p.status]);
|
||||
return podDataValue.map(p => {
|
||||
return p.map((value): azdata.DeclarativeTableCellValue => {
|
||||
return { value: value };
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private refreshDashboardLinks(): void {
|
||||
if (this._postgresModel.config) {
|
||||
const kibanaUrl = this._postgresModel.config.status.logSearchDashboard ?? '';
|
||||
@@ -419,14 +266,6 @@ export class PostgresOverviewPage extends DashboardPage {
|
||||
}
|
||||
}
|
||||
|
||||
private refreshServerNodes(): void {
|
||||
if (this._postgresModel.config) {
|
||||
this.podStatusData = this.getPodStatus();
|
||||
this.podStatusTable.setDataValues(this.createPodStatusDataValues());
|
||||
this.serverGroupNodesLoading.loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
private handleRegistrationsUpdated() {
|
||||
this.properties!.propertyItems = this.getProperties();
|
||||
this.propertiesLoading!.loading = false;
|
||||
@@ -436,6 +275,5 @@ export class PostgresOverviewPage extends DashboardPage {
|
||||
this.properties!.propertyItems = this.getProperties();
|
||||
this.propertiesLoading!.loading = false;
|
||||
this.refreshDashboardLinks();
|
||||
this.refreshServerNodes();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,6 @@ export abstract class PostgresParametersPage extends DashboardPage {
|
||||
this.parameterUpdates.forEach((value, key) => {
|
||||
engineSettings.push(`${key}="${value}"`);
|
||||
});
|
||||
await this.saveParameterEdits(engineSettings.toString());
|
||||
} catch (err) {
|
||||
// If an error occurs while editing the instance then re-enable the save button since
|
||||
// the edit wasn't successfully applied
|
||||
@@ -224,7 +223,6 @@ export abstract class PostgresParametersPage extends DashboardPage {
|
||||
},
|
||||
async (_progress, _token): Promise<void> => {
|
||||
try {
|
||||
await this.resetAllParameters();
|
||||
} catch (err) {
|
||||
// If an error occurs while resetting the instance then re-enable the reset button since
|
||||
// the edit wasn't successfully applied
|
||||
@@ -425,7 +423,6 @@ export abstract class PostgresParametersPage extends DashboardPage {
|
||||
cancellable: false
|
||||
},
|
||||
async (_progress, _token): Promise<void> => {
|
||||
await this.resetParameter(engineSetting.parameterName!);
|
||||
try {
|
||||
await this.callGetEngineSettings();
|
||||
} catch (error) {
|
||||
@@ -649,10 +646,4 @@ export abstract class PostgresParametersPage extends DashboardPage {
|
||||
await this.callGetEngineSettings();
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract saveParameterEdits(engineSettings: string): Promise<void>;
|
||||
|
||||
protected abstract resetAllParameters(): Promise<void>;
|
||||
|
||||
protected abstract resetParameter(parameterName: string): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -103,9 +103,7 @@ export class PostgresPropertiesPage extends DashboardPage {
|
||||
new InputKeyValue(this.modelView.modelBuilder, loc.subscriptionId, this._controllerModel.controllerConfig?.spec.settings.azure.subscription ?? ''),
|
||||
new TextKeyValue(this.modelView.modelBuilder, loc.resourceGroup, this._controllerModel.controllerConfig?.spec.settings.azure.resourceGroup ?? ''),
|
||||
new LinkKeyValue(this.modelView.modelBuilder, loc.dataController, this._controllerModel.controllerConfig?.metadata.name ?? '', () => controllerDashboard.showDashboard()),
|
||||
new TextKeyValue(this.modelView.modelBuilder, loc.nodeConfiguration, this._postgresModel.scaleConfiguration ?? ''),
|
||||
new TextKeyValue(this.modelView.modelBuilder, loc.status, status ? `${status.state} (${status.readyPods} ${loc.podsReady})` : loc.unknown),
|
||||
new TextKeyValue(this.modelView.modelBuilder, loc.postgresVersion, this._postgresModel.engineVersion ?? ''),
|
||||
new TextKeyValue(this.modelView.modelBuilder, loc.status, status ? `${status.state} (${status.readyPods} ${loc.podsReady})` : loc.unknown)
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -36,27 +36,4 @@ export class PostgresWorkerNodeParametersPage extends PostgresParametersPage {
|
||||
return this._postgresModel.workerNodesEngineSettings;
|
||||
}
|
||||
|
||||
protected async saveParameterEdits(engineSettings: string): Promise<void> {
|
||||
await this._azApi.az.postgres.arcserver.edit(
|
||||
this._postgresModel.info.name,
|
||||
{ workerEngineSettings: engineSettings },
|
||||
this._postgresModel.controllerModel.info.namespace,
|
||||
this._postgresModel.controllerModel.azAdditionalEnvVars);
|
||||
}
|
||||
|
||||
protected async resetAllParameters(): Promise<void> {
|
||||
await this._azApi.az.postgres.arcserver.edit(
|
||||
this._postgresModel.info.name,
|
||||
{ workerEngineSettings: `''`, replaceEngineSettings: true },
|
||||
this._postgresModel.controllerModel.info.namespace,
|
||||
this._postgresModel.controllerModel.azAdditionalEnvVars);
|
||||
}
|
||||
|
||||
protected async resetParameter(parameterName: string): Promise<void> {
|
||||
await this._azApi.az.postgres.arcserver.edit(
|
||||
this._postgresModel.info.name,
|
||||
{ workerEngineSettings: parameterName + '=' },
|
||||
this._postgresModel.controllerModel.info.namespace,
|
||||
this._postgresModel.controllerModel.azAdditionalEnvVars);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ export class AzureArcTreeDataProvider implements vscode.TreeDataProvider<TreeNod
|
||||
if (controllerNode) {
|
||||
controllerNode.model.info = model.info;
|
||||
} else {
|
||||
this._controllerNodes.push(new ControllerTreeNode(model, this._context, this));
|
||||
this._controllerNodes.push(new ControllerTreeNode(model, this));
|
||||
}
|
||||
if (refreshTree) {
|
||||
this._onDidChangeTreeData.fire(undefined);
|
||||
@@ -85,7 +85,7 @@ export class AzureArcTreeDataProvider implements vscode.TreeDataProvider<TreeNod
|
||||
const controllerMementos: ControllerInfo[] = this._context.globalState.get(mementoToken) || [];
|
||||
this._controllerNodes = controllerMementos.map(memento => {
|
||||
const controllerModel = new ControllerModel(this, memento);
|
||||
return new ControllerTreeNode(controllerModel, this._context, this);
|
||||
return new ControllerTreeNode(controllerModel, this);
|
||||
});
|
||||
} finally {
|
||||
this._loading = false;
|
||||
|
||||
@@ -27,7 +27,7 @@ export class ControllerTreeNode extends TreeNode {
|
||||
|
||||
private _children: ResourceTreeNode<ResourceModel>[] = [];
|
||||
|
||||
constructor(public model: ControllerModel, private _context: vscode.ExtensionContext, private _treeDataProvider: AzureArcTreeDataProvider) {
|
||||
constructor(public model: ControllerModel, private _treeDataProvider: AzureArcTreeDataProvider) {
|
||||
super(model.label, vscode.TreeItemCollapsibleState.Collapsed, ResourceType.dataControllers);
|
||||
model.onInfoUpdated(_ => {
|
||||
this.label = model.label;
|
||||
@@ -107,7 +107,7 @@ export class ControllerTreeNode extends TreeNode {
|
||||
info.name === resourceInfo.name &&
|
||||
info.resourceType === resourceInfo.resourceType) as PGResourceInfo)?.userName;
|
||||
const postgresModel = new PostgresModel(this.model, resourceInfo, registration, this._treeDataProvider);
|
||||
node = new PostgresTreeNode(postgresModel, this.model, this._context);
|
||||
node = new PostgresTreeNode(postgresModel, this.model);
|
||||
break;
|
||||
case ResourceType.sqlManagedInstances:
|
||||
// Fill in the username too if we already have it
|
||||
|
||||
@@ -15,12 +15,12 @@ import { ResourceTreeNode } from './resourceTreeNode';
|
||||
*/
|
||||
export class PostgresTreeNode extends ResourceTreeNode<PostgresModel> {
|
||||
|
||||
constructor(model: PostgresModel, private _controllerModel: ControllerModel, private _context: vscode.ExtensionContext) {
|
||||
constructor(model: PostgresModel, private _controllerModel: ControllerModel) {
|
||||
super(model.info.name, vscode.TreeItemCollapsibleState.None, ResourceType.postgresInstances, model);
|
||||
}
|
||||
|
||||
public override async openDashboard(): Promise<void> {
|
||||
const postgresDashboard = new PostgresDashboard(this._context, this._controllerModel, this.model);
|
||||
const postgresDashboard = new PostgresDashboard(this._controllerModel, this.model);
|
||||
await postgresDashboard.showDashboard();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "azcli",
|
||||
"displayName": "%azcli.arc.displayName%",
|
||||
"description": "%azcli.arc.description%",
|
||||
"version": "1.5.1",
|
||||
"version": "1.5.2",
|
||||
"publisher": "Microsoft",
|
||||
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt",
|
||||
"icon": "images/extension.png",
|
||||
|
||||
@@ -71,44 +71,37 @@ export function getAzApi(localAzDiscovered: Promise<IAzTool | undefined>, azTool
|
||||
}
|
||||
},
|
||||
postgres: {
|
||||
arcserver: {
|
||||
serverarc: {
|
||||
delete: async (name: string, namespace: string, additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
||||
await localAzDiscovered;
|
||||
validateAz(azToolService.localAz);
|
||||
return azToolService.localAz!.postgres.arcserver.delete(name, namespace, additionalEnvVars);
|
||||
return azToolService.localAz!.postgres.serverarc.delete(name, namespace, additionalEnvVars);
|
||||
},
|
||||
list: async (namespace: string, additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
||||
await localAzDiscovered;
|
||||
validateAz(azToolService.localAz);
|
||||
return azToolService.localAz!.postgres.arcserver.list(namespace, additionalEnvVars);
|
||||
return azToolService.localAz!.postgres.serverarc.list(namespace, additionalEnvVars);
|
||||
},
|
||||
show: async (name: string, namespace: string, additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
||||
await localAzDiscovered;
|
||||
validateAz(azToolService.localAz);
|
||||
return azToolService.localAz!.postgres.arcserver.show(name, namespace, additionalEnvVars);
|
||||
return azToolService.localAz!.postgres.serverarc.show(name, namespace, additionalEnvVars);
|
||||
},
|
||||
edit: async (
|
||||
update: async (
|
||||
name: string,
|
||||
args: {
|
||||
adminPassword?: boolean;
|
||||
coresLimit?: string;
|
||||
coresRequest?: string;
|
||||
coordinatorEngineSettings?: string;
|
||||
engineSettings?: string;
|
||||
extensions?: string;
|
||||
memoryLimit?: string;
|
||||
memoryRequest?: string;
|
||||
noWait?: boolean;
|
||||
port?: number;
|
||||
replaceEngineSettings?: boolean;
|
||||
workerEngineSettings?: string;
|
||||
workers?: number;
|
||||
},
|
||||
namespace: string,
|
||||
additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
||||
await localAzDiscovered;
|
||||
validateAz(azToolService.localAz);
|
||||
return azToolService.localAz!.postgres.arcserver.edit(name, args, namespace, additionalEnvVars);
|
||||
return azToolService.localAz!.postgres.serverarc.update(name, args, namespace, additionalEnvVars);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -127,49 +127,35 @@ export class AzTool implements azExt.IAzApi {
|
||||
};
|
||||
|
||||
public postgres = {
|
||||
arcserver: {
|
||||
serverarc: {
|
||||
delete: (name: string, namespace: string, additionalEnvVars?: azExt.AdditionalEnvVars): Promise<azExt.AzOutput<void>> => {
|
||||
return this.executeCommand<void>(['postgres', 'arc-server', 'delete', '-n', name, '--k8s-namespace', namespace, '--force', '--use-k8s'], additionalEnvVars);
|
||||
return this.executeCommand<void>(['postgres', 'server-arc', 'delete', '-n', name, '--k8s-namespace', namespace, '--force', '--use-k8s'], additionalEnvVars);
|
||||
},
|
||||
list: (namespace: string, additionalEnvVars?: azExt.AdditionalEnvVars): Promise<azExt.AzOutput<azExt.PostgresServerListResult[]>> => {
|
||||
return this.executeCommand<azExt.PostgresServerListResult[]>(['postgres', 'arc-server', 'list', '--k8s-namespace', namespace, '--use-k8s'], additionalEnvVars);
|
||||
return this.executeCommand<azExt.PostgresServerListResult[]>(['postgres', 'server-arc', 'list', '--k8s-namespace', namespace, '--use-k8s'], additionalEnvVars);
|
||||
},
|
||||
show: (name: string, namespace: string, additionalEnvVars?: azExt.AdditionalEnvVars): Promise<azExt.AzOutput<azExt.PostgresServerShowResult>> => {
|
||||
return this.executeCommand<azExt.PostgresServerShowResult>(['postgres', 'arc-server', 'show', '-n', name, '--k8s-namespace', namespace, '--use-k8s'], additionalEnvVars);
|
||||
return this.executeCommand<azExt.PostgresServerShowResult>(['postgres', 'server-arc', 'show', '-n', name, '--k8s-namespace', namespace, '--use-k8s'], additionalEnvVars);
|
||||
},
|
||||
edit: (
|
||||
update: (
|
||||
name: string,
|
||||
args: {
|
||||
adminPassword?: boolean,
|
||||
coresLimit?: string,
|
||||
coresRequest?: string,
|
||||
coordinatorEngineSettings?: string,
|
||||
engineSettings?: string,
|
||||
extensions?: string,
|
||||
memoryLimit?: string,
|
||||
memoryRequest?: string,
|
||||
noWait?: boolean,
|
||||
port?: number,
|
||||
replaceEngineSettings?: boolean,
|
||||
workerEngineSettings?: string,
|
||||
workers?: number
|
||||
port?: number
|
||||
},
|
||||
namespace: string,
|
||||
additionalEnvVars?: azExt.AdditionalEnvVars): Promise<azExt.AzOutput<void>> => {
|
||||
const argsArray = ['postgres', 'arc-server', 'edit', '-n', name, '--k8s-namespace', namespace, '--use-k8s'];
|
||||
if (args.adminPassword) { argsArray.push('--admin-password'); }
|
||||
const argsArray = ['postgres', 'server-arc', 'update', '-n', name, '--k8s-namespace', namespace, '--use-k8s'];
|
||||
if (args.coresLimit) { argsArray.push('--cores-limit', args.coresLimit); }
|
||||
if (args.coresRequest) { argsArray.push('--cores-request', args.coresRequest); }
|
||||
if (args.coordinatorEngineSettings) { argsArray.push('--coordinator-settings', args.coordinatorEngineSettings); }
|
||||
if (args.engineSettings) { argsArray.push('--engine-settings', args.engineSettings); }
|
||||
if (args.extensions) { argsArray.push('--extensions', args.extensions); }
|
||||
if (args.memoryLimit) { argsArray.push('--memory-limit', args.memoryLimit); }
|
||||
if (args.memoryRequest) { argsArray.push('--memory-request', args.memoryRequest); }
|
||||
if (args.noWait) { argsArray.push('--no-wait'); }
|
||||
if (args.port) { argsArray.push('--port', args.port.toString()); }
|
||||
if (args.replaceEngineSettings) { argsArray.push('--replace-settings'); }
|
||||
if (args.workerEngineSettings) { argsArray.push('--worker-settings', args.workerEngineSettings); }
|
||||
if (args.workers !== undefined) { argsArray.push('--workers', args.workers.toString()); }
|
||||
return this.executeCommand<void>(argsArray, additionalEnvVars);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,66 +44,51 @@ describe('az', function () {
|
||||
});
|
||||
|
||||
describe('postgres', function (): void {
|
||||
describe('arc-server', function (): void {
|
||||
describe('server-arc', function (): void {
|
||||
it('delete', async function (): Promise<void> {
|
||||
await azTool.postgres.arcserver.delete(name, namespace);
|
||||
verifyExecuteCommandCalledWithArgs(['postgres', 'arc-server', 'delete', name, '--k8s-namespace', namespace]);
|
||||
await azTool.postgres.serverarc.delete(name, namespace);
|
||||
verifyExecuteCommandCalledWithArgs(['postgres', 'server-arc', 'delete', name, '--k8s-namespace', namespace]);
|
||||
});
|
||||
it('list', async function (): Promise<void> {
|
||||
await azTool.postgres.arcserver.list(namespace);
|
||||
verifyExecuteCommandCalledWithArgs(['postgres', 'arc-server', 'list', '--k8s-namespace', namespace]);
|
||||
await azTool.postgres.serverarc.list(namespace);
|
||||
verifyExecuteCommandCalledWithArgs(['postgres', 'server-arc', 'list', '--k8s-namespace', namespace]);
|
||||
});
|
||||
it('show', async function (): Promise<void> {
|
||||
await azTool.postgres.arcserver.show(name, namespace);
|
||||
verifyExecuteCommandCalledWithArgs(['postgres', 'arc-server', 'show', name, '--k8s-namespace', namespace]);
|
||||
await azTool.postgres.serverarc.show(name, namespace);
|
||||
verifyExecuteCommandCalledWithArgs(['postgres', 'server-arc', 'show', name, '--k8s-namespace', namespace]);
|
||||
});
|
||||
it.skip('edit', async function (): Promise<void> {
|
||||
it.skip('update', async function (): Promise<void> {
|
||||
const args = {
|
||||
adminPassword: true,
|
||||
coresLimit: 'myCoresLimit',
|
||||
coresRequest: 'myCoresRequest',
|
||||
engineSettings: 'myEngineSettings',
|
||||
extensions: 'myExtensions',
|
||||
memoryLimit: 'myMemoryLimit',
|
||||
memoryRequest: 'myMemoryRequest',
|
||||
noWait: true,
|
||||
port: 1337,
|
||||
replaceEngineSettings: true,
|
||||
workers: 2
|
||||
port: 1337
|
||||
};
|
||||
await azTool.postgres.arcserver.edit(name, args, namespace);
|
||||
await azTool.postgres.serverarc.update(name, args, namespace);
|
||||
verifyExecuteCommandCalledWithArgs([
|
||||
'postgres', 'arc-server', 'edit',
|
||||
'postgres', 'server-arc', 'update',
|
||||
name,
|
||||
'--admin-password',
|
||||
args.coresLimit,
|
||||
args.coresRequest,
|
||||
args.engineSettings,
|
||||
args.extensions,
|
||||
args.memoryLimit,
|
||||
args.memoryRequest,
|
||||
'--no-wait',
|
||||
args.port.toString(),
|
||||
'--replace-engine-settings',
|
||||
args.workers.toString()]);
|
||||
args.port.toString()]);
|
||||
});
|
||||
it('edit no optional args', async function (): Promise<void> {
|
||||
await azTool.postgres.arcserver.edit(name, {}, namespace);
|
||||
it('update no optional args', async function (): Promise<void> {
|
||||
await azTool.postgres.serverarc.update(name, {}, namespace);
|
||||
verifyExecuteCommandCalledWithArgs([
|
||||
'postgres', 'arc-server', 'edit',
|
||||
'postgres', 'server-arc', 'update',
|
||||
name]);
|
||||
verifyExecuteCommandCalledWithoutArgs([
|
||||
'--admin-password',
|
||||
'--cores-limit',
|
||||
'--cores-request',
|
||||
'--engine-settings',
|
||||
'--extensions',
|
||||
'--memory-limit',
|
||||
'--memory-request',
|
||||
'--no-wait',
|
||||
'--port',
|
||||
'--replace-engine-settings',
|
||||
'--workers']);
|
||||
'--port']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
13
extensions/azcli/src/typings/az-ext.d.ts
vendored
13
extensions/azcli/src/typings/az-ext.d.ts
vendored
@@ -549,26 +549,19 @@ declare module 'az-ext' {
|
||||
}
|
||||
},
|
||||
postgres: {
|
||||
arcserver: {
|
||||
serverarc: {
|
||||
delete(name: string, namespace?: string, additionalEnvVars?: AdditionalEnvVars): Promise<AzOutput<void>>,
|
||||
list(namespace?: string, additionalEnvVars?: AdditionalEnvVars): Promise<AzOutput<PostgresServerListResult[]>>,
|
||||
show(name: string, namespace?: string, additionalEnvVars?: AdditionalEnvVars): Promise<AzOutput<PostgresServerShowResult>>,
|
||||
edit(
|
||||
update(
|
||||
name: string,
|
||||
args: {
|
||||
adminPassword?: boolean,
|
||||
coresLimit?: string,
|
||||
coresRequest?: string,
|
||||
coordinatorEngineSettings?: string,
|
||||
engineSettings?: string,
|
||||
extensions?: string,
|
||||
memoryLimit?: string,
|
||||
memoryRequest?: string,
|
||||
noWait?: boolean,
|
||||
port?: number,
|
||||
replaceEngineSettings?: boolean,
|
||||
workerEngineSettings?: string,
|
||||
workers?: number
|
||||
port?: number
|
||||
},
|
||||
namespace?: string,
|
||||
additionalEnvVars?: AdditionalEnvVars
|
||||
|
||||
Reference in New Issue
Block a user