diff options
author | Jason Myers <jason@jasonamyers.com> | 2015-07-21 23:51:40 -0500 |
---|---|---|
committer | Jason Myers <jason@jasonamyers.com> | 2015-07-29 08:46:32 -0500 |
commit | 7050d3be10788d695d83d7162bc5e078622a982d (patch) | |
tree | 46b4cad64874e32091aefde94e927cd6ab4984fb /ceilometer/nova_client.py | |
parent | bee1d5e02f34d7173d2aa10702bd87f0578ca5c0 (diff) | |
download | ceilometer-7050d3be10788d695d83d7162bc5e078622a982d.tar.gz |
Instance Caching
This is the work to complete the resource-metadata-caching blueprint.
* Implement an in-memory cache in the compute agent.
* Change compute-agent to populate an in-memory cache.
* Change compute-agent to use the changes-since parameter in the Nova API call .
* Change compute-agent to record the polling timestamp in the cache.
* Change compute-agent to cache the flavor and image metadata as well.
Implements blueprint resource-metadata-caching
Change-Id: I97594e082db6d8e34d9201a7ec5710978e557d6d
Signed-off-by: Jason Myers <jason@jasonamyers.com>
Diffstat (limited to 'ceilometer/nova_client.py')
-rw-r--r-- | ceilometer/nova_client.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ceilometer/nova_client.py b/ceilometer/nova_client.py index ce5efcda..832499bd 100644 --- a/ceilometer/nova_client.py +++ b/ceilometer/nova_client.py @@ -136,9 +136,15 @@ class Client(object): setattr(instance, attr, ameta) @logged - def instance_get_all_by_host(self, hostname): - """Returns list of instances on particular host.""" + def instance_get_all_by_host(self, hostname, since=None): + """Returns list of instances on particular host. + + If since is supplied, it will return the instances changed since that + datetime. since should be in ISO Format '%Y-%m-%dT%H:%M:%SZ' + """ search_opts = {'host': hostname, 'all_tenants': True} + if since: + search_opts['changes-since'] = since return self._with_flavor_and_image(self.nova_client.servers.list( detailed=True, search_opts=search_opts)) |