Subscribe

API call for file metadata

Hello, Basically what I need is an API call that I can use to:

- given a folder get as much information as possible about the folder and its files statistics, including sizes, how long they have been stored, how long they have been untouched and so on.

I know this is file level metadata that DFM SRM used to collect. Is there anything currently available in any NetApp API/SDK?

Thanks very much!

API call for file metadata

I'd also love to hear any comments such as "that doesn't exist natively but try this 3rd party tool"

rle Former NetApp Employee

Re: API call for file metadata

In 7-mode, there is file-list-directory-iter-[start|next|end].  Here is the information that is returned:

Information about a single file.
NameRangeTypeDescription
accessed-timestamp[0..2^32-1]integer
Last asscess time of the file.  The value is in seconds since January 1, 1970.
acl-type
string
The type of access control list (acl) on the file. Possible values are: "no_acl", "nt_acl", "nfs_acl", and goddess forbid, "unknown".
bytes-used[0..2^63-1]integer
optional
returns the number of bytes actually used on disk by this file
changed-timestamp[0..2^32-1]integer
Last changed time of the file.  The value is in seconds since January 1, 1970.
creation-timestamp[0..2^32-1]integer
Creation time of the file.  The value is in seconds since January 1, 1970.
file-size[0..2^63-1]integer
The size of the file in bytes.
file-type
string
Type of the file.  Possible values: file, directory, blockdev, chardev, symlink, socket, fifo, stream, lun. A cluster-mode volume can also return "junction".
group-id[0..2^32-1]integer
The integer id of the group owner of the file.
hard-links-count[0..2^32-1]integer
The number of hard links to the file.
inode-gen-number[0..2^32-1]integer
optional
Inode generation number
inode-number[0..2^32-1]integer
The file node number.
is-empty
boolean
optional
This element tells whether directory is empty or not. Directory is considered     empty if it only contains entries for "." and "..". This element is present if file is directory. In some special error cases like volume goes offline in between or directory is moved in the middle of getting this info, this field might not get set.
modified-timestamp[0..2^32-1]integer
Last modification time of the file.  The value is in seconds since January 1, 1970.
name
string
Name of the file.
owner-id[0..2^32-1]integer
The integer id of the owner of the file.
perm
string
File permission bits. It's similar to Unix style permission bits: 0755 gives read/write/execute permissions to owner and read/execute to group and other users. It consists of 4 octal digits derived by adding up bits 4, 2 and 1. Omitted digits are assumed to be zeros. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. The second digit selects permission for the owner of the file: read (4), write (2) and execute (1); the third selects permissions for other users in the same group; the fourth for other users not in the group.

In clustered ONTAP, there is file-list-directory-iter.  It returns:

nformation about a single file.
NameRangeTypeDescription
accessed-timestamp[0..2^32-1]integer
Last asscess time of the file.  The value is in seconds since January 1, 1970.
acl-type
string
The type of access control list (acl) on the file. Possible values are: "no_acl", "nt_acl", "nfs_acl", and goddess forbid, "unknown".
bytes-used[0..2^63-1]integer
optional
returns the number of bytes actually used on disk by this file
changed-timestamp[0..2^32-1]integer
Last changed time of the file.  The value is in seconds since January 1, 1970.
creation-timestamp[0..2^32-1]integer
Creation time of the file.  The value is in seconds since January 1, 1970.
dsid[0..2^64-1]integer
optional
Data Set ID
file-size[0..2^63-1]integer
The size of the file in bytes.
file-type
string
Type of the file.  Possible values: file, directory, blockdev, chardev, symlink, socket, fifo, stream, lun. A cluster-mode volume can also return "junction".
group-id[0..2^32-1]integer
The integer id of the group owner of the file.
hard-links-count[0..2^32-1]integer
The number of hard links to the file.
inode-gen-number[0..2^32-1]integer
optional
Inode generation number
inode-number[0..2^32-1]integer
The file node number.
is-empty
boolean
optional
This element tells whether directory is empty or not. Directory is considered     empty if it only contains entries for "." and "..". This element is present if file is directory. In some special error cases like volume goes offline in between or directory is moved in the middle of getting this info, this field might not get set.
modified-timestamp[0..2^32-1]integer
Last modification time of the file.  The value is in seconds since January 1, 1970.
msid[0..2^64-1]integer
optional
Mirror Set ID
name
string
Name of the file.
owner-id[0..2^32-1]integer
The integer id of the owner of the file.
perm
string
File permission bits. It's similar to Unix style permission bits: 0755 gives read/write/execute permissions to owner and read/execute to group and other users. It consists of 4 octal digits derived by adding up bits 4, 2 and 1. Omitted digits are assumed to be zeros. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. The second digit selects permission for the owner of the file: read (4), write (2) and execute (1); the third selects permissions for other users in the same group; the fourth for other users not in the group.

Regards,

   - Rick -