RESTful Services

compared with
Current by Bren Eckles
on Sep 18, 2017 12:10.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (14)

View Page History
[(top)|#Top]









h5. 16.1 Create Perf Data


|| Field || Description || Required ||
| appType | the application type of this service | True |
| label | A text string label describing this service name that is attached to the plotted line graph | False |
| serverName | the Groundwork Host name | True |
| serverTime | total number of seconds since the epoch (time in seconds since Jan 1, 1970) | True |
| serviceName | the name of the Groundwork service | True |
| value | The performance data value to be plotted | True |
| warning | The Warning level threshold for this service | False |
| critical | The Critical level threshold for this service | False |

h6. 16.1.4 XML POST Data Example
</perfDataList>{code}

See [Appendix A|DOC70:RESTful Appendices#Appendix A|DOC71:1.0 Appendix A Curl Examples] for examples of usage with Curl
More Post Data Examples: [XML|DOC70:RESTful Appendices#Perf Data POST XML] \- [JSON|DOC70:RESTful Appendices#Service Notification Post Data JSON]
More Post Data Examples: [XML|DOC71:2.0 Appendix B XML Example Data#Perf Data POST XML] \- [JSON|DOC71:3.0 Appendix C JSON Example Data#Service Notification Post Data JSON]













h6. 16.1.5 HTTP Status Codes

</results>{code}

h5. 16.2 Get Time Series Performance Data

Gets proxied time series from underlying performance data store. Data returned includes host/service values and thresholds for a specific time range. This service is primarily intended to drive graphing in the Status viewer and thus is not a generalized graph query endpoint. It's intended to return raw data posted to the performance data endpoint, (see 16.1 above). Outside of down sampling to return data in the specified interval, aggregation or other transformations cannot be performed. Returned performance data captures query parameters in a wrapping XML {{<perfDataTimeSeries>}} element or JSON object with a {{perfDataTimeSeriesValues}} array member.
{note}Direct retrieval from RRD files via this API is not supported and will result in no results. However, if the underlying performance data store is configured to be RRD, then retrieval of performance data is possible if performance data is also being stored in Foundation by way of configuring {{/usr/local/groundwork/config/perfdata.properties}}. See the {{send_perf_data}} property in the {{<foundation>}} section for more details. This is not generally recommended unless you are using BIRT Performance (EPR) reports.{note}

h6. 16.2.1 Method: GET Performance Data

{color:#4a86e8}GET /api/perfdata?(query parameters){color}

h6. 16.2.2 HTTP Query and Path Parameters

|| Field || Type || Description || Required ||
| serverName | Query | Host name primary key | yes |
| serviceName | Query | Service name primary key | yes |
| startTime | Query | Start of time series, (millis) | yes |
| endTime | Query | End of time series, (millis), defaults to current time | no |
| interval | Query | Interval time series down sampled to, (millis) | yes |
| appType | Query | Service application type | no |

h6. {color:#333333}16.2.3 HTTP Headers{color}

|| Header || Valid Values || Required ||
| Accept | application/xml or application/json | False |
| GWOS-API-TOKEN | a valid token returned from login | True |
| GWOS-APP-NAME | your application name | True |

h6. {color:#333333}16.2.4 Examples{color}

_These examples are not HTTP encoded for readability. In practice queries must be encoded._
# {color:#000000}{_}time series data for a service{_}{color}
{color:#4a86e8}GET /api/perfdata?serverName=loadtest-vm-0&serviceName=loadtest-vm-metric-0&startTime=1443160800000&endTime=1443207330000&interval=72000{color}

h6. {color:#333333}16.2.5 HTTP Status Codes{color}

|| Code || Description ||
| 200 | Time series data returned |
| 401 | Authentication/authorization error occurred |
| 404 | No time series data returned for service in time range |
| 500 | An internal server error occurred while returning time series data |

h6. {color:#333333}16.2.6 Example Time Series Data{color}

Here is an XML example of returned time series performance data. Value types returned can include the {{value}}, {{thold-c}}, (critical threshold), and {{thold-w}}, (warning threshold).

XML query results are always wrapped in an {{<perfDataTimeSeries>}} collection element, with one or more {{<perfDataTimeSeriesValue>}} subelements.

{code: language=html/xml}
<perfDataTimeSeries appType="VEMA" serverName="loadtest-vm-0" serviceName="loadtest-vm-metric-0" startTime="1443208066000" endTime="1443208366000" interval="30000">
<perfDataTimeSeriesValue valueType="value" timestamp="1443208110000" value="36.0"/>
<perfDataTimeSeriesValue valueType="value" timestamp="1443208170000" value="27.0"/>
<perfDataTimeSeriesValue valueType="value" timestamp="1443208230000" value="20.0"/>
<perfDataTimeSeriesValue valueType="value" timestamp="1443208290000" value="13.0"/>
<perfDataTimeSeriesValue valueType="thold-c" timestamp="1443208110000" value="100.0"/>
<perfDataTimeSeriesValue valueType="thold-c" timestamp="1443208170000" value="100.0"/>
<perfDataTimeSeriesValue valueType="thold-c" timestamp="1443208230000" value="100.0"/>
<perfDataTimeSeriesValue valueType="thold-c" timestamp="1443208290000" value="100.0"/>
<perfDataTimeSeriesValue valueType="thold-w" timestamp="1443208110000" value="90.0"/>
<perfDataTimeSeriesValue valueType="thold-w" timestamp="1443208170000" value="90.0"/>
<perfDataTimeSeriesValue valueType="thold-w" timestamp="1443208230000" value="90.0"/>
<perfDataTimeSeriesValue valueType="thold-w" timestamp="1443208290000" value="90.0"/>
</perfDataTimeSeries>
{code}

Here is a JSON example of returned time series performance data.

JSON query results are always wrapped in an object with a {{perfDataTimeSeriesValues}} array member, with one or more object members.

{code: language=javascript}
{
"appType" : "VEMA",
"serverName" : "loadtest-vm-0",
"serviceName" : "loadtest-vm-metric-0",
"startTime" : 1443208066000,
"endTime" : 1443208366000,
"interval" : 30000,
"perfDataTimeSeriesValues" : [ {
"valueType" : "value",
"timestamp" : 1443208110000,
"value" : 36.0
}, {
"valueType" : "value",
"timestamp" : 1443208170000,
"value" : 27.0
}, {
"valueType" : "value",
"timestamp" : 1443208230000,
"value" : 20.0
}, {
"valueType" : "value",
"timestamp" : 1443208290000,
"value" : 13.0
}, {
"valueType" : "thold-c",
"timestamp" : 1443208110000,
"value" : 100.0
}, {
"valueType" : "thold-c",
"timestamp" : 1443208170000,
"value" : 100.0
}, {
"valueType" : "thold-c",
"timestamp" : 1443208230000,
"value" : 100.0
}, {
"valueType" : "thold-c",
"timestamp" : 1443208290000,
"value" : 100.0
}, {
"valueType" : "thold-w",
"timestamp" : 1443208110000,
"value" : 90.0
}, {
"valueType" : "thold-w",
"timestamp" : 1443208170000,
"value" : 90.0
}, {
"valueType" : "thold-w",
"timestamp" : 1443208230000,
"value" : 90.0
}, {
"valueType" : "thold-w",
"timestamp" : 1443208290000,
"value" : 90.0
} ]
}
{code}

h4. 17.0 Version API