PlainApp
API 참조

파일 인덱스

저장된 파일 인덱스를 페이지별로 검색하고 정렬하거나 같은 조건의 일치 항목 수를 조회합니다.

Volume scan scheduling

pause → PAUSED · resume → QUEUED

타입 정의

graphql
type Subscription {
  fileIndexScanProgressUpdated: FileIndexScanProgress!
}

type Query {
  indexedFileCount(query: String!): Long!
  indexedFiles(query: String!, offset: Int!, limit: Int!, sortBy: FileSortBy!): [File!]!
  fileIndexDefaults: FileIndexDefaults!
  fileIndexScanProgress(volumeId: ID): FileIndexScanProgress!
  fileIndexVolumes: [FileIndexVolume!]!
}

type Mutation {
  pauseFileIndex(volumeId: ID): Boolean!
  rebuildFileIndex(volumeId: ID): Boolean!
  resumeFileIndex(volumeId: ID): Boolean!
  setFileIndexVolume(volumeId: ID!, input: FileIndexVolumeInput!): Boolean!
  stopFileIndex(volumeId: ID): Boolean!
}

type File {
	permission: String!
	
	mediaId: ID
	name: String!
	path: String!
	createdAt: Instant
	updatedAt: Instant!
	size: Long!
	isDir: Boolean!
	childCount: Int!
	url: String!
	isSystem: Boolean!
}

type FileIndexDefaults {
	excludedDirs: [String!]!
	excludedNames: [String!]!
	
	excludedProfileDirs: [FileIndexProfileDir!]!
	
	mediaExcludedDirSuffixes: [String!]!
}

enum FileIndexMode {
	UNCONFIGURED
	DISABLED
	ALLOWLIST
	BLOCKLIST
}

type FileIndexProfileDir {
	
	profilesDir: String!
	
	excludedDir: String!
	
	exceptDirs: [String!]!
}

type FileIndexScanProgress {
	volumeId: ID
	indexed: Int!
	pending: Int
	total: Int
	state: FileIndexScanState!
	error: String
}

enum FileIndexScanState {
	IDLE
	QUEUED
	RUNNING
	PAUSED
	STOPPED
	FAILED
}

enum FileIndexScanStatus {
	COMPLETED
	CANCELED
	FAILED
}

type FileIndexVolume {
	id: ID!
	path: String!
	isAvailable: Boolean!
	indexMode: FileIndexMode!
	includedDirs: [String!]!
	excludedDirs: [String!]!
	lastScanAt: Instant
	lastScanStatus: FileIndexScanStatus
	lastScanCount: Long
	lastScanTotal: Long
}

input FileIndexVolumeInput {
	indexMode: FileIndexMode!
	includedDirs: [String!]!
	excludedDirs: [String!]!
}

enum FileSortBy {
	UPDATED_AT_ASC
	UPDATED_AT_DESC
	SIZE_ASC
	SIZE_DESC
	NAME_ASC
	NAME_DESC
}

scalar Instant

scalar Long

작업

subscription

fileIndexScanProgressUpdated

파일 인덱스 스캔 진행 상황 업데이트를 받습니다.

graphql
subscription fileIndexScanProgressUpdated {
  fileIndexScanProgressUpdated { volumeId indexed pending total state error }
}
query

indexedFileCount

쿼리에 일치하는 인덱스된 파일 수를 셉니다.

graphql
query indexedFileCount($query: String!) {
  indexedFileCount(query: $query)
}
query

indexedFiles

저장된 파일 인덱스를 페이지 구분 및 정렬로 검색합니다.

graphql
query indexedFiles($query: String!, $offset: Int!, $limit: Int!, $sortBy: FileSortBy!) {
  indexedFiles(query: $query, offset: $offset, limit: $limit, sortBy: $sortBy) { permission mediaId name path createdAt updatedAt size isDir }
}
mutation

pauseFileIndex

실행 중인 파일 인덱스 스캔을 일시 중지합니다.

graphql
mutation pauseFileIndex($volumeId: ID) {
  pauseFileIndex(volumeId: $volumeId)
}
mutation

rebuildFileIndex

지정한 볼륨의 파일 인덱스를 다시 만듭니다. volumeId를 생략하거나 null로 전달하면 설정된 모든 볼륨이 대상입니다.

graphql
mutation rebuildFileIndex($volumeId: ID) {
  rebuildFileIndex(volumeId: $volumeId)
}
mutation

resumeFileIndex

일시 중지된 파일 인덱스 스캔을 재개합니다.

graphql
mutation resumeFileIndex($volumeId: ID) {
  resumeFileIndex(volumeId: $volumeId)
}
mutation

setFileIndexVolume

볼륨의 인덱싱 모드와 디렉터리 설정을 저장한 후 해당 인덱스를 새로 고칩니다.

graphql
mutation setFileIndexVolume($volumeId: ID!, $input: FileIndexVolumeInput!) {
  setFileIndexVolume(volumeId: $volumeId, input: $input)
}
mutation

stopFileIndex

실행 중인 파일 인덱스 스캔을 중지합니다.

graphql
mutation stopFileIndex($volumeId: ID) {
  stopFileIndex(volumeId: $volumeId)
}
query

fileIndexDefaults

기본 파일 인덱스 설정을 읽습니다.

graphql
query fileIndexDefaults {
  fileIndexDefaults { excludedDirs excludedNames mediaExcludedDirSuffixes }
}
query

fileIndexScanProgress

현재 파일 인덱스 스캔 진행 상황을 읽습니다.

graphql
query fileIndexScanProgress($volumeId: ID) {
  fileIndexScanProgress(volumeId: $volumeId) { volumeId indexed pending total state error }
}
query

fileIndexVolumes

등록된 파일 인덱스 볼륨과 설정을 읽습니다.

graphql
query fileIndexVolumes {
  fileIndexVolumes { id path isAvailable indexMode includedDirs excludedDirs lastScanAt lastScanStatus }
}