Change primaryEndpoints to primary (#21079)

* Status update for miaa structure

* Added examples in comments

* Changed primaryEndpoint to primary

Co-authored-by: Candice Ye <canye@microsoft.com>
This commit is contained in:
Candice Ye
2022-11-02 14:06:56 -07:00
committed by GitHub
parent 64f40a56d8
commit f6dbe7539c
5 changed files with 13 additions and 13 deletions

View File

@@ -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.endpoints.primaryEndpoint) {
if (this._config.status.endpoints.primary) {
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.endpoints.primaryEndpoint || '');
const ipAndPort = parseIpAndPort(this.config?.status.endpoints.primary || '');
return {
serverName: `${ipAndPort.ip},${ipAndPort.port}`,
databaseName: '',

View File

@@ -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.endpoints.primaryEndpoint) {
if (this._miaaModel?.config?.status.endpoints.primary) {
this._connectToServerLoading.loading = false;
this._connectToServerButton.enabled = true;
}

View File

@@ -74,11 +74,11 @@ export class MiaaConnectionStringsPage extends DashboardPage {
private getConnectionStrings(): KeyValue[] {
const config = this._miaaModel.config;
if (!config?.status.endpoints.primaryEndpoint) {
if (!config?.status.endpoints.primary) {
return [];
}
const externalEndpoint = parseIpAndPort(config.status.endpoints.primaryEndpoint);
const externalEndpoint = parseIpAndPort(config.status.endpoints.primary);
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.endpoints.primaryEndpoint ? loc.noExternalEndpoint : '';
this._connectionStringsMessage.value = !this._miaaModel.config?.status.endpoints.primary ? loc.noExternalEndpoint : '';
this._keyValueContainer.refresh(this.getConnectionStrings());
}
}

View File

@@ -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.endpoints.primaryEndpoint || loc.notConfigured;
this._instanceProperties.externalEndpoint = this._miaaModel.config.status.endpoints.primary || loc.notConfigured;
this._instanceProperties.vCores = this._miaaModel.config.spec?.scheduling?.default?.resources?.limits?.cpu?.toString() || '';
this._databasesMessage.value = !this._miaaModel.config.status.endpoints.primaryEndpoint ? loc.noExternalEndpoint : '';
if (!this._miaaModel.config.status.endpoints.primaryEndpoint) {
this._databasesMessage.value = !this._miaaModel.config.status.endpoints.primary ? loc.noExternalEndpoint : '';
if (!this._miaaModel.config.status.endpoints.primary) {
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.endpoints.primaryEndpoint) {
if (this._miaaModel?.config?.status.endpoints.primary) {
this._connectToServerLoading.loading = false;
this._connectToServerButton.enabled = true;
}

View File

@@ -175,7 +175,7 @@ declare module 'az-ext' {
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"
primary?: string // "10.91.86.39:32718"
},
highAvailability: {
lastUpdateTime: string, // "2022-02-07T06:08:20.500688Z"
@@ -237,7 +237,7 @@ declare module 'az-ext' {
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"
primary?: string // "10.91.86.39:32718"
},
highAvailability: {
lastUpdateTime: string, // "2022-02-07T06:08:20.500688Z"
@@ -375,7 +375,7 @@ declare module 'az-ext' {
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"
primary?: string // "10.91.86.39:32718"
},
highAvailability: {
lastUpdateTime: string, // "2022-02-07T06:08:20.500688Z"