Struct taskcluster::Object

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

Object Service

The object service provides HTTP-accessible storage for large blobs of data.

Objects can be uploaded and downloaded, with the object data flowing directly from the storage “backend” to the caller, and not directly via this service. Once uploaded, objects are immutable until their expiration time.

Fields§

§client: Client

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

Implementations§

source§

impl Object

source

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

Create a new Object 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 createUpload( &self, name: &str, payload: &Value ) -> Result<Value, Error>

Begin upload of a new object

Create a new object by initiating upload of its data.

This endpoint implements negotiation of upload methods. It can be called multiple times if necessary, either to propose new upload methods or to renew credentials for an already-agreed upload.

The name parameter can contain any printable ASCII character (0x20 - 0x7e). The uploadId must be supplied by the caller, and any attempts to upload an object with the same name but a different uploadId will fail. Thus the first call to this method establishes the uploadId for the object, and as long as that value is kept secret, no other caller can upload an object of that name, regardless of scopes. Object expiration cannot be changed after the initial call, either. It is possible to call this method with no proposed upload methods, which has the effect of “locking in” the expiration, projectId, and uploadId properties and any supplied hashes.

Unfinished uploads expire after 1 day.

source

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

Mark an upload as complete.

This endpoint marks an upload as complete. This indicates that all data has been transmitted to the backend. After this call, no further calls to uploadObject are allowed, and downloads of the object may begin. This method is idempotent, but will fail if given an incorrect uploadId for an unfinished upload.

It is possible to finish an upload with no hashes specified via either startUpload or finishUpload. However, many clients will refuse to download an object with no hashes. The utility methods included with the client libraries always include hashes as of version 44.0.0.

Note that, once finishUpload is complete, the object is considered immutable.

source

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

Download object data

Start the process of downloading an object’s data. Call this endpoint with a list of acceptable download methods, and the server will select a method and return the corresponding payload.

Returns a 406 error if none of the given download methods are available.

See Download Methods for more detail.

source

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

Get an object’s metadata

Get the metadata for the named object. This metadata is not sufficient to get the object’s content; for that use startDownload.

source

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

Generate an unsigned URL for the object endpoint

source

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

Generate a signed URL for the object endpoint

source

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

Get an object’s data

Get the data in an object directly. This method does not return a JSON body, but redirects to a location that will serve the object content directly.

URLs for this endpoint, perhaps with attached authentication (?bewit=..), are typically used for downloads of objects by simple HTTP clients such as web browsers, curl, or wget.

This method is limited by the common capabilities of HTTP, so it may not be the most efficient, resilient, or featureful way to retrieve an artifact. Situations where such functionality is required should ues the startDownload API endpoint.

See Simple Downloads for more detail.

source

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

Generate an unsigned URL for the download endpoint

source

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

Generate a signed URL for the download 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 Object

§

impl Send for Object

§

impl Sync for Object

§

impl Unpin for Object

§

impl !UnwindSafe for Object

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.

§

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

§

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