Show / Hide Table of Contents

Class OneComputePlatformClient

Provides an HTTP REST client for the OneCompute Platform web API.

Inheritance
System.Object
RestClientBase
OneComputePlatformClient
Implements
IOneComputePlatformClient
IJobSchedulingClient
IJobScheduler
Inherited Members
RestClientBase.HttpClient
RestClientBase.PostAsync(String, Object, CancellationToken)
RestClientBase.GetAsync(String, CancellationToken)
RestClientBase.GetAsync<T>(String, CancellationToken)
Namespace: DNVGL.One.Compute.Platform.Client
Assembly: DNVGL.One.Compute.Platform.Client.dll
Syntax
public class OneComputePlatformClient : RestClientBase, IOneComputePlatformClient, IJobSchedulingClient, IJobScheduler

Constructors

View Source

OneComputePlatformClient(String, String)

Initializes a new instance of the OneComputePlatformClient class.

Declaration
public OneComputePlatformClient(string baseAddress, string token = null)
Parameters
Type Name Description
System.String baseAddress

The REST API base address.

System.String token

The authentication bearer token (not yet implemented).

Properties

View Source

Options

Gets or sets the client options.

Declaration
public OneComputePlatformClient.ClientOptions Options { get; set; }
Property Value
Type Description
OneComputePlatformClient.ClientOptions

The options.

View Source

PollingIntervalSeconds

Gets or sets the polling interval.

Declaration
public int PollingIntervalSeconds { get; set; }
Property Value
Type Description
System.Int32

The polling interval in seconds.

Methods

View Source

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 async Task<IJobMonitor> BeginMonitorJobAsync(string jobId)
Parameters
Type Name Description
System.String jobId

The job identifier.

Returns
Type Description
Task<IJobMonitor>

Asynchronous .

Remarks

The returned task ends when observation has been set up.

View Source

CancelJob(String)

Cancels an executing job.

Declaration
public void CancelJob(string jobId)
Parameters
Type Name Description
System.String jobId

The job id.

View Source

CancelJobAsync(String)

Cancels an executing job.

Declaration
public async Task CancelJobAsync(string jobId)
Parameters
Type Name Description
System.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.

View Source

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
System.String containerName

Name of the container.

IEnumerable<System.String> blobPaths

The BLOB paths.

Returns
Type Description
IEnumerable<Uri>

A set of URIs for the blobPaths.

View Source

CreateBlobUrisAsync(String, IEnumerable<String>)

Creates the BLOB URIs for the given blob paths.

Declaration
public async Task<IEnumerable<Uri>> CreateBlobUrisAsync(string containerName, IEnumerable<string> blobPaths)
Parameters
Type Name Description
System.String containerName

Name of the container.

IEnumerable<System.String> blobPaths

The BLOB paths.

Returns
Type Description
Task<IEnumerable<Uri>>

A set of URIs for the blobPaths.

View Source

DeleteJob(String)

Deletes a job.

Declaration
public void DeleteJob(string jobId)
Parameters
Type Name Description
System.String jobId

The job id.

View Source

DeleteJobAsync(String)

Deletes a job.

Declaration
public async Task DeleteJobAsync(string jobId)
Parameters
Type Name Description
System.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.

View Source

EndMonitorJobAsync(String)

End monitoring the specified Job.

Declaration
public Task EndMonitorJobAsync(string jobId)
Parameters
Type Name Description
System.String jobId

The job identifier.

Returns
Type Description
Task

Asynchronous .

View Source

GetAppInfo()

Gets the application information.

Declaration
public async Task<string> GetAppInfo()
Returns
Type Description
Task<System.String>

A string containing information about the application.

View Source

GetAuthInfo()

Gets the authentication information.

Declaration
public async Task<string> GetAuthInfo()
Returns
Type Description
Task<System.String>

A string containing information about the authentication status of the current user.

View Source

GetContainers()

Gets the containers the user has access to.

Declaration
public IEnumerable<string> GetContainers()
Returns
Type Description
IEnumerable<System.String>

Names of containers the user has access to.

View Source

GetContainersAsync()

Gets the containers the user has access to.

Declaration
public async Task<IEnumerable<string>> GetContainersAsync()
Returns
Type Description
Task<IEnumerable<System.String>>

Names of containers the user has access to.

View Source

GetContainerUri(String, Nullable<Int32>)

Gets the container URI to the given container.

Declaration
public Uri GetContainerUri(string containerName, int? days = null)
Parameters
Type Name Description
System.String containerName

Name of the container.

System.Nullable<System.Int32> 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.

View Source

GetContainerUriAsync(String, Nullable<Int32>)

Gets the container URI to the given container.

Declaration
public async Task<Uri> GetContainerUriAsync(string containerName, int? days = null)
Parameters
Type Name Description
System.String containerName

Name of the container.

System.Nullable<System.Int32> 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.

View Source

GetContainerUriReadOnly(String, Nullable<Int32>)

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
System.String containerName

Name of the container.

System.Nullable<System.Int32> 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.

View Source

GetContainerUriReadOnlyAsync(String, Nullable<Int32>)

Gets the container URI to the given container, with read-only access permissions only.

Declaration
public async Task<Uri> GetContainerUriReadOnlyAsync(string containerName, int? days = null)
Parameters
Type Name Description
System.String containerName

Name of the container.

System.Nullable<System.Int32> 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.

View Source

GetIdentityNames()

Gets the identity names.

Declaration
public async Task<IEnumerable<string>> GetIdentityNames()
Returns
Type Description
Task<IEnumerable<System.String>>

A sequence of strings representing the identity name(s) of the user.

View Source

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 DNVGL.One.Compute.Core.JobProperties.

View Source

GetJobProperties(String)

Gets job properties for the specified job.

Declaration
public JobProperties GetJobProperties(string jobId)
Parameters
Type Name Description
System.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 and can be accessed through the property indexer on DNVGL.One.Compute.Core.JobProperties.

View Source

GetJobPropertiesAsync()

Gets job properties for all jobs of the authenticated user.

Declaration
public async 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 DNVGL.One.Compute.Core.JobProperties.

View Source

GetJobPropertiesAsync(String)

Gets job properties for the specified job.

Declaration
public async Task<JobProperties> GetJobPropertiesAsync(string jobId)
Parameters
Type Name Description
System.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.

View Source

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
System.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 DNVGL.One.Compute.Core.JobProperties.

View Source

GetJobPropertiesInSegmentsAsync(String)

Gets job properties of jobs in segments of the authenticated user for the specified continuation token.

Declaration
public async Task<JobPropertiesSegment> GetJobPropertiesInSegmentsAsync(string continuationToken)
Parameters
Type Name Description
System.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 DNVGL.One.Compute.Core.JobProperties.

View Source

GetJobs()

Gets the jobs for the current authenticated user.

Declaration
public IEnumerable<JobInfo> GetJobs()
Returns
Type Description
IEnumerable<JobInfo>

A sequence of JobInfo.

View Source

GetJobsAsync()

Gets the jobs for the current user.

Declaration
public async Task<IEnumerable<JobInfo>> GetJobsAsync()
Returns
Type Description
Task<IEnumerable<JobInfo>>

A sequence of JobInfo.

View Source

GetJobStatus(String)

Gets status info for the specified job.

Declaration
public JobInfo GetJobStatus(string jobId)
Parameters
Type Name Description
System.String jobId

The job identifier.

Returns
Type Description
JobInfo

The job info object.

View Source

GetJobStatusAsync(String)

Gets the status info for the specified job.

Declaration
public async Task<JobInfo> GetJobStatusAsync(string jobId)
Parameters
Type Name Description
System.String jobId

The job identifier.

Returns
Type Description
Task<JobInfo>

The job info object, null if the job is not found.

View Source

GetRoles()

Gets the roles of the authenticated user.

