platform9 / cctl

Apache License 2.0
47 stars 8 forks source link

Add support for downloading support bundle for a node through cctl #144

Closed puneetguptanitj closed 6 years ago

puneetguptanitj commented 6 years ago

Help prints the default file name

coreos-puneet-556-10-105-16-89platform9 ~ # ./cctl bundle machine --help
Create a support bundle for a node

Usage:
  cctl bundle machine [flags]

Flags:
  -h, --help            help for machine
      --ip string       IP address of the machine
      --output string   File path for bundle tgz file (default "cctl-bundle-<ip>-<timestamp>.tgz" created in current directory)

Global Flags:
  -l, --log-level string   set log level for output, permitted values debug, info, warn, error, fatal and panic (default "info")
      --state string       state file (default "/etc/cctl-state.yaml")

When user does not provide value for output flag

coreos-puneet-556-10-105-16-89platform9 ~ # ./cctl bundle machine --ip 10.105.16.72
INFO[0000] Not able to verify machine SSH identity: No public keys given. Continuing...
INFO[0000] Started creating support bundle for 10.105.16.72. This will take a few minutes.
INFO[0035] cctl bundle downloaded to cctl-bundle-10.105.16.72-2018-10-23T00:04:14Z.tgz

When user provides a value for output flag

coreos-puneet-556-10-105-16-89platform9 ~ # ./cctl bundle machine --ip 10.105.16.72  --output /tmp/myfile.tgz
INFO[0000] Not able to verify machine SSH identity: No public keys given. Continuing...
INFO[0000] Started creating support bundle for 10.105.16.72. This will take a few minutes.
INFO[0038] cctl bundle downloaded to /tmp/myfile.tgz