mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 17:23:40 -05:00
Converting all SQL MIAA commands to use K8s API commands (#20203)
* refresh does not differentiate direct vs indirect * For direct mode MIAA commands, always use --use-k8s * Changed comment language to use ARM instead of direct and K8S API instead of indirect Co-authored-by: Candice Ye <canye@microsoft.com>
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
import { ControllerInfo, ResourceType } from 'arc';
|
||||
import * as azExt from 'az-ext';
|
||||
import * as vscode from 'vscode';
|
||||
import { ConnectionMode } from '../constants';
|
||||
import * as loc from '../localizedConstants';
|
||||
import { AzureArcTreeDataProvider } from '../ui/tree/azureArcTreeDataProvider';
|
||||
|
||||
@@ -69,15 +68,6 @@ export class ControllerModel {
|
||||
}
|
||||
|
||||
public async refresh(showErrors: boolean = true, namespace: string): Promise<void> {
|
||||
await this.refreshController(showErrors, namespace);
|
||||
if (this._controllerConfig?.spec.settings.azure.connectionMode.toLowerCase() === ConnectionMode.direct) {
|
||||
await this.refreshDirectMode(this._controllerConfig?.spec.settings.azure.resourceGroup, namespace);
|
||||
} else {
|
||||
await this.refreshIndirectMode(namespace);
|
||||
}
|
||||
}
|
||||
|
||||
public async refreshController(showErrors: boolean = true, namespace: string): Promise<void> {
|
||||
await Promise.all([
|
||||
this._azApi.az.arcdata.dc.config.show(namespace, this.azAdditionalEnvVars).then(result => {
|
||||
this._controllerConfig = result.stdout;
|
||||
@@ -108,38 +98,6 @@ export class ControllerModel {
|
||||
throw err;
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
public async refreshDirectMode(resourceGroup: string, namespace: string): Promise<void> {
|
||||
const newRegistrations: Registration[] = [];
|
||||
await Promise.all([
|
||||
this._azApi.az.postgres.arcserver.list(namespace, this.azAdditionalEnvVars).then(result => {
|
||||
newRegistrations.push(...result.stdout.map(r => {
|
||||
return {
|
||||
instanceName: r.name,
|
||||
state: r.state,
|
||||
instanceType: ResourceType.postgresInstances
|
||||
};
|
||||
}));
|
||||
}),
|
||||
this._azApi.az.sql.miarc.list({ resourceGroup: resourceGroup, namespace: undefined }, this.azAdditionalEnvVars).then(result => {
|
||||
newRegistrations.push(...result.stdout.map(r => {
|
||||
return {
|
||||
instanceName: r.name,
|
||||
state: r.state,
|
||||
instanceType: ResourceType.sqlManagedInstances
|
||||
};
|
||||
}));
|
||||
|
||||
})
|
||||
]).then(() => {
|
||||
this._registrations = newRegistrations;
|
||||
this.registrationsLastUpdated = new Date();
|
||||
this._onRegistrationsUpdated.fire(this._registrations);
|
||||
});
|
||||
}
|
||||
|
||||
public async refreshIndirectMode(namespace: string): Promise<void> {
|
||||
const newRegistrations: Registration[] = [];
|
||||
await Promise.all([
|
||||
this._azApi.az.postgres.arcserver.list(namespace, this.azAdditionalEnvVars).then(result => {
|
||||
|
||||
Reference in New Issue
Block a user