Declaration
public async Task<IEnumerable<string>> GetRoles()
Returns
Type Description
Task<IEnumerable<System.String>>

A sequence of strings representing the roles of the user.

View Source

GetSignalRUserToken(String, String)

Gets a SignalR user token.

Declaration
public string GetSignalRUserToken(string jobId, string userId)
Parameters
Type Name Description
System.String jobId

The job identifier.

System.String userId

The user identifier.

Returns
Type Description
System.String

A SignalR token identifying the user.

View Source

GetSignalRUserTokenAsync(String, String)

Gets a SignalR user token.

Declaration
public async Task<string> GetSignalRUserTokenAsync(string jobId, string userId)
Parameters
Type Name Description
System.String jobId

The job identifier.

System.String userId

The user identifier.

Returns
Type Description
Task<System.String>

A SignalR token identifying the user.

View Source

GetSignalRWorkerToken(String, String)

Gets a worker SignalR token.

Declaration
public string GetSignalRWorkerToken(string jobId, string userId)
Parameters
Type Name Description
System.String jobId

The job identifier.

System.String userId

The user identifier.

Returns
Type Description
System.String

A SignalR token for the worker.

View Source

GetSignalRWorkerTokenAsync(String, String)

Gets a worker SignalR token.

Declaration
public async Task<string> GetSignalRWorkerTokenAsync(string jobId, string userId)
Parameters
Type Name Description
System.String jobId

The job identifier.

System.String userId

The user identifier.

Returns
Type Description
Task<System.String>

A SignalR token for the worker.

View Source

GetWorkItemInfo(String)

Gets status info for the work items for the specified job.

Declaration
public IEnumerable<WorkItemInfo> GetWorkItemInfo(string jobId)
Parameters
Type Name Description
System.String jobId

The job identifier.

Returns
Type Description
IEnumerable<WorkItemInfo>

A sequence of WorkItemInfo, one for each work item in the job.

View Source

GetWorkItemInfo(String, String)

Gets status info for the specified work item.

Declaration
public WorkItemInfo GetWorkItemInfo(string jobId, string workItemId)
Parameters
Type Name Description
System.String jobId

The job identifier.

System.String workItemId

The work item identifier.

Returns
Type Description
WorkItemInfo

The work item status info object.

View Source

GetWorkItemInfoAsync(String)

Gets the work item identifiers for the specified job.

Declaration
public async Task<IEnumerable<WorkItemInfo>> GetWorkItemInfoAsync(string jobId)
Parameters
Type Name Description
System.String jobId

The job identifier.

Returns
Type Description
Task<IEnumerable<WorkItemInfo>>

A sequence of work item identifiers, null if the job is not found.

View Source

GetWorkItemInfoAsync(String, String)

Gets status info for the specified work item.

Declaration
public async Task<WorkItemInfo> GetWorkItemInfoAsync(string jobId, string workItemId)
Parameters
Type Name Description
System.String jobId

The job identifier.

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

View Source

GetWorkItemProperties(String)

Gets application properties for the work items of the specified job.

Declaration
public IEnumerable<WorkItemProperties> GetWorkItemProperties(string jobId)
Parameters
Type Name Description
System.String jobId

The job identifier.

Returns
Type Description
IEnumerable<WorkItemProperties>

A sequence of DNVGL.One.Compute.Core.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 and can be accessed through the property indexer on DNVGL.One.Compute.Core.WorkItemProperties.

View Source

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
System.String jobId

The job identifier.

System.String workItemId

The work item identifier.

Returns
Type Description
WorkItemProperties

A DNVGL.One.Compute.Core.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 and can be accessed through the property indexer on DNVGL.One.Compute.Core.WorkItemProperties.

View Source

GetWorkItemPropertiesAsync(String)

Gets application properties for the work items of the specified job.

Declaration
public async Task<IEnumerable<WorkItemProperties>> GetWorkItemPropertiesAsync(string jobId)
Parameters
Type Name Description
System.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.

View Source

GetWorkItemPropertiesAsync(String, String)

