Legacy jobs client
The legacy Jobs client will be deprecated in the future. You can switch from the Entities client to the Jobs client to start using the Jobs client.
The legacy Jobs client can be used to create many kinds of fetch jobs.
Available fetch jobs
The fetch job models are located in: Stylelabs.M.Sdk.Models.Jobs.
The available models are:
-
AzureFetchJobRequest- fetches one or more files from Azure blob storage. -
FileFetchJobRequest- fetches one or more files from a directory on the web server. -
WebFetchJobRequest- fetches one or more files over HTTP or HTTPS.
When creating a fetch job, the following arguments are always required:
-
Description- a description of the job. -
Asset id- the asset to link the fetched files on.
Create a fetch job
To create a fetch job, pass the fetch job model to the CreateFetchJobAsync method of the jobs client. This returns the ID of the newly created job.
The following example will fetch an image from a public URL and link it to an asset with ID 1000:
var webFetchJob = new WebFetchJobRequest("Fetches an example image from the web.", 1000)
{
Urls = new[] { "https://picsum.photos/200" }
};
long jobId = await MClient.Jobs.CreateFetchJobAsync(webFetchJob);