Struct taskcluster::Index

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

Index Service

The index service is responsible for indexing tasks. The service ensures that tasks can be located by user-defined names.

As described in the service documentation, tasks are typically indexed via Pulse messages, so the most common use of API methods is to read from the index.

Slashes (/) aren’t allowed in index paths.

Fields§

§client: Client

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

Implementations§

source§

impl Index

source

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

Create a new Index 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 findTask(&self, indexPath: &str) -> Result<Value, Error>

Find Indexed Task

Find a task by index path, returning the highest-rank task with that path. If no task exists for the given path, this API end-point will respond with a 404 status.

source

pub fn findTask_url(&self, indexPath: &str) -> Result<String, Error>

Generate an unsigned URL for the findTask endpoint

source

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

Generate a signed URL for the findTask endpoint

source

pub async fn listNamespaces( &self, namespace: &str, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<Value, Error>

List Namespaces

List the namespaces immediately under a given namespace.

This endpoint lists up to 1000 namespaces. If more namespaces are present, a continuationToken will be returned, which can be given in the next request. For the initial request, the payload should be an empty JSON object.

source

pub fn listNamespaces_url( &self, namespace: &str, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<String, Error>

Generate an unsigned URL for the listNamespaces endpoint

source

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

Generate a signed URL for the listNamespaces endpoint

source

pub async fn listTasks( &self, namespace: &str, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<Value, Error>

List Tasks

List the tasks immediately under a given namespace.

This endpoint lists up to 1000 tasks. If more tasks are present, a continuationToken will be returned, which can be given in the next request. For the initial request, the payload should be an empty JSON object.

Remark, this end-point is designed for humans browsing for tasks, not services, as that makes little sense.

source

pub fn listTasks_url( &self, namespace: &str, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<String, Error>

Generate an unsigned URL for the listTasks endpoint

source

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

Generate a signed URL for the listTasks endpoint

source

pub async fn insertTask( &self, namespace: &str, payload: &Value ) -> Result<Value, Error>

Insert Task into Index

Insert a task into the index. If the new rank is less than the existing rank at the given index path, the task is not indexed but the response is still 200 OK.

Please see the introduction above for information about indexing successfully completed tasks automatically using custom routes.

source

pub async fn deleteTask(&self, namespace: &str) -> Result<(), Error>

Remove Task from Index

Remove a task from the index. This is intended for administrative use, where an index entry is no longer appropriate. The parent namespace is not automatically deleted. Index entries with lower rank that were previously inserted will not re-appear, as they were never stored.

source

pub async fn findArtifactFromTask( &self, indexPath: &str, name: &str ) -> Result<(), Error>

Get Artifact From Indexed Task

Find a task by index path and redirect to the artifact on the most recent run with the given name.

Note that multiple calls to this endpoint may return artifacts from differen tasks if a new task is inserted into the index between calls. Avoid using this method as a stable link to multiple, connected files if the index path does not contain a unique identifier. For example, the following two links may return unrelated files:

  • https://tc.example.com/api/index/v1/task/some-app.win64.latest.installer/artifacts/public/installer.exe`
  • https://tc.example.com/api/index/v1/task/some-app.win64.latest.installer/artifacts/public/debug-symbols.zip`

This problem be remedied by including the revision in the index path or by bundling both installer and debug symbols into a single artifact.

If no task exists for the given index path, this API end-point responds with 404.

source

pub fn findArtifactFromTask_url( &self, indexPath: &str, name: &str ) -> Result<String, Error>

Generate an unsigned URL for the findArtifactFromTask endpoint

source

pub fn findArtifactFromTask_signed_url( &self, indexPath: &str, name: &str, ttl: Duration ) -> Result<String, Error>

Generate a signed URL for the findArtifactFromTask 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 !RefUnwindSafe for Index

§

impl Send for Index

§

impl Sync for Index

§

impl Unpin for Index

§

impl !UnwindSafe for Index

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.

§

impl<T> Instrument for T

§

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

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

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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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