Administration Procedures
All administration happens through SQL stored procedures. Most require the
app_admin role; app_user can run masking requests, start a suspended
runtime, and check status or retention settings.
Role summary
Section titled “Role summary”| Role | Can call |
|---|---|
app_admin | All procedures |
app_user | mask(), start_app(), status(), get_retention() |
Start / Stop
Section titled “Start / Stop”start_app
Section titled “start_app”CALL app_public.start_app(target VARCHAR DEFAULT 'both');Resume a suspended compute pool and/or service.
CALL app_public.start_app(); -- bothCALL app_public.start_app('service'); -- service onlyCALL app_public.start_app('pool'); -- pool onlystop_app
Section titled “stop_app”CALL app_public.stop_app(target VARCHAR DEFAULT 'both');Suspend the compute pool and/or service. Resources are not destroyed — use start_app() to resume.
CALL app_public.stop_app();CALL app_public.stop_app('pool');Setup / Teardown
Section titled “Setup / Teardown”setup_app
Section titled “setup_app”CALL app_public.setup_app();Manual setup and recovery procedure for the Snowflake Native App runtime. It creates the app-managed compute pool, container service, and SQL functions needed to process masking requests. Use this only when initial provisioning did not complete, or when Agent Mask support asks you to run it during recovery.
teardown_app
Section titled “teardown_app”CALL app_public.teardown_app();Removes the app-managed runtime resources, including the cleanup task,
container service, and compute pool. Use setup_app() to recreate them.
Scaling
Section titled “Scaling”scale (simple)
Section titled “scale (simple)”CALL app_public.scale(nodes INT);Sets the service to a fixed node count by applying the same value to the minimum and maximum node settings.
CALL app_public.scale(3);See Scaling for guidance.
Auto-suspend
Section titled “Auto-suspend”set_auto_suspend
Section titled “set_auto_suspend”CALL app_public.set_auto_suspend(seconds INT, target VARCHAR DEFAULT 'both');Configure how long the pool and/or service wait before suspending when idle. Default 300 seconds.
CALL app_public.set_auto_suspend(1800); -- 30 min, bothCALL app_public.set_auto_suspend(3600, 'pool'); -- 60 min, pool onlySee Cold start and auto-suspend.
Retention
Section titled “Retention”set_retention
Section titled “set_retention”CALL app_public.set_retention(hours INT);Sets how long temporary mask response records remain available for retrieval. Expired records are removed by the cleanup task hourly. Default 24h.
CALL app_public.set_retention(48);get_retention
Section titled “get_retention”CALL app_public.get_retention();Returns the current retention (hours). Available to app_user.
Cleanup task
Section titled “Cleanup task”start_cleanup_task / stop_cleanup_task
Section titled “start_cleanup_task / stop_cleanup_task”CALL app_public.start_cleanup_task();CALL app_public.stop_cleanup_task();Manually start or stop the hourly cleanup task. This is normally unnecessary: the task is created during app setup and removes expired temporary response records.
Status
Section titled “Status”status
Section titled “status”CALL app_public.status();Returns the compute pool name and state, plus service status, as a VARIANT.
Available to app_user.
Returns:
{ "pool_name": "AGENT_MASK_EN_MASK_POOL", "pool_status": "IDLE", "service_status": [{"index": 0, "status": "READY"}]}