Class OneComputePlatformClient
Provides an HTTP REST client for the OneCompute Platform web API.
Inherited Members
Namespace: DNVGL.One.Compute.Platform.Client
Assembly: DNVGL.One.Compute.Platform.Client.dll
Syntax
public class OneComputePlatformClient : RestClientBase, IOneComputePlatformClient, IJobSchedulingClient, IJobScheduler
Constructors
View SourceOneComputePlatformClient(IOneComputePlatformClientAuthenticator)
Initializes a new instance of the OneComputePlatformClient class.
Declaration
public OneComputePlatformClient(IOneComputePlatformClientAuthenticator authenticator)
Parameters
| Type | Name | Description |
|---|---|---|
| IOneComputePlatformClientAuthenticator | authenticator | The Platform client authenticator, whose input type determines the authentication mode. |
See Also
OneComputePlatformClient(string, string)
Initializes a new instance of the OneComputePlatformClient class.
Declaration
public OneComputePlatformClient(string baseAddress, string token = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | baseAddress | The REST API base address. |
| string | token | The authentication bearer (access) token. |
See Also
Fields
View SourceOneComputeWebApiBaseAddressMustBeGivenErrorMessage
The error message yielded when the Platform client is attempted to be created without a OneCompute web API base address.
Declaration
public const string OneComputeWebApiBaseAddressMustBeGivenErrorMessage = "A OneCompute web API base address must be given"
Field Value
| Type | Description |
|---|---|
| string |
See Also
Properties
View SourceOptions
Gets or sets the client options.
Declaration
public OneComputePlatformClient.ClientOptions Options { get; set; }
Property Value
| Type | Description |
|---|---|
| OneComputePlatformClient.ClientOptions | The options. |
See Also
PollingIntervalSeconds
Gets or sets the polling interval.
Declaration
public int PollingIntervalSeconds { get; set; }
Property Value
| Type | Description |
|---|---|
| int | The polling interval in seconds. |
See Also
Methods
View SourceAddWorkToJobAsync(string, WorkItem)
Add work to job.
Declaration
public Task AddWorkToJobAsync(string jobId, WorkItem work)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| WorkItem | work | The work to be added. |
Returns
| Type | Description |
|---|---|
| Task | Asynchronous Task. |
See Also
BeginMonitorJobAsync(string)
Begin monitoring the specified Job. Any job and work item event for this job will be pushed through the event handlers on the returned IJobMonitor.
Declaration
public Task<IJobMonitor> BeginMonitorJobAsync(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
Returns
| Type | Description |
|---|---|
| Task<IJobMonitor> | Asynchronous Task. |
Remarks
The returned task ends when observation has been set up.
See Also
CancelJob(string)
Cancels an executing job.
Declaration
public void CancelJob(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job id. |
See Also
CancelJobAsync(string)
Cancels an executing job.
Declaration
public Task CancelJobAsync(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job id. |
Returns
| Type | Description |
|---|---|
| Task | The cancel task. |
Remarks
The returned task ends when the job has been cancelled with the backend services.
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Could not cancel job. Status code = " + response.StatusCode. |
See Also
CreateBlobUris(string, IEnumerable<string>)
Creates the BLOB uris for the given blobs.
Declaration
public IEnumerable<Uri> CreateBlobUris(string containerName, IEnumerable<string> blobPaths)
Parameters
| Type | Name | Description |
|---|---|---|
| string | containerName | Name of the container. |
| IEnumerable<string> | blobPaths | The BLOB paths. |
Returns
| Type | Description |
|---|---|
| IEnumerable<Uri> | A set of URIs for the |
See Also
CreateBlobUrisAsync(string, IEnumerable<string>)
Creates the BLOB URIs for the given blob paths.
Declaration
public Task<IEnumerable<Uri>> CreateBlobUrisAsync(string containerName, IEnumerable<string> blobPaths)
Parameters
| Type | Name | Description |
|---|---|---|
| string | containerName | Name of the container. |
| IEnumerable<string> | blobPaths | The BLOB paths. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<Uri>> | A set of URIs for the |
See Also
DeleteJob(string)
Deletes a job.
Declaration
public void DeleteJob(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job id. |
See Also
DeleteJobAsync(string)
Deletes a job.
Declaration
public Task DeleteJobAsync(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job id. |
Returns
| Type | Description |
|---|---|
| Task | The delete task. |
Remarks
The returned task ends when the job has been deleted with the backend services.
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Could not delete job. Status code = " + response.StatusCode. |
See Also
EndMonitorJobAsync(string)
End monitoring the specified Job.
Declaration
public Task EndMonitorJobAsync(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
Returns
| Type | Description |
|---|---|
| Task | Asynchronous Task. |
Exceptions
| Type | Condition |
|---|---|
| NotImplementedException | Need to retrieve the CancellationTokenSource for the job and cancel it. |
See Also
GetAppInfo()
Gets the application information.
Declaration
public Task<string> GetAppInfo()
Returns
| Type | Description |
|---|---|
| Task<string> | A string containing information about the application. |
See Also
GetAuthInfo()
Gets the authentication information.
Declaration
public Task<string> GetAuthInfo()
Returns
| Type | Description |
|---|---|
| Task<string> | A string containing information about the authentication status of the current user. |
See Also
GetContainerUri(string, int?)
Gets the container URI to the given container.
Declaration
public Uri GetContainerUri(string containerName, int? days = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | containerName | Name of the container. |
| int? | days | Number of days until the container (shared access signature) URI expires. |
Returns
| Type | Description |
|---|---|
| Uri | URI to the container including shared access signature, null if the container is not found. |
See Also
GetContainerUriAsync(string, int?)
Gets the container URI to the given container.
Declaration
public Task<Uri> GetContainerUriAsync(string containerName, int? days = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | containerName | Name of the container. |
| int? | days | Number of days until the container (shared access signature) URI expires. |
Returns
| Type | Description |
|---|---|
| Task<Uri> | URI to the container including shared access signature, null if the container is not found. |
See Also
GetContainerUriReadOnly(string, int?)
Gets the container URI to the given container, with read-only access permissions only.
Declaration
public Uri GetContainerUriReadOnly(string containerName, int? days = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | containerName | Name of the container. |
| int? | days | Number of days until the container (shared access signature) URI expires. |
Returns
| Type | Description |
|---|---|
| Uri | Read-only URI to the container including shared access signature, null if the container is not found. |
See Also
GetContainerUriReadOnlyAsync(string, int?)
Gets the container URI to the given container, with read-only access permissions only.
Declaration
public Task<Uri> GetContainerUriReadOnlyAsync(string containerName, int? days = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | containerName | Name of the container. |
| int? | days | Number of days until the container (shared access signature) URI expires. |
Returns
| Type | Description |
|---|---|
| Task<Uri> | Read-only URI to the container including shared access signature, null if the container is not found. |
See Also
GetContainers()
Gets the containers the user has access to.
Declaration
public IEnumerable<string> GetContainers()
Returns
| Type | Description |
|---|---|
| IEnumerable<string> | Names of containers the user has access to. |
See Also
GetContainersAsync()
Gets the containers the user has access to.
Declaration
public Task<IEnumerable<string>> GetContainersAsync()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<string>> | Names of containers the user has access to. |
See Also
GetIdentityNames()
Gets the identity names.
Declaration
public Task<IEnumerable<string>> GetIdentityNames()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<string>> | A sequence of strings representing the identity name(s) of the user. |
See Also
GetJobProperties()
Gets job properties for all jobs of the authenticated user.
Declaration
public IEnumerable<JobProperties> GetJobProperties()
Returns
| Type | Description |
|---|---|
| IEnumerable<JobProperties> | A collection of job properties objects for the user's jobs. |
Remarks
Each job properties object contains the application properties that were set by the application prior to submitting the job, see Properties and can be accessed through the property indexer on JobProperties.
See Also
GetJobProperties(string)
Gets job properties for the specified job.
Declaration
public JobProperties GetJobProperties(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
Returns
| Type | Description |
|---|---|
| JobProperties | The job properties object. |
Remarks
This object contains the application properties that were set by the application prior to submitting the job, see Properties and can be accessed through the property indexer on JobProperties.
See Also
GetJobPropertiesAsync()
Gets job properties for all jobs of the authenticated user.
Declaration
public Task<IEnumerable<JobProperties>> GetJobPropertiesAsync()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<JobProperties>> | A collection of job properties objects for the user's jobs. |
Remarks
Each job properties object contains the application properties that were set by the application prior to submitting the job, see Properties and can be accessed through the property indexer on JobProperties.
See Also
GetJobPropertiesAsync(string)
Gets job properties for the specified job.
Declaration
public Task<JobProperties> GetJobPropertiesAsync(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
Returns
| Type | Description |
|---|---|
| Task<JobProperties> | The job properties object, null if the job is not found. |
Remarks
This object contains the application properties that were set by the application prior to submitting the job, see Properties and can be accessed through the property indexer on JobProperties.
See Also
GetJobPropertiesInSegments(string)
Gets job properties of jobs in segments of the authenticated user for the specified continuation token.
Declaration
public JobPropertiesSegment GetJobPropertiesInSegments(string continuationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | continuationToken | An object representing a continuation token from the server when the operation returns a partial result. |
Returns
| Type | Description |
|---|---|
| JobPropertiesSegment | An instance of JobPropertiesSegment. |
Remarks
Each job properties object contains the application properties that were set by the application prior to submitting the job, see Properties and can be accessed through the property indexer on JobProperties.
See Also
GetJobPropertiesInSegmentsAsync(string)
Gets job properties of jobs in segments of the authenticated user for the specified continuation token.
Declaration
public Task<JobPropertiesSegment> GetJobPropertiesInSegmentsAsync(string continuationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | continuationToken | An object representing a continuation token from the server when the operation returns a partial result. |
Returns
| Type | Description |
|---|---|
| Task<JobPropertiesSegment> | An instance of JobPropertiesSegment. |
Remarks
Each job properties object contains the application properties that were set by the application prior to submitting the job, see Properties and can be accessed through the property indexer on JobProperties.
See Also
GetJobStatus(string)
Gets status info for the specified job.
Declaration
public JobInfo GetJobStatus(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
Returns
| Type | Description |
|---|---|
| JobInfo | The job info object. |
See Also
GetJobStatusAsync(string)
Gets the status info for the specified job.
Declaration
public Task<JobInfo> GetJobStatusAsync(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
Returns
| Type | Description |
|---|---|
| Task<JobInfo> | The job info object, null if the job is not found. |
See Also
GetJobs()
Gets the jobs for the current authenticated user.
Declaration
public IEnumerable<JobInfo> GetJobs()
Returns
| Type | Description |
|---|---|
| IEnumerable<JobInfo> | A sequence of JobInfo. |
See Also
GetJobsAsync()
Gets the jobs for the current user.
Declaration
public Task<IEnumerable<JobInfo>> GetJobsAsync()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<JobInfo>> | A sequence of JobInfo. |
See Also
GetRoles()
Gets the roles of the authenticated user.
Declaration
public Task<IEnumerable<string>> GetRoles()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<string>> | A sequence of strings representing the roles of the user. |
See Also
GetSignalRUserToken(string, string)
Gets a SignalR user token.
Declaration
public string GetSignalRUserToken(string jobId, string userId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| string | userId | The user identifier. |
Returns
| Type | Description |
|---|---|
| string | A SignalR token identifying the user. |
See Also
GetSignalRUserTokenAsync(string, string)
Gets a SignalR user token.
Declaration
public Task<string> GetSignalRUserTokenAsync(string jobId, string userId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| string | userId | The user identifier. |
Returns
| Type | Description |
|---|---|
| Task<string> | A SignalR token identifying the user. |
See Also
GetSignalRWorkerToken(string, string)
Gets a worker SignalR token.
Declaration
public string GetSignalRWorkerToken(string jobId, string userId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| string | userId | The user identifier. |
Returns
| Type | Description |
|---|---|
| string | A SignalR token for the worker. |
See Also
GetSignalRWorkerTokenAsync(string, string)
Gets a worker SignalR token.
Declaration
public Task<string> GetSignalRWorkerTokenAsync(string jobId, string userId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| string | userId | The user identifier. |
Returns
| Type | Description |
|---|---|
| Task<string> | A SignalR token for the worker. |
See Also
GetWorkItemInfo(string)
Gets status info for the work items for the specified job.
Declaration
public IEnumerable<WorkItemInfo> GetWorkItemInfo(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
Returns
| Type | Description |
|---|---|
| IEnumerable<WorkItemInfo> | A sequence of WorkItemInfo, one for each work item in the job. |
See Also
GetWorkItemInfo(string, string)
Gets status info for the specified work item.
Declaration
public WorkItemInfo GetWorkItemInfo(string jobId, string workItemId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| string | workItemId | The work item identifier. |
Returns
| Type | Description |
|---|---|
| WorkItemInfo | The work item status info object. |
See Also
GetWorkItemInfoAsync(string)
Gets the work item identifiers for the specified job.
Declaration
public Task<IEnumerable<WorkItemInfo>> GetWorkItemInfoAsync(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<WorkItemInfo>> | A sequence of work item identifiers, null if the job is not found. |
See Also
GetWorkItemInfoAsync(string, string)
Gets status info for the specified work item.
Declaration
public Task<WorkItemInfo> GetWorkItemInfoAsync(string jobId, string workItemId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| string | workItemId | The work item identifier. |
Returns
| Type | Description |
|---|---|
| Task<WorkItemInfo> | The work item status info object, null if the work item is not found. |
See Also
GetWorkItemProperties(string)
Gets application properties for the work items of the specified job.
Declaration
public IEnumerable<WorkItemProperties> GetWorkItemProperties(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
Returns
| Type | Description |
|---|---|
| IEnumerable<WorkItemProperties> | A sequence of WorkItemProperties, one for each work item in the job. |
Remarks
This object contains the application properties that were set by the application prior to submitting the job, see Properties and can be accessed through the property indexer on WorkItemProperties.
See Also
GetWorkItemProperties(string, string)
Gets application properties for the work item given by the jobId and workItemId.
Declaration
public WorkItemProperties GetWorkItemProperties(string jobId, string workItemId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| string | workItemId | The work item identifier. |
Returns
| Type | Description |
|---|---|
| WorkItemProperties | A WorkItemProperties instance for the given work item. |
Remarks
This object contains the application properties that were set by the application prior to submitting the job, see Properties and can be accessed through the property indexer on WorkItemProperties.
See Also
GetWorkItemPropertiesAsync(string)
Gets application properties for the work items of the specified job.
Declaration
public Task<IEnumerable<WorkItemProperties>> GetWorkItemPropertiesAsync(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<WorkItemProperties>> | A sequence of WorkItemProperties, one for each work item in the job. If the job is not found, null is returned. |
Remarks
This object contains the application properties that were set by the application prior to submitting the job, see Properties and can be accessed through the property indexer on WorkItemProperties.
See Also
GetWorkItemPropertiesAsync(string, string)
Gets application properties for the work item given by the jobId and workItemId.
Declaration
public Task<WorkItemProperties> GetWorkItemPropertiesAsync(string jobId, string workItemId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| string | workItemId | The work item identifier. |
Returns
| Type | Description |
|---|---|
| Task<WorkItemProperties> | A WorkItemProperties instance for the given work item. |
Remarks
This object contains the application properties that were set by the application prior to submitting the job, see Properties and can be accessed through the property indexer on WorkItemProperties.
See Also
GetWorkItemResult(string, string)
Gets the work item result for the specified work item.
Declaration
public Result GetWorkItemResult(string jobId, string workItemId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| string | workItemId | The work item identifier. |
Returns
| Type | Description |
|---|---|
| Result | The Result of the specified work item. |
See Also
GetWorkItemResultAsync(string, string)
Gets the work item result for the specified work item.
Declaration
public Task<Result> GetWorkItemResultAsync(string jobId, string workItemId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| string | workItemId | The work item identifier. |
Returns
| Type | Description |
|---|---|
| Task<Result> | The Result of the specified work item, null if the work item is not found. |
See Also
GetWorkItemResults(string)
The get work item results.
Declaration
public IEnumerable<Result> GetWorkItemResults(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job id. |
Returns
| Type | Description |
|---|---|
| IEnumerable<Result> | A sequence of Result objects, one for each work item in the given job. |
See Also
GetWorkItemResultsAsync(string)
Gets the work item results.
Declaration
public Task<IEnumerable<Result>> GetWorkItemResultsAsync(string jobId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job id. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<Result>> | A sequence of Result, null if the job is not found. |
See Also
GetWorkItemStorageContainerUri(string, string, string)
Gets the work item storage container URI with access (SAS) token.
Declaration
public Uri GetWorkItemStorageContainerUri(string jobId, string workUnitId, string containerName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| string | workUnitId | The work unit identifier. |
| string | containerName | Name of the container. |
Returns
| Type | Description |
|---|---|
| Uri | A container URI with a valid SAS token. |
See Also
GetWorkItemStorageContainerUriAsync(string, string, string)
Gets the work item storage container URI with access (SAS) token.
Declaration
public Task<Uri> GetWorkItemStorageContainerUriAsync(string jobId, string workUnitId, string containerName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| string | workUnitId | The work unit identifier. |
| string | containerName | Name of the container. |
Returns
| Type | Description |
|---|---|
| Task<Uri> | A container URI with a valid SAS token. |
See Also
GetWorkItemStorageInfo(string, string)
Gets storage information for all work items in the given job.
Declaration
public IEnumerable<WorkItemStorageInfo> GetWorkItemStorageInfo(string jobId, string containerName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| string | containerName | Name of the container. |
Returns
| Type | Description |
|---|---|
| IEnumerable<WorkItemStorageInfo> | A collection of WorkItemStorageInfo, one for each work unit in the job, containing container URIs with a valid SAS tokens. |
Remarks
The returned storage information contains storage container URIs, with access (SAS) token to access the storage container that contains the result files from the work item. Only work items that have uploaded results to Result Lake will be listed.
See Also
GetWorkItemStorageInfoAsync(string, string)
Gets storage information for all work items in the given job.
Declaration
public Task<IEnumerable<WorkItemStorageInfo>> GetWorkItemStorageInfoAsync(string jobId, string containerName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jobId | The job identifier. |
| string | containerName | Name of the container. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<WorkItemStorageInfo>> | A collection of WorkItemStorageInfo, one for each work unit in the job, containing container URIs with a valid SAS tokens. |
Remarks
The returned storage information contains storage container URIs, with access (SAS) token to access the storage container that contains the result files from the work item. Only work items that have uploaded results to Result Lake will be listed.
See Also
SubmitJob(Job)
Submit the job for execution.
Declaration
public string SubmitJob(Job job)
Parameters
| Type | Name | Description |
|---|---|---|
| Job | job | The job. |
Returns
| Type | Description |
|---|---|
| string | Job identifier. |
See Also
SubmitJobAsync(Job)
Submits the specified Job and returns a job monitor that allows the client to monitor the status and progress of the job. Any job and work item event for this job will be pushed through the event handlers on the returned IJobMonitor.
Declaration
public Task<IJobMonitor> SubmitJobAsync(Job job)
Parameters
| Type | Name | Description |
|---|---|---|
| Job | job | The job. |
Returns
| Type | Description |
|---|---|
| Task<IJobMonitor> | A job monitor. |
See Also
SubmitJobAsync(Job, CancellationToken)
Submits the specified job with the cancellation token as an asynchronous operation.
Declaration
public Task<string> SubmitJobAsync(Job job, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| Job | job | The job to submit. |
| CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| Task<string> | A task object, holding the reference to the job, representing the asynchronous operation. |
Remarks
In the scenario of InvalidOperationException exception, the HTTP error code can be found in its message property. In the scenario of UnauthorizedAccessException exception, an additional detail about the request rejection may be found in inner-exception property pointing to ForbiddenException or PaymentRequiredException exception.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The |
| InvalidOperationException | UserId was not specified, or failed to submit the specified job. |
| UnauthorizedAccessException | The request is rejected by the server for various reasons. |