Skip to content

Commit 184a045

Browse files
committed
add additional fields to json output
1 parent fb807ee commit 184a045

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cmd/snapshot/snapshot_schedule_show.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ var snapshotScheduleShowCmd = &cobra.Command{
5555
data["last_snapshot_state"] = schedule.Status.LastSnapshot.State
5656
}
5757

58+
for i, instance := range schedule.Instances {
59+
data[fmt.Sprintf("instance_%d_id", i+1)] = instance.ID
60+
if instance.Size != "" {
61+
data[fmt.Sprintf("instance_%d_size", i+1)] = instance.Size
62+
}
63+
if len(instance.IncludedVolumes) > 0 {
64+
data[fmt.Sprintf("instance_%d_included_volumes", i+1)] = strings.Join(instance.IncludedVolumes, ", ")
65+
}
66+
}
67+
5868
ow := utility.NewOutputWriterWithMap(data)
5969

6070
switch common.OutputFormat {

0 commit comments

Comments
 (0)