APIs in Category: lock
API version 1.9

 
lock-break
lock-status-iter-end
lock-status-iter-next
lock-status-iter-start

NetApp Manage ONTAP
 
lock-break [top]

Breaks all specified locks. At least one input argument needs to be specified.
Input Name Range Type Description
file-name string
optional
File name prefixed by "/vol/volX" style path. Input syntax of file-name is the same for all protocols. NOTE: Currently, breaking all locks of a file is not encouraged, as NFSv4 does not yet implement breaking of locks. If attempted, will lead to an inconsistent NFSv4 lock state. Specifying a protocol will prevent this by limiting the breaking of locks to that particular protocol. Also, breaking locks for proto "nfsv4" is explicitly disallowed.
host string
optional
Identity of a host. It is the NetBIOS name or IP address of a CIFS cient, FQDN of a PFS client, IP address or FQDN of NLM (Nfsv2/Nfsv3) client, and IP address of NFSv4 client. If specified, then locks are printed for that host only. If not specified, then locks across all hosts are printed.

NOTE: Currently, only CIFS protocol filters lock output by host name.
owner string
optional
Name of the lock owner, viz., a username prefixed by an optional domain (and a backslash) for CIFS protocol ([domain\]username), IP address of caching filer suffixed by a colon and a filesystem ID of origin filer (IP:fsid) for PFS, and process-ID for NLM(Nfsv2/Nfsv3). The concept of an owner for NFSv4 is yet to be defined. If specified, then locks are printed for that owner only. If owner is not specified, locks across all owners are printed.

NOTE: Currently, only CIFS protocol filters lock output by owner name.
protocol string
optional
Name of the protocol (case-insensitive): "cifs" (CIFS), "nlm" (Nfsv2/Nfsv3), "nfsv4" (NFSv4), and "pfs"(PFS). If not specified, then all protocols are scanned for locks. If in that case, a host and/or owner were specified, then expect input syntax errors in "error" output field for protocols that define syntax of host or owner differently. However, scanning of locks is not aborted due to these syntax errors and instead all protocols are still scanned to completion.
 
Output Name Range Type Description
errors break-error[]
optional
If a specific protocol encounters an error, e.g., a syntax error, this element is included in the output to indicate it because the error might be for specific protocols but not for other protocols and hence should not fail the entire API. This structure includes the same information (status, reason, errno) that is normally included in the "results" attribute of the API itself.
 Errno  Description
 EINTERNALERROR

 
lock-status-iter-end [top]
Terminate a list iteration and clean up any saved info.
Input Name Range Type Description
tag string
Tag from a previous cifs-share-list-iter-start.

 
lock-status-iter-next [top]
Returns items from a previous call to cifs-lock-status-iter-start. This API actually prints out the required locks.
Input Name Range Type Description
maximum integer
The maximum number of lock entries to retrieve.
tag string
Tag from a previous cifs-lock-status-iter-start.
 
Output Name Range Type Description
lock-status lock-status-info[]
An array, one entry per each lock.
records integer
This tells you how many locks are being returned from this particular call to lock-status-iter-next. When this value is 0, you have retrieved everything.

 
lock-status-iter-start [top]
Gives information about one or more locks, the results of which are retrieved by using lock-status-iter-next. One or more of the defined inputs can be specified in tandem to get locks for specific cases. If none of the inputs are specified, then all the locks in the system are printed. If no protocol is specified but one or more of the other inputs are specified, then locks across all protocols, viz., CIFS, PFS, NLM (Nfsv2/Nfsv3), and NFSv4, are printed. In this case, it is possible for protocols that define syntax of specified input differently to generate input syntax errors. However, these errors do not stop scanning of locks for other protocols.
Input Name Range Type Description
file-name string
optional
File name prefixed by "/vol/volX" style path. If not specified, then locks across all files are printed. Input syntax of file-name is the same for all protocols.
host string
optional
Identity of a host. It is the NetBIOS name or IP address of a CIFS client, FQDN of a PFS client, IP address or FQDN of NLM (Nfsv2/Nfsv3) client, and IP address of NFSv4 client. If specified, then locks are printed for that host only. If not specified, then locks across all hosts are printed.

