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
impl Hooks
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 Hooks 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 listHookGroups(&self) -> Result<Value, Error>
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.
sourcepub fn listHookGroups_url(&self) -> Result<String, Error>
pub fn listHookGroups_url(&self) -> Result<String, Error>
Generate an unsigned URL for the listHookGroups endpoint
sourcepub fn listHookGroups_signed_url(&self, ttl: Duration) -> Result<String, Error>
pub fn listHookGroups_signed_url(&self, ttl: Duration) -> Result<String, Error>
Generate a signed URL for the listHookGroups endpoint
sourcepub async fn listHooks(&self, hookGroupId: &str) -> Result<Value, Error>
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.
sourcepub fn listHooks_url(&self, hookGroupId: &str) -> Result<String, Error>
pub fn listHooks_url(&self, hookGroupId: &str) -> Result<String, Error>
Generate an unsigned URL for the listHooks endpoint
sourcepub fn listHooks_signed_url(
&self,
hookGroupId: &str,
ttl: Duration
) -> Result<String, Error>
pub fn listHooks_signed_url( &self, hookGroupId: &str, ttl: Duration ) -> Result<String, Error>
Generate a signed URL for the listHooks endpoint
sourcepub async fn hook(
&self,
hookGroupId: &str,
hookId: &str
) -> Result<Value, Error>
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.
sourcepub fn hook_url(&self, hookGroupId: &str, hookId: &str) -> Result<String, Error>
pub fn hook_url(&self, hookGroupId: &str, hookId: &str) -> Result<String, Error>
Generate an unsigned URL for the hook endpoint
sourcepub fn hook_signed_url(
&self,
hookGroupId: &str,
hookId: &str,
ttl: Duration
) -> Result<String, Error>
pub fn hook_signed_url( &self, hookGroupId: &str, hookId: &str, ttl: Duration ) -> Result<String, Error>
Generate a signed URL for the hook endpoint
sourcepub async fn getHookStatus(
&self,
hookGroupId: &str,
hookId: &str
) -> Result<Value, Error>
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.
sourcepub fn getHookStatus_url(
&self,
hookGroupId: &str,
hookId: &str
) -> Result<String, Error>
pub fn getHookStatus_url( &self, hookGroupId: &str, hookId: &str ) -> Result<String, Error>
Generate an unsigned URL for the getHookStatus endpoint
sourcepub fn getHookStatus_signed_url(
&self,
hookGroupId: &str,
hookId: &str,
ttl: Duration
) -> Result<String, Error>
pub fn getHookStatus_signed_url( &self, hookGroupId: &str, hookId: &str, ttl: Duration ) -> Result<String, Error>
Generate a signed URL for the getHookStatus endpoint
sourcepub async fn createHook(
&self,
hookGroupId: &str,
hookId: &str,
payload: &Value
) -> Result<Value, Error>
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.
sourcepub async fn updateHook(
&self,
hookGroupId: &str,
hookId: &str,
payload: &Value
) -> Result<Value, Error>
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.
sourcepub async fn removeHook(
&self,
hookGroupId: &str,
hookId: &str
) -> Result<(), Error>
pub async fn removeHook( &self, hookGroupId: &str, hookId: &str ) -> Result<(), Error>
Delete a hook
This endpoint will remove a hook definition.
sourcepub async fn triggerHook(
&self,
hookGroupId: &str,
hookId: &str,
payload: &Value
) -> Result<Value, Error>
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.
sourcepub async fn getTriggerToken(
&self,
hookGroupId: &str,
hookId: &str
) -> Result<Value, Error>
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
.
sourcepub fn getTriggerToken_url(
&self,
hookGroupId: &str,
hookId: &str
) -> Result<String, Error>
pub fn getTriggerToken_url( &self, hookGroupId: &str, hookId: &str ) -> Result<String, Error>
Generate an unsigned URL for the getTriggerToken endpoint
sourcepub fn getTriggerToken_signed_url(
&self,
hookGroupId: &str,
hookId: &str,
ttl: Duration
) -> Result<String, Error>
pub fn getTriggerToken_signed_url( &self, hookGroupId: &str, hookId: &str, ttl: Duration ) -> Result<String, Error>
Generate a signed URL for the getTriggerToken endpoint
sourcepub async fn resetTriggerToken(
&self,
hookGroupId: &str,
hookId: &str
) -> Result<Value, Error>
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.
sourcepub async fn triggerHookWithToken(
&self,
hookGroupId: &str,
hookId: &str,
token: &str,
payload: &Value
) -> Result<Value, Error>
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.
sourcepub async fn listLastFires(
&self,
hookGroupId: &str,
hookId: &str,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<Value, Error>
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.
sourcepub fn listLastFires_url(
&self,
hookGroupId: &str,
hookId: &str,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<String, Error>
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
sourcepub fn listLastFires_signed_url(
&self,
hookGroupId: &str,
hookId: &str,
continuationToken: Option<&str>,
limit: Option<&str>,
ttl: Duration
) -> Result<String, Error>
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
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