Class AQPool
This class manages pools life cycle: submission, monitor, delete.
Inherited Members
Namespace: QarnotSDK
Assembly: QarnotSDK.dll
Syntax
public abstract class AQPool
Fields
_api
Reference to the api connection.
Declaration
protected Connection _api
Field Value
Type | Description |
---|---|
Connection |
_uri
The pool resource uri.
Declaration
protected string _uri
Field Value
Type | Description |
---|---|
string |
Properties
Connection
The inner Connection object.
Declaration
public virtual Connection Connection { get; }
Property Value
Type | Description |
---|---|
Connection |
Uuid
The pool unique identifier. The Uuid is generated by the Api when the pool is submitted.
Declaration
public virtual Guid Uuid { get; }
Property Value
Type | Description |
---|---|
Guid |
Methods
Close(CancellationToken)
Abort a running pool.
Declaration
[Obsolete("Close is deprecated, please use CloseAsync instead.")]
public virtual void Close(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
CloseAsync(CancellationToken)
Close the pool.
Declaration
public virtual Task CloseAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
CopyFreshOutputsToAsync(Stream, string, CancellationToken)
Copies the fresh new content of the outputs since the last call to the given stream.
Declaration
protected virtual Task CopyFreshOutputsToAsync(Stream destinationStream, string endpoint, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | destinationStream | The destination stream. |
string | endpoint | Endpoint from which to get the output content. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
CopyFreshStderrToAsync(Stream, uint?, CancellationToken)
Copies the fresh new standard error of the pool instance since the last call to the given stream.
Declaration
public virtual Task CopyFreshStderrToAsync(Stream destinationStream, uint? instanceId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | destinationStream | The destination stream. |
uint? | instanceId | (optional) Id of the instance of which we want the fresh stderr. Will retrieve the fresh stderr of all instances if null |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
CopyFreshStderrToAsync(Stream, CancellationToken)
Copies the fresh new standard error of the pool instance since the last call to the given stream.
Declaration
public virtual Task CopyFreshStderrToAsync(Stream destinationStream, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | destinationStream | The destination stream. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
CopyFreshStdoutToAsync(Stream, uint?, CancellationToken)
Copies the fresh new standard output of the pool instance since the last call to the given stream.
Declaration
public virtual Task CopyFreshStdoutToAsync(Stream destinationStream, uint? instanceId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | destinationStream | The destination stream. |
uint? | instanceId | (optional) Id of the instance of which we want the fresh stdout. Will retrieve the fresh stdout of all instances if null |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
CopyFreshStdoutToAsync(Stream, CancellationToken)
Copies the fresh new standard output since the last call to the given stream.
Declaration
public virtual Task CopyFreshStdoutToAsync(Stream destinationStream, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | destinationStream | The destination stream. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
CopyOutputsToAsync(Stream, string, CancellationToken)
Copies the full content of the outputs received from the endpoint to the given stream Note: the Content will rotate if it's too large
Declaration
protected virtual Task CopyOutputsToAsync(Stream destinationStream, string endpoint, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | destinationStream | The destination stream. |
string | endpoint | Endpoint from which to get the output content. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
CopyStderrToAsync(Stream, uint?, CancellationToken)
Copies the full standard error of the pool instance to the given stream. Note: the standard error will rotate if it's too large.
Declaration
public virtual Task CopyStderrToAsync(Stream destinationStream, uint? instanceId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | destinationStream | The destination stream. |
uint? | instanceId | (optional) Id of the instance of which we want the stderr. Will retrieve the stderr of all instances if null |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
CopyStderrToAsync(Stream, CancellationToken)
Copies the full standard error to the given stream. Note: the standard error will rotate if it's too large.
Declaration
public virtual Task CopyStderrToAsync(Stream destinationStream, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | destinationStream | The destination stream. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
CopyStdoutToAsync(Stream, uint?, CancellationToken)
Copies the full standard output of the pool instance to the given stream. Note: the standard output will rotate if it's too large.
Declaration
public virtual Task CopyStdoutToAsync(Stream destinationStream, uint? instanceId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | destinationStream | The destination stream. |
uint? | instanceId | (optional) Id of the instance of which we want the stdout. Will retrieve the stdout of all instances if null |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
CopyStdoutToAsync(Stream, CancellationToken)
Copies the full standard output to the given stream. Note: the standard output will rotate if it's too large.
Declaration
public virtual Task CopyStdoutToAsync(Stream destinationStream, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | destinationStream | The destination stream. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
Delete(bool, bool)
Delete the pool. If the pool is running, the pool is aborted and deleted.
Declaration
[Obsolete("Delete is deprecated, please use DeleteAsync instead.")]
public virtual void Delete(bool failIfDoesntExist = false, bool purgeResources = false)
Parameters
Type | Name | Description |
---|---|---|
bool | failIfDoesntExist | If set to false and the pool doesn't exist, no exception is thrown. Default is true. |
bool | purgeResources | Boolean to trigger all resource storages deletion. Default is false. |
Delete(CancellationToken, bool, bool)
Delete the pool. If the pool is running, the pool is aborted and deleted.
Declaration
[Obsolete("Delete is deprecated, please use DeleteAsync instead.")]
public abstract void Delete(CancellationToken cancellationToken, bool failIfDoesntExist = false, bool purgeResources = false)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
bool | failIfDoesntExist | If set to false and the pool doesn't exist, no exception is thrown. Default is true. |
bool | purgeResources | Boolean to trigger all resource storages deletion. Default is false. |
DeleteAsync(bool, bool)
Delete the pool. If the pool is running, the task is aborted and deleted.
Declaration
public virtual Task DeleteAsync(bool failIfDoesntExist = false, bool purgeResources = false)
Parameters
Type | Name | Description |
---|---|---|
bool | failIfDoesntExist | If set to false and the pool doesn't exist, no exception is thrown. Default is true. |
bool | purgeResources | Boolean to trigger all resource storages deletion. Default is false. |
Returns
Type | Description |
---|---|
Task |
DeleteAsync(CancellationToken, bool, bool)
Delete the pool. If the pool is running, the task is aborted and deleted.
Declaration
public abstract Task DeleteAsync(CancellationToken cancellationToken, bool failIfDoesntExist = false, bool purgeResources = false)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
bool | failIfDoesntExist | If set to false and the pool doesn't exist, no exception is thrown. Default is true. |
bool | purgeResources | Boolean to trigger all resource storages deletion. Default is false. |
Returns
Type | Description |
---|---|
Task |
FreshStderrAsync(uint?, CancellationToken)
Returns the fresh new standard error of the pool instance since the last call.
Declaration
public virtual Task<string> FreshStderrAsync(uint? instanceId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
uint? | instanceId | (optional) Id of the instance of which we want the fresh stderr. Will retrieve the fresh stderr of all instances if null. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task<string> | The instance fresh standard error. |
FreshStderrAsync(CancellationToken)
Returns the fresh new standard error since the last call.
Declaration
public virtual Task<string> FreshStderrAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task<string> | The pool fresh standard error. |
FreshStdoutAsync(uint?, CancellationToken)
Returns the fresh new standard output of the pool instance since the last call.
Declaration
public virtual Task<string> FreshStdoutAsync(uint? instanceId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
uint? | instanceId | (optional) Id of the instance of which we want the fresh stdout. Will retrieve the fresh stdout of all instances if null. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task<string> | The instance fresh standard output. |
FreshStdoutAsync(CancellationToken)
Returns the fresh new standard output since the last call.
Declaration
public virtual Task<string> FreshStdoutAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task<string> | The pool fresh standard output. |
StderrAsync(uint?, CancellationToken)
Return the full standard error of the pool instance. Note: the standard error will rotate if it's too large.
Declaration
public virtual Task<string> StderrAsync(uint? instanceId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
uint? | instanceId | (optional) Id of the instance of which we want the stderr. Will retrieve the stderr of all instances if null. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task<string> | The instance standard error. |
StderrAsync(CancellationToken)
Return the full standard error. Note: the standard error will rotate if it's too large.
Declaration
public virtual Task<string> StderrAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task<string> | The pool standard error. |
StdoutAsync(uint?, CancellationToken)
Returns the full standard output of the pool instance. Note: the standard output will rotate if it's too large.
Declaration
public virtual Task<string> StdoutAsync(uint? instanceId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
uint? | instanceId | (optional) Id of the instance of which we want the stdout. Will retrieve the stdout of all instances if null. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task<string> | The instance standard output. |
StdoutAsync(CancellationToken)
Returns the full standard output. Note: the standard output will rotate if it's too large.
Declaration
public virtual Task<string> StdoutAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task<string> | The pool standard output. |
Stop(CancellationToken)
Stop the pool.
Declaration
[Obsolete("use Close")]
public virtual void Stop(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
StopAsync(CancellationToken)
Delete the pool.
Declaration
[Obsolete("use CloseAsync")]
public virtual Task StopAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
UpdateResources(CancellationToken)
Request made on a running pool to re-sync the resource buckets to the compute nodes. 1 - Upload new files on your resource bucket, 2 - Call this method, 3 - The new files will appear on all the compute nodes in the $DOCKER_WORKDIR folder Note: There is no way to know when the files are effectively transfered. This information is available on the compute node only. Note: The update is additive only: files deleted from the bucket will NOT be deleted from the pool's resources directory.
Declaration
[Obsolete("UpdateResources is deprecated, please use UpdateResourcesAsync instead.")]
public virtual void UpdateResources(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
UpdateResourcesAsync(CancellationToken)
Request made on a running pool to re-sync the resource buckets to the compute nodes. 1 - Upload new files on your resource bucket, 2 - Call this method, 3 - The new files will appear on all the compute nodes in the $DOCKER_WORKDIR folder Note: There is no way to know when the files are effectively transfered. This information is available on the compute node only. Note: The update is additive only: files deleted from the bucket will NOT be deleted from the pool's resources directory.
Declaration
public Task UpdateResourcesAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |