Bug 988362 - [RFE] POST API for metering samples
[RFE] POST API for metering samples
Status: CLOSED ERRATA
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-ceilometer (Show other bugs)
4.0
Unspecified Unspecified
low Severity high
: Upstream M1
: 4.0
Assigned To: Eoghan Glynn
Kevin Whitney
https://blueprints.launchpad.net/ceil...
: FutureFeature, OtherQA
Depends On:
Blocks: 973191 RHOS40RFE 1055813
  Show dependency treegraph
 
Reported: 2013-07-25 08:02 EDT by Eoghan Glynn
Modified: 2014-03-14 01:56 EDT (History)
10 users (show)

See Also:
Fixed In Version: openstack-ceilometer-2013.2-0.2.b1.el6ost
Doc Type: Enhancement
Doc Text:
A public RESTful API to accept incoming sample datapoints has been added to OpenStack Metering. This was required because it is often more convenient for user-level agents to emit statistics to Ceilometer via a public API, than to gain access to the AMQP bus. Now, samples may be POSTed to the "/v2/meters/<meter_name>" endpoint.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-19 19:15:34 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
OpenStack gerrit 26367 None None None Never

  None (edit)
Description Eoghan Glynn 2013-07-25 08:02:47 EDT
Allow metering samples to be submitted directly to the ceilometer-api via a RESTful interface (as opposed to everything being collected over AMQP).  

Upstream blueprint: https://blueprints.launchpad.net/ceilometer/+spec/meter-post-api
Comment 3 Ami Jeain 2013-11-21 08:14:29 EST
Heat and Ceilometer tests will be performed mainly by Dev
Comment 5 Eoghan Glynn 2013-12-09 10:47:42 EST
How To Test
===========

0. Install packstack allinone in the usual way.


1. Submit a sequence of samples for a fabricated meter:

  for i in $(seq 5)
  do
    ceilometer sample-create -r foobar -m instance_likes \
      --meter-type delta --meter-unit thumbs_up --sample-volume $i \
      --resource-metadata '{"image_id": "cirros", "vcpus": "1", "display_name": "test_server", "ram": "512"}' \
      --timestamp $(date -u +"%Y-%m-%dT%H:%M:%SZ")
    sleep 1
  done


2. Ensure that the samples are all reported correctly:

   ceilometer sample-list -m instance_likes

   The correct number of samples should be reported, with the volumes in descending order.


3. Ensure that samples are aggregated as expected:

   ceilometer statistics ceilometer sample-list -m instance_likes

   Check that the aggregates reported are sane:

     count: 5
     min:   1
     max:   5
     sum:   sigma n (n <= 5)
     avg:   3


4. Ensure that the project and user IDs for the submitted samples can only be set to another indentity by admin:

  export OS_USERNAME=demo
  export OS_TENANT_NAME=demo
  export OS_PASSWORD=<DEMO_PASSWORD>

  ceilometer --debug sample-create -r foobar -m instance_likes \
    --meter-type delta --meter-unit thumbs_up --sample-volume 6 \
    --resource-metadata '{"image_id": "cirros", "vcpus": "1", "display_name": "test_server", "ram": "512"}' \
    --timestamp $(date -u +"%Y-%m-%dT%H:%M:%SZ") \
    --project-id foo --user-id bar

  Should fail with:
 
  ...
  {"error_message": {"debuginfo": null, "faultcode": "Client", "faultstring": "Invalid input for field/attribute project_id. Value: 'project_id'. can not post samples to other projects"}}

  WARNING (http:172) Request returned failure status.
  HTTPBadRequest (HTTP 400)
Comment 9 errata-xmlrpc 2013-12-19 19:15:34 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2013-1859.html

Note You need to log in before you can comment on or make changes to this bug.