def _create_domain_resource_dictionary(self):
        """
        Build the resource file structure from the kubernetes section of the model.
        :return: the resource file structure
        """
        kubernetes_map = self._model.get_model_kubernetes()

        resource_dict = PyOrderedDict()

        schema = wko_schema_helper.get_domain_resource_schema(ExceptionType.DEPLOY)

        model_path = KUBERNETES + ":"
        self._process_folder(kubernetes_map, schema, resource_dict, None, model_path)
        return resource_dict
Exemple #2
0
    def validate_model(self, model_dict):
        """
        Validate the kubernetes section of the specified model.
        :param model_dict: A Python dictionary of the model to be validated
        :raises ValidationException: if problems occur during validation
        """
        _method_name = 'validate_model'

        kubernetes_section = dictionary_utils.get_dictionary_element(
            model_dict, KUBERNETES)
        if not kubernetes_section:
            return

        schema = wko_schema_helper.get_domain_resource_schema(
            exception_type=ExceptionType.VALIDATE)

        model_path = KUBERNETES + ":"
        self.validate_folder(kubernetes_section, schema, None, model_path)
Exemple #3
0
    def setUp(self):
        self.schema_map = wko_schema_helper.get_domain_resource_schema()

        os.mkdir(self._model_dir)
        file_path = self._model_dir + "/model.yaml"
        self.out_file = open(file_path, "w")
 def __init__(self):
     self._schema = wko_schema_helper.get_domain_resource_schema()