Notification Target Management using Spyctl
Published: December 7, 2023
To learn more about what Notification Targets are, see:
Notification TargetsPrerequisites
If you have never used Spyctl start here to learn how to install it, then follow the Initial Configuration guide.
Managing Notification Targets
Create
To create a new Notification Target you can use the create
command:
Note: This will only create a local yaml file for you to edit. It makes no immediate changes to your Spyderbat environment.
For example:
This will create a default Notification Target and save it to a file called target.yaml
Edit
When creating new Notification Targets you will need to edit the default document to point to the proper destination. With spyctl you can use the edit
command to ensure you don't accidentally introduce syntax errors.
If you have already applied the Notification Target you may edit the resource using the following:
For example:
This will bring up a prompt to select a text editor unless you have already done so previously. Then, using your text editor you may fill in your desired destination or destinations.
If you save without making any changes, nothing happens to the resource or file you're editing. If you save and there were syntax errors, Spyctl will save your draft to a temporary location and re-open it with comments detailing the errors. Finally, if your changes have no syntax errors, Spyctl will update the resource or file you're editing.
Note: If you edit a Notification Target in a local file, but the Target has already been applied. You will need to apply the file again for the updates to take effect.
Apply
In order for a Notification Target to be usable by the Spyderbat Notifications System you must first apply it using the apply
command.
For example:
If the operation is successful, your Notification Target will be ready for use.
Delete
To remove a Notification Target from the Spyderbat Notifications System you can use the delete
command.
For example:
You will not be able to delete a Notification Target that is currently being used by a Notification Configuration
View or Download
You can use the get
command to view or download your Notification Targets.
For example:
The default output is a tabular summary of your Notification Targets. To download the Notification Target as yaml or json you can use the -o
option
Using the >
character you can save the document to a file.
Last updated