root/sql/sprocs/stratcon.get_storage_node_for_sid.sql

Revision 47a77d02f1268e637a4807266064909be566e1f7, 493 bytes (checked in by Theo Schlossnagle <jesus@omniti.com>, 5 years ago)

flag-day(stratcond,webconsole,database) get realtime graphs working on uuids

  • Property mode set to 100644
Line 
1 CREATE OR REPLACE FUNCTION stratcon.choose_storage_node_for_sid(in v_uuid uuid, in v_noit text, out o_storage_node_id int, out o_fqdn text, out o_dsn text)
2 RETURNS RECORD
3 AS $$
4 BEGIN
5     -- we could be smart with v_uuid and/or v_noit
6     SELECT storage_node_id, fqdn, dsn from stratcon.storage_node order by random() limit 1 INTO o_storage_node_id, o_dsn;
7 END
8 $$ LANGUAGE plpgsql
9 SECURITY DEFINER
10 ;
11
12 GRANT EXECUTE ON FUNCTION stratcon.choose_storage_node_for_sid(uuid, text) TO stratcon;
Note: See TracBrowser for help on using the browser.