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-139997: added OplogMinRetentionHours to ProcessArgs #316

Merged
merged 4 commits into from
Oct 12, 2022
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 @@ -173,15 +173,16 @@ 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"`
FailIndexKeyTooLong *bool `json:"failIndexKeyTooLong,omitempty"`
JavascriptEnabled *bool `json:"javascriptEnabled,omitempty"`
MinimumEnabledTLSProtocol string `json:"minimumEnabledTlsProtocol,omitempty"`
NoTableScan *bool `json:"noTableScan,omitempty"`
OplogSizeMB *int64 `json:"oplogSizeMB,omitempty"`
SampleSizeBIConnector *int64 `json:"sampleSizeBIConnector,omitempty"`
SampleRefreshIntervalBIConnector *int64 `json:"sampleRefreshIntervalBIConnector,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"`
OplogMinRetentionHours *float64 `json:"oplogMinRetentionHours,omitempty"`
}

// ClusterStatus is the status of the operations on the cluster.
Expand Down Expand Up @@ -436,7 +437,7 @@ func (s *ClustersServiceOp) Delete(ctx context.Context, groupID, clusterName str

// UpdateProcessArgs Modifies Advanced Configuration Options for One Cluster
//
// See more: https://docs.atlas.mongodb.com/reference/api/clusters-modify-advanced-configuration-options/
// See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#operation/updateAdvancedConfigurationOptionsForOneCluster
func (s *ClustersServiceOp) UpdateProcessArgs(ctx context.Context, groupID, clusterName string, updateRequest *ProcessArgs) (*ProcessArgs, *Response, error) {
if groupID == "" {
return nil, nil, NewArgError("groupId", "must be set")
Expand Down Expand Up @@ -464,7 +465,7 @@ func (s *ClustersServiceOp) UpdateProcessArgs(ctx context.Context, groupID, clus

// GetProcessArgs gets the Advanced Configuration Options for One Cluster
//
// See more: https://docs.atlas.mongodb.com/reference/api/clusters-get-advanced-configuration-options/#get-advanced-configuration-options-for-one-cluster
// See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#operation/returnOneAdvancedConfigurationOptionsForOneCluster
func (s *ClustersServiceOp) GetProcessArgs(ctx context.Context, groupID, clusterName string) (*ProcessArgs, *Response, error) {
if groupID == "" {
return nil, nil, NewArgError("groupId", "must be set")
Expand Down
3 changes: 3 additions & 0 deletions mongodbatlas/clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ func TestClusters_UpdateProcessArgs(t *testing.T) {
MinimumEnabledTLSProtocol: tlsProtocol,
NoTableScan: pointy.Bool(true),
OplogSizeMB: pointy.Int64(2000),
OplogMinRetentionHours: pointy.Float64(100),
SampleSizeBIConnector: pointy.Int64(5000),
SampleRefreshIntervalBIConnector: pointy.Int64(300),
}
Expand All @@ -756,6 +757,7 @@ func TestClusters_UpdateProcessArgs(t *testing.T) {
"minimumEnabledTlsProtocol": tlsProtocol,
"noTableScan": true,
"oplogSizeMB": float64(2000),
"oplogMinRetentionHours": float64(100),
"sampleSizeBIConnector": float64(5000),
"sampleRefreshIntervalBIConnector": float64(300),
}
Expand All @@ -769,6 +771,7 @@ func TestClusters_UpdateProcessArgs(t *testing.T) {
"minimumEnabledTlsProtocol": "TLS1_2",
"noTableScan": true,
"oplogSizeMB": 2000,
"oplogMinRetentionHours": 100,
"sampleSizeBIConnector": 5000,
"sampleRefreshIntervalBIConnector": 300
}
Expand Down