Endpoint

/v1/files/{ref}/punch-hole

POST

Create a hole in a region of a file. Destroys all data within the hole so that subsequent reads will return zeroes. Returns the post-operation attributes of the file.

Parameters

Name Description Required
ref The file ID or the absolute path to the file system object. File IDs can be found in the id field of responses of APIs that return file attributes. You must URL-encode the paths. The APIs & Tools page in the Qumulo Core Web UI URL-encodes the paths. Yes
If-Match ETag for expected version No

Request

Schema

{
  "description": "api_files_punch_hole",
  "type": "object",
  "properties": {
    "offset": {
      "description": "Offset in bytes specifying the start of the hole to create.",
      "type": "string"
    },
    "size": {
      "description": "Size in bytes of the hole to create.",
      "type": "string"
    }
  }
}

Response

Codes

Code Description
200 Return value on success

Schema

{
  "description": "api_files_attributes",
  "type": "object",
  "properties": {
    "path": {
      "description": "Filesystem path of the object",
      "type": "string"
    },
    "name": {
      "description": "Name of this file",
      "type": "string"
    },
    "num_links": {
      "description": "How many directory entries are associated with this file",
      "type": "number"
    },
    "type": {
      "type": "string",
      "enum": [
        "FS_FILE_TYPE_FILE",
        "FS_FILE_TYPE_DIRECTORY",
        "FS_FILE_TYPE_SYMLINK",
        "FS_FILE_TYPE_UNIX_PIPE",
        "FS_FILE_TYPE_UNIX_CHARACTER_DEVICE",
        "FS_FILE_TYPE_UNIX_BLOCK_DEVICE",
        "FS_FILE_TYPE_UNIX_SOCKET"
      ],
      "description": "Resource type:\n * `FS_FILE_TYPE_DIRECTORY` - FS_FILE_TYPE_DIRECTORY,\n * `FS_FILE_TYPE_FILE` - FS_FILE_TYPE_FILE,\n * `FS_FILE_TYPE_SYMLINK` - FS_FILE_TYPE_SYMLINK,\n * `FS_FILE_TYPE_UNIX_BLOCK_DEVICE` - FS_FILE_TYPE_UNIX_BLOCK_DEVICE,\n * `FS_FILE_TYPE_UNIX_CHARACTER_DEVICE` - FS_FILE_TYPE_UNIX_CHARACTER_DEVICE,\n * `FS_FILE_TYPE_UNIX_PIPE` - FS_FILE_TYPE_UNIX_PIPE,\n * `FS_FILE_TYPE_UNIX_SOCKET` - FS_FILE_TYPE_UNIX_SOCKET"
    },
    "major_minor_numbers": {
      "description": "The major and minor numbers for UNIX device files",
      "type": "object",
      "properties": {
        "major": {
          "description": "major",
          "type": "number"
        },
        "minor": {
          "description": "minor",
          "type": "number"
        }
      }
    },
    "symlink_target_type": {
      "type": "string",
      "enum": [
        "FS_FILE_TYPE_UNKNOWN",
        "FS_FILE_TYPE_FILE",
        "FS_FILE_TYPE_DIRECTORY"
      ],
      "description": "The type of the target file if this file is a symlink:\n * `FS_FILE_TYPE_DIRECTORY` - API_SYMLINK_TARGET_DIRECTORY,\n * `FS_FILE_TYPE_FILE` - API_SYMLINK_TARGET_FILE,\n * `FS_FILE_TYPE_UNKNOWN` - API_SYMLINK_TARGET_UNKNOWN"
    },
    "file_number": {
      "description": "Unique ID of this file",
      "type": "string"
    },
    "id": {
      "description": "Unique ID of this file",
      "type": "string"
    },
    "mode": {
      "description": "POSIX-style file mode (octal)",
      "type": "string"
    },
    "owner": {
      "description": "File owner",
      "type": "string"
    },
    "owner_details": {
      "description": "File owner details",
      "type": "object",
      "properties": {
        "id_type": {
          "type": "string",
          "enum": [
            "LOCAL_USER",
            "LOCAL_GROUP",
            "NFS_GID",
            "NFS_UID",
            "SMB_SID",
            "INTERNAL",
            "QUMULO_OPERATOR"
          ],
          "description": "id_type:\n * `INTERNAL` - INTERNAL,\n * `LOCAL_GROUP` - LOCAL_GROUP,\n * `LOCAL_USER` - LOCAL_USER,\n * `NFS_GID` - NFS_GID,\n * `NFS_UID` - NFS_UID,\n * `QUMULO_OPERATOR` - QUMULO_OPERATOR,\n * `SMB_SID` - SMB_SID"
        },
        "id_value": {
          "description": "id_value",
          "type": "string"
        }
      }
    },
    "group": {
      "description": "File group",
      "type": "string"
    },
    "group_details": {
      "description": "File group details",
      "type": "object",
      "properties": {
        "id_type": {
          "type": "string",
          "enum": [
            "LOCAL_USER",
            "LOCAL_GROUP",
            "NFS_GID",
            "NFS_UID",
            "SMB_SID",
            "INTERNAL",
            "QUMULO_OPERATOR"
          ],
          "description": "id_type:\n * `INTERNAL` - INTERNAL,\n * `LOCAL_GROUP` - LOCAL_GROUP,\n * `LOCAL_USER` - LOCAL_USER,\n * `NFS_GID` - NFS_GID,\n * `NFS_UID` - NFS_UID,\n * `QUMULO_OPERATOR` - QUMULO_OPERATOR,\n * `SMB_SID` - SMB_SID"
        },
        "id_value": {
          "description": "id_value",
          "type": "string"
        }
      }
    },
    "blocks": {
      "description": "Number of blocks used by the file",
      "type": "string"
    },
    "datablocks": {
      "description": "Number of data blocks used by the file",
      "type": "string"
    },
    "metablocks": {
      "description": "Number of meta blocks used by the file",
      "type": "string"
    },
    "size": {
      "description": "File size in bytes",
      "type": "string"
    },
    "access_time": {
      "description": "Last time content was read, RFC 3339 format",
      "type": "string"
    },
    "modification_time": {
      "description": "Last time content was modified, RFC 3339 format",
      "type": "string"
    },
    "change_time": {
      "description": "Last time content or attributes were modified, RFC 3339 format",
      "type": "string"
    },
    "creation_time": {
      "description": "File creation time, RFC 3339 format",
      "type": "string"
    },
    "child_count": {
      "description": "Count of children (valid for directories)",
      "type": "number"
    },
    "extended_attributes": {
      "description": "SMB extended file attributes",
      "type": "object",
      "properties": {
        "read_only": {
          "description": "read_only",
          "type": "boolean"
        },
        "hidden": {
          "description": "hidden",
          "type": "boolean"
        },
        "system": {
          "description": "system",
          "type": "boolean"
        },
        "archive": {
          "description": "archive",
          "type": "boolean"
        },
        "temporary": {
          "description": "temporary",
          "type": "boolean"
        },
        "compressed": {
          "description": "compressed",
          "type": "boolean"
        },
        "not_content_indexed": {
          "description": "not_content_indexed",
          "type": "boolean"
        },
        "sparse_file": {
          "description": "sparse_file",
          "type": "boolean"
        },
        "offline": {
          "description": "offline",
          "type": "boolean"
        }
      }
    },
    "directory_entry_hash_policy": {
      "type": "string",
      "enum": [
        "FS_DIRECTORY_HASH_VERSION_LOWER",
        "FS_DIRECTORY_HASH_VERSION_FOLDED"
      ],
      "description": "Hash policy for directory entries:\n * `FS_DIRECTORY_HASH_VERSION_FOLDED` - FS_DIRECTORY_HASH_VERSION_FOLDED,\n * `FS_DIRECTORY_HASH_VERSION_LOWER` - FS_DIRECTORY_HASH_VERSION_LOWER"
    },
    "data_revision": {
      "description": "The revision for changes to the underlying file data.",
      "type": "string"
    },
    "user_metadata_revision": {
      "description": "The revision for changes to the user defined metadata of the file.",
      "type": "string"
    }
  }
}