/labelpartners/{labelpartner}/streamer/power-thresholds/configuration
Sets the power thresholds alert configuration in the pt_mgmt shadow for all devices registered to a specific label partner. Each phase (mains, phase_1, phase_2, phase_3) accepts a list of threshold configurations. The label partner setting overrides any previously applied per-device configuration. Disclaimer: Any changes to the power thresholds alert configuration will be applied to all devices registered to the label partner. All user-defined configurations will be lost without a way to restore them.
The label partner short name
defaultContains the power thresholds configuration. At least one phase must be provided. Each phase accepts at most 4 threshold configurations.
Successful operation
The success message returned.
Invalid request:
- Request body is required but was not provided.
- Schema validation failed due to error: At least one phase must be provided.
- Schema validation failed due to error: Invalid phase: '{phase}'.
- Schema validation failed due to error: Phase '{phase}' must be a non-empty list of threshold configurations.
- Schema validation failed due to error: Phase '{phase}' must contain at most 4 threshold configurations.
- Schema validation failed due to error: Each threshold in '{phase}' must be a dict.
- Schema validation failed due to error: Duplicate 'threshold_id': '{id}' in phase '{phase}'.
- Schema validation failed due to error: Invalid 'threshold_id': '{id}'.
- Schema validation failed due to error: Invalid 'alert_state': '{state}'.
- Schema validation failed due to error: Invalid 'alert_type': '{type}'.
- Schema validation failed due to error: Invalid 'aggregation_method': '{method}'.
- Schema validation failed due to error: Invalid 'cooldown': '{cooldown}'. Must be >= 1.
- Schema validation failed due to error: Invalid 'aggregation_sample_count': '{count}'. Must be between 1 and 120.
- Schema validation failed due to error: Invalid 'aggregation_sample_interval': '{interval}'. Must be >= 1.
- Edge events are not enabled for label partner '{labelpartner}'.
Not found:
- The thing group '{labelpartner}' was not found in the registry.
- The thing group '{labelpartner}' does not have any IoT Things associated with it.
Internal server error
PUT /v2/labelpartners/{labelpartner}/streamer/power-thresholds/configuration HTTP/1.1
Host: device-management.n2g-dev.net
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 839
{
"mains": [
{
"threshold_id": "threshold_0",
"alert_state": "enabled",
"threshold_value": 1,
"alert_type": "upper",
"cooldown": 1,
"aggregation_method": "mean",
"aggregation_sample_count": 1,
"aggregation_sample_interval": 1
}
],
"phase_1": [
{
"threshold_id": "threshold_0",
"alert_state": "enabled",
"threshold_value": 1,
"alert_type": "upper",
"cooldown": 1,
"aggregation_method": "mean",
"aggregation_sample_count": 1,
"aggregation_sample_interval": 1
}
],
"phase_2": [
{
"threshold_id": "threshold_0",
"alert_state": "enabled",
"threshold_value": 1,
"alert_type": "upper",
"cooldown": 1,
"aggregation_method": "mean",
"aggregation_sample_count": 1,
"aggregation_sample_interval": 1
}
],
"phase_3": [
{
"threshold_id": "threshold_0",
"alert_state": "enabled",
"threshold_value": 1,
"alert_type": "upper",
"cooldown": 1,
"aggregation_method": "mean",
"aggregation_sample_count": 1,
"aggregation_sample_interval": 1
}
]
}{
"message": "text"
}Last updated
Was this helpful?

