Generate a Metrics Report
get
/monitoring/monitoring/{idDomainName}/.customer/api/v1/metricReports
Generates a metrics report based on specific query criteria.
Request
Path Parameters
-
idDomainName: string
Identity domain ID for the Oracle Monitoring Cloud Service account.
Query Parameters
-
extraFields(optional): string
Specify the extra field to include in the report. Accepted value are: items.data.startInMillisecond and items.data.endInMillisecond
-
filterOutDeleted(optional): boolean
Filter on isDeleted attribute of the metric series.
-
metricTypeIds(optional): string
Filter on the metric type.
-
precision(optional): string
Desired precision expressed in time duration of the returned elements. If not specified, the service will use the most precise precision available for the supplied interval. Note that the user cannot request a precision with a lower time interval that is presently available on the service. Note: You must use the iCalendar Duration format. For example, PT10M.
-
seriesIds(optional): string
Filter on the metric series.
-
since(optional): string
Start of the time range. This value is inclusive and must not be specified if sinceDuration is specified.
-
sinceDuration(optional): string
Specify how far from the current time should the start of the time range be set. Note: You must use the iCalendar Duration format. For example, PT10M.
-
subjectIds(optional): string
Filter on the metric subject.
-
until(optional): string
End of the time range. This value is exclusive and is set to the current time if not specified.
Header Parameters
-
Authorization: string
Basic Authentication credentials. The user must be located in the identity domain name specified by the header X-ID-TENANT-NAME.
-
X-ID-TENANT-NAME: string
Set to the identity domain ID where the user specified in the Authorization header resides.
Response
Supported Media Types
- application/json
200 Response
successful operation
Root Schema : MetricReports
Type:
Show Source
object
-
canonicalLink(optional):
string(uri)
Relative path to the resource.
-
items(optional):
array items
Nested Schema : MetricReportElement
Type:
Show Source
object
-
avg(optional):
number(double)
Average value of the data point collected within this interval. Note that if there is no data point available in the range then this value can be set to null.
-
count(optional):
integer(int32)
Number of data points present in this interval.
-
end(optional):
string(date-time)
End of the range, exclusive.
-
endInMilliseconds(optional):
integer(int64)
End of the range in millisecond since UNIX Epoch, exclusive.
-
max(optional):
number(double)
Maximum value of the data points collected within this interval. Note that if there is no data point available in the range then this value can be set to null.
-
min(optional):
number(double)
Minimum value of the data point collected within this interval. Note that if there is no data point available in the range then this value can be set to null.
-
start(optional):
string(date-time)
Start of the range, inclusive.
-
startInMilliseconds(optional):
integer(int64)
Start of the range in millisecond since UNIX Epoch, inclusive.
-
sum(optional):
number(double)
Sum of the data points value collected within this interval. Note that if there is no data point available in the range then this value can be set to null.
Nested Schema : MetricSeries
Type:
Show Source
object
-
canonicalLink(optional):
string(uri)
Relative path to the resource.
-
id(optional):
string(uuid)
A unique ID representing a metric type for a specific metric subject. For example, 821ce631-691e-494e-ba69-526739e086e2.
-
isDeleted(optional):
boolean
Default Value:
false
Indicates whether the referenced object has been deleted. -
metricType(optional):
object MetricType
-
subject(optional):
object MetricSubject
Nested Schema : MetricType
Type:
Show Source
object
-
canonicalLink(optional):
string(uri)
Relative path to the resource.
-
description(optional):
string
Description of the metric type.
-
displayName(optional):
string
Display name of the metric type.
-
id(optional):
string
Unique ID of the metric type. For example, compute.CPU.PERCENT.
-
name(optional):
string
Short name of the metric type. For example, cpuPercent.
-
shortDisplayName(optional):
string
Short display name for the metric type.
-
subjectType(optional):
object MetricSubjectType
-
unit(optional):
object MetricUnit
Nested Schema : MetricSubject
Type:
Show Source
object
-
canonicalLink(optional):
string(uri)
Relative path to the resource.
-
displayName(optional):
string
Display name of the metric subject.
-
id(optional):
string(uuid)
Unique ID of the metric subject. For example, bbdce636-691e-494e-ba69-526739e086e0.
-
isDeleted(optional):
boolean
Default Value:
false
Indicates whether the referenced object has been deleted. -
properties(optional):
array properties
Properties of the subject.
-
subjectType(optional):
object MetricSubjectType
Nested Schema : MetricSubjectType
Type:
Show Source
object
-
id(optional):
string
Unique ID of the metric unit. For example, compute.vm.
Nested Schema : MetricUnit
Type:
Show Source
object
-
canonicalLink(optional):
string(uri)
Relative path to the resource.
-
displayName(optional):
string
Display name of the metric unit.
-
id(optional):
string
Unique ID of the metric unit. For example, BYTES.
-
shortDisplayName(optional):
string
Short display name for the metric unit.
Nested Schema : MetricProperty
Type:
Show Source
object
-
name(optional):
string
The name of the metric property. For example, vmUuid.
-
value(optional):
string
The value of the metric property. For example, 11da4f96-e95e-4998-810c-198d5df034c4 for the vmUuid property.
Examples
The following example shows how to generate a metrics report based on specific query criteria by submitting a GET request on the REST resource using cURL. See Use cURL.
curl -X GET -H "Authorization: Basic d2VibG9naWM6V2VsY29tZTE=" -H "X-ID-TENANT-NAME:mydomain" https://monitoring.us.oraclecloud.com/monitoring/mydomain/.customer/api/v1/metricReports?sinceDuration=PT5M&seriesIds=2b0af13a-e497-6bec-e053-caa0f90a8a24
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 200 OK Date: Fri, 29 Apr 2016 08:40:06 GMT Content-Type: application/json
Example of Response Body
The following example shows the contents of the response body in JSON format:
{ "items": [ { "target": { "series": { "id": "2b0af13a-e497-6bec-e053-caa0f90a8a24", "metricType": { "id": "compute.CPU.PERCENT", "canonicalLink": "/monitoring/mydomain/.customer/api/v1/metricTypes/compute.CPU.PERCENT" }, "subject": { "id": "2b0af13a-e496-6bec-e053-caa0f90a8a24", "canonicalLink": "/monitoring/mydomain/.customer/api/v1/metricSubjects/2b0af13a-e496-6bec-e053-caa0f90a8a24" }, "canonicalLink": "/monitoring/mydomain/.customer/api/v1/metricSeries/2b0af13a-e497-6bec-e053-caa0f90a8a24" } }, "data": [ { "start": "2016-04-29T08:35:00.000Z", "end": "2016-04-29T08:36:00.000Z", "avg": 4, "min": 5, "max": 4, "sum": 4, "count": 1 }, { "start": "2016-04-29T08:36:00.000Z", "end": "2016-04-29T08:37:00.000Z", "avg": 0, "min": 0, "max": 0, "sum": 0, "count": 1 }, { "start": "2016-04-29T08:37:00.000Z", "end": "2016-04-29T08:38:00.000Z", "avg": 1, "min": 1, "max": 1, "sum": 1, "count": 1 }, { "start": "2016-04-29T08:38:00.000Z", "end": "2016-04-29T08:39:00.000Z", "avg": 22, "min": 22, "max": 22, "sum": 22, "count": 1 }, { "start": "2016-04-29T08:39:00.000Z", "end": "2016-04-29T08:40:00.000Z", "avg": 0, "min": 0, "max": 0, "sum": 0, "count": 1 }, { "start": "2016-04-29T08:40:00.000Z", "end": "2016-04-29T08:41:00.000Z", "avg": 0, "min": 0, "max": 0, "sum": 0, "count": 1 } ] } ], "canonicalLink": "/monitoring/mydomain/.customer/api/v1/metricReports" }