Gets application properties for the work item given by the jobId and workItemId.

Declaration
public async Task<WorkItemProperties> GetWorkItemPropertiesAsync(string jobId, string workItemId)
Parameters
Type Name Description
System.String jobId

The job identifier.

System.String workItemId

The work item identifier.

Returns
Type Description
Task<WorkItemProperties>

A DNVGL.One.Compute.Core.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 and can be accessed through the property indexer on DNVGL.One.Compute.Core.WorkItemProperties.

View Source

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
System.String jobId

The job identifier.

System.String workItemId

The work item identifier.

Returns
Type Description
Result

The Result of the specified work item.

View Source

GetWorkItemResultAsync(String, String)

Gets the work item result for the specified work item.

Declaration
public async Task<Result> GetWorkItemResultAsync(string jobId, string workItemId)
Parameters
Type Name Description
System.String jobId

The job identifier.

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

View Source

GetWorkItemResults(String)

The get work item results.

Declaration
public IEnumerable<Result> GetWorkItemResults(string jobId)
Parameters
Type Name Description
System.String jobId

The job id.

Returns
Type Description
IEnumerable<Result>

A sequence of Result objects, one for each work item in the given job.

View Source

GetWorkItemResultsAsync(String)

Gets the work item results.

Declaration
public async Task<IEnumerable<Result>> GetWorkItemResultsAsync(string jobId)
Parameters
Type Name Description
System.String jobId

The job id.

Returns
Type Description
Task<IEnumerable<Result>>

A sequence of Result, null if the job is not found.

View Source

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
System.String jobId

The job identifier.

System.String workUnitId

The work unit identifier.

System.String containerName

Name of the container.

Returns
Type Description
Uri

A container URI with a valid SAS token.

View Source

GetWorkItemStorageContainerUriAsync(String, String, String)

Gets the work item storage container URI with access (SAS) token.

Declaration
public async Task<Uri> GetWorkItemStorageContainerUriAsync(string jobId, string workUnitId, string containerName)
Parameters
Type Name Description
System.String jobId

The job identifier.

System.String workUnitId

The work unit identifier.

System.String containerName

Name of the container.

Returns
Type Description
Task<Uri>

A container URI with a valid SAS token.

View Source

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
System.String jobId

The job identifier.

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

View Source

GetWorkItemStorageInfoAsync(String, String)

Gets storage information for all work items in the given job.

Declaration
public async Task<IEnumerable<WorkItemStorageInfo>> GetWorkItemStorageInfoAsync(string jobId, string containerName)
Parameters
Type Name Description
System.String jobId

The job identifier.

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

View Source

SubmitJob(Job)

Submit the job for execution.

Declaration
public string SubmitJob(Job job)
Parameters
Type Name Description
Job job

The job.

Returns
Type Description
System.String

Job identifier.

View Source

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 async Task<IJobMonitor> SubmitJobAsync(Job job)
Parameters
Type Name Description
Job job

The job.

Returns
Type Description
Task<IJobMonitor>

A job monitor.

View Source

SubmitJobAsync(Job, CancellationToken)

Submits the specified job with the cancellation token as an asynchronous operation.

Declaration
public async 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<System.String>

A task object, holding the reference to the job, representing the asynchronous operation.

Remarks

In the scenario of System.InvalidOperationException exception, the HTTP error code can be found in its message property. In the scenario of System.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
System.ArgumentNullException

The job was null.

System.InvalidOperationException

UserId was not specified, or failed to submit the specified job.

System.UnauthorizedAccessException

The request is rejected by the server for various reasons.

Implements

IOneComputePlatformClient
IJobSchedulingClient
IJobScheduler

See Also

RestClientBase
IOneComputePlatformClient
IJobScheduler
RestClientBase
IOneComputePlatformClient
IJobScheduler
RestClientBase
IOneComputePlatformClient
IJobScheduler
  • View Source
In This Article
Back to top Copyright © DNV AS. All rights reserved.