List meters (GET /v2/meters)
Lists meters, based on the specified query.
Request headers
Refer to "Common API items".
Request parameters
q.field
Specifies the following fields for query.
- resource_id: ID of the resource.
- source: Source meter.
- user_id: ID of the user that created the meter.
If omitted, all meters will be targeted.
Data type | Cardinality |
---|---|
String | 0..10 |
q.op
Specifies the comparison operator described below.
- If q.field is "resource_id":
eq: Equal to
- If q.field is "source":
eq: Equal to
- If q.field is user_id:
eq: Equal to
If omitted, "eq" is used.
Data type | Cardinality |
---|---|
String | 0..10 |
q.value
Query data value.
Specifies the following data value targeted for comparison.
- If q.field is "resource_id":
Resource ID
- If q.field is "source":
Source
- If q.field is user_id:
User ID
Valid characters: Fullwidth characters, halfwidth alphanumeric characters and halfwidth symbols
Number of characters: 1 to 255
Data type | Cardinality |
---|---|
String | 0..10 |
limit
Maximum number of meters to retrieve.
Range: 1 to 1440
If omitted, "1440" is used.
Data type | Cardinality |
---|---|
Int | 0..1 |
offset
Number of meters to offset.
If omitted, "0" is used.
Data type | Cardinality |
---|---|
Int | 0..1 |
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 meters based on the specified query.
Refer to "type Meter" for details.
Example of request
Example 1: List all meters.
curl -H 'X-Auth-Token: ImFkbWluVVJMIjogImh0dHA6Ly8xMC4x . . .' \
'https://telemetry.jp-east-1.cloud.global.fujitsu.com/v2/meters'
Example 2: List the meters concerning the specified user and resource.
curl -H 'X-Auth-Token: ImFkbWluVVJMIjogImh0dHA6Ly8xMC4x . . .' \
'https://telemetry.jp-east-1.cloud.global.fujitsu.com/v2/meters?q.field=
user_id&q.op=eq&q.value=0382c98eaf574d1ab5751a3e938b744d&q.field=
resource_id&q.op=eq&q.value=my_resource
Example of response
[
{
"meter_id": "ZGVtb19yZXNvdXJjZTAwMyt0ZXN0bWV0ZXIwMDU=\n",
"name": "my_meter",
"project_id": "610678ac162147c4a5e838190a80994e",
"resource_id": "my_resource",
"source": "89b0b9f21b414cd39354a1b8056aef87:my_source",
"type": "gauge",
"unit": "test",
"user_id": "0382c98eaf574d1ab5751a3e938b744d"
},
{
"meter_id": "ZGVtb19yZXNvdXJjZTAwMyt0ZXN0bWV0ZXIwMDY=\n",
"name": "my_meter",
"project_id": "610678ac162147c4a5e838190a80994e",
"resource_id": "my_resource2",
"source": "89b0b9f21b414cd39354a1b8056aef87:my_source",
"type": "gauge",
"unit": "test",
"user_id": "0382c98eaf574d1ab5751a3e938b744d"
}
]