Permalink: https://doc.oneportal.fi/x/dYAW
Table of Contents |
---|
Child pages (Children Display) |
---|
...
The Cloud Database is a Data Storage intended to be a light-weight database to store structured data in searchable form. It is not a full-blown relational database, but it serves most use cases for cloud and mobile-first applications.
Basics
The Data Storage is an API for storing JSON based data on the service. A single Data Storage has its own:
...
A new Data Storage can be created with the creation endpoint. Using it requires a special permission: DATA_STORAGE_CREATE.
Data section
The data section is a JSON object. It can contain any valid JSON content under unlimited number of sub-keys.
Data read and write operations
Data can be added either by replacing the whole data section, or by replacing single keys in the data section.
Data can be read by downloading the whole data section as one JSON document, or by downloading individual key values.
Limitations
The API is limited by the backend storage solution in the following ways:
...
Shall the size limitation be observed, some re-factoring is needed. Splitting data is recommended well before maximum size for best performance.
Remarks on stored data
It is not recommended to store binary data in Data Storage. However, small (couple of kilobytes) base64-encoded binaries are ok. If your needs are different, you need to experiment.
- It is possible to store pre-encrypted data. It is normally stored in base64-encoded form.
Anchor config config
Data Storage Configurations
DataStorage object configurations:
...
Expand | ||
---|---|---|
| ||
|
Search
If you have access to multiple data storages, it may be necessary to search for one that matches a filter. The endpoint which is used to list data storages supports using 'datafilter' parameter. If it is used with a valid filter string, the endpoint will return only data storages which match the filter. The filter is given in SCIM compatible format (see RFC-7644). Complex filters are not supported.
...
See the RFC-7644 for more comprehensive examples.
OpenAPI Endpoints
The Management API end-points for Data Storage are as follows:
...
As the API subject for improvements, the above may not be up to date.
List all accessible data storages
API end-point: GET /api/rest/v1/datastorage
...
- startIndex pagination start index (0 - based)
- count pagination page size (max 500)
- dsfilter data storage configuration filter.
dsfilter=ownerId eq exampleID
- datafilter data filter.
datafilter=objectKey.subKey eq exampleValue
datafilter=created ge 2017-10-20T07:17:17.606Z
Add new data storage
API end-point: POST /api/rest/v1/datastorage
...
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Get datastorage settings
API end-point: GET /api/rest/v1/datastorage/{dsID}
...
- 200 when the data storage was successfully found
- 404 in case the data storage ID was not found or is not accessible
Update datastorage configurations
API end-point: PUT /api/rest/v1/datastorage/{dsID}
...
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Delete datastorage
API end-point: DELETE /api/rest/v1/datastorage/{dsID}
...
- 200 when the data storage was successfully deleted
- 404 in case the data storage ID was not found or is not deletable
Get all datastorage data
API end-point: GET /api/rest/v1/datastorage/{dsID}/data
...
Code Block |
---|
{ "exampleStringKey": "string", "exampleNumberKey": 0, "exampleBooleanKey": true } |
Replace datastorage data
API end-point: PUT /api/rest/v1/datastorage/{dsID}/data
...
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Get value for a single data key
API end-point: GET /api/rest/v1/datastorage/{dsID}/data/{key}
...
- 200 when the value was successfully found
- 404 in case when data storage was not found
Replace single data key value
API end-point: PUT /api/rest/v1/datastorage/{dsID}/data/{key}
...
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Clear single data key value
API end-point: DELETE /api/rest/v1/datastorage/{dsID}/data/{key}
...