efa notification subscribers add-https
Registers a new subscriber to the Notification service with an HTTPS webhook.
Syntax
Parameters
- --url address
- (Required) Specifies the URL of the subscriber. Can be either IPv4 or IPv6 address.
- --username name
- (Required) Specifies the user name for access to the URL.
- --password password
- (Optional) Specifies the password for the user name.
- --insecure
- (Optional) Indicates that insecure SSL connection and transfers are used for sending notifications. By default, the SSL connection and transfers are secure.
- --cacert string
- (Optional) Local path to the cacert pem file for SSL verification.
- --filter strings
- (Optional) Comma separated filter values. Possible values are “DEVICE_EVENTS” - RAS/syslog events from devices, “APP_ALERTS” - fault alerts from application, “APP_EVENTS” - task events from application. If no filters are provided it means all types. Example: --filters DEVICE_EVENTS,APP_ALERTS,APP_EVENTS.
Example
The following example registers a new HTTPS webhook subscriber to the Notification Service.
efa notification subscribers add-https --url https://path/to/my/service:port --username myusername --password mypassword --insecure Successfully registered subscriber. +-----------+-----------------------------------------------------------------------+ | attribute | value | +-----------+-----------------------------------------------------------------------+ | id | 1 | +-----------+-----------------------------------------------------------------------+ | handler | http | +-----------+-----------------------------------------------------------------------+ | endpoint | https://path/to/my/service:port | +-----------+-----------------------------------------------------------------------+ | config | {"cacert":"","insecure":true,"password":"mypassword", "username":"myusername"} | +-----------+-----------------------------------------------------------------------+ Notification Subscriber ID=1 --- Time Elapsed: 2.203878641s ---
Example
The following example enables webhook subscriber with only APP_ALERTS.
#efa notification subscribers add-https --url https://127.0.0.1:5000 --username jarvis --password vision --insecure --filter APP_ALERTS Successfully registered subscriber. +-----------+----------------------------------------------------------------------------------+ | attribute | value | +-----------+----------------------------------------------------------------------------------+ | id | 18 | +-----------+----------------------------------------------------------------------------------+ | handler | http | +-----------+----------------------------------------------------------------------------------+ | endpoint | https://127.0.0.1:5000 | +-----------+----------------------------------------------------------------------------------+ | config | {"cacert":"","filters":["APP_ALERTS"],"insecure":true,"password":"vision","usern | | | ame":"jarvis"} | +-----------+----------------------------------------------------------------------------------+ Notification Subscriber ID=18 --- Time Elapsed: 2.148580068s ---