APIs in Category: snaplock | API version 1.6

file-get-snaplock-retention-time file-get-snaplock-retention-time-list-info-max file-set-snaplock-retention-time file-snaplock-retention-time-list-info

NetApp Manage ONTAP

file-get-snaplock-retention-time | [top]

> Get the SnapLock retention attributes of a file.

> Input Name | Range | Type | Description
> path |  | string | Absolute path of the file to query. The value must be prefixed with "/vol/".
> Output Name | Range | Type | Description
> retention-time |  | integer | Retention time in seconds since 01/01/1970 00:00:00. A zero value indicates that the file is not in WORM state. Range: [0..2^64-1]

> Errno | Description
> EONTAPI_ENXIO |  |
> EONTAPI_EIO |  |
> EONTAPI_ENOENT |  |
> EONTAPI_EINVAL |  |
> EVOLUMEOFFLINE |  |
> EFILENOTFOUND |  |
> EVOLUMEDOESNOTEXIST |  |
> EVOLUMEQUIESCED |  |
> EINTERNALERROR |  |

file-get-snaplock-retention-time-list-info-max | [top]

> Get the maximum number of entries that can be processed and returned in one call to the zapi file-snaplock-retention-time-list-info.

> Output Name | Range | Type | Description
> max-list-entries |  | integer | The maximum number of pathnames that can be processed in one call to file-snaplock-retention-time-list-info. This limit is imposed to prevent taking up too much CPU/memory for a ZAPI call. If the number of input pathnames for file-snaplock-retention-time-list-info is more than this number, it returns the error EAPITOOMANYENTRIES. Range: [0..2^64-1]

file-set-snaplock-retention-time | [top]

> Set the SnapLock retention attributes of a file.

> Input Name | Range | Type | Description
> path |  | string | Absolute path of the file. The value must be prefixed with "/vol/".
> retention-time |  | integer optional | Expiry time in seconds since 01-Jan-1970 00:00:00 at which time the file will be eligible for deletion. If the expiry time specified does not comply with the snaplock_minimum_period and snaplock_maximum_period of the volume, the expiry time will be increased or decreased to do so. Range: [0..2^64-1] If the retention-time is not specified, the file is only committed to worm(i.e. made read-only). The expiry time of the file 1> is the atime of the file, if it has been set manually. 2> depends on the default retention time of the volume containing the file. Expiry time = current time + snaplock_default_period of the vol In some cases, even if the call to file-set-snaplock-retention-time fails (that is the file could not be committed to worm successfully), it is possible that the atime of the file would be modified.

> Errno | Description
> EONTAPI_ENOENT |  |
> EONTAPI_EINVAL |  |
> EONTAPI_ERANGE |  |
> EONTAPI_ENXIO |  |
> EONTAPI_EIO |  |
> EVOLUMEOFFLINE |  |
> EFILENOTFOUND |  |
> EVOLUMEDOESNOTEXIST |  |
> EVOLUMEQUIESCED |  |
> EINTERNALERROR |  |

file-snaplock-retention-time-list-info | [top]

> Get the Snaplock retention attributes for a list of files.

> Input Name | Range | Type | Description
> pathnames |  | pathname-info[] | List of pathnames to query. The function returns the file-retention-information for each of these pathnames. If this ZAPI function is called without any input parameter, the error EAPIMISSINGARGUMENT is returned If number of input pathnames exceeds max-list-entries an error of EAPITOOMANYENTRIES is returned. The value of max-list-entries can be retrieved using the zapi call file-get-snaplock-retention-time-list-info-max.
> Output Name | Range | Type | Description
> file-retention-details |  | file-retention-info[] | information about retention period for each file in the list

> Errno | Description
> EAPIMISSINGARGUMENT |  |
> EAPITOOMANYENTRIES |  |

Element definition: file-retention-info | [top]

> retention information for each file

> Name | Range | Type | Description
> formatted-retention-time |  | string optional | expiry date of the worm file formatted in a human-readable format. This takes care of wrap-around dates and prints the expiry date of the file in the the format :: A value of "INFINITE" indicates that this file has infinite retention-time. This field is not included in non-worm files (when snaplock-type is NONE).
> is-wraparound |  | boolean optional | True if the date represented in retention-time is a wrap-around date. This field is not included in case the file is not a worm file or if it has infinite retention.
> pathname |  | string | pathname of the file. This will always have the same format and values as the input pathname-info array.
> retention-time |  | integer optional | retention time in seconds in the standard UNIX format (since 01/01/1970 00:00:00). SnapLock wraps around the retention time to indicate dates after 01/19/2038. It remaps 01/01/1970 - 12/31/2002 to 01/19/2038 - 01/19/2071 This field is not included in case the file is not a worm file or if the file has infinite retention. The flag is-wraparound indicates if this date is in the normal format or is wrapped around. The field formatted-retention-time represents the date as understood by SnapLock for retention of the file. Range: [0..2^64-1]
> snaplock-error |  | snaplock-error optional | This value is only present if there is an error for a specific pathname entry. Error numbers returned EFILENOTFOUND, EINVALIDINPUTERROR, EVOLUMEOFFLINE, EVOLUMEDOESNOTEXIST, EVOLUMEQUIESCED, EINTERNALERROR
> snaplock-type |  | string optional | type of snaplock license applicable for this file Possible values "SLC" - indicates it is a worm file with snaplock compliance restrictions applying to it. "SLE" - indicates it is a worm file with snaplock enterprise restrictions applying to it. "NONE" - Not a worm file

Element definition: pathname-info | [top]

> pathname info for each file

> Name | Range | Type | Description
> pathname |  | string | pathname of the file. Pathname must be of the format /vol//

Element definition: snaplock-error | [top]

> Information about a single quota error.

> Name | Range | Type | Description
> errno |  | integer | The error number Range: [0..2^64-1]
> reason |  | string | A human-readable concise reason for the error.