APIs in Category: snaplock | API version 1.14

file-get-snaplock-retention-time file-get-snaplock-retention-time-list-info-max file-set-snaplock-retention-time file-snaplock-retention-time-list-info snaplock-get-compliance-clock snaplock-get-log-volume snaplock-get-options snaplock-log-archive snaplock-log-status-list-info snaplock-privileged-delete-file snaplock-set-log-volume snaplock-set-options

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 |  |

> Vfiler-enabled
> Yes

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]

> Vfiler-enabled
> Yes

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 |  |

> Vfiler-enabled
> Yes

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 |  |

> Vfiler-enabled
> Yes

snaplock-get-compliance-clock | [top]

> Get the SnapLock Compliance Clock date and time.

> Output Name | Range | Type | Description
> formatted-snaplock-compliance-clock |  | string | If Compliance Clock is initialized then human readable time :: is displayed. A value of "Not Initalized" indicates that Compliance Clock has not been initialized.
> snaplock-compliance-clock |  | integer optional | If Compliance Clock is initialized then time in seconds in the standard UNIX format (since 01/01/1970 00:00:00) is displayed. Range:[0..2^64-1].

snaplock-get-log-volume | [top]

> Get the active WORM log volume configuration

> Output Name | Range | Type | Description
> log-volume |  | string optional | When asking for the WORM log volume, the string value of the configured log-volume is returned. If the value is not set, a string is returned saying that no log volume is configured.

> Errno | Description
> ENOENT |  |
> EONTAPI_EIO |  |

snaplock-get-options | [top]

> gets the value of given snaplock option on a volume

> Input Name | Range | Type | Description
> option |  | string | Specifies snaplock option. Presently, only the "privdel" snaplock option is supported. This option specifies the privileged delete capability state of the volume. For unsupported options, this zapi returns EONTAPI_EINVAL.
> volume |  | string | Specifies the volume
> Output Name | Range | Type | Description
> option-value |  | string | Value of the option parameter.

> Errno | Description
> EONTAPI_ENXIO |  |
> EONTAPI_EIO |  |
> EONTAPI_EINVAL |  |
> EINTERNALERROR |  |
> EAPIERROR |  |
> EONTAPI_ENOENT |  |
> EONTAPI_EOFFLINE |  |
> EOPNOTSUPPORTED |  |
> EONTAPI_EPERM |  |
> EONTAPI_EACCES |  |
> EONTAPI_EWORMNOCLOCK |  |

snaplock-log-archive | [top]

> Archive the active worm log file. This will close the current log file for furthur updates and it will open a new log file to write future log updates.

> Input Name | Range | Type | Description
> log-basename |  | string optional | The basename of the worm log file to be archived. The logfile is of the format basename.-present. The date is in the format YYYYMMDD_HHMMSS_ZZZ If the log-basename is not specified, all the active WORM log files in the log-volume are archived. If the old log file was basename.-present, once the archive command is run, the file will be renamed to basename.- and closed. A new log file of the name basename.-present will be opened for future log updates. e.g. - The system log file was created on Jan 1st, 2007. The file would have the name system_log.20070101_000000_GMT-present. If this zapi is run on the file on Jun 1st, 2007 at 5 pm, the file would get renamed to system_log.20070101_000000_GMT-20070601_170000_GMT and will be closed to future updates. A new log file system_log.20070601_170000_GMT-present will be opened to capture future log updates.
> log-volume |  | string optional | The name of the volume that contains the WORM log files. This volume must be a SnapLock Compliance volume. If the log-volume is not specified, the log-volume is considered to be the volume configured by the snaplock zapi or command.

> Errno | Description
> EONTAPI_EWORMVOLNOTWORM |  |
> EONTAPI_EWORMNOCLOCK |  |
> EINTERNALERROR |  |
> EFILENOTFOUND |  |
> EVOLUMEOFFLINE |  |
> ENOENT |  |

snaplock-log-status-list-info | [top]

> Status of the active worm log file/s

> Input Name | Range | Type | Description
> log-basename |  | string optional | The basename of the worm log file whos status is required. The logfile is of the format basename.-present If the log-basename is not specified, the status of all the active WORM log files in this volume are returned
> log-volume |  | string optional | The name of the volume that contains the WORM log files. This volume must be a SnapLock Compliance volume. If the log-volume is not specified, the log-volume is considered to be the volume configured by the snaplock zapi or command.
> Output Name | Range | Type | Description
> log-file-count |  | integer | Number of active WORM log files contained in the log-volume
> log-file-details |  | log-file-info[] optional | Status information of each of the active WORM log files present in log-volume
> log-volume |  | string | The name of the log volume. If log-volume is specified in the input, this value should be the same. If it isn't specified, this should be the same as the name configured by the snaplock zapi or command. The log-volume is a SnapLock compliance volume.

