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-69433: Milestone: Snapshot schedule #496

Merged
merged 10 commits into from
Oct 14, 2020
Merged

Conversation

andreaangiolillo
Copy link
Collaborator

Proposed changes

Jira ticket: CLOUDP-69433

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code

Further comments

DESCRIBE

./bin/mongocli om backup snapshot schedule describe --clusterId 5f85b7417af9e20819997917 -P ops
PROJECT ID                 ID                         MONTHLY SNAPSHOT RETENTION MONTHS   POINT IN TIME WINDOW HOURS
5f84269c7af9e2081998b599   5f85b7417af9e20819997917   1                                   24
./bin/mongocli om backup snapshot schedule describe --clusterId 5f85b7417af9e20819997917 -P ops -o json
{
  "clusterId": "5f85b7417af9e20819997917",
  "groupId": "5f84269c7af9e2081998b599",
  "links": [
    {
      "rel": "self",
      "href": "http://localhost:8080/api/public/v1.0/groups/5f84269c7af9e2081998b599/backupConfigs/5f85b7417af9e20819997917/snapshotSchedule"
    },
    {
      "rel": "http://mms.mongodb.com/cluster",
      "href": "http://localhost:8080/api/public/v1.0/groups/5f84269c7af9e2081998b599/clusters/5f85b7417af9e20819997917"
    },
    {
      "rel": "http://mms.mongodb.com/backupConfig",
      "href": "http://localhost:8080/api/public/v1.0/groups/5f84269c7af9e2081998b599/backupConfigs/5f85b7417af9e20819997917"
    },
    {
      "rel": "http://mms.mongodb.com/group",
      "href": "http://localhost:8080/api/public/v1.0/groups/5f84269c7af9e2081998b599"
    }
  ],
  "monthlySnapshotRetentionMonths": 1,
  "pointInTimeWindowHours": 24,
  "snapshotIntervalHours": 24,
  "snapshotRetentionDays": 2,
  "weeklySnapshotRetentionWeeks": 2
}

UPDATE

./bin/mongocli om backup snapshot schedule update --clusterId 5f85b7417af9e20819997917 --monthlySnapshotRetentionMonths 2 -P ops
Snapshot schedule updated.
./bin/mongocli om backup snapshot schedule update --clusterId 5f85b7417af9e20819997917 --monthlySnapshotRetentionMonths 2 -P ops -o json
{
  "clusterId": "5f85b7417af9e20819997917",
  "groupId": "5f84269c7af9e2081998b599",
  "referenceTimeZoneOffset": "+0000",
  "links": [
    {
      "rel": "self",
      "href": "http://localhost:8080/api/public/v1.0/groups/5f84269c7af9e2081998b599/backupConfigs/5f85b7417af9e20819997917/snapshotSchedule"
    },
    {
      "rel": "http://mms.mongodb.com/cluster",
      "href": "http://localhost:8080/api/public/v1.0/groups/5f84269c7af9e2081998b599/clusters/5f85b7417af9e20819997917"
    },
    {
      "rel": "http://mms.mongodb.com/backupConfig",
      "href": "http://localhost:8080/api/public/v1.0/groups/5f84269c7af9e2081998b599/backupConfigs/5f85b7417af9e20819997917"
    },
    {
      "rel": "http://mms.mongodb.com/group",
      "href": "http://localhost:8080/api/public/v1.0/groups/5f84269c7af9e2081998b599"
    }
  ],
  "monthlySnapshotRetentionMonths": 2,
  "pointInTimeWindowHours": 0,
  "referenceHourOfDay": 0,
  "referenceMinuteOfHour": 0,
  "snapshotIntervalHours": 24,
  "snapshotRetentionDays": 2,
  "weeklySnapshotRetentionWeeks": 2
}

Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of nits on copy

Comment on lines 199 to 206
ClusterCheckpointIntervalMin = "Number of minutes between successive cluster checkpoints. Ops Manager may return values of 15, 30, or 60."
SnapshotIntervalHours = "Number of hours between snapshots. Ops Manager may return values of 6, 8, 12, or 24."
SnapshotRetentionDays = "Number of days to keep recent snapshots. Ops Manager may return values between 2 and 5, inclusive."
WeeklySnapshotRetentionWeeks = "Number of weeks to retain weekly snapshots. Ops Manager may return values between 1 and 52, inclusive."
PointInTimeWindowHours = "Number of hours in the past for which a point-in-time snapshot can be created."
ReferenceHourOfDay = "Hour of the day to schedule snapshots using a 24 hour clock. Ops Manager may return values between 0 and 23, inclusive."
ReferenceMinuteOfHour = "Minute of the hour to schedule snapshots. Ops Manager may return values between 0 and 59, inclusive."
MonthlySnapshotRetentionMonths = "Number of months to retain monthly snapshots. Ops Manager may return values between 1 and 36, inclusive."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since these are all for cloud manager as well may want to say something like, Valid values: list of values we have other examples of Valid values here in this file

internal/store/snapshot_schedule.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a small nit on some flags being required

Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andreaangiolillo andreaangiolillo merged commit 1d9218b into master Oct 14, 2020
@andreaangiolillo andreaangiolillo deleted the CLOUDP-69433 branch October 14, 2020 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants