Skip to content

Funktionen_StorageResource

Florian Fehring edited this page Apr 30, 2026 · 3 revisions

Here you find the storage functions. A storage is an organisation area inside the data structure. postgres: storage = schema

Function 1: Create a Storage

URL: {{base_url}}/{{smartdata}}/smartdata/storage/create?name=teststorage

Method: POST

Body: None

  1. Sending POST CreateStorage Request
    • Storage created
    • Response with State 201 CREATED

Testcases:

  • testCreateStorage()
  • testCreateSecondStorage()

Exceptions:

  1. A storage should be created that allready exists
    • Response with State NOT_MODIFIED

Testcases:

  • testCreateStorageAllreadyExists()

Function 2: Get Storages abilities

URL: {{base_url}}/{{smartdata}}/smartdata/storage/getAbilities?name=teststorage

Method: GET

  1. Sending GET request
  • Returns a list of abilities with names and versions.
  • Response state: 200 OK

Testcases:

  • testGetAbilities()

Exceptions:

  1. Storage does not have abilities
    • Responds with an empty list
    • Response state: 200 OK

Function 3: Get all collections of a storage

URL: {{base_url}}/{{smartdata}}/smartdata/storage/getCollections?name=teststorage

Method: GET

  1. Sending GET request
  • All available Collections in Storage are listed (JSON)
  • Response state: 200 OK

Testcases:

  • testGetCollections()

Exceptions:

  1. There are no Collections in Storage
    • Resulting list is empty (JSON)
    • Response state: 200 OK

Testcases:

  • testGetCollectionsNoOne()

Function 4: Abfragen der Collections, mit Ausschluss

  1. Es wird eine Liste aller Collections im angegebenen Storage zurückgegeben. Dabei werden Collections, die im Parameter "exclude" angegeben wurden, ignoriert.

Beispiel: localhost:8080/SmartDataTest/smartdata/storage/getCollections?name=smartmonitoring&exclude='label_labels','label_observedobject','map_pictures','map_pictures_join_oo','schemes','schemes_visuals','tbl_card','tbl_datatype','tbl_locations'

Funktion 3: Einen Storage löschen

  1. Es wird der angegebene Storage mit allen Collections gelöscht
    • testDeleteStorage()

Ausnahmen:

  1. Es gibt den Storage nicht
    • Es wird mit Status NOT_MODIFIED geantwortet

Clone this wiki locally