> Errno | Description
> ENOENT |  |
> EONTAPI_EWORMMNOTWORM |  |
> EONTAPI_EWORMNOCLOCK |  |
> EINTERNALERROR |  |
> EONTAPI_EWORMVOLNOTWORM |  |

snaplock-privileged-delete-file | [top]

> Executes a privileged delete on a SnapLock file

> Input Name | Range | Type | Description
> do-it |  | boolean optional | If set to true, it will enable privileged delete of the file specified by the path argument. If set to false, This zapi will not delete the file, instead it will return error EAPIERROR with message that user is trying to delete a file that is retained by Snaplock. Default value of this argument is 'false'.
> path |  | string | Absolute path of the file to delete The value must be prefixed with "/vol/".

> Errno | Description
> EONTAPI_ENXIO |  |
> EONTAPI_EIO |  |
> EONTAPI_EINVAL |  |
> EINTERNALERROR |  |
> EAPIERROR |  |
> EONTAPI_EROFS |  |
> EONTAPI_ENOENT |  |
> EONTAPI_EOFFLINE |  |
> EONTAPI_ENOMEM |  |
> EOPNOTSUPPORTED |  |
> EONTAPI_EPERM |  |
> EONTAPI_EACCES |  |
> EONTAPI_EWORMNOCLOCK |  |

snaplock-set-log-volume | [top]

> Set the active WORM log volume configuration

> Input Name | Range | Type | Description
> is-force |  | boolean optional | If true it will enable the set log volume operation to ignore errors encountered during SnapLock log volume change. Useful when the log volume is inconsistent or have not enough disk space Default is false.
> log-volume |  | string | The name of the volume that will contain the WORM log files. This volume must be a SnapLock Compliance volume. if log-volume is NULL, ENOENT is returned with a string saying no volume was specified. If the set fails, EONTAPI_EIO is returned with a string indicating the reason.

> Errno | Description
> ENOENT |  |
> EONTAPI_EIO |  |

snaplock-set-options | [top]

> sets snaplock options on a volume

> Input Name | Range | Type | Description
> do-it |  | boolean optional | If set to true, it will allow setting of privileged delete snaplock option to "disallowed" state. if set to false it will not allow setting of privileged delete option to "disallowed" state. However setting of privileged delete option to "on" or "off" state can be done regardless of the value of this parameter. Default value of this parameter is false.
> option |  | string | Specifies snaplock option. Presently, only the "privdel" snaplock option is supported. This option specifies the privileged delete capability state of the volume. For unsupported options, this zapi returns EONTAPI_EINVAL.
> option-value |  | string | Specifies the new value of the option. Presently for the "privdel" snaplock option, three values "on"/"off"/"disallowed" are supported. To set new value to "disallowed" requires "do-it" parameter to be set to "true". For unsupported option-value string, this zapi returns EONTAPI_EINVAL.
> volume |  | string | Specifies the volume

> Errno | Description
> EONTAPI_ENXIO |  |
> EONTAPI_EIO |  |
> EONTAPI_EINVAL |  |
> EINTERNALERROR |  |
> EAPIERROR |  |
> EONTAPI_EROFS |  |
> EONTAPI_ENOENT |  |
> EONTAPI_EOFFLINE |  |
> EONTAPI_ENOMEM |  |
> EOPNOTSUPPORTED |  |
> EONTAPI_EPERM |  |
> EONTAPI_EACCES |  |
> EONTAPI_EWORMNOCLOCK |  |

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: log-file-info | [top]

> Status information for each active WORM log file

> Name | Range | Type | Description
> file-size |  | string optional | size of the active WORM log file (units are given when more than 1024 bytes)
> formatted-retention-date |  | string optional | Expiry date of the active WORM log file. This takes care of wraparound dates and prints the expiry date of the file in the format :: . The value of "INFINITE" indicates that the file has infinite retention and will never expire.
> log-basename |  | string | The basename for the active WORM log file. If the caller of the ZAPI passed in the optional parameter log-basename, this should have the same value
> log-complete-path |  | string optional | The complete pathname of the active WORM log file. The format of the filename is basename.-present.
> 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

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 active WORM log file

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