Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Commit 41c23d2

Browse files
author
rbranche
authored
Add ossRDBMSResourceId to Environment configuration. (#635)
1 parent 82fc42f commit 41c23d2

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

autorest/azure/environments.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type ResourceIdentifier struct {
4545
Datalake string `json:"datalake"`
4646
Batch string `json:"batch"`
4747
OperationalInsights string `json:"operationalInsights"`
48+
OSSRDBMS string `json:"ossRDBMS"`
4849
Storage string `json:"storage"`
4950
Synapse string `json:"synapse"`
5051
ServiceBus string `json:"serviceBus"`
@@ -116,6 +117,7 @@ var (
116117
Datalake: "https://datalake.azure.net/",
117118
Batch: "https://batch.core.windows.net/",
118119
OperationalInsights: "https://api.loganalytics.io",
120+
OSSRDBMS: "https://ossrdbms-aad.database.windows.net",
119121
Storage: "https://storage.azure.com/",
120122
Synapse: "https://dev.azuresynapse.net",
121123
ServiceBus: "https://servicebus.azure.net/",
@@ -156,6 +158,7 @@ var (
156158
Datalake: NotAvailable,
157159
Batch: "https://batch.core.usgovcloudapi.net/",
158160
OperationalInsights: "https://api.loganalytics.us",
161+
OSSRDBMS: "https://ossrdbms-aad.database.usgovcloudapi.net",
159162
Storage: "https://storage.azure.com/",
160163
Synapse: NotAvailable,
161164
ServiceBus: "https://servicebus.azure.net/",
@@ -196,6 +199,7 @@ var (
196199
Datalake: NotAvailable,
197200
Batch: "https://batch.chinacloudapi.cn/",
198201
OperationalInsights: NotAvailable,
202+
OSSRDBMS: "https://ossrdbms-aad.database.chinacloudapi.cn",
199203
Storage: "https://storage.azure.com/",
200204
Synapse: "https://dev.azuresynapse.net",
201205
ServiceBus: "https://servicebus.azure.net/",
@@ -236,6 +240,7 @@ var (
236240
Datalake: NotAvailable,
237241
Batch: "https://batch.cloudapi.de/",
238242
OperationalInsights: NotAvailable,
243+
OSSRDBMS: "https://ossrdbms-aad.database.cloudapi.de",
239244
Storage: "https://storage.azure.com/",
240245
Synapse: NotAvailable,
241246
ServiceBus: "https://servicebus.azure.net/",

autorest/azure/environments_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const (
3333
graphResourceID = "--graph-resource-id--"
3434
keyvaultResourceID = "--keyvault-resource-id--"
3535
opInsightsResourceID = "--operational-insights-resource-id--"
36+
ossRDBMSResourceID = "--oss-rdbms-resource-id--"
3637
)
3738

3839
// This correlates to the expected contents of ./testdata/test_environment_1.json
@@ -65,6 +66,7 @@ var testEnvironment1 = Environment{
6566
Graph: graphResourceID,
6667
KeyVault: keyvaultResourceID,
6768
OperationalInsights: opInsightsResourceID,
69+
OSSRDBMS: ossRDBMSResourceID,
6870
},
6971
}
7072

@@ -225,7 +227,8 @@ func TestDeserializeEnvironment(t *testing.T) {
225227
"datalake": "` + datalakeResourceID + `",
226228
"graph": "` + graphResourceID + `",
227229
"keyVault": "` + keyvaultResourceID + `",
228-
"operationalInsights": "` + opInsightsResourceID + `"
230+
"operationalInsights": "` + opInsightsResourceID + `",
231+
"ossRDBMS": "` + ossRDBMSResourceID + `"
229232
}
230233
}`
231234

@@ -313,6 +316,9 @@ func TestDeserializeEnvironment(t *testing.T) {
313316
if opInsightsResourceID != testSubject.ResourceIdentifiers.OperationalInsights {
314317
t.Errorf("Expected ResourceIdentifiers.OperationalInsights to be "+opInsightsResourceID+", but got %q", testSubject.ResourceIdentifiers.OperationalInsights)
315318
}
319+
if ossRDBMSResourceID != testSubject.ResourceIdentifiers.OSSRDBMS {
320+
t.Errorf("Expected ResourceIdentifiers.OperationalInsights to be "+ossRDBMSResourceID+", but got %q", testSubject.ResourceIdentifiers.OSSRDBMS)
321+
}
316322
}
317323

318324
func TestRoundTripSerialization(t *testing.T) {
@@ -345,6 +351,7 @@ func TestRoundTripSerialization(t *testing.T) {
345351
Graph: graphResourceID,
346352
KeyVault: keyvaultResourceID,
347353
OperationalInsights: opInsightsResourceID,
354+
OSSRDBMS: ossRDBMSResourceID,
348355
},
349356
}
350357

@@ -440,6 +447,9 @@ func TestRoundTripSerialization(t *testing.T) {
440447
if env.ResourceIdentifiers.OperationalInsights != testSubject.ResourceIdentifiers.OperationalInsights {
441448
t.Errorf("Expected ResourceIdentifiers.OperationalInsights to be %q, but got %q", env.ResourceIdentifiers.OperationalInsights, testSubject.ResourceIdentifiers.OperationalInsights)
442449
}
450+
if env.ResourceIdentifiers.OSSRDBMS != testSubject.ResourceIdentifiers.OSSRDBMS {
451+
t.Errorf("Expected ResourceIdentifiers.OSSRDBMS to be %q, but got %q", env.ResourceIdentifiers.OSSRDBMS, testSubject.ResourceIdentifiers.OSSRDBMS)
452+
}
443453
}
444454

445455
func TestSetEnvironment(t *testing.T) {

autorest/azure/testdata/test_environment_1.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"datalake": "--datalake-resource-id--",
2727
"graph": "--graph-resource-id--",
2828
"keyVault": "--keyvault-resource-id--",
29-
"operationalInsights": "--operational-insights-resource-id--"
29+
"operationalInsights": "--operational-insights-resource-id--",
30+
"ossRDBMS": "--oss-rdbms-resource-id--"
3031
}
3132
}

0 commit comments

Comments
 (0)