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

feat: Adds field to ProcessArgs #538

Merged
merged 1 commit into from
Aug 26, 2024
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
23 changes: 12 additions & 11 deletions mongodbatlas/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,18 @@ type Cluster struct {

// ProcessArgs represents the advanced configuration options for the cluster.
type ProcessArgs struct {
DefaultReadConcern string `json:"defaultReadConcern,omitempty"`
DefaultWriteConcern string `json:"defaultWriteConcern,omitempty"`
MinimumEnabledTLSProtocol string `json:"minimumEnabledTlsProtocol,omitempty"`
FailIndexKeyTooLong *bool `json:"failIndexKeyTooLong,omitempty"`
JavascriptEnabled *bool `json:"javascriptEnabled,omitempty"`
NoTableScan *bool `json:"noTableScan,omitempty"`
OplogSizeMB *int64 `json:"oplogSizeMB,omitempty"`
SampleSizeBIConnector *int64 `json:"sampleSizeBIConnector,omitempty"`
SampleRefreshIntervalBIConnector *int64 `json:"sampleRefreshIntervalBIConnector,omitempty"`
TransactionLifetimeLimitSeconds *int64 `json:"transactionLifetimeLimitSeconds,omitempty"`
OplogMinRetentionHours *float64 `json:"oplogMinRetentionHours,omitempty"`
DefaultReadConcern string `json:"defaultReadConcern,omitempty"`
DefaultWriteConcern string `json:"defaultWriteConcern,omitempty"`
MinimumEnabledTLSProtocol string `json:"minimumEnabledTlsProtocol,omitempty"`
FailIndexKeyTooLong *bool `json:"failIndexKeyTooLong,omitempty"`
JavascriptEnabled *bool `json:"javascriptEnabled,omitempty"`
NoTableScan *bool `json:"noTableScan,omitempty"`
OplogSizeMB *int64 `json:"oplogSizeMB,omitempty"`
SampleSizeBIConnector *int64 `json:"sampleSizeBIConnector,omitempty"`
SampleRefreshIntervalBIConnector *int64 `json:"sampleRefreshIntervalBIConnector,omitempty"`
TransactionLifetimeLimitSeconds *int64 `json:"transactionLifetimeLimitSeconds,omitempty"`
OplogMinRetentionHours *float64 `json:"oplogMinRetentionHours,omitempty"`
ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds *int64 `json:"changeStreamOptionsPreAndPostImagesExpireAfterSeconds,omitempty"`
}

type Tag struct {
Expand Down
9 changes: 7 additions & 2 deletions mongodbatlas/clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ func TestClusters_UpdateProcessArgs(t *testing.T) {
SampleSizeBIConnector: pointer(int64(5000)),
SampleRefreshIntervalBIConnector: pointer(int64(300)),
TransactionLifetimeLimitSeconds: pointer(int64(30)),
ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: pointer(int64(-1)),
}

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

jsonBlob := `
Expand All @@ -813,7 +815,8 @@ func TestClusters_UpdateProcessArgs(t *testing.T) {
"oplogMinRetentionHours": 100,
"sampleSizeBIConnector": 5000,
"sampleRefreshIntervalBIConnector": 300,
"transactionLifetimeLimitSeconds": 30
"transactionLifetimeLimitSeconds": 30,
"changeStreamOptionsPreAndPostImagesExpireAfterSeconds": -1
}
`

Expand Down Expand Up @@ -862,7 +865,8 @@ func TestClusters_GetProcessArgs(t *testing.T) {
"oplogSizeMB": 2000,
"sampleSizeBIConnector": 5000,
"sampleRefreshIntervalBIConnector": 300,
"transactionLifetimeLimitSeconds": 30
"transactionLifetimeLimitSeconds": 30,
"ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds": 113
}`)
})

Expand All @@ -882,6 +886,7 @@ func TestClusters_GetProcessArgs(t *testing.T) {
SampleSizeBIConnector: pointer(int64(5000)),
SampleRefreshIntervalBIConnector: pointer(int64(300)),
TransactionLifetimeLimitSeconds: pointer(int64(30)),
ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: pointer(int64(113)),
}

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