<budget_ name>!REMOVE_ SHARED_ RESOURCE¶
Removes a shared resource from a custom budget. Shared resources are added to the budget using the ADD_SHARED_RESOURCE method.
Syntax¶
Arguments¶
'domain'The type of resource being removed from the budget. Valid values:
AI FUNCTIONCORTEX CODECORTEX AGENTSNOWFLAKE INTELLIGENCE
Unless you specify a second argument, the budget stops tracking consumption for all resources within the specified domain.
'instance'Optional. Specifies a specific resource within the selected
domainto remove from the budget.For domains that support instance-level selection (such as
AI FUNCTIONandCORTEX CODE), this argument identifies a specific function or interface to remove.For object-backed domains (
CORTEX AGENTandSNOWFLAKE INTELLIGENCE), pass an object reference for the instance value: use the serialized string returned by SYSTEM$REFERENCE, or a subquery such as(SELECT SYSTEM$REFERENCE(...)).Examples:
- AI Functions:
AI_CLASSIFY,AI_COMPLETE - Cortex Code:
CORTEX_CODE_CLI,CORTEX_CODE_SNOWSIGHT
- AI Functions:
Returns¶
Returns a VARCHAR value that indicates whether or not the resource was successfully removed from the budget.
If the resource could not be removed from the budget, the function returns an error message.
Access control requirements¶
The following minimum privileges and roles are required to call this method on a custom budget:
- ADMIN instance role for the budget instance.
- USAGE privilege on the database and schema that contains the budget instance.
- USAGE privilege on the database and schema that contain the resource (for schema objects).
For more information, see Budgets roles and privileges.
Usage notes¶
- This method can only be called on custom budget instances.
-
Calling this method does not return the object. Because of this, you can’t use method chaining to call another method on the return value of this method. Instead, call each method in a separate SQL statement.
Examples¶
Remove all AI Functions from the budget:
Remove a specific AI function from the budget:
Remove all Cortex Code workloads from the budget:
Remove the Cortex Code CLI workload from the budget:
Remove the Cortex Code Snowsight workload from the budget:
Remove all Cortex Agent workloads from the budget:
Remove a specific Cortex Agent workload from the budget:
Remove all Snowflake Intelligence workloads from the budget:
Remove a specific Snowflake Intelligence workload from the budget: