Class: QgsExternalStorage

class qgis.core.QgsExternalStorage

Bases: sip.wrapper

Abstract interface for external storage - to be implemented by various backends and registered in QgsExternalStorageRegistry.

New in version 3.22:

Methods

displayName

Returns the translated external storage name, which should be used for any user-visible display of the external storage name.

doFetch

Fetches file from url using authCfg for this project external storage.

doStore

Stores file filePath to the url using authCfg authentication for this project external storage.

fetch

Fetches file from url for this project external storage.

store

Stores file filePath to the url for this project external storage.

type

Unique identifier of the external storage type.

displayName(self) str

Returns the translated external storage name, which should be used for any user-visible display of the external storage name.

Return type:

str

doFetch(self, url: str, authCfg: str = '') QgsExternalStorageFetchedContent

Fetches file from url using authCfg for this project external storage.

Parameters:
  • url (str) –

  • authCfg (str = '') –

Return type:

QgsExternalStorageFetchedContent

doStore(self, filePath: str, url: str, authCfg: str = '') QgsExternalStorageStoredContent

Stores file filePath to the url using authCfg authentication for this project external storage.

Parameters:
  • filePath (str) –

  • url (str) –

  • authCfg (str = '') –

Return type:

QgsExternalStorageStoredContent

fetch(self, url: str, authCfg: str = '', fetchingMode: Qgis.ActionStart = Qgis.ActionStart.Deferred) QgsExternalStorageFetchedContent

Fetches file from url for this project external storage. Fetching process is run in background. Returns a QgsExternalStorageFetchedContent to follow the status of the fetched resource.

fetchingMode defines if the download will start immediately or shall be manually triggered calling QgsExternalStorageFetchedContent.fetch(). User should use Qgis.ActionStart.Deferred if he needs to connect the fetched() signal.

After using this method, user should wait for QgsExternalStorageStoredContent.fetched(), QgsExternalStorageStoredContent.errorOccurred() or QgsExternalStorageStoredContent.canceled() signals.

It’s possible to give authCfg authentication configuration id in case its needed.

Parameters:
  • url (str) –

  • authCfg (str = '') –

  • fetchingMode (Qgis.ActionStart = Qgis.ActionStart.Deferred) –

Return type:

QgsExternalStorageFetchedContent

store(self, filePath: str, url: str, authCfg: str = '', storingMode: Qgis.ActionStart = Qgis.ActionStart.Deferred) QgsExternalStorageStoredContent

Stores file filePath to the url for this project external storage. Storing process is run in background. Returns a QgsExternalStorageStoredContent to follow the status of the stored resource.

storingMode defines if the download will start immediately or shall be manually triggered calling QgsExternalStorageStoredContent.store(). User should use Qgis.ActionStart.Deferred if he needs to connect the stored() signal.

After using this method, user wait for QgsExternalStorageStoredContent.stored(), QgsExternalStorageStoredContent.errorOccurred() or QgsExternalStorageStoredContent.canceled() signals.

It’s possible to give authCfg authentication configuration id in case its needed.

Caller takes ownership of the returned symbol.

Parameters:
  • filePath (str) –

  • url (str) –

  • authCfg (str = '') –

  • storingMode (Qgis.ActionStart = Qgis.ActionStart.Deferred) –

Return type:

QgsExternalStorageStoredContent

type(self) str

Unique identifier of the external storage type.

Return type:

str