_resource_classes = {}
+def get_types():
+ '''Return an iterator over the list of valid resource types'''
+ return iter(_resource_classes)
+
+
def get_class(resource_type):
+ '''Return the Resource class for a given resource type'''
return _resource_classes.get(resource_type)
from heat.common import exception
from heat.common import identifier
from heat.engine import parser
+from heat.engine import resource
from heat.engine import resources
from heat.engine import watchrule
self.tg.add_thread(stack.delete)
return None
+ def list_resource_types(self, context):
+ """
+ Get a list of supported resource types.
+ arg1 -> RPC context.
+ """
+ return list(resource.get_types())
+
@request_context
def list_events(self, context, stack_identity):
"""
stack_identity=stack_identity),
topic=_engine_topic(self.topic, ctxt, None))
+ def list_resource_types(self, ctxt):
+ """
+ Get a list of valid resource types.
+
+ :param ctxt: RPC context.
+ """
+ return self.call(ctxt, self.make_msg('list_resource_types'),
+ topic=_engine_topic(self.topic, ctxt, None))
+
def list_events(self, ctxt, stack_identity):
"""
The list_events method lists all events associated with a given stack.
self.assertNotEqual(s['description'].find('WordPress'), -1)
self.assertTrue('parameters' in s)
+ def test_list_resource_types(self):
+ resources = self.man.list_resource_types(self.ctx)
+ self.assertTrue(isinstance(resources, list))
+ self.assertTrue('AWS::EC2::Instance' in resources)
+
def test_stack_resource_describe(self):
r = self.man.describe_stack_resource(self.ctx, self.stack_identity,
'WebServer')