Riferimento API

Indice dei file

Cercare nell’indice dei file con paginazione e ordinamento o contare i risultati della stessa ricerca.

Volume scan scheduling

pause → PAUSED · resume → QUEUED

Definizioni di tipo

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

Operazioni

subscription

fileIndexScanProgressUpdated

Ricevere aggiornamenti sull’avanzamento della scansione dell’indice dei file.

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

indexedFileCount

Contare i file indicizzati corrispondenti alla query.

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

indexedFiles

Cercare nell’indice dei file memorizzato con paginazione e ordinamento.

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

Sospendere la scansione attiva dell’indice dei file.

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

rebuildFileIndex

Ricostruire l’indice dei file di un volume; omettendo volumeId o passando null, elaborare tutti i volumi configurati.

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

resumeFileIndex

Riprendere una scansione sospesa dell’indice dei file.

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

setFileIndexVolume

Salvare la modalità di indicizzazione e le directory del volume, quindi aggiornarne l’indice.

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

stopFileIndex

Interrompere la scansione attiva dell’indice dei file.

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

fileIndexDefaults

Leggere la configurazione predefinita dell’indice dei file.

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

fileIndexScanProgress

Leggere l’avanzamento corrente della scansione dell’indice dei file.

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

fileIndexVolumes

Leggere i volumi registrati nell’indice dei file e la relativa configurazione.

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