Vault management (IRPCVaultsAdmin)

View as Markdown

Creates, attaches, detaches, destroys, upgrades, backs up, restores and copies the vaults of a server, and takes them offline and online.

Use this interface to add, modify and remove vaults. Use IRPCVaultsAdminBasic to get document vault definitions.

gRPC serviceMFiles.IRPCVaultsAdmin
Book and levelAdministration API, specialized
Methods23
Proto filemfiles/IRPCVaultsAdmin.proto

Overview

Server-level vault management: the vault commands of M-Files Admin and of the M-Files API's server vault management operations. Use it from administration tools and automation scripts that manage the vaults of an on-premises server. Read the definitions of existing vaults with GetVaultsAdmin and GetVaultAdmin; administer the contents of one vault with IRPCVaultAdmin.

Session and rights. Every method names its vault in the request, so a server-level session is enough: log in with login_data.vault_guid = {00000000-0000-0000-0000-000000000000}. The methods need a server right, and only logins with the system administrator server role (SRVROLES.system_administrator) have server rights:

Server right (ServerAccess) Methods
manage_vaults All methods not listed below
backup_vaults BackUpVault
restore_vault RestoreVault, GetBackupFileContents

Exceptions: UpdateVault and GetFullTextSearchInfo also accept a vault session with full control of the vault, and OptimizeVaultMetaDataDatabase a vault session with the vault right manage_scheduled_jobs. A missing server right fails with gRPC status UNKNOWN and the message "Access denied. You do not have the server-level access rights required by this operation." (error codes 0x800400A8 and 0x800407E4).

Tasks and the usual order of calls:

Background jobs. BackUpVault, CopyVault, EncryptFileData, OptimizeVaultMetaDataDatabase, RestoreVault (unless synchronous) and, when they start a migration, UpdateVault and UpdateGroundLinkProxy create a temporary scheduled job and return its ID in task_id before the work is done. Follow the job like the M-Files API does:

  1. Call GetScheduledJobRunInfo with scheduled_job = task_id about twice a second.
  2. The job has finished when is_running is false and current_step is not -1 (-1 means the job has not started yet).
  3. Check last_run_succeeded and last_run_errors; output holds the job's result.
  4. Remove the finished job with RemoveScheduledJob. Cancel a running job with CancelScheduledJob.

These jobs are server-level jobs (except an optimization started with a vault session, which is a job of that vault). Server-level and vault-level jobs have separate IDs: read a server-level job with a server-level session, which needs the server right manage_jobs.

Methods

MethodSummaryFacts
AttachExistingVaultAttaches an existing vault (metadata database and file data files) to the server.admin session
AttachVaultToOneDbTestChecks whether existing vault files can be attached on a server that has joined a subscription, without attaching them.admin session idempotent
BackUpVaultBacks up a vault into a backup file on the server.admin session
BringVaultOnlineBrings an offline vault online so that users can log in to it again.admin session idempotent
CheckForOpenSessionsChecks whether users have open sessions to a vault: succeeds if there are none and fails with a list of the sessions otherwise.admin session idempotent
CopyVaultCopies the specified vault into a new vault (creates the target vault).admin session
CreateNewGroundLinkProxyCreates a ground link proxy, a vault of type VAULT_TYPE_GROUND_LINK_PROXY.admin session
CreateNewReplicaVaultCreates a new replica vault.admin session
CreateNewVaultCreates a new document vault.admin session
DestroyVaultDestroys a vault: deletes its metadata database and its file data permanently and removes it from the server.admin session
DetachVaultRemoves the vault from the server's list of registered vaults but does not remove the metadata database or file data files.admin session
EncryptFileDataEncrypts the existing files of a vault with the vault's latest encryption key.admin session
GetBackupFileContentsReads the vault identity and data folders stored in a backup file on the server.admin session idempotent
GetDefaultDataFolderPrefixGets the default data folder prefix of new document vaults.admin session idempotent
GetFullTextSearchInfoGets the languages that the full-text search of a vault supports, or the server's defaults.admin session idempotent
OptimizeVaultMetaDataDatabaseOptimizes the metadata database of a vault.admin session
RestoreVaultRestores a vault from backup files on the server and attaches it.admin session
TakeVaultOfflineTakes a vault offline: users cannot log in to it until it is brought online again.admin session idempotent
TestConnectionToSQLDatabaseTests whether the server can connect to a Microsoft SQL Server database, for example before creating a vault in it.admin session idempotent
UpdateGroundLinkProxyUpdates the definition of a ground link proxy.admin session idempotent
UpdateReplicaVaultUpdates the definition of a replica vault.admin session idempotent
UpdateVaultChanges the definition of a vault: name and other registration data, data folders, database, file data storage and vault variables.admin session idempotent
UpgradeVaultUpgrades an old document vault to the current version.admin session idempotent