Add samples to meter (POST /v2/meters/{meter_name})
Adds samples to the specified meter.
{meter_name}: Name of the meter to which to add samples. Note that the specified value cannot start with "fcx.(dot)".
CAUTION:
Alarm evaluation (threshold monitoring) is performed in accordance with the monitoring interval (60 seconds) specified for the monitoring service. Therefore, depending on the timing of when a sample is added, it may become a target for alarm evaluation only in the next monitoring interval, not the current one.
Request headers
Refer to "Common API items".
Request parameters
None.
Request body
Specifies a list of samples to be added in JSON format.
Up to 20 samples can be specified at once (the meter names must all be the same).
Also, the meter name specified for {meterName} must match the name specified for counter_name in Request body.
Refer to "type OldSample" for details.
Response headers
Status
If normal, the following status is returned.
200: Normal completion
Refer to "Common API error codes" if the state is error.
Data type | Cardinality |
---|---|
Int | 1..1 |
Response elements
List (in JSON format) of the samples added.
Refer to "type OldSample" for details.
Example of request
Example: Add a sample to meter "my_meter".
curl -X POST -H 'Content-Type: application/json' \
-H 'X-Auth-Token: ImFkbWluVVJMIjogImh0dHA6Ly8xMC4x . . .' \
-d requestBody "https://telemetry.jp-east-1.cloud.global.fujitsu.com/v2/meters/my_meter"
Request body (JSON format)
[
{
"counter_name": "my_meter",
"counter_type": "gauge",
"counter_unit": "instance",
"counter_volume": 2.0,
"resource_id": "my_resource",
"resource_metadata": {
"my_metadata": "test",
"my_metadata2": "test2"
},
"source": "my_source",
"timestamp": "2014-06-12T07:01:07.428799"
}
]
Example of response
[
{
"counter_name": "my_meter",
"counter_type": "gauge",
"counter_unit": "instance",
"counter_volume": 2.0,
"message_id": "5a016f38-5b39-11e4-9966-fa163e0aad81",
"project_id": "39bd0d0341484a1a88f8ecdb1b21311c",
"resource_id": "my_resource",
"resource_metadata": {
"my_ metadata": "test",
"my_metadata2": "test2"
},
"source": "39bd0d0341484a1a88f8ecdb1b21311c:my_source",
"timestamp": "2014-06-12T07:01:07.428799",
"user_id": "9953aae1953a4caab3cc278e3018cf68"
}
]