-
Notifications
You must be signed in to change notification settings - Fork 194
Description
Basic Operation
A command to create a ticket should be added to the CLI. We would eventually want to be able to perform other actions on tickets by ID or as a whole, so the command structure would be straightforward:
$ sl ticket create
We could add flags to the command directly:
Composing
$ sl ticket create --title="Help me! My HDD is dead!"
Once invoked, we could observe the $EDITOR environment variable or search for a sane editor in the users path (nano, vim, emacs, etc.) and use it to compose the body of the ticket. The output of the ticket could simply be the ticket ID for later use with an 'update' command or for finding the thread in the portal.
$ sl ticket create
(...nano...)
Ticket created: #12345
Without a Title Flag
It is possible the message composition could prefer the first line or first sentence of the message as its title to avoid requiring the user to specify beforehand.
If the user has provided a title flag, however, the simplest method of exemplifying usage would be to correctly format the editor using the title they provided. Place their cursor on the 2nd line following the title to begin the ticket body.
Query the Metadata Service
When the command is invoked, we could attempt to query the metadata service to see if the invocation has occurred on a host on our network. If it has we can include basic information, such as current hostname and network configuration, services running, etc.
This data would not be silently gathered, rather populated in the $EDITOR during ticket composition. This intermediate step would allow the customer to suppress any information they did not believe pertained to the trouble they are experiencing.
Sample $EDITOR Session
sl ticket create --title="Help me! My HDD is dead!"
- Locate suitable editor: /usr/bin/nano
- Query metadata service: Success, scan for extra stuff.
- Scan machine for critical metrics: basic network and disk utilization.
- Launch & populate editor:
Help me! My HDD is dead!
I've been having issues with /dev/sdb and it seems as
though the drive has stopped responding entirely. I'm
assuming hardware failure but I would appreciate you
taking a look. Thank you!
--------------------------------------------------
Below is information which may assist our support
techs. Nothing has been transmitted at this point.
Feel free to remove information now.
--------------------------------------------------
Hostname: host-001.example.com
IP Address: 127.0.0.1
Filesystems:
/dev/sda1 90M 52M 61% /boot
/dev/sda6 457G 7.6G 2% /
(etc)
Upon closing,
Ticket created: #12345
$