# Path: vitrageclient/common/yaml_utils.py
# def load(stream):
# 
# Path: vitrageclient/exceptions.py
# class CommandError(Exception):
# class ClientException(Exception):
#     def __init__(self, code, message=None, request_id=None,
#                  url=None, method=None):
#     def __str__(self):
# def from_response(resp, url, method):


import os
from vitrageclient.common import yaml_utils
from vitrageclient import exceptions as exc
            self._load_template(path=path, template_str=template_str)
        api_params = dict(templates=files_content,
                          template_type=template_type,
                          params=params)
        return self.api.post(self.url, json=api_params).json()

    @classmethod
    def _load_yaml_files(cls, path):
        if os.path.isdir(path):

            files_content = []
            for file_name in os.listdir(path):

                file_path = '%s/%s' % (path, file_name)
                if os.path.isfile(file_path):
                    template = cls._load_yaml_file(file_path)
                    files_content.append((file_path, template))
        else:
            files_content = [(path, cls._load_yaml_file(path))]

        return files_content

    @classmethod
    def _load_yaml_file(cls, path):
        with open(path, 'r') as stream:
            return cls._load_yaml(stream)

    @classmethod
    def _load_yaml(cls, yaml_content):
        try:

# Path: vitrageclient/common/yaml_utils.py
# def load(stream):
# 
# Path: vitrageclient/exceptions.py
# class CommandError(Exception):
# class ClientException(Exception):
#     def __init__(self, code, message=None, request_id=None,
#                  url=None, method=None):
#     def __str__(self):
# def from_response(resp, url, method):


# Path: vitrageclient/v1/template.py
import os
from vitrageclient.common import yaml_utils
from vitrageclient import exceptions as exc

            self._load_template(path=path, template_str=template_str)
        api_params = dict(templates=files_content,
                          template_type=template_type,
                          params=params)
        return self.api.post(self.url, json=api_params).json()

    @classmethod
    def _load_yaml_files(cls, path):
        if os.path.isdir(path):

            files_content = []
            for file_name in os.listdir(path):

                file_path = '%s/%s' % (path, file_name)
                if os.path.isfile(file_path):
                    template = cls._load_yaml_file(file_path)
                    files_content.append((file_path, template))
        else:
            files_content = [(path, cls._load_yaml_file(path))]

        return files_content

    @classmethod
    def _load_yaml_file(cls, path):
        with open(path, 'r') as stream:
            return cls._load_yaml(stream)

    @classmethod
    def _load_yaml(cls, yaml_content):
        try:

            return yaml_utils.load(yaml_content)