C# Flat SDK 1.0 has been Released

Last post 03-18-2008 7:11 PM by Nick. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 03-07-2008 2:42 AM

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 529

    C# Flat SDK 1.0 has been Released

    You can find this release at: http://developer.nirvanix.com/files/folders/reference_code__applications/entry692.aspx 

     Based on user feedback we have modified the SDK to give a simplified interface to help you developer c# applications.  Some of the highlights of this SDK include:

    • Using REST rather than SOAP for increased speed.
    • Full HTTP Upload using Partial File Update / Partial File Upload
    • Threaded uploads with delegates giving file progress.

    This SDK includes all of the new 2.0 features including PresetTranscode as well as wrappers for the entire system.

     Please let us know what you think of the new API, we think you will enjoy the new features.

    Regards,
         Barry R. (On behalf of Nick)

     

     

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 03-11-2008 4:29 PM In reply to

    • acamp
    • Top 25 Contributor
    • Joined on 03-11-2008
    • Posts 10

    Re: C# Flat SDK 1.0 has been Released

    I've just started looking at development for Nirvanix, and the SDK looks great and will be a big timesaver.  My only comment is that it would be nice if it were testable/mockable, more interface driven.  For my calling code, I mainly want an IUpload, IIMFS, IImage, etc..., so that I could mock these interfaces in unit tests.  This way, I can do some tests w/o hitting the nirvanix services.  On the bottom side, it would be nice if Transport.Transport.ExecuteCommand and other similiar low level functions were mockable as well, in case I need more fine grained verification in my tests of exactly which calls are being made, or wanted to test the actual SDK code.

    This isn't a big deal, I've got the code and can fairly easily do this on my own.  But just a suggestion if this ever gets touched again.

    Filed under: ,
  • 03-11-2008 7:06 PM In reply to

    • Nick
    • Top 50 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 6

    Re: C# Flat SDK 1.0 has been Released

    I will give the main "Namespace" objects an interface, i.e. IAccounting and IIMFS.  I will also give some of the low level internal objects interfaces.  That was a good suggestion.  Please keep them coming.

  • 03-14-2008 11:31 PM In reply to

    • acamp
    • Top 25 Contributor
    • Joined on 03-11-2008
    • Posts 10

    Re: C# Flat SDK 1.0 has been Released

    Thanks for the quick reply.  Since you asked, I do have a couple other suggestions: I'd like a synchronous call for Uploading files as well as an async call.  My general logic looks like:

    • pre-process file
    • upload file
    • post-process file 

    post processing involves deleting my temp file used for upload, recording status in the database, etc.  I can generally put the post-process into the complete delegate, but I have state information from the pre-process that I need to know, like filename.    This means I need to manage this state information now, which I can do, but I think it's needless complication.  I'd rather just wait for the upload to finish.

    This isn't a big deal, it's not too hard to do on my own - I've created a wrapper class that transforms the async call into a sync call.

    Also, although I haven't needed it yet, think it would be nice to have control over the upload thread, mainly to kill it if it takes to long, or if I need to reclaim my bandwidth for some reason, or just generally cancel an upload.  The simple way would be to return the Thread object, but this would probably let the user do bad things.  It's probably more appropriate to expose an EndUpload() method, that does the correct thing with respect to the Nirvanix API's as well.

    edit: after a little bit more looking, perhaps implementing the transfer namespace might work.  Not sure.

  • 03-17-2008 9:37 PM In reply to

    • acamp
    • Top 25 Contributor
    • Joined on 03-11-2008
    • Posts 10

    Re: C# Flat SDK 1.0 has been Released

    I don't think upload.UploadFiles(...) works w/ shouldAllowOverwrite = false.  From this link http://developer.nirvanix.com/sitefiles/1000/API.html#_Toc175999949:

    The http protocol also allows a multipart/form-data POST to update an existing file using "/Upload.ashx" in conjunction with the "Content-Range" header. Please refer to this section for more details on multipart/form-data POST. Because this operation overwrites an existing file, the upload token must be obtained by calling the method GetStorageNodeExtended with the parameter "fileOverwrite" set to true.

    If I set that parameter to false, I always got an error '700004', 'FileExists'.  Given this, I'm assuming that there is no other way for me to prevent a file from overwriting, so I'll have to check this on my own before doing an upload.

  • 03-18-2008 7:11 PM In reply to

    • Nick
    • Top 50 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 6

    Re: C# Flat SDK 1.0 has been Released

    Upload tokens in the SDK are generated by calling GetStorageNodeExtended.  The value for ShouldAllowOverwrite is passed into the GetStorageNodeExtended method, and gets an upload token that will either allow or prevent an overwrite.

    If the ShouldAllowOverwrite parameter is set to false, then a path that allready exists should throw the '700004', 'FileExists' error.  If the ShouldAllowOverwrite parameter is set to true, then file path collisions should result in an overwrite with no error message.

    Does this help?

Page 1 of 1 (6 items)