Create TSDBv2 Schema
POST/projects/{projectId}/tsdb/v2/schemas
Base URL: https://api.tinkermode.com
Creates a new schema.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain a project API key.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
projectId | integer | Yes | The unique ID for a specified project. |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
metrics | array<object> | Yes | One or more metrics to be included in the schema. | ||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
name | string | Yes | Name of the schema to be created. | ||||||||||||||||||||||||||||||||||||
Request example
{
"metrics": [
{
"name": "foo_metric",
"tags": [
{
"key": "location",
"value": "inside"
}
],
"type": "float"
},
{
"name": "bar_metric",
"tags": [
{
"key": "location",
"value": "outside"
}
],
"type": "string"
}
],
"name": "foo_schema"
}Responses
201 Successfully created the schema.
Content type: application/json
| Property | Type | Required | Constraints | Description | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
metrics | array<object> | No | |||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
name | string | No | read-only (server-generated) | Name of the schema. | |||||||||||||||||||||||||||||||||||
totalMetrics | integer | No | read-only (server-generated) | Total number of metrics in schema. | |||||||||||||||||||||||||||||||||||
Response example
{
"metrics": [
{
"name": "foo_metric",
"tags": [
{
"key": "location",
"value": "inside"
}
],
"type": "float"
},
{
"name": "bar_metric",
"tags": [
{
"key": "location",
"value": "outside"
}
],
"type": "string"
}
],
"name": "foo_schema",
"totalMetrics": 2
}401 Authorization is required to access this resource.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
403 Request failed because of invalid data or denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |