10 and is ran by Workers during the execution of eHive pipelines.
11 It is not generally supposed to be instantiated and used outside of
this framework.
19 This RunnableDB module will send a notification to a Slack channel.
20 You can either dataflow into it, or simply create standalone jobs.
22 It requires
"slack_webhook" to be defined. You can
this in the parameters of your Slack team.
23 The message itself is defined by the
"text" parameter (and optionally by
"attachments" too).
27 Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
28 Copyright [2016-2022] EMBL-European Bioinformatics Institute
30 Licensed under the Apache License,
Version 2.0 (the
"License"); you may not use
this file except in compliance with the License.
31 You may obtain a copy of the License at
35 Unless required by applicable law or agreed to in writing, software distributed under the License
36 is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37 See the License
for the specific language governing permissions and limitations under the License.
41 Please subscribe to the
Hive mailing list: http:
46 package Bio::EnsEMBL::Hive::RunnableDB::SlackNotification;
53 use base (
'Bio::EnsEMBL::Hive::Process');
58 # These parameters have a default value in the webhook, but can be overriden here 62 'icon_emoji' => undef, # wins
if both icon_* parameters are defined
64 # If the sender wants something more fancy than a paragraph 65 'attachments' => undef,
75 foreach my $k (qw(text)) {
76 $payload->{$k} = $self->param_required($k);
80 foreach my $k (qw(username channel icon_emoji icon_url attachments)) {
81 $payload->{$k} = $self->param($k)
if $self->param($k);
84 send_message_to_slack($self->param_required(
'slack_webhook'), $payload);