Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Add snapshot interval operations to CLI #2257

Merged
merged 1 commit into from
Sep 22, 2020

Conversation

ip1981
Copy link
Member

@ip1981 ip1981 commented Sep 21, 2020

[root@adm ~]# iml snapshot interval list
+----+------------+---------------------+-------------+----------+
| Id | Filesystem | Interval            | Use Barrier | Last Run |
+====+============+=====================+=============+==========+
| 1  | zfsmo      | 1 minute            | false       | --       |
+----+------------+---------------------+-------------+----------+
| 3  | zfsmo      | 1 week              | false       | --       |
+----+------------+---------------------+-------------+----------+
| 4  | zfsmo      | 1 year and 11 hours | false       | --       |
+----+------------+---------------------+-------------+----------+

[root@adm ~]# iml snapshot interval add zfsmo  10 year -b
[root@adm ~]# iml snapshot interval list
+----+------------+-------------------------------+-------------+----------+
| Id | Filesystem | Interval                      | Use Barrier | Last Run |
+====+============+===============================+=============+==========+
| 1  | zfsmo      | 1 minute                      | false       | --       |
+----+------------+-------------------------------+-------------+----------+
| 3  | zfsmo      | 1 week                        | false       | --       |
+----+------------+-------------------------------+-------------+----------+
| 4  | zfsmo      | 1 year and 11 hours           | false       | --       |
+----+------------+-------------------------------+-------------+----------+
| 10 | zfsmo      | 10 years, 2 days and 12 hours | true        | --       |
+----+------------+-------------------------------+-------------+----------+

[root@adm ~]# iml snapshot interval remove 1 3
[root@adm ~]# iml snapshot interval list
+----+------------+-------------------------------+-------------+----------+
| Id | Filesystem | Interval                      | Use Barrier | Last Run |
+====+============+===============================+=============+==========+
| 4  | zfsmo      | 1 year and 11 hours           | false       | --       |
+----+------------+-------------------------------+-------------+----------+
| 10 | zfsmo      | 10 years, 2 days and 12 hours | true        | --       |
+----+------------+-------------------------------+-------------+----------+

Signed-off-by: Igor Pashev pashev.igor@gmail.com


This change is Reviewable

@ip1981 ip1981 requested a review from a team September 21, 2020 16:14
@ip1981 ip1981 self-assigned this Sep 21, 2020
@ip1981 ip1981 force-pushed the ip1981/ex-1750-cli-snap-interval branch from 13a3713 to b219557 Compare September 21, 2020 16:16
iml-api/src/graphql.rs Outdated Show resolved Hide resolved
Copy link
Member

@jgrund jgrund left a comment

Choose a reason for hiding this comment

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

Just a comment on the conflict change, otherwise LGTM.

Signed-off-by: Igor Pashev <pashev.igor@gmail.com>
@ip1981 ip1981 force-pushed the ip1981/ex-1750-cli-snap-interval branch from b219557 to ac0811c Compare September 21, 2020 16:32
Copy link
Contributor

@mkpankov mkpankov left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 7 files at r1, 2 of 2 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ip1981)


iml-manager-cli/src/snapshot.rs, line 28 at r2 (raw file):

        #[structopt(short = "d", long = "display", default_value = "tabular")]
        display_type: DisplayType,
        // TODO? Optional FS?

Still TODO?

@jgrund jgrund self-requested a review September 22, 2020 17:28
chrono::Duration::from_std(i.interval.0)
.map(HumanTime::from)
.map(|x| x.to_text_en(Accuracy::Precise, Tense::Present))
.unwrap_or("---".into()),
Copy link
Member

Choose a reason for hiding this comment

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

nit: clippy warning here.

@jgrund jgrund merged commit e033bf5 into master Sep 22, 2020
@jgrund jgrund deleted the ip1981/ex-1750-cli-snap-interval branch September 22, 2020 17:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants