From 662870ca3a795f8d1013c32080cfbb325f0a58dd Mon Sep 17 00:00:00 2001 From: ZhiQiang Fan Date: Tue, 13 Oct 2015 02:13:51 -0700 Subject: [PATCH] remove instance:FLAVOR related code and docs We have already removed meter instance:FLAVOR, let's clean our code and docs to avoid unnecessary misleading. Change-Id: I0c03b93252a263840ff50da6beed6445cc122ac2 Closes-Bug: #1505566 --- ceilometer/pipeline.py | 3 +-- .../test_compute_duration_by_resource_scenarios.py | 6 +++--- doc/source/configuration.rst | 2 +- doc/source/webapi/v2.rst | 14 -------------- tools/make_test_data.sh | 2 +- 5 files changed, 6 insertions(+), 21 deletions(-) diff --git a/ceilometer/pipeline.py b/ceilometer/pipeline.py index 7a47c42a2e..d3a6c306c9 100644 --- a/ceilometer/pipeline.py +++ b/ceilometer/pipeline.py @@ -689,8 +689,7 @@ class PipelineManager(object): "meter_name" will be excluded; 'meter_name' means 'meter_name' will be included. - The 'meter_name" is Sample name field. For meter names with - variable like "instance:m1.tiny", it's "instance:*". + The 'meter_name" is Sample name field. Valid meters definition is all "included meter names", all "excluded meter names", wildcard and "excluded meter names", or diff --git a/ceilometer/tests/functional/api/v2/test_compute_duration_by_resource_scenarios.py b/ceilometer/tests/functional/api/v2/test_compute_duration_by_resource_scenarios.py index 19254f2b84..1995083028 100644 --- a/ceilometer/tests/functional/api/v2/test_compute_duration_by_resource_scenarios.py +++ b/ceilometer/tests/functional/api/v2/test_compute_duration_by_resource_scenarios.py @@ -77,7 +77,7 @@ class TestComputeDurationByResource(v2.FunctionalTest, side_effect=get_interval) def _invoke_api(self): - return self.get_json('/meters/instance:m1.tiny/statistics', + return self.get_json('/meters/instance/statistics', q=[{'field': 'timestamp', 'op': 'ge', 'value': self.start.isoformat()}, @@ -151,7 +151,7 @@ class TestComputeDurationByResource(v2.FunctionalTest, ] with mock.patch.object(type(self.conn), 'get_meter_statistics', return_value=statistics): - data = self.get_json('/meters/instance:m1.tiny/statistics', + data = self.get_json('/meters/instance/statistics', q=[{'field': 'timestamp', 'op': 'ge', 'value': self.late1.isoformat()}, @@ -183,7 +183,7 @@ class TestComputeDurationByResource(v2.FunctionalTest, with mock.patch.object(type(self.conn), 'get_meter_statistics', return_value=statistics): - data = self.get_json('/meters/instance:m1.tiny/statistics', + data = self.get_json('/meters/instance/statistics', q=[{'field': 'timestamp', 'op': 'le', 'value': self.early2.isoformat()}, diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index 0f32787e0e..2a5abbf57b 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -163,7 +163,7 @@ with which a source should operate: * To define the list of included meters, use the 'meter_name' syntax * To define the list of excluded meters, use the '!meter_name' syntax * For meters, which identify a complex Sample field, use the wildcard - symbol to select all, e.g. for "instance:m1.tiny", use "instance:\*" + symbol to select all, e.g. for "disk.read.bytes", use "disk.\*" The above definition methods can be used in the following combinations: diff --git a/doc/source/webapi/v2.rst b/doc/source/webapi/v2.rst index 81a52aca73..c8f6e09ae1 100644 --- a/doc/source/webapi/v2.rst +++ b/doc/source/webapi/v2.rst @@ -346,20 +346,6 @@ project:: "op": "eq", "value": "8d6057bc-5b90-4296-afe0-84acaa2ef909"}] -Get the list of samples about instances with *m1.tiny* flavor running for June -2013 for a particular project:: - - GET /v2/meters/instance:m1.tiny - q: [{"field": "timestamp", - "op": "ge", - "value": "2013-06-01T00:00:00"}, - {"field": "timestamp", - "op": "lt", - "value": "2013-07-01T00:00:00"}, - {"field": "project_id", - "op": "eq", - "value": "8d6057bc-5b90-4296-afe0-84acaa2ef909"}] - Now you may want to have statistics on the meters you are targeting. Consider the following example where you are getting the list of samples about CPU utilization of a given instance (identified by its *resource_id*) diff --git a/tools/make_test_data.sh b/tools/make_test_data.sh index 0e6304b5b4..3576c6f8d9 100755 --- a/tools/make_test_data.sh +++ b/tools/make_test_data.sh @@ -49,7 +49,7 @@ late2="2012-08-31T20:00:00" mkdata() { ${bindir}/make_test_data.py --project "$project" \ --user "$user" --start "$2" --end "$3" \ - --resource "$1" --counter instance:m1.tiny --volume 1 + --resource "$1" --counter instance --volume 1 } dates=(early1 early2 start middle1 middle2 middle3 middle4 end late1 late2)