mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Status dictionary update for MIAA (#21050)
* Status update for miaa structure * Added examples in comments Co-authored-by: Candice Ye <canye@microsoft.com>
This commit is contained in:
@@ -123,7 +123,7 @@ export class MiaaModel extends ResourceModel {
|
||||
}
|
||||
|
||||
// If we have an external endpoint configured then fetch the databases now
|
||||
if (this._config.status.primaryEndpoint) {
|
||||
if (this._config.status.endpoints.primaryEndpoint) {
|
||||
this.getDatabases(false).catch(_err => {
|
||||
// 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)
|
||||
@@ -205,7 +205,7 @@ export class MiaaModel extends ResourceModel {
|
||||
}
|
||||
|
||||
protected createConnectionProfile(): azdata.IConnectionProfile {
|
||||
const ipAndPort = parseIpAndPort(this.config?.status.primaryEndpoint || '');
|
||||
const ipAndPort = parseIpAndPort(this.config?.status.endpoints.primaryEndpoint || '');
|
||||
return {
|
||||
serverName: `${ipAndPort.ip},${ipAndPort.port}`,
|
||||
databaseName: '',
|
||||
|
||||
@@ -278,7 +278,7 @@ export class MiaaBackupsPage extends DashboardPage {
|
||||
} else {
|
||||
// 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
|
||||
if (this._miaaModel?.config?.status.primaryEndpoint) {
|
||||
if (this._miaaModel?.config?.status.endpoints.primaryEndpoint) {
|
||||
this._connectToServerLoading.loading = false;
|
||||
this._connectToServerButton.enabled = true;
|
||||
}
|
||||
|
||||
@@ -74,11 +74,11 @@ export class MiaaConnectionStringsPage extends DashboardPage {
|
||||
|
||||
private getConnectionStrings(): KeyValue[] {
|
||||
const config = this._miaaModel.config;
|
||||
if (!config?.status.primaryEndpoint) {
|
||||
if (!config?.status.endpoints.primaryEndpoint) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const externalEndpoint = parseIpAndPort(config.status.primaryEndpoint);
|
||||
const externalEndpoint = parseIpAndPort(config.status.endpoints.primaryEndpoint);
|
||||
const username = this._miaaModel.username ?? '{your_username_here}';
|
||||
|
||||
return [
|
||||
@@ -97,7 +97,7 @@ $conn = sqlsrv_connect($serverName, $connectionInfo);`),
|
||||
}
|
||||
|
||||
private updateConnectionStrings(): void {
|
||||
this._connectionStringsMessage.value = !this._miaaModel.config?.status.primaryEndpoint ? loc.noExternalEndpoint : '';
|
||||
this._connectionStringsMessage.value = !this._miaaModel.config?.status.endpoints.primaryEndpoint ? loc.noExternalEndpoint : '';
|
||||
this._keyValueContainer.refresh(this.getConnectionStrings());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,10 +343,10 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
||||
private handleMiaaConfigUpdated(): void {
|
||||
if (this._miaaModel.config) {
|
||||
this._instanceProperties.status = this._miaaModel.config.status.state || '-';
|
||||
this._instanceProperties.externalEndpoint = this._miaaModel.config.status.primaryEndpoint || loc.notConfigured;
|
||||
this._instanceProperties.externalEndpoint = this._miaaModel.config.status.endpoints.primaryEndpoint || loc.notConfigured;
|
||||
this._instanceProperties.vCores = this._miaaModel.config.spec?.scheduling?.default?.resources?.limits?.cpu?.toString() || '';
|
||||
this._databasesMessage.value = !this._miaaModel.config.status.primaryEndpoint ? loc.noExternalEndpoint : '';
|
||||
if (!this._miaaModel.config.status.primaryEndpoint) {
|
||||
this._databasesMessage.value = !this._miaaModel.config.status.endpoints.primaryEndpoint ? loc.noExternalEndpoint : '';
|
||||
if (!this._miaaModel.config.status.endpoints.primaryEndpoint) {
|
||||
this._databasesContainer.removeItem(this._connectToServerLoading);
|
||||
}
|
||||
}
|
||||
@@ -375,7 +375,7 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
||||
} else {
|
||||
// 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
|
||||
if (this._miaaModel?.config?.status.primaryEndpoint) {
|
||||
if (this._miaaModel?.config?.status.endpoints.primaryEndpoint) {
|
||||
this._connectToServerLoading.loading = false;
|
||||
this._connectToServerButton.enabled = true;
|
||||
}
|
||||
@@ -426,12 +426,12 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
||||
|
||||
private refreshDashboardLinks(): void {
|
||||
if (this._miaaModel.config) {
|
||||
const kibanaUrl = this._miaaModel.config.status.logSearchDashboard ?? '';
|
||||
const kibanaUrl = this._miaaModel.config.status.endpoints.logSearchDashboard ?? '';
|
||||
this._kibanaLink.label = kibanaUrl;
|
||||
this._kibanaLink.url = kibanaUrl;
|
||||
this._kibanaLoading!.loading = false;
|
||||
|
||||
const grafanaUrl = this._miaaModel.config.status.metricsDashboard ?? '';
|
||||
const grafanaUrl = this._miaaModel.config.status.endpoints.metricsDashboard ?? '';
|
||||
this._grafanaLink.label = grafanaUrl;
|
||||
this._grafanaLink.url = grafanaUrl;
|
||||
this._grafanaLoading!.loading = false;
|
||||
|
||||
69
extensions/azcli/src/typings/az-ext.d.ts
vendored
69
extensions/azcli/src/typings/az-ext.d.ts
vendored
@@ -171,12 +171,26 @@ declare module 'az-ext' {
|
||||
}
|
||||
},
|
||||
status: {
|
||||
readyReplicas: string, // "1/1"
|
||||
state: string, // "Ready",
|
||||
endpoints: {
|
||||
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
|
||||
mirroring: string, // 10.91.90.25:3448
|
||||
primaryEndpoint?: string // "10.91.86.39:32718"
|
||||
runningVersion: string // "v1.5.0_2022-04-05"
|
||||
},
|
||||
highAvailability: {
|
||||
lastUpdateTime: string, // "2022-02-07T06:08:20.500688Z"
|
||||
mirroringCertificate: string // "-----BEGIN CERTIFICATE-----****-----END CERTIFICATE-----\n"
|
||||
},
|
||||
lastUpdateTime: string, // "2022-02-07T06:08:20.500688Z"
|
||||
observedGeneration: string, // 1
|
||||
roles: {
|
||||
sql: {
|
||||
lastUpdateTime: string, // "2022-02-07T06:08:20.500688Z"
|
||||
readyReplicas: string // "1/1"
|
||||
}
|
||||
},
|
||||
runningVersion: string, // "v1.5.0_2022-04-05"
|
||||
state: string // "Ready",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,12 +233,26 @@ declare module 'az-ext' {
|
||||
}
|
||||
},
|
||||
status: {
|
||||
readyReplicas: string, // "1/1"
|
||||
state: string, // "Ready",
|
||||
endpoints: {
|
||||
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
|
||||
mirroring: string, // 10.91.90.25:3448
|
||||
primaryEndpoint?: string // "10.91.86.39:32718"
|
||||
runningVersion: string // "v1.5.0_2022-04-05"
|
||||
},
|
||||
highAvailability: {
|
||||
lastUpdateTime: string, // "2022-02-07T06:08:20.500688Z"
|
||||
mirroringCertificate: string // "-----BEGIN CERTIFICATE-----****-----END CERTIFICATE-----\n"
|
||||
},
|
||||
lastUpdateTime: string, // "2022-02-07T06:08:20.500688Z"
|
||||
observedGeneration: string, // 1
|
||||
roles: {
|
||||
sql: {
|
||||
lastUpdateTime: string, // "2022-02-07T06:08:20.500688Z"
|
||||
readyReplicas: string // "1/1"
|
||||
}
|
||||
},
|
||||
runningVersion: string, // "v1.5.0_2022-04-05"
|
||||
state: string // "Ready",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,30 +372,25 @@ declare module 'az-ext' {
|
||||
},
|
||||
status: {
|
||||
endpoints: {
|
||||
logSearchDashboard: string, // https://localhost:12345/app/kibana#/discover?_a=(query:(language:kuery,query:'custom_resource_name:sql1')),
|
||||
metricsDashboard: string, // https://12.123.1.4:12345/d/sdfgwseg/sql-managed-instance-metrics?var-hostname=sql1-0,
|
||||
mirroring: string, // 10.224.0.4:32040,
|
||||
primary: string, // 10.224.0.4,32477
|
||||
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
|
||||
mirroring: string, // 10.91.90.25:3448
|
||||
primaryEndpoint?: string // "10.91.86.39:32718"
|
||||
},
|
||||
highAvailability: {
|
||||
lastUpdateTime: string, // 2022-05-09T23:40:19.626856Z,
|
||||
mirroringCertificate: string,
|
||||
lastUpdateTime: string, // "2022-02-07T06:08:20.500688Z"
|
||||
mirroringCertificate: string // "-----BEGIN CERTIFICATE-----****-----END CERTIFICATE-----\n"
|
||||
},
|
||||
lastUpdateTime: string, // 2022-05-09T23:41:00.137919Z,
|
||||
logSearchDashboard: string,
|
||||
metricsDashboard: string,
|
||||
observedGeneration: number, // 1,
|
||||
primaryEndpoint: string, // 10.224.0.4,32477,
|
||||
readyReplicas: string, // 1/1,
|
||||
lastUpdateTime: string, // "2022-02-07T06:08:20.500688Z"
|
||||
observedGeneration: string, // 1
|
||||
roles: {
|
||||
sql: {
|
||||
lastUpdateTime: string, // 2022-05-09T23:39:53.364002Z,
|
||||
readyReplicas: number, // 1,
|
||||
replicas: number, // 1
|
||||
lastUpdateTime: string, // "2022-02-07T06:08:20.500688Z"
|
||||
readyReplicas: string // "1/1"
|
||||
}
|
||||
},
|
||||
runningVersion: string, // v1.4.0_2022-02-25,
|
||||
state: string, // Ready
|
||||
runningVersion: string, // "v1.5.0_2022-04-05"
|
||||
state: string // "Ready",
|
||||
}
|
||||
},
|
||||
lastUploadedDate: string, // null,
|
||||
|
||||
Reference in New Issue
Block a user