Skip to content

Commit 33f2542

Browse files
authored
feat: add useOrgAndGroupNamesInExportPrefix to snapshot shcedule (#290)
1 parent 03ecb28 commit 33f2542

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

mongodbatlas/cloud_provider_snapshot_backup_policies.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,17 @@ var _ CloudProviderSnapshotBackupPoliciesService = &CloudProviderSnapshotBackupP
4242

4343
// CloudProviderSnapshotBackupPolicy represents a cloud provider snapshot schedule.
4444
type CloudProviderSnapshotBackupPolicy struct {
45-
ClusterID string `json:"clusterId,omitempty"` // Unique identifier of the Atlas cluster.
46-
ClusterName string `json:"clusterName,omitempty"` // Name of the Atlas cluster.
47-
ReferenceHourOfDay *int64 `json:"referenceHourOfDay,omitempty"` // UTC Hour of day between 0 and 23, inclusive, representing which hour of the day that Atlas takes snapshots for backup policy items.
48-
ReferenceMinuteOfHour *int64 `json:"referenceMinuteOfHour,omitempty"` // UTC Minutes after referenceHourOfDay that Atlas takes snapshots for backup policy items. Must be between 0 and 59, inclusive. Number of days back in time you can restore to with point-in-time accuracy.
49-
RestoreWindowDays *int64 `json:"restoreWindowDays,omitempty"` // Number of days back in time you can restore to with point-in-time accuracy. Must be a positive, non-zero integer.
50-
UpdateSnapshots *bool `json:"updateSnapshots,omitempty"` // Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.
51-
NextSnapshot string `json:"nextSnapshot,omitempty"` // UTC ISO 8601 formatted point in time when Atlas will take the next snapshot.
52-
Policies []Policy `json:"policies,omitempty"` // A list of policy definitions for the cluster.
53-
AutoExportEnabled *bool `json:"autoExportEnabled,omitempty"` // Specify true to enable automatic export of cloud backup snapshots to the AWS bucket. You must also define the export policy using export. Specify false to disable automatic export.
54-
Export *Export `json:"export,omitempty"` // Export struct that represents a policy for automatically exporting cloud backup snapshots to AWS bucket.
45+
ClusterID string `json:"clusterId,omitempty"` // Unique identifier of the Atlas cluster.
46+
ClusterName string `json:"clusterName,omitempty"` // Name of the Atlas cluster.
47+
ReferenceHourOfDay *int64 `json:"referenceHourOfDay,omitempty"` // UTC Hour of day between 0 and 23, inclusive, representing which hour of the day that Atlas takes snapshots for backup policy items.
48+
ReferenceMinuteOfHour *int64 `json:"referenceMinuteOfHour,omitempty"` // UTC Minutes after referenceHourOfDay that Atlas takes snapshots for backup policy items. Must be between 0 and 59, inclusive. Number of days back in time you can restore to with point-in-time accuracy.
49+
RestoreWindowDays *int64 `json:"restoreWindowDays,omitempty"` // Number of days back in time you can restore to with point-in-time accuracy. Must be a positive, non-zero integer.
50+
UpdateSnapshots *bool `json:"updateSnapshots,omitempty"` // Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.
51+
NextSnapshot string `json:"nextSnapshot,omitempty"` // UTC ISO 8601 formatted point in time when Atlas will take the next snapshot.
52+
Policies []Policy `json:"policies,omitempty"` // A list of policy definitions for the cluster.
53+
AutoExportEnabled *bool `json:"autoExportEnabled,omitempty"` // Specify true to enable automatic export of cloud backup snapshots to the AWS bucket. You must also define the export policy using export. Specify false to disable automatic export.
54+
Export *Export `json:"export,omitempty"` // Export struct that represents a policy for automatically exporting cloud backup snapshots to AWS bucket.
55+
UseOrgAndGroupNamesInExportPrefix *bool `json:"useOrgAndGroupNamesInExportPrefix,omitempty"` // Specifies whether to use organization and project names instead of organization and project UUIDs in the path to the metadata files that Atlas uploads to your S3 bucket after it finishes exporting the snapshots
5556
}
5657

5758
// Policy represents for the snapshot and an array of backup policy items.

mongodbatlas/cloud_provider_snapshot_backup_policies_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ func TestCloudProviderSnapshotBackupPolicies_Get(t *testing.T) {
9191
"export": {
9292
"frequencyType": "monthly",
9393
"exportBucketId": "604f6322dc786a5341d4f7fb"
94-
}
94+
},
95+
"useOrgAndGroupNamesInExportPrefix": false
9596
}`)
9697
})
9798

@@ -147,6 +148,7 @@ func TestCloudProviderSnapshotBackupPolicies_Get(t *testing.T) {
147148
ExportBucketID: "604f6322dc786a5341d4f7fb",
148149
FrequencyType: "monthly",
149150
},
151+
UseOrgAndGroupNamesInExportPrefix: pointy.Bool(false),
150152
}
151153

152154
if diff := deep.Equal(snapshotBackupPolicy, expected); diff != nil {

0 commit comments

Comments
 (0)