List resources (GET /v2/resources)
Lists resources, 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 resources are retrieved.
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 |
meter_links
Specifies whether to retrieve meter link.
- 0: Do not retrieve
- Other than 0: Retrieve
If omitted, "other than 0" (retrieve) is used.
Data type | Cardinality |
---|---|
Int | 0..1 |
limit
Maximum number of resources to retrieve.
Range: 1 to 1440
If omitted, "1440" is used.
Data type | Cardinality |
---|---|
Int | 0..1 |
offset
Number of resource items 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 the resources, based on the specified conditions.
Refer to "type Resource" for details.
Example of request
Example 1: List all resources.
curl -H 'X-Auth-Token: ImFkbWluVVJMIjogImh0dHA6Ly8xMC4x . . .' \
'https://telemetry.jp-east-1.cloud.global.fujitsu.com/v2/resources'
Example 2: .List only up to a certain number of resources.
curl -H 'X-Auth-Token: ImFkbWluVVJMIjogImh0dHA6Ly8xMC4x . . .' \
'https://telemetry.jp-east-1.cloud.global.fujitsu.com/v2/resources?limit=100
Example of response
[
{
"links": [
{
"href": "https://telemetry.jp-east-1.cloud.global.fujitsu.com/v2/resources/bef3d406-a050-4854-821e-c3024d286e03",
"rel": "self"
}
],
"project_id": "7c4f776d782049108a6255aaff940629",
"resource_id": "bef3d406-a050-4854-821e-c3024d286e03",
"source": "fcx",
"user_id": "bc880de0722e4c78b2cb5afd9838ad11"
},
{
"links": [
{
"https://telemetry.jp-east-1.cloud.global.fujitsu.com/v2/resources/d4415484-a4c1-4f05-a910-e55cba5e4984",
"rel": "self"
}
],
"project_id": "7c4f776d782049108a6255aaff940629",
"resource_id": "d4415484-a4c1-4f05-a910-e55cba5e4984",
"source": "fcx",
"user_id": "bc880de0722e4c78b2cb5afd9838ad11"
}
]