Struct taskcluster::Hooks

source ·
pub struct Hooks {
    pub client: Client,
}
Expand description

Hooks Service

The hooks service provides a mechanism for creating tasks in response to events.

Fields§

§client: Client

The underlying client used to make API calls for this service.

Implementations§

source§

impl Hooks

source

pub fn new<CB: Into<ClientBuilder>>(client_builder: CB) -> Result<Self, Error>

Create a new Hooks instance, based on the given client builder

source

pub async fn ping(&self) -> Result<(), Error>

Ping Server

Respond without doing anything. This endpoint is used to check that the service is up.

source

pub fn ping_url(&self) -> Result<String, Error>

Generate an unsigned URL for the ping endpoint

source

pub fn ping_signed_url(&self, ttl: Duration) -> Result<String, Error>

Generate a signed URL for the ping endpoint

source

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.

source

pub fn lbheartbeat_url(&self) -> Result<String, Error>

Generate an unsigned URL for the lbheartbeat endpoint

source

pub fn lbheartbeat_signed_url(&self, ttl: Duration) -> Result<String, Error>

Generate a signed URL for the lbheartbeat endpoint

source

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

source

pub fn version_url(&self) -> Result<String, Error>

Generate an unsigned URL for the version endpoint

source

pub fn version_signed_url(&self, ttl: Duration) -> Result<String, Error>

Generate a signed URL for the version endpoint

source

pub async fn listHookGroups(&self) -> Result<Value, Error>

List hook groups

This endpoint will return a list of all hook groups with at least one hook.

source

pub fn listHookGroups_url(&self) -> Result<String, Error>

Generate an unsigned URL for the listHookGroups endpoint

source

pub fn listHookGroups_signed_url(&self, ttl: Duration) -> Result<String, Error>

Generate a signed URL for the listHookGroups endpoint

source

pub async fn listHooks(&self, hookGroupId: &str) -> Result<Value, Error>

List hooks in a given group

This endpoint will return a list of all the hook definitions within a given hook group.

source

pub fn listHooks_url(&self, hookGroupId: &str) -> Result<String, Error>

Generate an unsigned URL for the listHooks endpoint

source

pub fn listHooks_signed_url( &self, hookGroupId: &str, ttl: Duration ) -> Result<String, Error>

Generate a signed URL for the listHooks endpoint

source

pub async fn hook( &self, hookGroupId: &str, hookId: &str ) -> Result<Value, Error>

Get hook definition

This endpoint will return the hook definition for the given hookGroupId and hookId.

source

pub fn hook_url(&self, hookGroupId: &str, hookId: &str) -> Result<String, Error>

Generate an unsigned URL for the hook endpoint

source

pub fn hook_signed_url( &self, hookGroupId: &str, hookId: &str, ttl: Duration ) -> Result<String, Error>

Generate a signed URL for the hook endpoint

source

pub async fn getHookStatus( &self, hookGroupId: &str, hookId: &str ) -> Result<Value, Error>

Get hook status

This endpoint will return the current status of the hook. This represents a snapshot in time and may vary from one call to the next.

This method is deprecated in favor of listLastFires.

source

pub fn getHookStatus_url( &self, hookGroupId: &str, hookId: &str ) -> Result<String, Error>

Generate an unsigned URL for the getHookStatus endpoint

source

pub fn getHookStatus_signed_url( &self, hookGroupId: &str, hookId: &str, ttl: Duration ) -> Result<String, Error>

Generate a signed URL for the getHookStatus endpoint

source

pub async fn createHook( &self, hookGroupId: &str, hookId: &str, payload: &Value ) -> Result<Value, Error>

Create a hook

This endpoint will create a new hook.

The caller’s credentials must include the role that will be used to create the task. That role must satisfy task.scopes as well as the necessary scopes to add the task to the queue.

source

pub async fn updateHook( &self, hookGroupId: &str, hookId: &str, payload: &Value ) -> Result<Value, Error>

Update a hook

This endpoint will update an existing hook. All fields except hookGroupId and hookId can be modified.

source

pub async fn removeHook( &self, hookGroupId: &str, hookId: &str ) -> Result<(), Error>

Delete a hook

This endpoint will remove a hook definition.

source

pub async fn triggerHook( &self, hookGroupId: &str, hookId: &str, payload: &Value ) -> Result<Value, Error>

Trigger a hook

This endpoint will trigger the creation of a task from a hook definition.

The HTTP payload must match the hooks triggerSchema. If it does, it is provided as the payload property of the JSON-e context used to render the task template.

source

pub async fn getTriggerToken( &self, hookGroupId: &str, hookId: &str ) -> Result<Value, Error>

Get a trigger token

Retrieve a unique secret token for triggering the specified hook. This token can be deactivated with resetTriggerToken.

source

pub fn getTriggerToken_url( &self, hookGroupId: &str, hookId: &str ) -> Result<String, Error>

Generate an unsigned URL for the getTriggerToken endpoint

source

pub fn getTriggerToken_signed_url( &self, hookGroupId: &str, hookId: &str, ttl: Duration ) -> Result<String, Error>

Generate a signed URL for the getTriggerToken endpoint

source

pub async fn resetTriggerToken( &self, hookGroupId: &str, hookId: &str ) -> Result<Value, Error>

Reset a trigger token

Reset the token for triggering a given hook. This invalidates token that may have been issued via getTriggerToken with a new token.

source

pub async fn triggerHookWithToken( &self, hookGroupId: &str, hookId: &str, token: &str, payload: &Value ) -> Result<Value, Error>

Trigger a hook with a token

This endpoint triggers a defined hook with a valid token.

The HTTP payload must match the hooks triggerSchema. If it does, it is provided as the payload property of the JSON-e context used to render the task template.

source

pub async fn listLastFires( &self, hookGroupId: &str, hookId: &str, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<Value, Error>

Get information about recent hook fires

This endpoint will return information about the the last few times this hook has been fired, including whether the hook was fired successfully or not

By default this endpoint will return up to 1000 most recent fires in one request.

source

pub fn listLastFires_url( &self, hookGroupId: &str, hookId: &str, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<String, Error>

Generate an unsigned URL for the listLastFires endpoint

source

pub fn listLastFires_signed_url( &self, hookGroupId: &str, hookId: &str, continuationToken: Option<&str>, limit: Option<&str>, ttl: Duration ) -> Result<String, Error>

Generate a signed URL for the listLastFires endpoint

source

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.

source

pub fn heartbeat_url(&self) -> Result<String, Error>

Generate an unsigned URL for the heartbeat endpoint

source

pub fn heartbeat_signed_url(&self, ttl: Duration) -> Result<String, Error>

Generate a signed URL for the heartbeat endpoint

Auto Trait Implementations§

§

impl Freeze for Hooks

§

impl !RefUnwindSafe for Hooks

§

impl Send for Hooks

§

impl Sync for Hooks

§

impl Unpin for Hooks

§

impl !UnwindSafe for Hooks

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more