Class QTask
This class manges tasks life cycle: submission, monitor, delete.
Inherited Members
Namespace: QarnotSDK
Assembly: QarnotSDK.dll
Syntax
public class QTask : AQTask
Constructors
QTask(Connection, Guid)
Create a task object given an existing Uuid.
Declaration
public QTask(Connection connection, Guid uuid)
Parameters
| Type | Name | Description |
|---|---|---|
| Connection | connection | The inner connection object. |
| Guid | uuid | The Uuid of an already existing task. |
QTask(Connection, string, QJob, AdvancedRanges, string, string, SchedulingType?)
Create a new task inside of an existing job.
Declaration
public QTask(Connection connection, string name, QJob job, AdvancedRanges range, string shortname = null, string profile = null, SchedulingType? schedulingType = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Connection | connection | The inner connection object. |
| string | name | The task shortname. |
| QJob | job | The job where this task will run. |
| AdvancedRanges | range | Which instance ids of the task have to run. If not specified, it must be given when the task is submitted. |
| string | shortname | optional unique friendly shortname of the task. |
| string | profile | profile for the task.(should be use with a job not attached to a pool) |
| SchedulingType? | schedulingType | Type of scheduling used for the dispatch of the task |
QTask(Connection, string, QJob, uint, string, string, SchedulingType?)
Create a new task inside an existing job.
Declaration
public QTask(Connection connection, string name, QJob job, uint instanceCount = 0, string shortname = null, string profile = null, SchedulingType? schedulingType = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Connection | connection | The inner connection object. |
| string | name | The task name. |
| QJob | job | The job where this task will run. |
| uint | instanceCount | How many times the task have to run. If not specified, it must be given when the task is submitted. |
| string | shortname | optional unique friendly shortname of the task. |
| string | profile | profile for the task.(should be use with a job not attached to a pool) |
| SchedulingType? | schedulingType | Type of scheduling used for the dispatch of the task |
QTask(Connection, string, QPool, AdvancedRanges, string, bool?)
Create a new task inside an existing pool, with an advanced range representation.
Declaration
public QTask(Connection connection, string name, QPool pool, AdvancedRanges range, string shortname = null, bool? waitForPoolResourcesSynchronization = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Connection | connection | The inner connection object. |
| string | name | The task shortname. |
| QPool | pool | The pool where this task will run. |
| AdvancedRanges | range | Which instance ids of the task have to run. If not specified, it must be given when the task is submitted. |
| string | shortname | optional unique friendly shortname of the task. |
| bool? | waitForPoolResourcesSynchronization | Whether task should wait for previous pool resources update to be completed before executing. See WaitForPoolResourcesSynchronization |
QTask(Connection, string, QPool, uint, string, bool?)
Create a new task inside an existing pool.
Declaration
public QTask(Connection connection, string name, QPool pool, uint instanceCount = 0, string shortname = null, bool? waitForPoolResourcesSynchronization = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Connection | connection | The inner connection object. |
| string | name | The task name. |
| QPool | pool | The pool where this task will run. |
| uint | instanceCount | How many times the task have to run. If not specified, it must be given when the task is submitted. |
| string | shortname | optional unique friendly shortname of the task. |
| bool? | waitForPoolResourcesSynchronization | Whether task should wait for previous pool resources update to be completed before executing. See WaitForPoolResourcesSynchronization |
QTask(Connection, string, string, AdvancedRanges, string, SchedulingType?)
Create a new task outside of a pool with an advanced range representation.
Declaration
public QTask(Connection connection, string name, string profile, AdvancedRanges range, string shortname = null, SchedulingType? schedulingType = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Connection | connection | The inner connection object. |
| string | name | The task name. |
| string | profile | The task profile. If not specified, it must be given when the task is submitted. |
| AdvancedRanges | range | Which instance ids of the task have to run. If not specified, it must be given when the task is submitted. |
| string | shortname | optional unique friendly shortname of the task. |
| SchedulingType? | schedulingType | Type of scheduling used for the dispatch of the task |
QTask(Connection, string, string, string)
Create a new task outside of a pool.
Declaration
public QTask(Connection connection, string name, string profile = null, string shortname = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Connection | connection | The inner connection object. |
| string | name | The task shortname. |
| string | profile | The task profile. If not specified, it must be given when the task is submitted. |
| string | shortname | optional unique friendly shortname of the task. |
QTask(Connection, string, string, uint, string, SchedulingType?)
Create a new task outside of a pool.
Declaration
public QTask(Connection connection, string name, string profile, uint instanceCount = 0, string shortname = null, SchedulingType? schedulingType = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Connection | connection | The inner connection object. |
| string | name | The task name. |
| string | profile | The task profile. If not specified, it must be given when the task is submitted. |
| uint | instanceCount | How many times the task have to run. If not specified, it must be given when the task is submitted. |
| string | shortname | optional unique friendly shortname of the task. |
| SchedulingType? | schedulingType | Type of scheduling used for the dispatch of the task |
Properties
AutoDeleteOnCompletion
AutoDeleteOnCompletion: Field allowing the automatic deletion of the task when in a final state. Must be set before the submission.
Declaration
public bool AutoDeleteOnCompletion { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Completed
True if the task is completed or false if the task is still running or deploying. Use UpdateStatus or UpdateStatusAsync to refresh.
Declaration
public virtual bool Completed { get; }
Property Value
| Type | Description |
|---|---|
| bool |
CompletedInstances
The list of status of completed instances.
Declaration
public virtual List<QTaskCompletedInstance> CompletedInstances { get; set; }
Property Value
| Type | Description |
|---|---|
| List<QTaskCompletedInstance> |
CompletionTimeToLive
CompletionTimeToLive: Final State Duration before deletion of the task. Must be set before the submission.
Declaration
public TimeSpan CompletionTimeToLive { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Constants
The task constants.
Declaration
public virtual Dictionary<string, string> Constants { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, string> | return all Constants |
Constraints
The task constraints.
Declaration
public virtual Dictionary<string, string> Constraints { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, string> | return all Constraints |
CreationDate
The task creation date. Available only after the submission.
Declaration
public virtual DateTime CreationDate { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
DefaultResourcesCacheTTLSec
The default TTL for the task resources cache.
Declaration
public virtual uint? DefaultResourcesCacheTTLSec { get; set; }
Property Value
| Type | Description |
|---|---|
| uint? |
DependsOn
The Task Dependencies Guid list of tasks to wait before running The task need to be in a job with depencendies activated
Declaration
public virtual List<Guid> DependsOn { get; set; }
Property Value
| Type | Description |
|---|---|
| List<Guid> |
EndDate
The task end date.
Declaration
public virtual DateTime EndDate { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
Errors
Retrieve the task errors.
Declaration
public virtual List<QTaskError> Errors { get; }
Property Value
| Type | Description |
|---|---|
| List<QTaskError> |
Executing
True if the task is executing (PartiallyExecuting or FullyExecuting) or false if the task is in another state. Use UpdateStatus or UpdateStatusAsync to refresh.
Declaration
public virtual bool Executing { get; }
Property Value
| Type | Description |
|---|---|
| bool |
ExecutionTime
The task execution time.
Declaration
public virtual TimeSpan ExecutionTime { get; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
ForcedConstants
Constant forced for the task.
Declaration
public virtual List<ForcedConstant> ForcedConstants { get; set; }
Property Value
| Type | Description |
|---|---|
| List<ForcedConstant> |
ForcedNetworkRules
Network rules forced for the task.
Declaration
public virtual List<ForcedNetworkRule> ForcedNetworkRules { get; set; }
Property Value
| Type | Description |
|---|---|
| List<ForcedNetworkRule> |
HardwareConstraints
The task hardware constraints list.
Declaration
public virtual HardwareConstraints HardwareConstraints { get; set; }
Property Value
| Type | Description |
|---|---|
| HardwareConstraints |
InstanceCount
How many times this task have to run.
Declaration
public virtual uint InstanceCount { get; }
Property Value
| Type | Description |
|---|---|
| uint |
Instances
Enumeration on the task instance ids. Useful if an advanced range is used.
Declaration
public virtual IEnumerable<uint> Instances { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<uint> |
Job
The job the task is attached to or null if the task isn't attached to a job.
Declaration
public virtual QJob Job { get; }
Property Value
| Type | Description |
|---|---|
| QJob |
JobUuid
The job id where the task is running or default Guid if the task is not attached to a job.
Declaration
public virtual Guid JobUuid { get; }
Property Value
| Type | Description |
|---|---|
| Guid |
Labels
The task labels.
Declaration
public virtual Dictionary<string, string> Labels { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, string> | return all Labels |
LastModified
The Task last modified date.
Declaration
public virtual DateTime? LastModified { get; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
MaxRetriesPerInstance
How many times this task can be retrieved if it is stopped while running.
Declaration
[Obsolete("Prefer the use of the RetrySettings field and its MaxPerInstanceRetries property")]
public virtual uint MaxRetriesPerInstance { get; set; }
Property Value
| Type | Description |
|---|---|
| uint |
Name
The task name.
Declaration
public virtual string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Pool
The pool where the task is running or null if the task doesn't belong to a pool.
Declaration
public virtual QPool Pool { get; }
Property Value
| Type | Description |
|---|---|
| QPool |
PoolUuid
The pool id where the task is running or default Guid if the task doesn't belong to a pool.
Declaration
public virtual Guid PoolUuid { get; }
Property Value
| Type | Description |
|---|---|
| Guid |
PreviousState
Retrieve the task previous state (see QTaskStates). Available only after the submission. Use UpdateStatus or UpdateStatusAsync to refresh.
Declaration
public virtual string PreviousState { get; }
Property Value
| Type | Description |
|---|---|
| string |
PreviousStateTransitionTime
Retrieve the task previous state transition utc-time (see QTaskStates). Available only after the submission. Use UpdateStatus or UpdateStatusAsync to refresh.
Declaration
public virtual DateTime? PreviousStateTransitionTime { get; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
Privileges
The task privileges list.
Declaration
public virtual Privileges Privileges { get; set; }
Property Value
| Type | Description |
|---|---|
| Privileges |
Profile
The task profile.
Declaration
public virtual string Profile { get; }
Property Value
| Type | Description |
|---|---|
| string |
Resources
Qarnot resources buckets bound to this task. Can be set only before the task submission.
Declaration
public virtual List<QAbstractStorage> Resources { get; set; }
Property Value
| Type | Description |
|---|---|
| List<QAbstractStorage> |
ResourcesBuckets
Qarnot resources buckets bound to this task. Can be set only before the task submission.
Declaration
public virtual IEnumerable<QBucket> ResourcesBuckets { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<QBucket> |
Results
Qarnot result bucket bound to this task. Can be set only before the task submission.
Declaration
public virtual QAbstractStorage Results { get; set; }
Property Value
| Type | Description |
|---|---|
| QAbstractStorage |
ResultsBlacklist
The results exclude all the files matching that regular expression. Must be set before the submission.
Declaration
public virtual string ResultsBlacklist { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ResultsBucket
Qarnot result bucket bound to this task. Can be set only before the task submission.
Declaration
public virtual QBucket ResultsBucket { get; }
Property Value
| Type | Description |
|---|---|
| QBucket |
ResultsBucketPrefix
The results bucket prefixes.
Declaration
public virtual string ResultsBucketPrefix { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ResultsCount
Increased each time a new set of results is available, when snapshot or final results are ready. Use UpdateStatus or UpdateStatusAsync to refresh.
Declaration
public virtual uint ResultsCount { get; }
Property Value
| Type | Description |
|---|---|
| uint |
ResultsWhitelist
The results include only the files matching that regular expression. Must be set before the submission.
Declaration
public virtual string ResultsWhitelist { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
RetrySettings
The task retry settings if instance fails.
Declaration
public virtual RetrySettings RetrySettings { get; set; }
Property Value
| Type | Description |
|---|---|
| RetrySettings |
RunningCoreCount
The actual running cores count.
Declaration
public virtual uint RunningCoreCount { get; }
Property Value
| Type | Description |
|---|---|
| uint |
RunningInstanceCount
The actual running instance count.
Declaration
public virtual uint RunningInstanceCount { get; }
Property Value
| Type | Description |
|---|---|
| uint |
SchedulingType
Scheduling type use for the dispatch of the task.
Declaration
public SchedulingType? SchedulingType { get; set; }
Property Value
| Type | Description |
|---|---|
| SchedulingType? |
Remarks
SecretsAccessRights
Description of the secrets the task will have access to when running.
Declaration
public virtual QSecretAccessRights SecretsAccessRights { get; set; }
Property Value
| Type | Description |
|---|---|
| QSecretAccessRights |
Remarks
Secrets can be accessible either by exact match on the key or by using a prefix in order to match all the secrets starting with said prefix.
Shortname
The task shortname identifier. The shortname is provided by the user. It has to be unique.
Declaration
public virtual string Shortname { get; }
Property Value
| Type | Description |
|---|---|
| string |
SnapshotBlacklist
The snapshots exclude all the files matching that regular expression. Must be set before the submission.
Declaration
public virtual string SnapshotBlacklist { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
SnapshotBucket
The snapshots bucket, can be different from the Result bucket.
Declaration
public virtual QBucket SnapshotBucket { get; set; }
Property Value
| Type | Description |
|---|---|
| QBucket |
SnapshotBucketPrefix
The snapshots bucket prefixes.
Declaration
public virtual string SnapshotBucketPrefix { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
SnapshotInterval
The delay in seconds between two periodic snapshots. Once the task is running, use the SnapshotPeriodic method to update.
Declaration
public virtual int SnapshotInterval { get; }
Property Value
| Type | Description |
|---|---|
| int |
SnapshotWhitelist
The snapshots include only the files matching that regular expression. Must be set before the submission.
Declaration
public virtual string SnapshotWhitelist { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
State
Retrieve the task state (see QTaskStates). Available only after the submission. Use UpdateStatus or UpdateStatusAsync to refresh.
Declaration
public virtual string State { get; }
Property Value
| Type | Description |
|---|---|
| string |
StateTransitionTime
Retrieve the task state transition utc-time (see QTaskStates). Available only after the submission. Use UpdateStatus or UpdateStatusAsync to refresh.
Declaration
public virtual DateTime? StateTransitionTime { get; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
Status
Retrieve the task detailed status. Available only after the submission. Use UpdateStatus or UpdateStatusAsync to refresh.
Declaration
public virtual QTaskStatus Status { get; }
Property Value
| Type | Description |
|---|---|
| QTaskStatus |
Tags
The custom task tag list.
Declaration
public virtual List<string> Tags { get; }
Property Value
| Type | Description |
|---|---|
| List<string> |
TargetedReservedMachineKey
The key of the reserved machine the task should be dispatch on.
Declaration
public string TargetedReservedMachineKey { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
To use with Reserved SchedulingType
WaitForPoolResourcesSynchronization
Queue in-pool task execution behind pool resources update.
Declaration
public virtual bool? WaitForPoolResourcesSynchronization { get; }
Property Value
| Type | Description |
|---|---|
| bool? |
Remarks
For an in-pool task, if set to true, any task submitted after a pool resources update will be sure to see the newer pool resources during its execution. The task will be queued until a pool slot with recent enough resources is available. Setting this to false will deactivate this behavior. If left null, then the pool's TaskDefaultWaitForPoolResourcesSynchronization value will be used. If both are null, then it will default to false.
See Also
WallTime
The task wall time.
Declaration
public virtual TimeSpan WallTime { get; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Methods
AddConstant(string, string)
Deprecated, use SetConstant.
Declaration
[Obsolete("use SetConstant")]
public virtual void AddConstant(string name, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Constant name. |
| string | value | Constant value. |
Commit(CancellationToken)
Commit the local task changes.
Declaration
[Obsolete("Commit is deprecated, please use CommitAsync instead.")]
public virtual void Commit(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
CommitAsync(CancellationToken)
Commit the local task changes.
Declaration
public virtual Task CommitAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task |
Delete(CancellationToken, bool, bool, bool)
Delete the task. If the task is running, the task is aborted and deleted.
Declaration
[Obsolete("Delete is deprecated, please use DeleteAsync instead.")]
public override void Delete(CancellationToken cancellationToken, bool failIfDoesntExist = false, bool purgeResources = false, bool purgeResults = false)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | Optional token to cancel the request. |
| bool | failIfDoesntExist | If set to true and the task doesn't exist, an exception is thrown. Default is false. |
| bool | purgeResources | Boolean to trigger all resource storages deletion. Default is false. |
| bool | purgeResults | Boolean to trigger result storage deletion. Default is false. |
Overrides
DeleteAsync(CancellationToken, bool, bool, bool)
Delete the task. If the task is running, the task is aborted and deleted.
Declaration
public override Task DeleteAsync(CancellationToken cancellationToken, bool failIfDoesntExist = false, bool purgeResources = false, bool purgeResults = false)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | Optional token to cancel the request. |
| bool | failIfDoesntExist | If set to false and the task doesn't exist, no exception is thrown. Default is true. |
| bool | purgeResources | Boolean to trigger all resource storages deletion. Default is false. |
| bool | purgeResults | Boolean to trigger result storage deletion. Default is false. |
Returns
| Type | Description |
|---|---|
| Task |
Overrides
DownloadResult(string, CancellationToken)
Download result in the given directory warning: Will override output_dir content.
Declaration
[Obsolete("DownloadResult is deprecated, please use DownloadResultAsync instead.")]
public virtual void DownloadResult(string outputDirectory, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | outputDirectory | local directory for the retrieved files |
| CancellationToken | cancellationToken | Optional token to cancel the request |
DownloadResultAsync(string, CancellationToken)
Download result in the given directory warning: Will override output_dir content.
Declaration
public virtual Task DownloadResultAsync(string outputDirectory, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | outputDirectory | local directory for the retrieved files |
| CancellationToken | cancellationToken | Optional token to cancel the request |
Returns
| Type | Description |
|---|---|
| Task |
GetCarbonFactsAsync(string, CancellationToken)
Get the task carbon facts
Declaration
public virtual Task<CarbonFacts> GetCarbonFactsAsync(string referenceDatacenter = null, CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | referenceDatacenter | |
| CancellationToken | ct |
Returns
| Type | Description |
|---|---|
| Task<CarbonFacts> | The carbon facts of the task. |
GetInstanceStatus(uint)
Get the status of an instance given its instance id. Note: the status of an instance could also be retrieved in the Status.CompletedInstances or Status.RunningInstancesInfo.PerRunningInstanceInfo structures. This method provides an unified way to retrieve those information.
Declaration
public virtual QTaskInstanceStatus GetInstanceStatus(uint instanceId)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | instanceId | The id of the instance. |
Returns
| Type | Description |
|---|---|
| QTaskInstanceStatus | The status of the instance or null if not available. |
GetPublicHostForApplicationPort(ushort)
Return the public host and port to establish an inbound connection to the master compute node (instance 0) running your task. Note: your profile have to define one or more inbound connection to support that feature. For example, the profile "docker-network-ssh" defines a redirection to the ssh port 22. If you need inbound connections on a specific port, you can make a request to the support team.
Declaration
public virtual string GetPublicHostForApplicationPort(ushort port)
Parameters
| Type | Name | Description |
|---|---|---|
| ushort | port | The port you want to access on the master compute node (instance 0). |
Returns
| Type | Description |
|---|---|
| string | The host and port formated in a string "host:port". |
Run(int, string, CancellationToken)
Run this task.
Declaration
[Obsolete("Run is deprecated, please use RunAsync instead.")]
public virtual void Run(int taskTimeoutSeconds = -1, string outputDirectory = null, CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | taskTimeoutSeconds | Optional number of second before abort is called. |
| string | outputDirectory | local directory for the retrieved files |
| CancellationToken | ct | Optional token to cancel the request. |
RunAsync(int, string, CancellationToken)
Run this task.
Declaration
public virtual Task RunAsync(int taskTimeoutSeconds = -1, string outputDirectory = null, CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | taskTimeoutSeconds | Optional number of second before abort is called. |
| string | outputDirectory | local directory for the retrieved files |
| CancellationToken | ct | Optional token to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task |
SetConstant(string, string)
Set a constant. If the constant already exists, it is replaced (or removed if value is null).
Declaration
public virtual void SetConstant(string name, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Constant name. |
| string | value | Constant value. If null, the constant is deleted. |
SetConstraint(string, string)
Set a constraint. If the constraint already exists, it is replaced (or removed if value is null).
Declaration
public virtual void SetConstraint(string name, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Constraint name. |
| string | value | Constraint value. If null, the constraint is deleted. |
SetLabel(string, string)
Set a label. If the label already exists, it is replaced (or removed if value is null).
Declaration
public virtual void SetLabel(string name, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Label name. |
| string | value | Label value. If null, the label is deleted. |
SetTags(params string[])
Set the a list of tags for the task.
Declaration
public virtual void SetTags(params string[] tags)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | tags | Task tags. |
SetTaskDependencies(params QTask[])
Set the task depencencies. The task need to be in a job with depencendies activated
Declaration
public virtual void SetTaskDependencies(params QTask[] tasks)
Parameters
| Type | Name | Description |
|---|---|---|
| QTask[] | tasks | list of task this task depends on. |
SetTaskDependencies(params Guid[])
Set the task depencencies. The task need to be in a job with depencendies activated
Declaration
public virtual void SetTaskDependencies(params Guid[] guids)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid[] | guids | list of task guids this task depends on. |
Submit(string, AdvancedRanges, CancellationToken)
Submit this task.
Declaration
[Obsolete("Submit is deprecated, please use SubmitAsync instead.")]
public virtual void Submit(string profile, AdvancedRanges range, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | profile | The task profile, if not running inside a pool. Optional if the profile has already been defined in the constructor or if the task is bound to a pool, profile must be null. |
| AdvancedRanges | range | Which instance ids of the task have to run. Optional if the instance count has already been defined in the constructor, it can be set to null. |
| CancellationToken | cancellationToken | Optional token to cancel the request. |
Submit(string, uint, CancellationToken)
Submit this task.
Declaration
[Obsolete("Submit is deprecated, please use SubmitAsync instead.")]
public virtual void Submit(string profile = null, uint instanceCount = 0, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | profile | The task profile, if not running inside a pool. Optional if the profile has already been defined in the constructor or if the task is bound to a pool, profile must be null. |
| uint | instanceCount | How many times the task have to run. Optional if the instance count has already been defined in the constructor, it can be set to 0. |
| CancellationToken | cancellationToken | Optional token to cancel the request. |
SubmitAsync(string, AdvancedRanges, CancellationToken)
Submit this task.
Declaration
public virtual Task SubmitAsync(string profile, AdvancedRanges range, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | profile | The task profile, if not running inside a pool. Optional if the profile has already been defined in the constructor or if the task is bound to a pool, profile must be null. |
| AdvancedRanges | range | Which instance ids of the task have to run. Optional if the instance count has already been defined in the constructor, it can be set to null. |
| CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task |
SubmitAsync(string, uint, CancellationToken)
Submit this task.
Declaration
public virtual Task SubmitAsync(string profile = null, uint instanceCount = 0, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | profile | The task profile, if not running inside a pool. Optional if the profile has already been defined in the constructor or if the task is bound to a pool, profile must be null. |
| uint | instanceCount | How many times the task have to run. Optional if the instance count has already been defined in the constructor, it can be set to 0. |
| CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task |
TriggerPeriodicSnapshotAsync(uint, string, string, QBucket, string, CancellationToken)
Call a periodic snapshot every interval seconds. You can select some additional options, like a bucket or a whitelist.
Declaration
public override Task TriggerPeriodicSnapshotAsync(uint interval, string whitelist = null, string blacklist = null, QBucket bucket = null, string bucketPrefix = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | interval | The interval in second between 2 snapshots. |
| string | whitelist | A globing string representing the whitelist filenames. |
| string | blacklist | A globing string representing the blacklist filenames. |
| QBucket | bucket | A specific bucket to retrieve the snapshot files. |
| string | bucketPrefix | A bucket prefix folder to the snapshot bucket, bucketPrefix prevent key collisions when using snapshots with many tasks. |
| CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task |
Overrides
UpdateStatus(bool)
Update this task state and status.
Declaration
[Obsolete("UpdateStatus is deprecated, please use UpdateStatusAsync instead.")]
public virtual void UpdateStatus(bool updateQBucketsInfo = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | updateQBucketsInfo | If set to true, the resources and results bucket objects are also updated. |
UpdateStatus(CancellationToken, bool)
Update this task state and status.
Declaration
[Obsolete("UpdateStatus is deprecated, please use UpdateStatusAsync instead.")]
public virtual void UpdateStatus(CancellationToken cancellationToken, bool updateQBucketsInfo = true)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | Optional token to cancel the request. |
| bool | updateQBucketsInfo | If set to true, the resources and results bucket objects are also updated. |
UpdateStatusAsync(bool)
Update this task state and status.
Declaration
public virtual Task UpdateStatusAsync(bool updateQBucketsInfo = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | updateQBucketsInfo | If set to true, the resources and results bucket objects are also updated. |
Returns
| Type | Description |
|---|---|
| Task |
UpdateStatusAsync(CancellationToken, bool)
Update this task state and status.
Declaration
public virtual Task UpdateStatusAsync(CancellationToken cancellationToken, bool updateQBucketsInfo = true)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | Optional token to cancel the request. |
| bool | updateQBucketsInfo | If set to true, the resources and results bucket objects are also updated. |
Returns
| Type | Description |
|---|---|
| Task |
Wait(int, CancellationToken)
Wait this task completion.
Declaration
[Obsolete("Wait is deprecated, please use WaitAsync instead.")]
public virtual bool Wait(int taskTimeoutSeconds = -1, CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | taskTimeoutSeconds | Optional maximum number of second to wait for completion. |
| CancellationToken | ct | Optional token to cancel the request. |
Returns
| Type | Description |
|---|---|
| bool |
WaitAsync(int, CancellationToken)
Wait this task completion.
Declaration
public virtual Task<bool> WaitAsync(int taskTimeoutSeconds = -1, CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | taskTimeoutSeconds | Optional maximum number of second to wait for completion. |
| CancellationToken | ct | Optional token to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<bool> | true if the task is completed |