mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fixed az sql mi-arc show for indirect scenario (#19378)
* Addressed sql mi show for indirect and direct * Throw error when output is not JSON Co-authored-by: Candice Ye <canye@microsoft.com>
This commit is contained in:
@@ -121,7 +121,7 @@ export class MiaaModel extends ResourceModel {
|
|||||||
}
|
}
|
||||||
this._config = result.stdout;
|
this._config = result.stdout;
|
||||||
this.configLastUpdated = new Date();
|
this.configLastUpdated = new Date();
|
||||||
this.rpSettings.retentionDays = this._config?.properties?.k8SRaw?.spec?.backup?.retentionPeriodInDays?.toString() ?? '';
|
this.rpSettings.retentionDays = this._config?.spec?.backup?.retentionPeriodInDays?.toString() ?? '';
|
||||||
this._onConfigUpdated.fire(this._config);
|
this._onConfigUpdated.fire(this._config);
|
||||||
this._onDatabasesUpdated.fire(this._databases);
|
this._onDatabasesUpdated.fire(this._databases);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -135,7 +135,7 @@ export class MiaaModel extends ResourceModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we have an external endpoint configured then fetch the databases now
|
// If we have an external endpoint configured then fetch the databases now
|
||||||
if (this._config.properties?.k8SRaw?.status.primaryEndpoint) {
|
if (this._config.status.primaryEndpoint) {
|
||||||
this.getDatabases(false).catch(_err => {
|
this.getDatabases(false).catch(_err => {
|
||||||
// If an error occurs still fire the event so callers can know to
|
// If an error occurs still fire the event so callers can know to
|
||||||
// update (e.g. so dashboards don't show the loading icon forever)
|
// update (e.g. so dashboards don't show the loading icon forever)
|
||||||
@@ -217,7 +217,7 @@ export class MiaaModel extends ResourceModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected createConnectionProfile(): azdata.IConnectionProfile {
|
protected createConnectionProfile(): azdata.IConnectionProfile {
|
||||||
const ipAndPort = parseIpAndPort(this.config?.properties?.k8SRaw?.status.primaryEndpoint || '');
|
const ipAndPort = parseIpAndPort(this.config?.status.primaryEndpoint || '');
|
||||||
return {
|
return {
|
||||||
serverName: `${ipAndPort.ip},${ipAndPort.port}`,
|
serverName: `${ipAndPort.ip},${ipAndPort.port}`,
|
||||||
databaseName: '',
|
databaseName: '',
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ export class MiaaBackupsPage extends DashboardPage {
|
|||||||
} else {
|
} else {
|
||||||
// If we don't have an endpoint then there's no point in showing the connect button - but the logic
|
// If we don't have an endpoint then there's no point in showing the connect button - but the logic
|
||||||
// to display text informing the user of this is already handled by the handleMiaaConfigUpdated
|
// to display text informing the user of this is already handled by the handleMiaaConfigUpdated
|
||||||
if (this._miaaModel?.config?.properties?.k8SRaw?.status.primaryEndpoint) {
|
if (this._miaaModel?.config?.status.primaryEndpoint) {
|
||||||
this._connectToServerLoading.loading = false;
|
this._connectToServerLoading.loading = false;
|
||||||
this._connectToServerButton.enabled = true;
|
this._connectToServerButton.enabled = true;
|
||||||
}
|
}
|
||||||
@@ -296,7 +296,7 @@ export class MiaaBackupsPage extends DashboardPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private refreshRD(): void {
|
private refreshRD(): void {
|
||||||
this._saveArgs.retentionDays = this._miaaModel.config?.properties?.k8SRaw?.spec?.backup?.retentionPeriodInDays.toString() ?? '';
|
this._saveArgs.retentionDays = this._miaaModel.config?.spec?.backup?.retentionPeriodInDays.toString() ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create restore button for every database entry in the database table
|
// Create restore button for every database entry in the database table
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ export class MiaaComputeAndStoragePage extends DashboardPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private editCores(): void {
|
private editCores(): void {
|
||||||
let currentCPUSize = this._miaaModel.config?.properties?.k8SRaw?.spec?.scheduling?.default?.resources?.requests?.cpu;
|
let currentCPUSize = this._miaaModel.config?.spec?.scheduling?.default?.resources?.requests?.cpu;
|
||||||
|
|
||||||
if (!currentCPUSize) {
|
if (!currentCPUSize) {
|
||||||
currentCPUSize = '';
|
currentCPUSize = '';
|
||||||
@@ -340,7 +340,7 @@ export class MiaaComputeAndStoragePage extends DashboardPage {
|
|||||||
this.coresRequestBox!.value = '';
|
this.coresRequestBox!.value = '';
|
||||||
this.saveArgs.coresRequest = undefined;
|
this.saveArgs.coresRequest = undefined;
|
||||||
|
|
||||||
currentCPUSize = this._miaaModel.config?.properties?.k8SRaw?.spec?.scheduling?.default?.resources?.limits?.cpu;
|
currentCPUSize = this._miaaModel.config?.spec?.scheduling?.default?.resources?.limits?.cpu;
|
||||||
|
|
||||||
if (!currentCPUSize) {
|
if (!currentCPUSize) {
|
||||||
currentCPUSize = '';
|
currentCPUSize = '';
|
||||||
@@ -353,7 +353,7 @@ export class MiaaComputeAndStoragePage extends DashboardPage {
|
|||||||
|
|
||||||
private editMemory(): void {
|
private editMemory(): void {
|
||||||
let currentMemSizeConversion: string;
|
let currentMemSizeConversion: string;
|
||||||
let currentMemorySize = this._miaaModel.config?.properties?.k8SRaw?.spec?.scheduling?.default?.resources?.requests?.memory;
|
let currentMemorySize = this._miaaModel.config?.spec?.scheduling?.default?.resources?.requests?.memory;
|
||||||
|
|
||||||
if (!currentMemorySize) {
|
if (!currentMemorySize) {
|
||||||
currentMemSizeConversion = '';
|
currentMemSizeConversion = '';
|
||||||
@@ -366,7 +366,7 @@ export class MiaaComputeAndStoragePage extends DashboardPage {
|
|||||||
|
|
||||||
this.saveArgs.memoryRequest = undefined;
|
this.saveArgs.memoryRequest = undefined;
|
||||||
|
|
||||||
currentMemorySize = this._miaaModel.config?.properties?.k8SRaw?.spec?.scheduling?.default?.resources?.limits?.memory;
|
currentMemorySize = this._miaaModel.config?.spec?.scheduling?.default?.resources?.limits?.memory;
|
||||||
|
|
||||||
if (!currentMemorySize) {
|
if (!currentMemorySize) {
|
||||||
currentMemSizeConversion = '';
|
currentMemSizeConversion = '';
|
||||||
|
|||||||
@@ -74,11 +74,11 @@ export class MiaaConnectionStringsPage extends DashboardPage {
|
|||||||
|
|
||||||
private getConnectionStrings(): KeyValue[] {
|
private getConnectionStrings(): KeyValue[] {
|
||||||
const config = this._miaaModel.config;
|
const config = this._miaaModel.config;
|
||||||
if (!config?.properties?.k8SRaw?.status.primaryEndpoint) {
|
if (!config?.status.primaryEndpoint) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const externalEndpoint = parseIpAndPort(config.properties?.k8SRaw?.status.primaryEndpoint);
|
const externalEndpoint = parseIpAndPort(config.status.primaryEndpoint);
|
||||||
const username = this._miaaModel.username ?? '{your_username_here}';
|
const username = this._miaaModel.username ?? '{your_username_here}';
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@@ -97,7 +97,7 @@ $conn = sqlsrv_connect($serverName, $connectionInfo);`),
|
|||||||
}
|
}
|
||||||
|
|
||||||
private updateConnectionStrings(): void {
|
private updateConnectionStrings(): void {
|
||||||
this._connectionStringsMessage.value = !this._miaaModel.config?.properties?.k8SRaw?.status.primaryEndpoint ? loc.noExternalEndpoint : '';
|
this._connectionStringsMessage.value = !this._miaaModel.config?.status.primaryEndpoint ? loc.noExternalEndpoint : '';
|
||||||
this._keyValueContainer.refresh(this.getConnectionStrings());
|
this._keyValueContainer.refresh(this.getConnectionStrings());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -335,11 +335,11 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
|||||||
|
|
||||||
private handleMiaaConfigUpdated(): void {
|
private handleMiaaConfigUpdated(): void {
|
||||||
if (this._miaaModel.config) {
|
if (this._miaaModel.config) {
|
||||||
this._instanceProperties.status = this._miaaModel.config.properties?.k8SRaw?.status.state || '-';
|
this._instanceProperties.status = this._miaaModel.config.status.state || '-';
|
||||||
this._instanceProperties.externalEndpoint = this._miaaModel.config.properties?.k8SRaw?.status.primaryEndpoint || loc.notConfigured;
|
this._instanceProperties.externalEndpoint = this._miaaModel.config.status.primaryEndpoint || loc.notConfigured;
|
||||||
this._instanceProperties.vCores = this._miaaModel.config.properties?.k8SRaw?.spec?.scheduling?.default?.resources?.limits?.cpu?.toString() || '';
|
this._instanceProperties.vCores = this._miaaModel.config.spec?.scheduling?.default?.resources?.limits?.cpu?.toString() || '';
|
||||||
this._databasesMessage.value = !this._miaaModel.config.properties?.k8SRaw?.status.primaryEndpoint ? loc.noExternalEndpoint : '';
|
this._databasesMessage.value = !this._miaaModel.config.status.primaryEndpoint ? loc.noExternalEndpoint : '';
|
||||||
if (!this._miaaModel.config.properties?.k8SRaw?.status.primaryEndpoint) {
|
if (!this._miaaModel.config.status.primaryEndpoint) {
|
||||||
this._databasesContainer.removeItem(this._connectToServerLoading);
|
this._databasesContainer.removeItem(this._connectToServerLoading);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -368,7 +368,7 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
|||||||
} else {
|
} else {
|
||||||
// If we don't have an endpoint then there's no point in showing the connect button - but the logic
|
// If we don't have an endpoint then there's no point in showing the connect button - but the logic
|
||||||
// to display text informing the user of this is already handled by the handleMiaaConfigUpdated
|
// to display text informing the user of this is already handled by the handleMiaaConfigUpdated
|
||||||
if (this._miaaModel?.config?.properties?.k8SRaw?.status.primaryEndpoint) {
|
if (this._miaaModel?.config?.status.primaryEndpoint) {
|
||||||
this._connectToServerLoading.loading = false;
|
this._connectToServerLoading.loading = false;
|
||||||
this._connectToServerButton.enabled = true;
|
this._connectToServerButton.enabled = true;
|
||||||
}
|
}
|
||||||
@@ -419,12 +419,12 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
|||||||
|
|
||||||
private refreshDashboardLinks(): void {
|
private refreshDashboardLinks(): void {
|
||||||
if (this._miaaModel.config) {
|
if (this._miaaModel.config) {
|
||||||
const kibanaUrl = this._miaaModel.config.properties?.k8SRaw?.status.logSearchDashboard ?? '';
|
const kibanaUrl = this._miaaModel.config.status.logSearchDashboard ?? '';
|
||||||
this._kibanaLink.label = kibanaUrl;
|
this._kibanaLink.label = kibanaUrl;
|
||||||
this._kibanaLink.url = kibanaUrl;
|
this._kibanaLink.url = kibanaUrl;
|
||||||
this._kibanaLoading!.loading = false;
|
this._kibanaLoading!.loading = false;
|
||||||
|
|
||||||
const grafanaUrl = this._miaaModel.config.properties?.k8SRaw?.status.metricsDashboard ?? '';
|
const grafanaUrl = this._miaaModel.config.status.metricsDashboard ?? '';
|
||||||
this._grafanaLink.label = grafanaUrl;
|
this._grafanaLink.label = grafanaUrl;
|
||||||
this._grafanaLink.url = grafanaUrl;
|
this._grafanaLink.url = grafanaUrl;
|
||||||
this._grafanaLoading!.loading = false;
|
this._grafanaLoading!.loading = false;
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ export class MiaaUpgradeManagementPage extends DashboardPage {
|
|||||||
this._controllerModel.azAdditionalEnvVars
|
this._controllerModel.azAdditionalEnvVars
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return miaaShowResult.stdout.properties.k8SRaw.status.runningVersion;
|
return miaaShowResult.stdout.status.runningVersion;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(loc.showMiaaError, e);
|
console.error(loc.showMiaaError, e);
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export class ConfigureRPOSqlDialog extends InitializingComponent {
|
|||||||
public showDialog(dialogTitle: string, retentionDays: string | undefined): azdata.window.Dialog {
|
public showDialog(dialogTitle: string, retentionDays: string | undefined): azdata.window.Dialog {
|
||||||
const dialog = azdata.window.createModelViewDialog(dialogTitle);
|
const dialog = azdata.window.createModelViewDialog(dialogTitle);
|
||||||
dialog.cancelButton.onClick(() => this.handleCancel());
|
dialog.cancelButton.onClick(() => this.handleCancel());
|
||||||
retentionDays = (retentionDays === undefined ? this._model.config?.properties?.k8SRaw?.spec?.backup?.retentionPeriodInDays?.toString() : retentionDays);
|
retentionDays = (retentionDays === undefined ? this._model.config?.spec?.backup?.retentionPeriodInDays?.toString() : retentionDays);
|
||||||
dialog.registerContent(async view => {
|
dialog.registerContent(async view => {
|
||||||
this.modelBuilder = view.modelBuilder;
|
this.modelBuilder = view.modelBuilder;
|
||||||
this.retentionDaysInputBox = this.modelBuilder.inputBox()
|
this.retentionDaysInputBox = this.modelBuilder.inputBox()
|
||||||
|
|||||||
@@ -193,12 +193,14 @@ export class AzTool implements azExt.IAzApi {
|
|||||||
additionalEnvVars?: azExt.AdditionalEnvVars
|
additionalEnvVars?: azExt.AdditionalEnvVars
|
||||||
): Promise<azExt.AzOutput<azExt.SqlMiShowResult>> => {
|
): Promise<azExt.AzOutput<azExt.SqlMiShowResult>> => {
|
||||||
const argsArray = ['sql', 'mi-arc', 'show', '-n', name];
|
const argsArray = ['sql', 'mi-arc', 'show', '-n', name];
|
||||||
if (args.resourceGroup) { argsArray.push('--resource-group', args.resourceGroup); }
|
if (args.resourceGroup) {
|
||||||
|
argsArray.push('--resource-group', args.resourceGroup);
|
||||||
|
}
|
||||||
if (args.namespace) {
|
if (args.namespace) {
|
||||||
argsArray.push('--k8s-namespace', args.namespace);
|
argsArray.push('--k8s-namespace', args.namespace);
|
||||||
argsArray.push('--use-k8s');
|
argsArray.push('--use-k8s');
|
||||||
}
|
}
|
||||||
return this.executeCommand<azExt.SqlMiShowResult>(argsArray, additionalEnvVars);
|
return this.executeSqlMiShow(argsArray, additionalEnvVars);
|
||||||
},
|
},
|
||||||
update: (
|
update: (
|
||||||
name: string,
|
name: string,
|
||||||
@@ -301,6 +303,64 @@ export class AzTool implements azExt.IAzApi {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes az sql mi-arc show and returns a normalized object, SqlMiShowResult, regardless of the indirect or direct mode raw output shape.
|
||||||
|
* @param args The args to pass to az
|
||||||
|
* @param additionalEnvVars Additional environment variables to set for this execution
|
||||||
|
*/
|
||||||
|
public async executeSqlMiShow(args: string[], additionalEnvVars?: azExt.AdditionalEnvVars): Promise<azExt.AzOutput<azExt.SqlMiShowResult>> {
|
||||||
|
try {
|
||||||
|
const result = await executeAzCommand(`"${this._path}"`, args.concat(['--output', 'json']), additionalEnvVars);
|
||||||
|
|
||||||
|
let stdout = <unknown>result.stdout;
|
||||||
|
let stderr = <unknown>result.stderr;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Automatically try parsing the JSON. This is expected to fail for some az commands such as resource delete.
|
||||||
|
stdout = JSON.parse(result.stdout);
|
||||||
|
} catch (err) {
|
||||||
|
// If the output was not pure JSON, catch the error and log it here.
|
||||||
|
Logger.log(loc.azOutputParseErrorCaught(args.concat(['--output', 'json']).toString()));
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((<azExt.SqlMiShowResultDirect>stdout).properties) {
|
||||||
|
// Then it is direct mode
|
||||||
|
return {
|
||||||
|
stdout: {
|
||||||
|
name: (<azExt.SqlMiShowResultDirect>stdout).name,
|
||||||
|
spec: (<azExt.SqlMiShowResultDirect>stdout).properties.k8SRaw.spec,
|
||||||
|
status: (<azExt.SqlMiShowResultDirect>stdout).properties.k8SRaw.status
|
||||||
|
},
|
||||||
|
stderr: <string[]>stderr
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// It must be indirect mode
|
||||||
|
return {
|
||||||
|
stdout: {
|
||||||
|
name: (<azExt.SqlMiShowResultIndirect>stdout).metadata.name,
|
||||||
|
spec: (<azExt.SqlMiShowResultIndirect>stdout).spec,
|
||||||
|
status: (<azExt.SqlMiShowResultIndirect>stdout).status
|
||||||
|
},
|
||||||
|
stderr: <string[]>stderr
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
if (err instanceof ExitCodeError) {
|
||||||
|
try {
|
||||||
|
await fs.promises.access(this._path);
|
||||||
|
//this.path exists
|
||||||
|
} catch (e) {
|
||||||
|
// this.path does not exist
|
||||||
|
await vscode.commands.executeCommand('setContext', azFound, false);
|
||||||
|
throw new NoAzureCLIError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes the specified az command.
|
* Executes the specified az command.
|
||||||
* @param args The args to pass to az
|
* @param args The args to pass to az
|
||||||
|
|||||||
128
extensions/azcli/src/typings/az-ext.d.ts
vendored
128
extensions/azcli/src/typings/az-ext.d.ts
vendored
@@ -137,53 +137,89 @@ declare module 'az-ext' {
|
|||||||
port?: number // 5432
|
port?: number // 5432
|
||||||
}
|
}
|
||||||
|
|
||||||
// export interface SqlMiShowResult {
|
|
||||||
// apiVersion: string, // "sql.arcdata.microsoft.com/v1alpha1"
|
|
||||||
// kind: string, // "sqlmanagedinstance"
|
|
||||||
// metadata: {
|
|
||||||
// creationTimestamp: string, // "2020-08-19T17:35:45Z"
|
|
||||||
// generation: number, // 1
|
|
||||||
// name: string, // "miaa-instance"
|
|
||||||
// namespace: string, // "arc"
|
|
||||||
// resourceVersion: string, // "202623"
|
|
||||||
// selfLink: string, // "/apis/sql.arcdata.microsoft.com/v1alpha1/namespaces/arc/sqlmanagedinstances/miaa-instance"
|
|
||||||
// uid: string // "cea737aa-3f82-4f6a-9bed-2b51c2c33dff"
|
|
||||||
// },
|
|
||||||
// spec: {
|
|
||||||
// backup?: {
|
|
||||||
// retentionPeriodInDays: number, // 1
|
|
||||||
// }
|
|
||||||
// scheduling?: {
|
|
||||||
// default?: {
|
|
||||||
// resources?: {
|
|
||||||
// limits?: SchedulingOptions,
|
|
||||||
// requests?: SchedulingOptions
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// services: {
|
|
||||||
// primary: ServiceSpec
|
|
||||||
// }
|
|
||||||
// storage: {
|
|
||||||
// data: {
|
|
||||||
// volumes: StorageVolume[]
|
|
||||||
// },
|
|
||||||
// logs: {
|
|
||||||
// volumes: StorageVolume[]
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// status: {
|
|
||||||
// readyReplicas: string, // "1/1"
|
|
||||||
// state: string, // "Ready",
|
|
||||||
// logSearchDashboard: string, // https://127.0.0.1:30777/kibana/app/kibana#/discover?_a=(query:(language:kuery,query:'custom_resource_name:miaa1'))
|
|
||||||
// metricsDashboard: string, // https://127.0.0.1:30777/grafana/d/40q72HnGk/sql-managed-instance-metrics?var-hostname=miaa1-0
|
|
||||||
// primaryEndpoint?: string // "10.91.86.39:32718"
|
|
||||||
// runningVersion: string // "v1.5.0_2022-04-05"
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
export interface SqlMiShowResult {
|
export interface SqlMiShowResult {
|
||||||
|
name: string, // "miaa-instance"
|
||||||
|
spec: {
|
||||||
|
backup?: {
|
||||||
|
retentionPeriodInDays: number, // 1
|
||||||
|
}
|
||||||
|
scheduling?: {
|
||||||
|
default?: {
|
||||||
|
resources?: {
|
||||||
|
limits?: SchedulingOptions,
|
||||||
|
requests?: SchedulingOptions
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
services: {
|
||||||
|
primary: ServiceSpec
|
||||||
|
}
|
||||||
|
storage: {
|
||||||
|
data: {
|
||||||
|
volumes: StorageVolume[]
|
||||||
|
},
|
||||||
|
logs: {
|
||||||
|
volumes: StorageVolume[]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
status: {
|
||||||
|
readyReplicas: string, // "1/1"
|
||||||
|
state: string, // "Ready",
|
||||||
|
logSearchDashboard: string, // https://127.0.0.1:30777/kibana/app/kibana#/discover?_a=(query:(language:kuery,query:'custom_resource_name:miaa1'))
|
||||||
|
metricsDashboard: string, // https://127.0.0.1:30777/grafana/d/40q72HnGk/sql-managed-instance-metrics?var-hostname=miaa1-0
|
||||||
|
primaryEndpoint?: string // "10.91.86.39:32718"
|
||||||
|
runningVersion: string // "v1.5.0_2022-04-05"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SqlMiShowResultIndirect {
|
||||||
|
apiVersion: string, // "sql.arcdata.microsoft.com/v1alpha1"
|
||||||
|
kind: string, // "sqlmanagedinstance"
|
||||||
|
metadata: {
|
||||||
|
creationTimestamp: string, // "2020-08-19T17:35:45Z"
|
||||||
|
generation: number, // 1
|
||||||
|
name: string, // "miaa-instance"
|
||||||
|
namespace: string, // "arc"
|
||||||
|
resourceVersion: string, // "202623"
|
||||||
|
selfLink: string, // "/apis/sql.arcdata.microsoft.com/v1alpha1/namespaces/arc/sqlmanagedinstances/miaa-instance"
|
||||||
|
uid: string // "cea737aa-3f82-4f6a-9bed-2b51c2c33dff"
|
||||||
|
},
|
||||||
|
spec: {
|
||||||
|
backup?: {
|
||||||
|
retentionPeriodInDays: number, // 1
|
||||||
|
}
|
||||||
|
scheduling?: {
|
||||||
|
default?: {
|
||||||
|
resources?: {
|
||||||
|
limits?: SchedulingOptions,
|
||||||
|
requests?: SchedulingOptions
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
services: {
|
||||||
|
primary: ServiceSpec
|
||||||
|
}
|
||||||
|
storage: {
|
||||||
|
data: {
|
||||||
|
volumes: StorageVolume[]
|
||||||
|
},
|
||||||
|
logs: {
|
||||||
|
volumes: StorageVolume[]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
status: {
|
||||||
|
readyReplicas: string, // "1/1"
|
||||||
|
state: string, // "Ready",
|
||||||
|
logSearchDashboard: string, // https://127.0.0.1:30777/kibana/app/kibana#/discover?_a=(query:(language:kuery,query:'custom_resource_name:miaa1'))
|
||||||
|
metricsDashboard: string, // https://127.0.0.1:30777/grafana/d/40q72HnGk/sql-managed-instance-metrics?var-hostname=miaa1-0
|
||||||
|
primaryEndpoint?: string // "10.91.86.39:32718"
|
||||||
|
runningVersion: string // "v1.5.0_2022-04-05"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SqlMiShowResultDirect {
|
||||||
extendedLocation: {
|
extendedLocation: {
|
||||||
name: string, // /subscriptions/a2382b66-3h2k-3h2k-2gdd-8ef45dgfdc33/resourcegroups/name-rg/providers/microsoft.extendedlocation/customlocations/custom-loc,
|
name: string, // /subscriptions/a2382b66-3h2k-3h2k-2gdd-8ef45dgfdc33/resourcegroups/name-rg/providers/microsoft.extendedlocation/customlocations/custom-loc,
|
||||||
type: string, // CustomLocation
|
type: string, // CustomLocation
|
||||||
|
|||||||
Reference in New Issue
Block a user