Bug 988362 - [RFE] POST API for metering samples
Summary: [RFE] POST API for metering samples
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-ceilometer
Version: 4.0
Hardware: Unspecified
OS: Unspecified
low
high
Target Milestone: Upstream M1
: 4.0
Assignee: Eoghan Glynn
QA Contact: Kevin Whitney
URL: https://blueprints.launchpad.net/ceil...
Whiteboard:
Depends On:
Blocks: 973191 RHOS40RFE 1055813
TreeView+ depends on / blocked
 
Reported: 2013-07-25 12:02 UTC by Eoghan Glynn
Modified: 2014-03-14 05:56 UTC (History)
10 users (show)

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.
Clone Of:
Environment:
Last Closed: 2013-12-20 00:15:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 26367 0 None None None Never
Red Hat Product Errata RHEA-2013:1859 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OpenStack Platform Enhancement Advisory 2013-12-21 00:01:48 UTC

Description Eoghan Glynn 2013-07-25 12:02:47 UTC
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 13:14:29 UTC
Heat and Ceilometer tests will be performed mainly by Dev

Comment 5 Eoghan Glynn 2013-12-09 15:47:42 UTC
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-20 00:15:34 UTC
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.