Skip to content

Commit

Permalink
CLOUDP-179698 Add tags to advanced clusters (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmenezes authored May 29, 2023
1 parent eb219ee commit 7389eac
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions mongodbatlas/advanced_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
28 changes: 27 additions & 1 deletion mongodbatlas/advanced_clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func TestAdvancedClusters_List(t *testing.T) {
],
"results": [
{
"tags": [ { "key": "key1", "value": "value1" } ],
"backupEnabled": true,
"biConnector": {
"enabled": false,
Expand Down Expand Up @@ -104,6 +105,7 @@ func TestAdvancedClusters_List(t *testing.T) {
"stateName": "CREATING"
},
{
"tags": [ { "key": "key1", "value": "value1" } ],
"backupEnabled": true,
"biConnector": {
"enabled": false,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 7389eac

Please sign in to comment.