Highlighted
zulu1231
1 Copper

Atmos- RESTfUL API -C#.NET

Hi all,

     I  am new to atmos and trying to access it using REST API.

     Trying to create a .net application using the predefined  wrapper bindings to access atmos.

     Is there any document to start up things on how to create a client application using REST API?

     Please help! Thanks in advance.

Labels (2)
0 Kudos
32 Replies
rbala1
3 Argentium

Re: Atmos- RESTfUL API -C#.NET

There is indeed a quick start guide for .NET located here:

https://community.emc.com/docs/DOC-10404

Raj

0 Kudos
zulu1231
1 Copper

Re: Atmos- RESTfUL API -C#.NET

Hey bala,

          Thanks for the reply. Actually we have a file system and need to copy the files from there  to Atmos.

        

          Atmos exposes REST API so we trying to create a tool which does the migration.

          Link which you have shared creates new object in the Atmos. But is there any other guide or document which helps to connect Atmos and do the copy operation.

          Also the tool should be a web application or it can also be a windows application??

         Please reply.  Thanks in adance.

0 Kudos
rbala1
3 Argentium

Re: Atmos- RESTfUL API -C#.NET

The example does indeed only depict interacting with Atmos.  Unfortunately, we don't have examples of all the possible ways in which data can be sourced to write to Atmos.

The Atmos REST API can be accessed from any number of platforms whether web, desktop client, mobile, etc irrespective of operating system.  Our .NET wrapper will be limited to .NET compatible apps and development environments.

0 Kudos
zulu1231
1 Copper

Re: Atmos- RESTfUL API -C#.NET

Actually i have downloaded the .net wrapper bindings but i could not find any inbuild method to copy files. So i am assuming that after making the connection to ATmos do i have to use the microsoft .net System.IO.File.Copy( fileToCopy, newLocation ); to do the copy operation? is it the way to do this? Please help!!!

Thanks in advance!!!

0 Kudos
rbala1
3 Argentium

Re: Atmos- RESTfUL API -C#.NET

That' won't work because the destination of the file copy operation is a file system.

If you're using the UploadHelper class in the .NET Atmos wrapper you should read the file into a byte array and use that variable in either the CreateObject or CreateObjectOnPath method to actually create the object on Atmos.

Raj

0 Kudos
rbala1
3 Argentium

Re: Atmos- RESTfUL API -C#.NET

Here's a complete example using C# that reads a file into a byte array and then uses that to create an object on Atmos:

(You'll need to use your own uid, shared secret, host and port information)

using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EsuApiLib;

namespace ConsoleApplication1

{
    class Program
    {
        static void Main(string[] args)
       
     
        {
            string uid = "YOUR_UID";
            string sharedSecret = "YOUR_SECRET";
            string host = "YOUR_ATMOS_IP_OR_DNS";
            int port = YOUR_PORT;

            byte[] array = File.ReadAllBytes("C:\\file.jpg");

            EsuApiLib.Rest.EsuRestApi api = new EsuApiLib.Rest.EsuRestApi(host, port, uid, sharedSecret);

            ObjectPath path = new ObjectPath("/path/to/object.jpg");

            ObjectId oid = api.CreateObjectOnPath(path, null, null, array, null);
                       
            Console.WriteLine(oid);
           
        }
    }
}

0 Kudos
zulu1231
1 Copper

Re: Atmos- RESTfUL API -C#.NET

Let me go back to basics. My understanding is like Atmos is also a FileStorage device(FileSystem). Is it right? if so why is that System.Io.file.Copy()is not possible? So for migrating files from existing file system to atmos  we need to use Uploadhelper or read the file as byte[] ? Existing system have many folders and sub folder where all files are kept. we need to migrate those including file attributes.!!!

Let me be more specific. While accessing Atmos using our Client application UI we can make use of the uploadhelper file to copy files. But now we have a file system which has 1000s of folder and sub folder with many files. Now we are trying to create a utility to migrate those files to Atoms. i am working on the utility and for this scenario we need to migrate files using the uploadheader as you mentioned in the above code??If this is the case how to copy directories??Please help!!!!

0 Kudos
rbala1
3 Argentium

Re: Atmos- RESTfUL API -C#.NET

Hello,

Atmos is an object storage platform that is best utilized through its RESTful web services API.  If you're using Atmos in your own datacenter then you may have access to the Atmos CIFS interface that will allow you to copy files and folders to it using standard copy operations that don't involve using the REST API.  This CIFS interface is not available from public cloud versions of Atmos including Atmos Online and our service provider partners.

So there are two ways to read/write objects to Atmos:

1.  Using the Atmos REST API

  • Requires using either the Atmos language bindings or using the HTTP REST interface directly

2.  Using the Atmos CIFS/NFS interfaces

  • Only available in local, on-premise deployments of Atmos

How do you plan on using Atmos after you copy files and folders to it?  How will users access content stored on Atmos?

Raj

0 Kudos
zulu1231
1 Copper

Re: Atmos- RESTfUL API -C#.NET

Hi Raj,

          Thanks for the reply. Actually at the end, users will access atmos using Atmos REST API. But for migrating the files and folders from the existing Filesystem we decided to create a tool which copies files to Atmos using REST. i am trying to create tool which uses the Atmos namspace API so that we will keep the folder structure and copy the files using uploadhelper method as u described in the sample code. So for atmos namespace API same wrapper c# bindings are used or different one...? actually what is the major difference between namespace api and object api.? using namespace api atmos will return object id rht?also is there any other way to migrate file (apart from uploadhelper method) using Rest API.??

Please help !!!! Thanks in advance!!!

0 Kudos