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

Add CLI for stratagem reports #2323

Merged
merged 1 commit into from
Oct 13, 2020
Merged

Conversation

ip1981
Copy link
Member

@ip1981 ip1981 commented Oct 12, 2020

[root@adm ~]# iml stratagem report 
+------------------------------------------------------------+------+---------------------------------+
| Filename                                                   | Size | Modify Time                     |
+============================================================+======+=================================+
| expiring_fids-fs2-1109de19-6952-4167-bb6d-c7a574baa44e.txt | 65   | Mon, 12 Oct 2020 12:29:48 +0000 |
+------------------------------------------------------------+------+---------------------------------+
| expiring_fids-fs2-eb539883-1ba1-409a-a23e-c812fcb8f214.txt | 65   | Mon, 12 Oct 2020 13:21:49 +0000 |
+------------------------------------------------------------+------+---------------------------------+
| expiring_fids-fs2-a6102211-77d8-4d75-b43d-7e1868ff8115.txt | 65   | Mon, 12 Oct 2020 13:21:54 +0000 |
+------------------------------------------------------------+------+---------------------------------+

[root@adm ~]# iml stratagem scan fs2 -r 120s
✔ Stratagem: Scanning all MDT's successful
[root@adm ~]# iml stratagem report list -d json
[
  {
    "filename": "expiring_fids-fs2-1109de19-6952-4167-bb6d-c7a574baa44e.txt",
    "modify_time": "2020-10-12T12:29:48.024442132Z",
    "size": 65
  },
  {
    "filename": "expiring_fids-fs2-eb539883-1ba1-409a-a23e-c812fcb8f214.txt",
    "modify_time": "2020-10-12T13:21:49.849442132Z",
    "size": 65
  },
  {
    "filename": "expiring_fids-fs2-a6102211-77d8-4d75-b43d-7e1868ff8115.txt",
    "modify_time": "2020-10-12T13:21:54.875442132Z",
    "size": 65
  },
  {
    "filename": "expiring_fids-fs2-c54c67e9-1310-43b3-be22-e6125defd85b.txt",
    "modify_time": "2020-10-12T14:51:53.138442132Z",
    "size": 65
  }
]
[root@adm ~]# iml stratagem report remove expiring_fids-fs2-c54c67e9-1310-43b3-be22-e6125defd85b.txt
[root@adm ~]# iml stratagem report 
+------------------------------------------------------------+------+---------------------------------+
| Filename                                                   | Size | Modify Time                     |
+============================================================+======+=================================+
| expiring_fids-fs2-1109de19-6952-4167-bb6d-c7a574baa44e.txt | 65   | Mon, 12 Oct 2020 12:29:48 +0000 |
+------------------------------------------------------------+------+---------------------------------+
| expiring_fids-fs2-eb539883-1ba1-409a-a23e-c812fcb8f214.txt | 65   | Mon, 12 Oct 2020 13:21:49 +0000 |
+------------------------------------------------------------+------+---------------------------------+
| expiring_fids-fs2-a6102211-77d8-4d75-b43d-7e1868ff8115.txt | 65   | Mon, 12 Oct 2020 13:21:54 +0000 |
+------------------------------------------------------------+------+---------------------------------+

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


This change is Reviewable

@ip1981 ip1981 requested a review from a team October 12, 2020 14:52
@ip1981 ip1981 self-assigned this Oct 12, 2020
Signed-off-by: Igor Pashev <pashev.igor@gmail.com>
@ip1981 ip1981 force-pushed the ip1981/ex-1896-cli-stratagem-report branch from c500458 to 0276e8f Compare October 12, 2020 14:55
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 6 of 6 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ip1981)

generate_table(
&["Filename", "Size", "Modify Time"],
self.into_iter()
.map(|r| vec![r.filename, r.size.to_string(), r.modify_time.to_rfc2822()]),
Copy link
Member

Choose a reason for hiding this comment

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

Nit, it would be nice to display this as a human readable string (number-formatters). This file could be pretty large

@jgrund jgrund merged commit f417361 into master Oct 13, 2020
@jgrund jgrund deleted the ip1981/ex-1896-cli-stratagem-report branch October 13, 2020 13:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants