Struct taskcluster::WorkerManager
source · 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
impl WorkerManager
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 WorkerManager 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 listProviders(
&self,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<Value, Error>
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.
sourcepub fn listProviders_url(
&self,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<String, Error>
pub fn listProviders_url( &self, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<String, Error>
Generate an unsigned URL for the listProviders endpoint
sourcepub fn listProviders_signed_url(
&self,
continuationToken: Option<&str>,
limit: Option<&str>,
ttl: Duration
) -> Result<String, Error>
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
sourcepub async fn createWorkerPool(
&self,
workerPoolId: &str,
payload: &Value
) -> Result<Value, Error>
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.
sourcepub async fn updateWorkerPool(
&self,
workerPoolId: &str,
payload: &Value
) -> Result<Value, Error>
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.
sourcepub async fn deleteWorkerPool(&self, workerPoolId: &str) -> Result<Value, Error>
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
.
sourcepub async fn workerPool(&self, workerPoolId: &str) -> Result<Value, Error>
pub async fn workerPool(&self, workerPoolId: &str) -> Result<Value, Error>
Get Worker Pool
Fetch an existing worker pool defition.
sourcepub fn workerPool_url(&self, workerPoolId: &str) -> Result<String, Error>
pub fn workerPool_url(&self, workerPoolId: &str) -> Result<String, Error>
Generate an unsigned URL for the workerPool endpoint
sourcepub fn workerPool_signed_url(
&self,
workerPoolId: &str,
ttl: Duration
) -> Result<String, Error>
pub fn workerPool_signed_url( &self, workerPoolId: &str, ttl: Duration ) -> Result<String, Error>
Generate a signed URL for the workerPool endpoint
sourcepub async fn listWorkerPools(
&self,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<Value, Error>
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.
sourcepub fn listWorkerPools_url(
&self,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<String, Error>
pub fn listWorkerPools_url( &self, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<String, Error>
Generate an unsigned URL for the listWorkerPools endpoint
sourcepub fn listWorkerPools_signed_url(
&self,
continuationToken: Option<&str>,
limit: Option<&str>,
ttl: Duration
) -> Result<String, Error>
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
sourcepub async fn reportWorkerError(
&self,
workerPoolId: &str,
payload: &Value
) -> Result<Value, Error>
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.
sourcepub async fn listWorkerPoolErrors(
&self,
workerPoolId: &str,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<Value, Error>
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.
sourcepub fn listWorkerPoolErrors_url(
&self,
workerPoolId: &str,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<String, Error>
pub fn listWorkerPoolErrors_url( &self, workerPoolId: &str, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<String, Error>
Generate an unsigned URL for the listWorkerPoolErrors endpoint
sourcepub fn listWorkerPoolErrors_signed_url(
&self,
workerPoolId: &str,
continuationToken: Option<&str>,
limit: Option<&str>,
ttl: Duration
) -> Result<String, Error>
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
sourcepub async fn listWorkersForWorkerGroup(
&self,
workerPoolId: &str,
workerGroup: &str,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<Value, Error>
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.
sourcepub fn listWorkersForWorkerGroup_url(
&self,
workerPoolId: &str,
workerGroup: &str,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<String, Error>
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
sourcepub fn listWorkersForWorkerGroup_signed_url(
&self,
workerPoolId: &str,
workerGroup: &str,
continuationToken: Option<&str>,
limit: Option<&str>,
ttl: Duration
) -> Result<String, Error>
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
sourcepub async fn worker(
&self,
workerPoolId: &str,
workerGroup: &str,
workerId: &str
) -> Result<Value, Error>
pub async fn worker( &self, workerPoolId: &str, workerGroup: &str, workerId: &str ) -> Result<Value, Error>
Get a Worker
Get a single worker.
sourcepub fn worker_url(
&self,
workerPoolId: &str,
workerGroup: &str,
workerId: &str
) -> Result<String, Error>
pub fn worker_url( &self, workerPoolId: &str, workerGroup: &str, workerId: &str ) -> Result<String, Error>
Generate an unsigned URL for the worker endpoint
sourcepub fn worker_signed_url(
&self,
workerPoolId: &str,
workerGroup: &str,
workerId: &str,
ttl: Duration
) -> Result<String, Error>
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
sourcepub async fn createWorker(
&self,
workerPoolId: &str,
workerGroup: &str,
workerId: &str,
payload: &Value
) -> Result<Value, Error>
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.
sourcepub async fn updateWorker(
&self,
workerPoolId: &str,
workerGroup: &str,
workerId: &str,
payload: &Value
) -> Result<Value, Error>
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.
sourcepub async fn removeWorker(
&self,
workerPoolId: &str,
workerGroup: &str,
workerId: &str
) -> Result<(), Error>
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.
sourcepub async fn listWorkersForWorkerPool(
&self,
workerPoolId: &str,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<Value, Error>
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.
sourcepub fn listWorkersForWorkerPool_url(
&self,
workerPoolId: &str,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<String, Error>
pub fn listWorkersForWorkerPool_url( &self, workerPoolId: &str, continuationToken: Option<&str>, limit: Option<&str> ) -> Result<String, Error>
Generate an unsigned URL for the listWorkersForWorkerPool endpoint
sourcepub fn listWorkersForWorkerPool_signed_url(
&self,
workerPoolId: &str,
continuationToken: Option<&str>,
limit: Option<&str>,
ttl: Duration
) -> Result<String, Error>
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
sourcepub async fn registerWorker(&self, payload: &Value) -> Result<Value, Error>
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.
sourcepub async fn reregisterWorker(&self, payload: &Value) -> Result<Value, Error>
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.
sourcepub async fn listWorkers(
&self,
provisionerId: &str,
workerType: &str,
continuationToken: Option<&str>,
limit: Option<&str>,
quarantined: Option<&str>,
workerState: Option<&str>
) -> Result<Value, Error>
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
.
sourcepub fn listWorkers_url(
&self,
provisionerId: &str,
workerType: &str,
continuationToken: Option<&str>,
limit: Option<&str>,
quarantined: Option<&str>,
workerState: Option<&str>
) -> Result<String, Error>
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
sourcepub 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>
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
sourcepub async fn getWorker(
&self,
provisionerId: &str,
workerType: &str,
workerGroup: &str,
workerId: &str
) -> Result<Value, Error>
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.
sourcepub fn getWorker_url(
&self,
provisionerId: &str,
workerType: &str,
workerGroup: &str,
workerId: &str
) -> Result<String, Error>
pub fn getWorker_url( &self, provisionerId: &str, workerType: &str, workerGroup: &str, workerId: &str ) -> Result<String, Error>
Generate an unsigned URL for the getWorker endpoint
sourcepub fn getWorker_signed_url(
&self,
provisionerId: &str,
workerType: &str,
workerGroup: &str,
workerId: &str,
ttl: Duration
) -> Result<String, Error>
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
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