Active IQ Unified Manager Discussions

ONTAPI to find the containing qtree or volume given a path?ONTAPI to find out the file type given a path?

sudha_k_iyer
3,936 Views

Hi,

I have 6 paths as such

1. /vol/VolumeName -

2. /vol/VolumeName/qtree -

3. /vol/VolumeName/qtree/dir1 -

4. /vol/VolumeName/qtree/dir1/file.txt -

5. /vol/VolumeName/qtree/lun1

6. /vol/VolumeName/lun1

For each of these I need the containing volume or qtree unless the path is a lun , in which case I need the complete lun path.

So the question is is there an ONTAPI to find out  file type and container type and  container name given a path.I tried to run all these paths through

the file-get-info API but it returns the file-type as directory for all fo them.

I found another api called file-inode-info whcih is documented but is not supported by the filer.

I am running NetApp Release 8.0 7-Mode: Thu Mar 11 16:17:13 PST 2010

I need this information while creating a dataset in DFM. DFM allows only qtree, volumes or luns to be entered into datasets

Any help is highly appreciated.

thanks

Sudha

4 REPLIES 4

kvishal
3,936 Views

Hi Sudha,

     One solution I can think of, assuming you do not have direct API's

is to parse the pattern of the path and the use the list APIs to check whether its a lun or qtree

/vol/x      - this pattern can only be a volume

/vol/x/y    - this pattern can be a qtree or lun. you could use lun-list-info qtree-list APIs to check if its a qtree or lun.

/vol/x/y/z - this can only be a lun. you could use lun-list-info api to check if its a lun.

kvishal
3,936 Views

Alternatively you could also use DFM APIs lun-list-iter-* and qtree-list-iter-* with object-name-or-id as the path

Using this you can check if the path is a valid qtree or lun before creating a dataset.

sudha_k_iyer
3,936 Views

I was doing the lun list , qtree list already was just wondering if there was an easier way to do this.

Thanks for the replies.

-Sudha

kvishal
3,936 Views

Hi Sudha,

     There is a CLI "dfm details" not aware of a ZAPI.

dfm details <obj id> will give what kind of path is it.

ex.

# dfm details 23800 | grep objType
objType                            Lun Path
#

Regards

Vishal

Public