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)
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)
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
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