Skip to content

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.

RoleCan call
app_adminAll procedures
app_usermask(), start_app(), status(), get_retention()
CALL app_public.start_app(target VARCHAR DEFAULT 'both');

Resume a suspended compute pool and/or service.

CALL app_public.start_app(); -- both
CALL app_public.start_app('service'); -- service only
CALL app_public.start_app('pool'); -- pool only
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');
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.

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.

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.

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, both
CALL app_public.set_auto_suspend(3600, 'pool'); -- 60 min, pool only

See Cold start and auto-suspend.

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);
CALL app_public.get_retention();

Returns the current retention (hours). Available to app_user.

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.

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"}]
}