Function Compute allows you to create an alias for a service version. As a resource in Function Compute, an alias can be considered as a pointer to a specific service version. An alias is dependent of a service or a version. When you use an alias to access a service or function, Function Compute parses the alias into the version that the alias points to. This frees the caller from needing to know the specific version that the alias points to. This topic describes how to create, update, view, and delete an alias in the Function Compute console.

Create an alias

  1. Log on to the Function Compute console.
  2. In the top navigation bar, select your region.
  3. In the left-side navigation pane, click Service/Function.
  4. Click the target service and click the Versions tab.
  5. In the version list, find the version for which you want to create an alias. Then, click Create Alias in the Actions column.create-alias
  6. In the Create Alias dialog box, enter the alias information and click OK.alias-information
    Table 1. Parameter description
    Parameter Required Action Example
    Alias Name Yes Enter an alias name. alias
    Description No Enter the description of the alias. None
    Additional Version ID No To route some requests to an additional version for processing, you can select the additional version from the Additional Version ID drop-down list. 2
    Weight No To route some requests to an additional version for processing, you must specify this parameter. Enter the weight of the additional version. 30
    Click the target service and click the Versions tab. On the tab that appears, click the Alias tab. You can view the alias that you just created. In this example, the alias points to version 1, the additional version is version 2, and the weight of the additional version is 30%. result-alias

View an alias

  1. Log on to the Function Compute console.
  2. In the top navigation bar, select your region.
  3. In the left-side navigation pane, click Service/Function.
  4. Click the target service and choose Versions > Alias.

    You can view all existing aliases in the alias list.

Update an alias

  1. Log on to the Function Compute console.
  2. In the top navigation bar, select your region.
  3. In the left-side navigation pane, click Service/Function.
  4. Click the target service and choose Versions > Alias.
  5. Find the target alias, and click Update Alias in the Actions column.
  6. In the Update Alias dialog box, modify the alias information and click OK.

    For the description of the related parameters, see Table 1.

Delete an alias

When you delete an alias, only the alias is deleted. The version to which the alias points and triggers that points to the alias are both retained. We recommend that you modify the alias associated with a trigger before you delete the alias.

  1. Log on to the Function Compute console.
  2. In the top navigation bar, select your region.
  3. In the left-side navigation pane, click Service/Function.
  4. Click the target service and choose Versions > Alias.
  5. Find the target alias, and click Delete Alias in the Actions column.
  6. In the dialog box that appears, click OK.

    You can see that the target alias has been deleted from the alias list.