Endpoint

/v1/files/locks/nlm/byte-range/

GET

Return a list of all granted file locks that the specified machine owns.

Parameters

Name Description Required
owner_name The lock owner's name. The client provides the name. Typically, it is the client hostname. No
owner_address The lock owner's address. This is the IP address of the machine that acquires the lock. If the machine's IP address changes, any existing lock entries are still listed under the old address. No
after Return entries after the given key (keys are returned in the paging object) No
limit Return no more than this many entries; the system may choose a smaller limit. No

Response

Codes

Code Description
200 Return value on success

Schema

{
  "description": "api_byte_range_grants",
  "type": "object",
  "properties": {
    "grants": {
      "type": "array",
      "items": {
        "description": "grants",
        "type": "object",
        "properties": {
          "file_id": {
            "description": "file_id",
            "type": "string"
          },
          "stream_id": {
            "description": "stream_id",
            "type": "string"
          },
          "snapshot_id": {
            "description": "The locked file's snapshot ID. Empty if the file is at the head version (not from a snapshot).",
            "type": "string"
          },
          "mode": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "API_BYTE_RANGE_EXCLUSIVE",
                "API_BYTE_RANGE_SHARED",
                "API_BYTE_RANGE_READ_OP",
                "API_BYTE_RANGE_WRITE_OP"
              ],
              "description": "mode:\n * `API_BYTE_RANGE_EXCLUSIVE` - API_BYTE_RANGE_EXCLUSIVE,\n * `API_BYTE_RANGE_READ_OP` - API_BYTE_RANGE_READ_OP,\n * `API_BYTE_RANGE_SHARED` - API_BYTE_RANGE_SHARED,\n * `API_BYTE_RANGE_WRITE_OP` - API_BYTE_RANGE_WRITE_OP"
            }
          },
          "offset": {
            "description": "offset",
            "type": "string"
          },
          "size": {
            "description": "size",
            "type": "string"
          },
          "owner_id": {
            "description": "The unique identifier for the process that owns the file lock.",
            "type": "string"
          },
          "owner_name": {
            "description": "The name of the machine that owns the lock.",
            "type": "string"
          },
          "owner_address": {
            "description": "The IP address to use for acquiring the file lock.",
            "type": "string"
          },
          "node_address": {
            "description": "The IP address of the node that receives the request.",
            "type": "string"
          }
        }
      }
    }
  }
}

DELETE

Release all locks held by a particular client. This is dangerous, and should only be used after confirming that the client is dead.

Parameters

Name Description Required
owner_name The lock owner's name. The client provides the name. Typically, it is the client hostname. No
owner_address The lock owner's address. This is the IP address of the machine that acquires the lock. If the machine's IP address changes, any existing lock entries are still listed under the old address. No

Response

Codes

Code Description
200 Return value on success