Example #1
0
    def render_resource(self, categories, links=None, attributes=None):
        """Render OCCI Resource instance

        :param occi.Category category: OCCI Category object
        :param occi.Link links[]: OCCI Link array
        :param occi.Attribute attributes[]: OCCI Attribute array
        :return: render result
        :rtype: [string, string[]]
        """
        Renderer.render_resource(self, categories, links, attributes)
        res = []
        cat_s, cat_h = self.render_categories(categories)
        res += cat_h
        if links is not None:
            res += self.render_links(links)
        if attributes is not None:
            res += self.render_attributes(attributes)
        return ['', res]
Example #2
0
    def render_resource(self, categories, links=None, attributes=None):
        """Render OCCI Resource instance

        :param occi.Category category: OCCI Category object
        :param occi.Link links[]: OCCI Link array
        :param occi.Attribute attributes[]: OCCI Attribute array
        :return: render result
        :rtype: [string, string[]]
        """
        Renderer.render_resource(self, categories, links, attributes)
        res = []
        cat_s, cat_h = self.render_categories(categories)
        res += cat_h
        if links is not None:
            res += self.render_links(links)
        if attributes is not None:
            res += self.render_attributes(attributes)
        return ['', res]
Example #3
0
    def render_resource(self, categories, links=None, attributes=None):
        """Render OCCI Resource instance

        :param occi.Category category: OCCI Category object
        :param occi.Link links[]: OCCI Link array
        :param occi.Attribute attributes[]: OCCI Attribute array
        :return: render result
        :rtype: [string, string[]]
        :return: render result
        """
        Renderer.render_resource(self, categories, links, attributes)
        cat_s, cat_h = self.render_categories(categories)
        res = []
        if links is not None:
            for link in links:
                res.append(self.render_link(link))
        if attributes is not None:
            for attr in attributes:
                res.append(self.render_attribute(attr))
        if res:
            return [cat_s + eol.join(res) + eol, []]
        else:
            return [cat_s, []]
Example #4
0
    def render_resource(self, categories, links=None, attributes=None):
        """Render OCCI Resource instance

        :param occi.Category category: OCCI Category object
        :param occi.Link links[]: OCCI Link array
        :param occi.Attribute attributes[]: OCCI Attribute array
        :return: render result
        :rtype: [string, string[]]
        :return: render result
        """
        Renderer.render_resource(self, categories, links, attributes)
        cat_s, cat_h = self.render_categories(categories)
        res = []
        if links is not None:
            for link in links:
                res.append(self.render_link(link))
        if attributes is not None:
            for attr in attributes:
                res.append(self.render_attribute(attr))
        if res:
            return [cat_s + eol.join(res) + eol, []]
        else:
            return [cat_s, []]