Struct taskcluster::Notify
source · pub struct Notify {
pub client: Client,
}
Expand description
Notification Service
The notification service listens for tasks with associated notifications and handles requests to send emails and post pulse messages.
Fields§
§client: Client
The underlying client used to make API calls for this service.
Implementations§
source§impl Notify
impl Notify
sourcepub fn new<CB: Into<ClientBuilder>>(client_builder: CB) -> Result<Self, Error>
pub fn new<CB: Into<ClientBuilder>>(client_builder: CB) -> Result<Self, Error>
Create a new Notify instance, based on the given client builder
sourcepub async fn ping(&self) -> Result<(), Error>
pub async fn ping(&self) -> Result<(), Error>
Ping Server
Respond without doing anything. This endpoint is used to check that the service is up.
sourcepub fn ping_signed_url(&self, ttl: Duration) -> Result<String, Error>
pub fn ping_signed_url(&self, ttl: Duration) -> Result<String, Error>
Generate a signed URL for the ping endpoint
sourcepub async fn lbheartbeat(&self) -> Result<(), Error>
pub async fn lbheartbeat(&self) -> Result<(), Error>
Load Balancer Heartbeat
Respond without doing anything. This endpoint is used to check that the service is up.
sourcepub fn lbheartbeat_url(&self) -> Result<String, Error>
pub fn lbheartbeat_url(&self) -> Result<String, Error>
Generate an unsigned URL for the lbheartbeat endpoint
sourcepub fn lbheartbeat_signed_url(&self, ttl: Duration) -> Result<String, Error>
pub fn lbheartbeat_signed_url(&self, ttl: Duration) -> Result<String, Error>
Generate a signed URL for the lbheartbeat endpoint
sourcepub async fn version(&self) -> Result<(), Error>
pub async fn version(&self) -> Result<(), Error>
Taskcluster Version
Respond with the JSON version object. https://github.com/mozilla-services/Dockerflow/blob/main/docs/version_object.md
sourcepub fn version_url(&self) -> Result<String, Error>
pub fn version_url(&self) -> Result<String, Error>
Generate an unsigned URL for the version endpoint
sourcepub fn version_signed_url(&self, ttl: Duration) -> Result<String, Error>
pub fn version_signed_url(&self, ttl: Duration) -> Result<String, Error>
Generate a signed URL for the version endpoint
sourcepub async fn email(&self, payload: &Value) -> Result<(), Error>
pub async fn email(&self, payload: &Value) -> Result<(), Error>
Send an Email
Send an email to address
. The content is markdown and will be rendered
to HTML, but both the HTML and raw markdown text will be sent in the
email. If a link is included, it will be rendered to a nice button in the
HTML version of the email
In case when duplicate message has been detected and no email was sent, this endpoint will return 204 status code.
sourcepub async fn pulse(&self, payload: &Value) -> Result<(), Error>
pub async fn pulse(&self, payload: &Value) -> Result<(), Error>
Publish a Pulse Message
Publish a message on pulse with the given routingKey
.
Endpoint will return 204 when duplicate message has been detected
sourcepub async fn matrix(&self, payload: &Value) -> Result<(), Error>
pub async fn matrix(&self, payload: &Value) -> Result<(), Error>
Post Matrix Message
Post a message to a room in Matrix. Optionally includes formatted message.
The roomId
in the scopes is a fully formed roomId
with leading !
such
as !foo:bar.com
.
Note that the matrix client used by taskcluster must be invited to a room before it can post there!
In case when duplicate message has been detected and no message was sent, this endpoint will return 204 status code.
sourcepub async fn slack(&self, payload: &Value) -> Result<(), Error>
pub async fn slack(&self, payload: &Value) -> Result<(), Error>
Post Slack Message
Post a message to a Slack channel.
The channelId
in the scopes is a Slack channel ID, starting with a capital C.
The Slack app can post into public channels by default but will need to be added to private channels before it can post messages there.
In case when duplicate message has been detected and no message was sent, this endpoint will return 204 status code.
sourcepub async fn addDenylistAddress(&self, payload: &Value) -> Result<(), Error>
pub async fn addDenylistAddress(&self, payload: &Value) -> Result<(), Error>
Denylist Given Address
Add the given address to the notification denylist. Addresses in the denylist will be ignored by the notification service.
sourcepub async fn deleteDenylistAddress(&self, payload: &Value) -> Result<(), Error>
pub async fn deleteDenylistAddress(&self, payload: &Value) -> Result<(), Error>
Delete Denylisted Address
Delete the specified address from the notification denylist.
sourcepub async fn listDenylist(
&self,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<Value, Error>
pub async fn listDenylist( &self, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<Value, Error>
List Denylisted Notifications
Lists all the denylisted addresses.
By default this end-point will try to return up to 1000 addresses in one
request. But it may return less, even if more tasks are available.
It may also return a continuationToken
even though there are no more
results. However, you can only be sure to have seen all results if you
keep calling list
with the last continuationToken
until you
get a result without a continuationToken
.
If you are not interested in listing all the members at once, you may
use the query-string option limit
to return fewer.
sourcepub fn listDenylist_url(
&self,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<String, Error>
pub fn listDenylist_url( &self, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<String, Error>
Generate an unsigned URL for the listDenylist endpoint
sourcepub fn listDenylist_signed_url(
&self,
continuationToken: Option<&str>,
limit: Option<&str>,
ttl: Duration
) -> Result<String, Error>
pub fn listDenylist_signed_url( &self, continuationToken: Option<&str>, limit: Option<&str>, ttl: Duration ) -> Result<String, Error>
Generate a signed URL for the listDenylist endpoint
sourcepub async fn heartbeat(&self) -> Result<(), Error>
pub async fn heartbeat(&self) -> Result<(), Error>
Heartbeat
Respond with a service heartbeat.
This endpoint is used to check on backing services this service depends on.
sourcepub fn heartbeat_url(&self) -> Result<String, Error>
pub fn heartbeat_url(&self) -> Result<String, Error>
Generate an unsigned URL for the heartbeat endpoint