Post metrics data
POST/projects/{projectId}/entities/{entityId}/metrics/{metricsDefinitionId}/data
Base URL: https://api.tinkermode.com
Post metrics data. The client can use this method to inject time-series data of the metrics.
This method injects the data into the corresponding collection in the Time Series Database instance.
Also, it sends an Entity metrics update system event (_entityMetricsUpdate_) to the home of the Entity.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain a user API key of a user with permission to create the entity metrics, a service account token with the same permission, or a project API key with admin permission.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
projectId | integer | Yes | The unique ID for a specified project. | |
entityId | string | Yes | Entity ID (unique within project) | |
metricsDefinitionId | string | Yes | Metrics definition ID (unique within entity class) |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
records | array<object> | Yes | read-only (server-generated) | Time-series data. Each entry contains the timestamp of the value in RFC3339 format. | ||||||||||||||||||||
| ||||||||||||||||||||||||
tagNames | array<string> | No | read-only (server-generated) | List of unique Identifiers of string tags in metrics. | ||||||||||||||||||||
valueNames | array<string> | Yes | read-only (server-generated) | List of unique Identifiers of numerical fields in metrics. | ||||||||||||||||||||
Request example
{
"records": [
{
"tags": [
"5DEF12AA3B",
"100"
],
"timestamp": "2021-04-10T01:12:22Z",
"values": [
89.8,
77,
9
]
},
{
"tags": [
"5DEF12AA3B",
"102"
],
"timestamp": "2021-04-10T01:12:32Z",
"values": [
87.2,
77,
8.33
]
},
{
"tags": [
"5DEF12AA3B",
"102"
],
"timestamp": "2021-04-10T01:12:43Z",
"values": [
87.5,
75,
7.92
]
},
{
"tags": [
"5DEF12AA3B",
"100"
],
"timestamp": "2021-04-10T01:12:52Z",
"values": [
90.3,
75,
6.01
]
}
],
"tagNames": [
"pid",
"diag"
],
"valueNames": [
"loi",
"tem",
"bri"
]
}