- URL:
- https://<root>/usagereports/add
- Methods:
POST
- Required Capability:
- Access allowed only with the default administrator role
- Version Introduced:
- 10.3
Description
The add
operation creates a new usage report. A usage report is created by submitting a JSON representation of it to this operation.
Request parameters
Parameter | Details |
---|---|
| The unique name of the report. Example
|
| The time duration for the report. Values: |
(Optional, used if | The time stamp (milliseconds since UNIX epoch, namely January 1, 1970, 00:00:00 GMT) for the beginning period of the report. Example
|
(Optional, used if | The time stamp (milliseconds since UNIX epoch, namely January 1, 1970, 00:00:00 GMT) for the ending period of the report. Example
|
(Optional) | The time interval in minutes. Server metrics are summarized and returned for time slices using the specified interval. The time range for the report, specified using the
|
| A list of queries used to generate the report. Specify the list as an array of JSON objects representing the queries. Each query specifies the list of metrics to be queries for a given set of Example
|
| A JSON object. This is typically used for storing presentation tier data for the usage report, such as report title, colors, line styles, and so on. It's also used to denote visibility in ArcGIS Server Manager for reports created with the Administrator Directory. To make a report created in the Administrator Directory visible to ArcGIS Server Manager, include Example
|
| The response format. The default value is Values: |
Query parameters
Property | Description |
---|---|
| A comma-separated list of resource URIs used to report metrics. This specifies services or folders that are used to gather metrics. The
Example
|
| A comma-separated list of metrics to be reported. The following are supported metrics:
Example
|
Example usage
Request JSON syntax
{
"reportname": [unique name or id of the report],
"since": ["LAST_DAY | LAST_WEEK | LAST_MONTH | CUSTOM"], //Optional, specified when "since" is CUSTOM"
"from" : [timestamp], to": [timestamp], //Optional, specified when "since" is CUSTOM
"aggregationInterval": [minutes], //Optional, aggregation interval in minutes
"queries": [
{
"resourceURIs": ["services/Map_bv_999.MapServer"], //Comma separated list of services and/or folders
"metrics": ["RequestCount"] // Comma-separated list of metrics
}
],
"metadata": "This could be any String or JSON Object."
}
Single query example
A sample POST request for the add
operation that demonstrates a single query:
POST /webadaptor/admin/usagereports/add HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
usagereport={
"reportname": 1394219221008,
"since": "LAST_MONTH",
"queries": [
{
"resourceURIs": [
"services/Map_bv_999.MapServer"
],
"metrics": [
"RequestCount"
]
}
],
"metadata": "This could be any String or JSON Object typically used for storing report metadata."
}&f=pjson
Multiple queries example
A sample POST request for the add
operation that demonstrates multiple queries:
POST /webadaptor/admin/usagereports/add HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
usagereport={
"reportname": "Server Statistics",
"since": "LAST_WEEK",
"aggregationInterval": 5,
"queries": [
{
"resourceURIs": [
"services/SampleWorldCities.MapServer",
"services/System"
],
"metrics": [
"RequestCount",
"RequestsFailed"
]
},
{
"resourceURIs": [
"services/System/CachingTools.GPServer"
],
"metrics": [
"RequestAvgResponseTime",
"RequestsTimedOut"
]
}
],
"metadata": "This is a random test String that could contain report metadata in any format."
}&f=json
JSON Response example
{"status": "success"}