Skip to content

Commit d8dbf22

Browse files
authored
feat: Adds field to ProcessArgs (#538)
1 parent 8f36ebd commit d8dbf22

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

mongodbatlas/clusters.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,18 @@ type Cluster struct {
178178

179179
// ProcessArgs represents the advanced configuration options for the cluster.
180180
type ProcessArgs struct {
181-
DefaultReadConcern string `json:"defaultReadConcern,omitempty"`
182-
DefaultWriteConcern string `json:"defaultWriteConcern,omitempty"`
183-
MinimumEnabledTLSProtocol string `json:"minimumEnabledTlsProtocol,omitempty"`
184-
FailIndexKeyTooLong *bool `json:"failIndexKeyTooLong,omitempty"`
185-
JavascriptEnabled *bool `json:"javascriptEnabled,omitempty"`
186-
NoTableScan *bool `json:"noTableScan,omitempty"`
187-
OplogSizeMB *int64 `json:"oplogSizeMB,omitempty"`
188-
SampleSizeBIConnector *int64 `json:"sampleSizeBIConnector,omitempty"`
189-
SampleRefreshIntervalBIConnector *int64 `json:"sampleRefreshIntervalBIConnector,omitempty"`
190-
TransactionLifetimeLimitSeconds *int64 `json:"transactionLifetimeLimitSeconds,omitempty"`
191-
OplogMinRetentionHours *float64 `json:"oplogMinRetentionHours,omitempty"`
181+
DefaultReadConcern string `json:"defaultReadConcern,omitempty"`
182+
DefaultWriteConcern string `json:"defaultWriteConcern,omitempty"`
183+
MinimumEnabledTLSProtocol string `json:"minimumEnabledTlsProtocol,omitempty"`
184+
FailIndexKeyTooLong *bool `json:"failIndexKeyTooLong,omitempty"`
185+
JavascriptEnabled *bool `json:"javascriptEnabled,omitempty"`
186+
NoTableScan *bool `json:"noTableScan,omitempty"`
187+
OplogSizeMB *int64 `json:"oplogSizeMB,omitempty"`
188+
SampleSizeBIConnector *int64 `json:"sampleSizeBIConnector,omitempty"`
189+
SampleRefreshIntervalBIConnector *int64 `json:"sampleRefreshIntervalBIConnector,omitempty"`
190+
TransactionLifetimeLimitSeconds *int64 `json:"transactionLifetimeLimitSeconds,omitempty"`
191+
OplogMinRetentionHours *float64 `json:"oplogMinRetentionHours,omitempty"`
192+
ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds *int64 `json:"changeStreamOptionsPreAndPostImagesExpireAfterSeconds,omitempty"`
192193
}
193194

194195
type Tag struct {

mongodbatlas/clusters_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@ func TestClusters_UpdateProcessArgs(t *testing.T) {
784784
SampleSizeBIConnector: pointer(int64(5000)),
785785
SampleRefreshIntervalBIConnector: pointer(int64(300)),
786786
TransactionLifetimeLimitSeconds: pointer(int64(30)),
787+
ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: pointer(int64(-1)),
787788
}
788789

789790
mux.HandleFunc(fmt.Sprintf("/api/atlas/v1.0/groups/%s/clusters/%s/processArgs", groupID, clusterName), func(w http.ResponseWriter, r *http.Request) {
@@ -799,6 +800,7 @@ func TestClusters_UpdateProcessArgs(t *testing.T) {
799800
"sampleSizeBIConnector": float64(5000),
800801
"sampleRefreshIntervalBIConnector": float64(300),
801802
"transactionLifetimeLimitSeconds": float64(30),
803+
"changeStreamOptionsPreAndPostImagesExpireAfterSeconds": float64(-1),
802804
}
803805

804806
jsonBlob := `
@@ -813,7 +815,8 @@ func TestClusters_UpdateProcessArgs(t *testing.T) {
813815
"oplogMinRetentionHours": 100,
814816
"sampleSizeBIConnector": 5000,
815817
"sampleRefreshIntervalBIConnector": 300,
816-
"transactionLifetimeLimitSeconds": 30
818+
"transactionLifetimeLimitSeconds": 30,
819+
"changeStreamOptionsPreAndPostImagesExpireAfterSeconds": -1
817820
}
818821
`
819822

@@ -862,7 +865,8 @@ func TestClusters_GetProcessArgs(t *testing.T) {
862865
"oplogSizeMB": 2000,
863866
"sampleSizeBIConnector": 5000,
864867
"sampleRefreshIntervalBIConnector": 300,
865-
"transactionLifetimeLimitSeconds": 30
868+
"transactionLifetimeLimitSeconds": 30,
869+
"ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds": 113
866870
}`)
867871
})
868872

@@ -882,6 +886,7 @@ func TestClusters_GetProcessArgs(t *testing.T) {
882886
SampleSizeBIConnector: pointer(int64(5000)),
883887
SampleRefreshIntervalBIConnector: pointer(int64(300)),
884888
TransactionLifetimeLimitSeconds: pointer(int64(30)),
889+
ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: pointer(int64(113)),
885890
}
886891

887892
if diff := deep.Equal(processArgs, expected); diff != nil {

0 commit comments

Comments
 (0)