Help Center> FunctionGraph> User Guide> Basic Operations> Version and Alias Management

Version and Alias Management

Managing Versions

After a function is created, the default version is latest. Each function has the latest version. After the function code is published, you can modify the version configuration as required.

Publishing a Version

  1. Log in to the FunctionGraph console, and choose Functions > Function List in the navigation pane.
  2. Click the name of the desired function.
  3. On the displayed function details page, select the latest version, and choose Operation > Publish new version in the upper right corner.
  4. Set the following information.
    • Version: Enter a version number. If no version number is specified, the system automatically generates a version number based on the current date, for example, v20170819-190658.
    • Description: Enter a description for the version. This parameter is optional.
  5. Click Publish.

    You can publish a maximum of 10 versions for a function.

Deleting a Version

  1. Log in to the FunctionGraph console, and choose Functions > Function List in the navigation pane.
  2. Click the name of the desired function.
  3. On the displayed function details page, select the version you want to delete, and choose Operation > Delete version in the upper right corner.
    • The latest version of a function cannot be deleted.
    • If a function version associated with aliases is deleted, the aliases will also be deleted.
  4. Enter DELETE and click Yes.

    Deleted versions cannot be recovered. Exercise caution when performing this operation.

Managing Aliases

An alias represents a specific function version and can be used to invoke this version.

Creating an Alias

  1. Log in to the FunctionGraph console, and choose Functions > Function List in the navigation pane.
  2. Click the name of the desired function.
  3. Open the Create Alias dialog box in either of the following ways:
    • On the displayed function details page, choose Operation > Create alias in the upper right corner.
    • On the displayed function details page, click the Aliases tab and then click Create Alias.
  4. Set the following parameters:
    • Alias: Enter an alias.
    • Version: Select a version to be associated with the alias.
    • Traffic Shifting: Choose whether to enable traffic shifting. If this function is enabled, you can distribute a specific percentage of traffic to the additional version.
    • Additional Version: Select an additional version to be associated. The latest version cannot be used as an additional version.
    • Weight: Enter an integer from 0 to 100.
    • Description: Enter a description for the alias.
    Figure 1 Specifying an additional version
  5. Click OK.

    You can create a maximum of 10 aliases for a function.

Modifying an Alias

  1. Log in to the FunctionGraph console, and choose Functions > Function List in the navigation pane.
  2. Click the name of the desired function.
  3. On the displayed function details page, select the version for which you want to modify the alias, and click the Aliases tab.
  4. In the same row as the alias, click Edit.
  5. Modify the alias information, and click OK.

Deleting an Alias

Delete an alias using either of the following methods:

Method 1:

  1. Log in to the FunctionGraph console, and choose Functions > Function List in the navigation pane.
  2. Click the name of the desired function.
  3. On the displayed function details page, select the alias you want to delete, and choose Operation > Delete alias.
  4. Enter DELETE and click Yes.

Method 2:

  1. Log in to the FunctionGraph console, and choose Functions > Function List in the navigation pane.
  2. Click the name of the desired function.
  3. On the displayed function details page, select the version for which you want to delete the alias and click the Aliases tab.
  4. In the same row as the alias you want to delete, click Delete.
  5. Enter DELETE and click Yes.