Ejemplo n.º 1
0
    def get(self, configuration, view, absolute_name):
        """ Get specified cname record belonging to default or provided Configuration and View plus Zone hierarchy. """
        config = g.user.get_api().get_configuration(configuration)
        view = config.get_view(view)

        cname_record = view.get_alias_record(absolute_name)
        if cname_record is None:
            return 'No matching CName Record(s) found', 404
        result = cname_record.to_json()
        return jsonify(result)
Ejemplo n.º 2
0
    def get(self, configuration, view, absolute_name):
        """ Get specified external host record belonging to default or provided Configuration and View plus Zone hierarchy. """
        config = g.user.get_api().get_configuration(configuration)
        view = config.get_view(view)

        host_record = view.get_external_host_record(absolute_name)
        if host_record is None:
            return 'No matching External Host Record(s) found', 404
        result = host_record.to_json()
        return jsonify(result)
Ejemplo n.º 3
0
    def delete(self, configuration, view, absolute_name):
        """
        Delete specified cname record belonging to default or provided Configuration and View plus Zone hierarchy.
        """
        config = g.user.get_api().get_configuration(configuration)
        view = config.get_view(view)

        cname_record = view.get_alias_record(absolute_name)
        if cname_record is None:
            return 'No matching CName Record(s) found', 404
        cname_record.delete()
        return '', 204
Ejemplo n.º 4
0
    def delete(self, configuration, view, absolute_name):
        """
        Delete specified external host record belonging to default or provided Configuration and View plus Zone hierarchy.
        """
        config = g.user.get_api().get_configuration(configuration)
        view = config.get_view(view)

        try:
            host_record = view.get_external_host_record(absolute_name)
        except:
            host_record = None
        if host_record is None:
            return 'No matching External Host Record(s) found', 404
        host_record.delete()
        return '', 204