pub struct WorkerManager {
    pub client: Client,
}
Expand description

Worker Manager Service

This service manages workers, including provisioning for dynamic worker pools.

Methods interacting with a provider may return a 503 response if that provider has not been able to start up, such as if the service to which it interfaces has an outage. Such requests can be retried as for any other 5xx response.

Fields§

§client: Client

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

Implementations§

source§

impl WorkerManager

source

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

Create a new WorkerManager 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 listProviders( &self, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<Value, Error>

List Providers

Retrieve a list of providers that are available for worker pools.

source

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

Generate an unsigned URL for the listProviders endpoint

source

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

Generate a signed URL for the listProviders endpoint

source

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

Create Worker Pool

Create a new worker pool. If the worker pool already exists, this will throw an error.

source

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

Update Worker Pool

Given an existing worker pool definition, this will modify it and return the new definition.

To delete a worker pool, set its providerId to "null-provider". After any existing workers have exited, a cleanup job will remove the worker pool. During that time, the worker pool can be updated again, such as to set its providerId to a real provider.

source

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

Delete Worker Pool

Mark a worker pool for deletion. This is the same as updating the pool to set its providerId to "null-provider", but does not require scope worker-manager:provider:null-provider.

source

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

Get Worker Pool

Fetch an existing worker pool defition.

source

pub fn workerPool_url(&self, workerPoolId: &str) -> Result<String, Error>

Generate an unsigned URL for the workerPool endpoint

source

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

Generate a signed URL for the workerPool endpoint

source

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

List All Worker Pools

Get the list of all the existing worker pools.

source

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

Generate an unsigned URL for the listWorkerPools endpoint

source

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

Generate a signed URL for the listWorkerPools endpoint

source

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

Report an error from a worker

Report an error that occurred on a worker. This error will be included with the other errors in listWorkerPoolErrors(workerPoolId).

Workers can use this endpoint to report startup or configuration errors that might be associated with the worker pool configuration and thus of interest to a worker-pool administrator.

NOTE: errors are publicly visible. Ensure that none of the content contains secrets or other sensitive information.

source

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

List Worker Pool Errors

Get the list of worker pool errors.

source

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

Generate an unsigned URL for the listWorkerPoolErrors endpoint

source

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

Generate a signed URL for the listWorkerPoolErrors endpoint

source

pub async fn listWorkersForWorkerGroup( &self, workerPoolId: &str, workerGroup: &str, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<Value, Error>

Workers in a specific Worker Group in a Worker Pool

Get the list of all the existing workers in a given group in a given worker pool.

source

pub fn listWorkersForWorkerGroup_url( &self, workerPoolId: &str, workerGroup: &str, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<String, Error>

Generate an unsigned URL for the listWorkersForWorkerGroup endpoint

source

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

Generate a signed URL for the listWorkersForWorkerGroup endpoint

source

pub async fn worker( &self, workerPoolId: &str, workerGroup: &str, workerId: &str ) -> Result<Value, Error>

Get a Worker

Get a single worker.

source

pub fn worker_url( &self, workerPoolId: &str, workerGroup: &str, workerId: &str ) -> Result<String, Error>

Generate an unsigned URL for the worker endpoint

source

pub fn worker_signed_url( &self, workerPoolId: &str, workerGroup: &str, workerId: &str, ttl: Duration ) -> Result<String, Error>

Generate a signed URL for the worker endpoint

source

pub async fn createWorker( &self, workerPoolId: &str, workerGroup: &str, workerId: &str, payload: &Value ) -> Result<Value, Error>

Create a Worker

Create a new worker. This is only useful for worker pools where the provider does not create workers automatically, such as those with a static provider type. Providers that do not support creating workers will return a 400 error. See the documentation for the individual providers, and in particular the static provider for more information.

source

pub async fn updateWorker( &self, workerPoolId: &str, workerGroup: &str, workerId: &str, payload: &Value ) -> Result<Value, Error>

Update an existing Worker

Update an existing worker in-place. Like createWorker, this is only useful for worker pools where the provider does not create workers automatically. This method allows updating all fields in the schema unless otherwise indicated in the provider documentation. See the documentation for the individual providers, and in particular the static provider for more information.

source

pub async fn removeWorker( &self, workerPoolId: &str, workerGroup: &str, workerId: &str ) -> Result<(), Error>

Remove a Worker

Remove an existing worker. The precise behavior of this method depends on the provider implementing the given worker. Some providers do not support removing workers at all, and will return a 400 error. Others may begin removing the worker, but it may remain available via the API (perhaps even in state RUNNING) afterward.

source

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

Workers in a Worker Pool

Get the list of all the existing workers in a given worker pool.

source

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

Generate an unsigned URL for the listWorkersForWorkerPool endpoint

source

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

Generate a signed URL for the listWorkersForWorkerPool endpoint

source

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

Register a running worker

Register a running worker. Workers call this method on worker start-up.

This call both marks the worker as running and returns the credentials the worker will require to perform its work. The worker must provide some proof of its identity, and that proof varies by provider type.

source

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

Reregister a Worker

Reregister a running worker.

This will generate and return new Taskcluster credentials for the worker on that instance to use. The credentials will not live longer the registrationTimeout for that worker. The endpoint will update terminateAfter for the worker so that worker-manager does not terminate the instance.

source

pub async fn listWorkers( &self, provisionerId: &str, workerType: &str, continuationToken: Option<&str>, limit: Option<&str>, quarantined: Option<&str>, workerState: Option<&str> ) -> Result<Value, Error>

Get a list of all active workers of a workerType

Get a list of all active workers of a workerType.

listWorkers allows a response to be filtered by quarantined and non quarantined workers, as well as the current state of the worker. To filter the query, you should call the end-point with one of [quarantined, workerState] as a query-string option with a true or false value.

The response is paged. If this end-point returns a continuationToken, you should call the end-point again with the continuationToken as a query-string option. By default this end-point will list up to 1000 workers in a single page. You may limit this with the query-string parameter limit.

source

pub fn listWorkers_url( &self, provisionerId: &str, workerType: &str, continuationToken: Option<&str>, limit: Option<&str>, quarantined: Option<&str>, workerState: Option<&str> ) -> Result<String, Error>

Generate an unsigned URL for the listWorkers endpoint

source

pub fn listWorkers_signed_url( &self, provisionerId: &str, workerType: &str, continuationToken: Option<&str>, limit: Option<&str>, quarantined: Option<&str>, workerState: Option<&str>, ttl: Duration ) -> Result<String, Error>

Generate a signed URL for the listWorkers endpoint

source

pub async fn getWorker( &self, provisionerId: &str, workerType: &str, workerGroup: &str, workerId: &str ) -> Result<Value, Error>

Get a worker-type

Get a worker from a worker-type.

source

pub fn getWorker_url( &self, provisionerId: &str, workerType: &str, workerGroup: &str, workerId: &str ) -> Result<String, Error>

Generate an unsigned URL for the getWorker endpoint

source

pub fn getWorker_signed_url( &self, provisionerId: &str, workerType: &str, workerGroup: &str, workerId: &str, ttl: Duration ) -> Result<String, Error>

Generate a signed URL for the getWorker 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§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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 Twhere V: MultiLane<T>,

§

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