The metadata for a process allows you to store arbitrary JSON data with that process, e.g. if you have an app that uses the datarhei Core API you can store app-specific information in the metadata.
In order not to conflict with other apps that might write to the metadata as well, you have to provide a key under which your metadata is stored. Think of a namespace or similar.
Create, Update
Add or update the metadata for a process and key.
Example: Write a metadata object into the metadata for the process test and key desc.
curlhttp://127.0.0.1:8080/api/v3/process/test/metadata/desc \-H'accept: application/json' \-H'Content-Type: application/json' \-XPOST \-d'{ "title": "My title", "description": "My description." }'
from core_client import Clientclient =Client( base_url="http://127.0.0.1:8080")client.login()client.v3_process_put_metadata( id="test", key="desc", data={"title": "My title","description": "My description." })
import ("github.com/datarhei/core-client-go/v16")client, _ := coreclient.New(coreclient.Config{ Address: "https://127.0.0.1:8080",})data :=map[string]string{"title": "My title","description": "My description.",}err := client.ProcessMetadataSet("test", "desc", data)if err !=nil {...}
Description:
Read
Read out the stored metadata. The key is optional. If the key is not provided, all stored metadata for that process will be in the result.
Example: read the metadata object for process test that is stored under the key desc.
Add JSON metadata with a process under the given key
Add arbitrary JSON metadata under the given key. If the key exists, all already stored metadata with this key will be overwritten. If the key doesn't exist, it will be created.
PUT//api/v3/process/{id}/metadata/{key}
Authorization
Path parameters
id*string
Process ID
key*string
Key for data store
Body
Arbitrary JSON data. The null value will remove the key and its contents
any
Response
OK
Body
any
Request
Response
Retrieve JSON metadata stored with a process under a key
Retrieve the previously stored JSON metadata under the given key. If the key is empty, all metadata will be returned.