function::set_user_short - Linux
Overview
function::set_user_short allows users to set the short username for the current Cloud Function. This is typically used for logging and monitoring purposes.
Syntax
gcloud functions set_user_short FUNCTION_NAME USER_SHORT [--regions REGIONS]
Options/Flags
--regions
: The Cloud Regions where you want to set the user short. If omitted, this operation applies to all regions.
Examples
To set the user short to admin
for all regions of the my-function
function:
gcloud functions set_user_short my-function admin
To set the user short for only the us-central1
region:
gcloud functions set_user_short my-function admin --regions us-central1
Common Issues
- Permission denied: Ensure that you have sufficient permissions to update the function.
- Invalid user short: The user short must be between 1 and 32 characters long, and can only contain lowercase alphanumeric characters and hyphens.
Integration
function::set_user_short can be used in conjunction with other Cloud Functions commands, such as function::get and function::log to track user actions and monitor function behavior.