Reference Guide
.NET SDK Reference for OSS
Resource Information
Namespace: | Autodesk.Oss |
Assembly: | Autodesk.Oss.dll |
Version: | 1.0.0 |
Installing this Library
The recommended way of installing this library to your .NET project is to use the NuGet Package Manager.
- Within the NuGet Package Manager locate the Autodesk.Oss library.
- Follow the instructions on the NuGet documentation site to install the library.
Alternatively, from Visual Studio IDE or CLI tools:
dotnet add package Autodesk.Oss
Learning Resources
Source Code
The source code for this library is available at https://github.com/autodesk-platform-services/aps-sdk-net.
Tutorials
The Simple Viewer tutorial on the https://tutorials.autodesk.io/ site illustrates how to use this library to store a model in a bucket. It also illustrates how to access the model for translation to the SVF format, so that the model can be displayed in a browser.
Code Sample
string token = "<token>";
string bucketKey = "<bucket key>";
string objectName = "<object name>";
string sourceToUpload = "<path to source file>";
OssClient ossClient = null!;
public void Initialise()
{
// Instantiate SDK manager as below.
// You can also optionally pass configurations, logger, etc.
SDKManager sdkManager = SdkManagerBuilder
.Create() // Creates SDK Manager Builder itself.
.Build();
// Instantiate OssClient using the created SDK manager
ossClient = new OssClient(sdkManager);
}
public async Task Upload()
{
//The below helper method takes care of the complete upload process, i.e.
// the steps 2 to 4 in this link (https://aps.autodesk.com/en/docs/data/v2/tutorials/app-managed-bucket/)
ObjectDetails objectDetails = await ossClient.Upload(bucketKey, objectName, sourceToUpload, accessToken: token, CancellationToken.None);
// query for required properties
string objectId = objectDetails.ObjectId;
string objectKey = objectDetails.ObjectKey;
}
Show More
REST API to SDK Cross Reference
| Complete Batch Upload to S3 Signed URLs | POST buckets/{bucketKey}/objects/batchcompleteupload | BatchCompleteUploadAsync |
SDK-Only Operations
Operation Category | Operation | Method | Description |
---|---|---|---|
Objects |
Upload a Stream | Upload (Upload a stream) | Uploads a stream by transparently handling operations like obtaining signed URLs, chunking large files for optimal transfer, and notifying OSS to assemble the uploaded parts. |
Upload a File | Upload (Upload a file) | Uploads a file by transparently handling operations like obtaining signed URLs, chunking large files for optimal transfer, and notifying OSS to assemble the uploaded parts. | |
Download a File | Download | Downloads a file by transparently handling operations like obtaining signed download URLs. |