From 47d59f2b1e5d0e1d0e2861f3e58e1a04e962d902 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam Date: Thu, 11 Jun 2015 09:13:43 +0530 Subject: [PATCH] Adds RPC api for export action Adds RPC client api for export action and test cases. RPC_VERSION = 1.22 Partial-Bug: #1353670 Co-Authored-By: Jason Dunsmore Change-Id: I88ef9bba073bf4e730e1dae114a9c5d3b856ca13 --- heat/rpc/client.py | 12 ++++++++++++ heat/tests/test_rpc_client.py | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/heat/rpc/client.py b/heat/rpc/client.py index daabc3dde9..f7c6308361 100644 --- a/heat/rpc/client.py +++ b/heat/rpc/client.py @@ -40,6 +40,7 @@ class EngineClient(object): 1.19 - Add show_output and list_outputs for returning stack outputs 1.20 - Add resolve_outputs to stack show 1.21 - Add deployment_id to create_software_deployment + 1.22 - Add support for stack export """ BASE_RPC_API_VERSION = '1.0' @@ -705,3 +706,14 @@ class EngineClient(object): stack_identity=stack_identity, output_key=output_key), version='1.19') + + def export_stack(self, ctxt, stack_identity): + """Exports the stack data in JSON format. + + :param ctxt: RPC context. + :param stack_identity: Name of the stack you want to export. + """ + return self.call(ctxt, + self.make_msg('export_stack', + stack_identity=stack_identity), + version='1.22') diff --git a/heat/tests/test_rpc_client.py b/heat/tests/test_rpc_client.py index 3a7a0e228f..30eb49ce22 100644 --- a/heat/tests/test_rpc_client.py +++ b/heat/tests/test_rpc_client.py @@ -376,3 +376,9 @@ class EngineRpcAPITestCase(common.HeatTestCase): self._test_engine_api( 'show_output', 'call', stack_identity=self.identity, output_key='test', version='1.19') + + def test_export_stack(self): + self._test_engine_api('export_stack', + 'call', + stack_identity=self.identity, + version='1.22')