All Products
Document Center

Use an alias

Last Updated: May 30, 2019

Using alias with version together can empower you to integrate the CI and CD process with Function Compute better. The caller only needs to invoke the function with correct alias without having to know the service version underlying.

Go back to service page, choose the version you want to use, and select “Create alias” in “Operations” dropdown menu. In the example, choosing version 1:createalias

Fill in the corresponding information in the pop-up window. In the example, create an alias named Prod, which points to version 1, click OK to confirm. For more alias configuration, please refer to Alias.capopup

After creation, the information displayed is alias Prod:aliasinfo

Select function “echo_version_info”, click “Invoke”:eaf

And check result and log. You can see during function execution, qualifier is alias Prod, and resolved version id is 1:invokealiaslog

Using specific alias in APIs

By adding delimiter “.” and alias name as “qualifier” after service name, you can invoke function of specific alias.

  1. POST /services/{serviceName}.{qualifier}/functions/{functionName}/invocations

Following APIs support adding “.{qualifier}” after service name to access alias you specify: