Skip to content

Commit f69bb47

Browse files
Merge pull request #204 from RedisLabs/fix/active-active-region-fixes
Minor API fixes for AA regions
2 parents cff47a3 + b979632 commit f69bb47

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

service/subscriptions/model.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,16 +278,16 @@ type listSubscriptionResponse struct {
278278
Subscriptions []*Subscription `json:"subscriptions"`
279279
}
280280

281-
type ListSubscriptionRegionsResponse struct {
281+
type ListAASubscriptionRegionsResponse struct {
282282
SubscriptionId *int `json:"subscriptionId,omitempty"`
283283
Regions []*ActiveActiveRegion `json:"regions"`
284284
}
285285

286286
// have to redeclare these here (copied from regions model) to avoid an import cycle
287287
type ActiveActiveRegion struct {
288-
RegionId *int `json:"regionId,omitempty"`
288+
//RegionId *int `json:"regionId,omitempty"` // not populated by the API
289289
Region *string `json:"region,omitempty"`
290-
DeploymentCIDR *string `json:"deploymentCIDR,omitempty"`
290+
DeploymentCIDR *string `json:"deploymentCidr,omitempty"`
291291
VpcId *string `json:"vpcId,omitempty"`
292292
Databases []ActiveActiveDatabase `json:"databases,omitempty"`
293293
}

service/subscriptions/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func (a *API) DeleteActiveActiveVPCPeering(ctx context.Context, subscription int
239239
}
240240

241241
func (a *API) ListActiveActiveRegions(ctx context.Context, subscription int) ([]*ActiveActiveRegion, error) {
242-
var response ListSubscriptionRegionsResponse
242+
var response ListAASubscriptionRegionsResponse
243243
err := a.client.Get(ctx, "list regions", fmt.Sprintf("/subscriptions/%d/regions", subscription), &response)
244244

245245
if err != nil {

subscription_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,6 @@ func TestSubscription_ListActiveActiveRegions(t *testing.T) {
800800
"subscriptionId": 1986,
801801
"regions": [
802802
{
803-
"regionId": 12,
804803
"region": "us-east-1",
805804
"deploymentCidr": "192.169.0.0/24",
806805
"vpcId": "vpc-0e828cd5c0c580389",
@@ -817,7 +816,6 @@ func TestSubscription_ListActiveActiveRegions(t *testing.T) {
817816
"links": []
818817
},
819818
{
820-
"regionId": 19,
821819
"region": "us-east-2",
822820
"deploymentCidr": "11.0.1.0/24",
823821
"vpcId": "vpc-0aecab539b31057a5",
@@ -867,15 +865,13 @@ func listRegionsExpected() []*subscriptions.ActiveActiveRegion {
867865

868866
// Initialize regions
869867
region1Struct := &subscriptions.ActiveActiveRegion{
870-
RegionId: redis.Int(12),
871868
Region: redis.String("us-east-1"),
872869
DeploymentCIDR: redis.String("192.169.0.0/24"),
873870
VpcId: redis.String("vpc-0e828cd5c0c580389"),
874871
Databases: []subscriptions.ActiveActiveDatabase{database},
875872
}
876873

877874
region2Struct := &subscriptions.ActiveActiveRegion{
878-
RegionId: redis.Int(19),
879875
Region: redis.String("us-east-2"),
880876
DeploymentCIDR: redis.String("11.0.1.0/24"),
881877
VpcId: redis.String("vpc-0aecab539b31057a5"),

0 commit comments

Comments
 (0)