|
APIs in Category: file |
API version 1.5 |
file-create-symlink |
The path and filename values used in these APIs are "NFS" filenames by default. If a file is created with a name that is illegal in CIFS, CIFS access to the file will need to use the file's 8.3 name. Similarly, if two filenames created by these APIs differ only by case (e.g. "a" and "A"), CIFS access will see the 8.3 name for the second one created. |
| file-create-symlink | [top] |
Create a symlink.
Input Name Range Type Description path string
Path of the symlink file to create. The value is expected to begin with /vol/ . symlink string
Value of the symlink.
| file-delete-directory | [top] |
Delete a directory.
Input Name Range Type Description path string
Path of the directory to delete. The value is expected to begin with /vol/ . The directory must be empty in order for this API to succeed.
| file-delete-file | [top] |
Delete a file.
Input Name Range Type Description path string
Path of the file or symlink to delete. The value is expected to begin with /vol/ .
| file-inode-info | [top] |
Get parent information for a given inode. This api corresponds to the "inodepath" diag CLI. The defaults for this api match the defaults for the CLI, etc.. A volume specifier and an inode numer must be specified as inputs. A volume may be specified by name, fsid, or uuid (not yet implemented).
Input Name Range Type Description inode-number integer
The inode number for which information is desired. report-leaf-name boolean
optional
If set to true, report the leaf name of the given inode. The leaf name is equivalent to the final component of a full pathname. For example, the leaf name of: /vol/vol0/foo/bar/baz is: baz By default, the inode's leaf name is not shown. report-no-pathname boolean
optional
If set to true, do not report on the given inode's full pathname. By default, the inode's full pathname is reported. report-other-parents boolean
optional
If set to true, report the requested information for all of the parents for the given inode. By default, only information about one of the given inode's parents is reported. report-parent-data boolean
optional
If set to true, report various other pieces of information about the given inode. This information includes the inode of the parent directory containing the given inode, along with the directory cookie by which the given inode is known in that parent directory inode. By default, this other information is not reported for the given inode. snap-id integer
optional
The snapshot number within the given volume in which the given inode is to be referenced. At most, one of snap-id or snap-name can be provided. If neither is provided, we reference the given inode within the active file system of the given volume. Valid snapshot ids have a range of 0 to (WAFL_SNAP_CNT - 1) (currently 255). A value of 0 will refer to the active file system of the given volume. snap-name string
optional
A snapshot name within the given volume in which the given inode is to be referenced. At most, one of snap-id or snap-name can be provided. If neither is provided, we reference the given inode within the active file system of the given volume. volume-fsid integer
optional
The FSID (file system identifier) of the volume containing the given inode. One and only one of volume-fsid, volume-name, or volume-uuid must be specified. A FSID may have any uint4 value. volume-name string
optional
The name of the volume containing the given inode. One and only one of volume-fsid, volume-name, or volume-uuid must be specified. volume-uuid string
optional
The UUID (Universally Unique IDentifier) of the volume containing the given inode.. One and only one of volume-fsid, volume-name, or volume-uuid must be specified. NOTE: Volume lookup by volume-uuid is currently unimplemented. It's a placeholder for a future feature. Output Name Range Type Description inode-number integer
The number identifying the inode. inode-paths inode-parent-info[]
List of requested paths and parent information for the given inode. number-of-parents integer
The number of parents for the inode. For a file this is the number of links to the file. volume-fsid integer
The volume FSID. volume-name string
The volume name. volume-uuid string
The volume UUID.
Errno Description EINVAL EINODENUMBERTOOSMALL EINODENUMBERTOOLARGE EVOLUMEDOESNOTEXIST ESNAPSHOTDOESNOTEXIST EINVALIDINODE EINELIGIBLEINODE EPARENTINFONOTLOADED EI2PNOTENABLED EINTERNALERROR
Vfiler-enabled Yes
| file-list-directory-iter-end | [top] |
Terminate a directory iteration.
Input Name Range Type Description tag string
Tag from a previous file-list-directory-iter-start.
Errno Description ENOENT
| file-list-directory-iter-next | [top] |
Obtain a list of files in a given directory.
Input Name Range Type Description maximum integer
Maximum number of directory entries to retrieve. tag string
Tag from a previous file-list-directory-iter-start. Output Name Range Type Description files file-info[]
Array with information for each file in the named directory. records integer
This tells you how many records are being returned from this particular call to file-list-directory-iter-next. When this value is 0, you have retrieved everything.
Errno Description ENOENT
| file-list-directory-iter-start | [top] |
Start in iteration through the list of files in a given directory.
Input Name Range Type Description path string
Pathname of the directory to list. The value is expected to begin with /vol/ . Output Name Range Type Description records integer
Number of items that have been saved for future retrieval with file-list-directory-iter-next. tag string
Tag to be used in subsequent iterations.
Errno Description ENOENT
| file-read-file | [top] |
Read data from a named file.
Input Name Range Type Description length integer
Number of bytes to read from the file. offset integer
Offset into file to start reading from. path string
Name of the file to read, in the form "/vol/ / ". Output Name Range Type Description data string
Data read from the file. The format of the data is ASCII hex characters, two characters representing one byte from the file. (This format allows the representation of 0-valued bytes.) length integer
Number of bytes actually read from the file. If this value is 0, then you have attempted to read at or past the end of the file.
Errno Description ENOENT
| file-read-symlink | [top] |
Read the contents of a symlink.
Input Name Range Type Description path string
Path of the symlink file to read. The value is expected to begin with /vol/ . Output Name Range Type Description symlink string
Value of the symlink. In other words, this is the destination path contained in the symlink.
| file-truncate-file | [top] |
Truncate a file. Any data past the truncation point will be lost, of course.
Input Name Range Type Description path string
Path of the file to truncate. The value is expected to begin with /vol/ . size string
optional
If provided, the file size is set to this value. The default value is 0.
Errno Description ENOENT
| file-write-file | [top] |
Write data into a named file. If the file does not previously exist, it will be created - the owner of the file will be root and it will not be readable or writable by non-root users.
Input Name Range Type Description data string
Data to be written. The format of the data is ASCII hex characters, two characters representing one byte. Whitespace characters, for convenience in formatting, can be present in the value and are ignored. offset integer
Offset into file at which to start writing. If the offset is -1, the data is appended to the file. overwrite boolean
optional
If false, and the file already exists, then the API will fail, with an errno of EEXIST. This allows the client to ensure that it was the exclusive creator of the file. The default value is true. path string
Pathname of the file to write. The value is expected to begin with /vol/ . Output Name Range Type Description length integer
Number of bytes actually written.
Errno Description ENOENT
| Element definition: file-info | [top] |
Name Range Type Description file-type string
Type of the file. Possible values: file, directory, blockdev, chardev, symlink, socket, fifo, stream, lun. name string
Name of the file.
| Element definition: inode-parent-info | [top] |
Inode's path and parent information.
Name Range Type Description inode-name string
optional
Name of inode in parent directory. inode-parent-cookie integer
optional
The opaque readdir cookie to determine the index of the inode in the parent directory tree. Note that this value is used as a testing hook, we do not plan to support its semantics and those semantics might change over time. inode-parent-inode-number integer
optional
Inode number of the parent directory. inode-path string
optional
Full path to inode