'Implements the GetTemplate API action.
Get the template body for an existing stack.'

def get_template(self, req):

    self._enforce(req, 'GetTemplate')
    con = req.context
    try:
        identity = self._get_identity(con, req.params['StackName'])
        templ = self.rpc_client.get_template(con, identity)
    except Exception as ex:
        return exception.map_remote_error(ex)
    return api_utils.format_response('GetTemplate', {'TemplateBody': templ})
