From 7389eac5a4ddb5299a2c99d7787f3005e2f54780 Mon Sep 17 00:00:00 2001 From: Filipe Constantinov Menezes Date: Mon, 29 May 2023 13:23:38 +0100 Subject: [PATCH] CLOUDP-179698 Add tags to advanced clusters (#489) --- mongodbatlas/advanced_clusters.go | 1 + mongodbatlas/advanced_clusters_test.go | 28 +++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/mongodbatlas/advanced_clusters.go b/mongodbatlas/advanced_clusters.go index cc9e70b49..1b371352d 100644 --- a/mongodbatlas/advanced_clusters.go +++ b/mongodbatlas/advanced_clusters.go @@ -64,6 +64,7 @@ type AdvancedCluster struct { RootCertType string `json:"rootCertType,omitempty"` VersionReleaseSystem string `json:"versionReleaseSystem,omitempty"` TerminationProtectionEnabled *bool `json:"terminationProtectionEnabled,omitempty"` + Tags []*Tag `json:"tags,omitempty"` } type AdvancedReplicationSpec struct { diff --git a/mongodbatlas/advanced_clusters_test.go b/mongodbatlas/advanced_clusters_test.go index 97f97f6b0..4c243f2cd 100644 --- a/mongodbatlas/advanced_clusters_test.go +++ b/mongodbatlas/advanced_clusters_test.go @@ -41,6 +41,7 @@ func TestAdvancedClusters_List(t *testing.T) { ], "results": [ { + "tags": [ { "key": "key1", "value": "value1" } ], "backupEnabled": true, "biConnector": { "enabled": false, @@ -104,6 +105,7 @@ func TestAdvancedClusters_List(t *testing.T) { "stateName": "CREATING" }, { + "tags": [ { "key": "key1", "value": "value1" } ], "backupEnabled": true, "biConnector": { "enabled": false, @@ -243,7 +245,12 @@ func TestAdvancedClusters_List(t *testing.T) { Paused: &paused, PitEnabled: &pitEnabled, StateName: "CREATING", - + Tags: []*Tag{ + { + Key: "key1", + Value: "value1", + }, + }, ReplicationSpecs: []*AdvancedReplicationSpec{ { ID: "1", @@ -307,6 +314,12 @@ func TestAdvancedClusters_List(t *testing.T) { Paused: &paused, PitEnabled: &pitEnabled, StateName: "CREATING", + Tags: []*Tag{ + { + Key: "key1", + Value: "value1", + }, + }, ReplicationSpecs: []*AdvancedReplicationSpec{ { ID: "2", @@ -616,6 +629,7 @@ func TestAdvancedClusters_Create(t *testing.T) { mux.HandleFunc(fmt.Sprintf("/api/atlas/v1.5/groups/%s/clusters", groupID), func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodPost) fmt.Fprint(w, `{ + "tags": [ { "key": "key1", "value": "value1" } ], "backupEnabled": true, "biConnector": { "enabled": false, @@ -739,6 +753,12 @@ func TestAdvancedClusters_Create(t *testing.T) { Paused: &paused, PitEnabled: &pitEnabled, StateName: "CREATING", + Tags: []*Tag{ + { + Key: "key1", + Value: "value1", + }, + }, ReplicationSpecs: []*AdvancedReplicationSpec{ { ID: "2", @@ -839,6 +859,12 @@ func TestAdvancedClusters_Create(t *testing.T) { Paused: &paused, PitEnabled: &pitEnabled, StateName: "CREATING", + Tags: []*Tag{ + { + Key: "key1", + Value: "value1", + }, + }, ReplicationSpecs: []*AdvancedReplicationSpec{ { ID: "2",