Skip to main content

updateStorage

StorageSettingsWrapper updateStorage(StorageRequestDto)

PUT /api/2.0/settings/storage

Switch the portal storage

Points the current portal at another storage and saves the credentials it needs: module is the identifier of one of the storages listed by GET api/2.0/settings/storage, and props carries that provider's authentication keys as name and value pairs, for example the bucket, region and access key of an Amazon S3 storage. The provider has to be available on the server, which the isSet flag of the listing tells, otherwise the request is rejected as invalid. Sending the module the portal already uses changes nothing and returns the saved settings as they are. Any other module starts an asynchronous migration of the portal data: the portal moves into the migrating state and stays unavailable until the transfer ends, so follow it with GET api/2.0/settings/storage/progress and do not send a second switch while it runs. The caller needs the permission to edit portal settings, which in practice means the portal owner or a DocSpace admin, on a server installation with an unrestricted access space. The response is the stored configuration, module and properties, not the state of the migration. To return to the built-in local storage call DELETE api/2.0/settings/storage, and for the CDN use PUT api/2.0/settings/storage/cdn.

Parameters​

NameInTypeDescriptionNotes
StorageRequestDtobodyStorageRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The saved storage configuration; migration of the portal data to it has been startedStorageSettingsWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read or has no module, or the requested storage module is unknown or not configured on this installation--
403The caller may not edit portal settings, or this installation does not allow changing the storage--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

StorageSettingsWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json