Using the OneCompute Platform Client
- Creating the Platform Client
- Using Asynchronous versus Synchronous Methods
- Access the Blob Container of the Authenticated User
- Submitting jobs
- Event-based job monitoring
- Canceling jobs
- List jobs for the user
- Retrieving job and work item status
- Retrieving job and work item properties
- Retrieving work unit results
- NuGet packages to use
- See also
The OneComputePlatformClient is a .NET wrapper around the OneCompute Platform REST API.
Creating the Platform Client
The OneComputePlatformClient constructor takes two arguments; the URL of the OneCompute Platform API instance and an authentication token from one of the identity providers supported by OneCompute Platform.
Using Asynchronous versus Synchronous Methods
The OneComputePlatformClient provides both synchronous and asynchronous methods for each API request. The async methods are named with the Async postfix. It is recommended to use the async methods whenever possible.
Access the Blob Container of the Authenticated User
See the File Management section for information about how to use the OneComputePlatformClient to do handle files that ar either input to or output from jobs. Here you will also find code examples on how to use these APIs.
Submitting jobs
See the How to Submit a Job to OneCompute Platform section for information about and code examples for how to submit jobs to OneCompute Platform.
Event-based job monitoring
See the Monitor Job Status and Progress section for information about how to do even-based monitoring of job and work item status and progress.
Canceling jobs
The CancelJobAsync methods allows a client to cancel an executing job.
List jobs for the user
The GetJobsAsync returns all jobs that the authenticated user has submitted.
Retrieving job and work item status
The OneCompute Platform API offers methods for requesting status information for jobs, status information for all work items in a job and status information for a particular work item. See Polling job status and progress through the API for more details on how to use the OneComputePlatformClient to retrieve job and work item status and progress.
Retrieving job and work item properties
Before submitting a job, the client application may add application specific properties to the Job and its work items using the property indexer. Properties are application specific information that are assigned to a job or work item. This can be used to
- Communicate application specific information to the application worker
- Create an association between a job or a work item and an application object
See Using Job and Work Item Properties for more details on how to use properties to assign application specific information to OneCompute jobs and work items.
Retrieving work unit results
As work units are completed, the application worker may return a result object. It can subsequently be retrieved by the client application through the OneCompute Platform API using the GetWorkItemResultAsync method.
See How to retrieve WorkUnit Results for details on how results for completed WorkUnits can be retrieved using the OneComputePlatformClient.