Im fetching data from an api where i have hard encoded the url while its defined in a netwrok rule
is there a way to get the api url from the network rule dynamically to pass it to my SP in snowflake ?
select statement doesn’t work
no meta data table from snowflake that stores network rule values where you can query it as a table
Anis Kheloufi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Sadly, no (unless there is something new I’m not aware of).
All you have is SHOW PARAMETERS LIKE 'network_policy' IN USER "the_user"
for every user, which is a pain if you’re trying to build a nice governance solution.
You can store all the rules in a table by using RESULT_SCAN
SHOW NETWORK RULES;
INSERT INTO temp_network_rules
SELECT "name", "entries_in_valuelist"
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()));
you can query snowflake.account_usage.network_rules
snowflake account_usage views. You should be able to access the view using the ACCOUNTADMIN Role or SECURITY_VIEWER Snowflake database role.
select * from snowflake.account_usage.network_rules
where deleted is null
;```
Please keep in mind that for any new network rule changes, you have to wait up to 2 hours to reflect.