NOTE: Currently, only CIFS protocol filters lock output by host name.
owner string
optional
Name of the lock owner, viz., a username prefixed by an optional domain (and a backslash) for CIFS protocol ([domain\]username), IP address suffixed by a colon and a filesystem ID of caching filer (IP:fsid) for PFS, and process-ID for NLM(Nfsv2/Nfsv3). The concept of an owner for NFSv4 is yet to be defined. If specified, then locks are printed for that owner only. If owner is not specified, locks across all owners are printed.

NOTE: Currently, only CIFS protocol filters lock output by owner name.
protocol string
optional
Name of the protocol (case-insensitive): "cifs" (CIFS), "nlm" (Nfsv2/Nfsv3), "nfsv4" (NFSv4), and "pfs"(PFS). If not specified, then all protocols are scanned for locks. If in that case, a host and/or owner were specified, then expect input syntax errors in "error" output field for protocols that define syntax of host or owner differently. However, scanning of locks is not aborted due to these syntax errors and instead all protocols are still scanned to completion.
 
Output Name Range Type Description
records integer
Number which tells you how many items have been saved for future retrieval with lock-status-iter-next.
tag string
Tag to be used in subsequent calls to lock-status-iter-next.
 Errno  Description
 EINVAL
 EPIERROR
 EINTERNALERROR

 
Element definition: break-error [top]
Information about a single error encountered by specific protocol(s).
Name Range Type Description
err string
The error string.

 
Element definition: lock-status-info [top]
Information about a single lock.
Name Range Type Description
client-id string
This is used to identify the client machine that owns the lock. "client-id" is a byte string that the n-blade generates for each lock request and is opaque to the d-blade. This value can be used as the "host" parameter for new invocations of d-lock-status-list-iter or d-lock-break.
file-name string
This is the file path on which the lock has been taken. The path is relative to the volume on which the file exists. The file-name format is "/volname/filepath". For example if the file is testdir/simple on volume root_vs0, then the returned path is /root_vs0/testdir/simple.
lock-id string
The 128-bit universally-unique identifier (UUID) of the lock.

UUIDs are formatted as 36-character strings. These strings are composed of 32 hexadecimal characters broken up into five groupings separated by '-'s. The first grouping has 8 hex characters, the second through fourth groupings have 4 hex characters each, and the fifth and final grouping has 12 hex characters. Note that a leading '0x' is not used.

op-lock op-lock
optional
Information about Opportunistic locks.
owner-id string
This is used to identify the lock owner. owner-id is also a byte string. Similar to the "client-id" value, this is n-blade generated, opaque to d-blade. This value can be used as "owner" parameter for new invocations of d-lock-status-list-iter or d-lock-break.
range-lock range-lock
optional
Information about range lock.
share-lock share-lock
optional
Information about share locks.
vif-id integer
Virtual interface id on which the lock request arrived. Refer to the description of "vif" in the input argument section. Range : [ 0 - 2^31-1]
volume-dsid string
The identity of the volume on which the lock is held.

The legal choice for a volume identifer is the Volume DSID. DSIDs are formatted as 10-character strings composed of 8 hex characters prefixed with '0x'.

vserver-id integer
Vserver to which the lock belongs. Refer to the description of "vserver" in the input argument section. Range : [ 0 - 2^31-1]

 
Element definition: op-lock [top]
Description of op-locks
Name Range Type Description
oplock-level string
Oplock level: "exclusive" or "read"

 
Element definition: range-lock [top]
information about range locks
Name Range Type Description
bytelock-length integer
Number of bytes (from bytelock-offset) that are locked. Range : [ 1 - 2^63-1]
bytelock-offset integer
Starting offset in file that gets bytelocked. Range : [ 0 - 2^63-2]
is-bytelock-exclusive boolean
is true for exclusive bytelocks
is-bytelock-mandatory boolean
is true for mandatory bytelocks, else advisory

 
Element definition: share-lock [top]
Description of share-locks
Name Range Type Description
mode string
Access mode. Various values are "delete-on-close" or a string of of type "Accessmode-Denymode" values for Accessmode are: read write read_write values for deny mode are "deny_read" "deny_write" "deny_all" "deny_delete" "deny_none"