Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLOUDP-179698 Add tags to advanced clusters #489

Merged
merged 1 commit into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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