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:
Candice Ye
2022-05-16 10:51:23 -07:00
committed by GitHub
parent 394417f93e
commit 801f797440
9 changed files with 166 additions and 70 deletions

View File

@@ -121,7 +121,7 @@ export class MiaaModel extends ResourceModel {
}
this._config = result.stdout;
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._onDatabasesUpdated.fire(this._databases);
} catch (err) {
@@ -135,7 +135,7 @@ export class MiaaModel extends ResourceModel {
}
// 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 => {
// 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)
@@ -217,7 +217,7 @@ export class MiaaModel extends ResourceModel {
}
protected createConnectionProfile(): azdata.IConnectionProfile {
const ipAndPort = parseIpAndPort(this.config?.properties?.k8SRaw?.status.primaryEndpoint || '');
const ipAndPort = parseIpAndPort(this.config?.status.primaryEndpoint || '');
return {
serverName: `${ipAndPort.ip},${ipAndPort.port}`,
databaseName: '',