Search

1.7. http://localhost:7080/rest/metric : Deal with metrics

download PDF

This part of the API deals with exporting and adding metrics

Defining class: org.rhq.enterprise.server.rest.MetricHandlerBean

Produces: application/json, application/xml, text/html

Methods

  • GET /metric/data/{scheduleId}

    Description

    Get the bucketized metric values for the schedule.

    Supports returning a gzip'ed Content-Encoding

    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    scheduleId Path Schedule Id of the values to query true int all
    startTime Query Start time since epoch. false long all End time - 8h
    endTime Query End time since epoch. false long all Now
    dataPoints Query Number of buckets false int all 60
    hideEmpty Query Hide rows that are NaN only false boolean all false

    Return type: javax.ws.rs.core.Response

    Error codes:
    CodeReason
    404 No schedule with the passed id exists
  • GET /metric/data/group/{groupId}/{definitionId}

    Description

    Get the bucketized metric values for the metric definition of the group

    Supports returning a gzip'ed Content-Encoding

    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    groupId Path Id of the group to query true int all
    definitionId Path Id of the metric definition to retrieve true int all
    startTime Query Start time since epoch. false long all End time - 8h
    endTime Query End time since epoch. false long all Now
    dataPoints Query Number of buckets false int all 60
    hideEmpty Query Hide rows that are NaN only false boolean all false

    Return type: javax.ws.rs.core.Response

  • GET /metric/data

    Description

    Return bucketized metric data (60 points) for the passed schedules

    Supports returning a gzip'ed Content-Encoding

    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    sid Query A comma separated list of schedule ids true String all
    startTime Query Start time in ms since epoch. Default is now -8h false long all
    endTime Query End time in ms since epoch. Default is now false long all
    dataPoints Query Number of buckets false int all 60
    hideEmpty Query Should empty datapoints be hidden false boolean all false

    Return type: javax.ws.rs.core.Response

    Error codes:
    CodeReason
    404 No schedule with the passed id exists
    406 No schedules requested
    406 Schedule Ids are not numeric
  • GET /metric/schedule/{id}

    Description

    Get the metric schedule for the passed id
    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    id Path Schedule Id true int all

    Return type: javax.ws.rs.core.Response

    Error codes:
    CodeReason
    404 No schedule with the passed id exists
  • GET /metric/data/resource/{resourceId}

    Description

    Retrieve a list of high/low/average/data aggregates for the resource

    Supports returning a gzip'ed Content-Encoding

    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    resourceId Path Id of the resource to query true int all
    startTime Query Start time since epoch. false long all End time - 8h
    endTime Query End time since epoch. false long all Now
    includeDataPoints Query Include data points false boolean all false
    dataPoints Query Number of buckets (if include data points)) false int all 60
    hideEmpty Query Hide rows that are NaN only false boolean all false

    Return type: List<MetricAggregate>

    Error codes:
    CodeReason
    404 If no resource with the passed id exists
  • GET /metric/data/group/{groupId}

    Description

    Retrieve a list of high/low/average/data aggregates for the group

    Supports returning a gzip'ed Content-Encoding

    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    groupId Path Id of the group to query true int all
    startTime Query Start time since epoch. false long all End time - 8h
    endTime Query End time since epoch. false long all Now

    Return type: List<MetricDefinitionAggregate>

    Error codes:
    CodeReason
    404 There is no group with the passed id
  • PUT /metric/schedule/{id}

    Description

    Update the schedule (enabled, interval)
    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    id Path Id of the schedule to update true int all
    -body- New schedule data true MetricSchedule all

    Return type: MetricSchedule

    Error codes:
    CodeReason
    404 No schedule with the passed id exists
  • GET /metric/definition/{id}

    Description

    Get the definition
    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    id Path Id of the definition to obtain true int all

    Return type: MetricSchedule

    Error codes:
    CodeReason
    404 No definition exists for the given id.
  • PUT /metric/definition/{id}

    Description

    Update the definition (default enabled, default interval)

    Notes

    This operation may internally take a long time to complete and is thus only triggered by this call. A return code of 200 only indicates that the operation was successfully submitted.

    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    id Path Id of the definition to update true int all
    -body- New definition data true MetricSchedule all
    updateExisting Query Update existing schedules for this definition as well? false boolean all false

    Return type: MetricSchedule

    Error codes:
    CodeReason
    404 No definition exists for the given id.
  • GET /metric/data/{scheduleId}/raw

    Description

    Expose the raw metrics of a single schedule. This can only expose raw data, which means the start date may not be older than 7 days.

    Supports returning a gzip'ed Content-Encoding

    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    scheduleId Path none true int all
    startTime Query Start time since epoch false long all Now - 8h
    endTime Query End time since epoch false long all Now
    duration Query Timespan in ms false long all 8h = 28800000ms

    Return type: javax.ws.rs.core.StreamingOutput

    Error codes:
    CodeReason
    404 No schedule with the passed id exists
  • GET /metric/data/{scheduleId}/callTime

    Description

    Expose callTime data for given scheduleId
    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    scheduleId Path none true int all
    startTime Query Start time since epoch false long all Now - 8h
    endTime Query End time since epoch false long all Now
    aggregate Query True to return callTimes aggregated by callDestination false boolean all true

    Return type: javax.ws.rs.core.StreamingOutput

    Error codes:
    CodeReason
    404 No schedule with the passed id exists
  • PUT /metric/data/{scheduleId}/callTime

    Description

    Submit a callTime metrics to the server
    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    scheduleId Path Id of the schedule true int all
    -body- A list of call time values to add. true List<CallTimeValueRest> -all- -none-

    Return type: javax.ws.rs.core.Response

    Error codes:
    CodeReason
    404 No schedule with the passed id exists
    406 beginTime is older than 7 days
    406 callDestination is null
    406 duration is negative number
  • PUT /metric/data/{scheduleId}/raw/{timeStamp}

    Description

    Submit a single (numerical) metric to the server
    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    scheduleId Path Id of the schedule true int all
    timeStamp Path Timestamp of the metric true long all
    -body- Data value true DoubleValue all

    Return type: javax.ws.rs.core.Response

    Error codes:
    CodeReason
    404 No schedule with the passed id exists
    406 Timestamp is older than 7 days
  • PUT /metric/data/{scheduleId}/trait/{timeStamp}

    Description

    Submit a new trait value for the passed schedule id
    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    scheduleId Path Id of the schedule true int all
    timeStamp Path Timestamp of the metric true long all
    -body- Data value true StringValue all

    Return type: javax.ws.rs.core.Response

    Error codes:
    CodeReason
    404 No schedule with the passed id exists
    406 Timestamp is older than 7 days
  • GET /metric/data/{scheduleId}/trait

    Description

    Get the current value of the trait with the passed schedule id
    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    scheduleId Path Id of the schedule true int all

    Return type: StringValue

    Error codes:
    CodeReason
    404 No schedule with the passed id exists
  • POST /metric/data/raw

    Description

    Submit a series of (numerical) metric values to the server
    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    -body- A collection of numeric data point values with their schedule id set. true Collection<NumericDataPoint> -all- -none-

    Return type: No response

    Error codes:
    CodeReason
    201 There are some submitted datapoints with non-existing scheduleId, API returns rejected values back to client, valid values are accepted
    403 All submitted datapoints have non-existing scheduleId, API returns rejected values back to client
  • POST /metric/data/raw/{resourceId}

    Description

    Submit a series of (numerical) metric values for a single resource to the server
    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    resourceId Path none int -all- -none-
    -body- A collection of numeric data point values with their metric definition name set. true Collection<NumericDataPoint> -all- -none-

    Return type: No response

    Error codes:
    CodeReason
    403 Any metric from received dataPoints does not exist for given resource
  • GET /metric/data/{scheduleId}/baseline

    Description

    Get the current baseline for the schedule
    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    scheduleId Path Id of the schedule true int all

    Return type: Baseline

    Error codes:
    CodeReason
    404 No schedule with the passed id exists
  • PUT /metric/data/{scheduleId}/baseline

    Description

    Set a new baseline for the schedule
    Parameters:
    NameP.TypeDescriptionRequiredTypeAllowed valuesDefault value
    scheduleId Path Id of the schedule true int all
    -body- The baseline value. true Baseline -all- -none-

    Return type: javax.ws.rs.core.Response

    Error codes:
    CodeReason
    404 No schedule with the passed id exists
    406 Baseline data is incorrect
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.