When the service of the LATEST version becomes stable, you can publish the service of this stable version to serve online requests. In addition, you can continue to develop more features over the LATEST version.

Prerequisites

Prepare a function

Publish a version

  1. Log on to the Function Compute console.
  2. In the top navigation bar, select a region.
  3. In the left-side navigation pane, click Services and Functions.
  4. On the Services and Functions page, click the service that you require. Then, click the Versions tab.
    version
  5. On the Versions tab, click Publish new version in the upper-right corner. In the Publish a New Version By Using the LATEST Version dialog box, enter the version description and click OK.
    version_release
    After the version is published, you can view the published version on the Versions tab.version-list

Invoke a function in a service of a new version in the Function Compute console

  1. On the Services and Functions page, click the service that you require.
  2. In the upper-left corner of the Functions tab, select the new version ID from the Service Version drop-down list.
    publish-new-version
  3. Click the name of the function that you require. On the page that appears, click the Code tab.
  4. Click Invoke.
    After the function is executed, you can view the execution log in the lower part of the page. In the log, you can see that the value of the qualifier parameter that indicates the version information is 1 and the value of the versionId parameter that indicates the version ID is 1. The log shows that the executed function belongs to the service of version 1.version1-log

Invoke a function in a service of a new version by calling the API operation

To enable the system to invoke a function in a service of a specified version, you can append a period (.) as a separator to the serviceName parameter in the request and use the qualifier parameter to specify the version. The request is in the following format:

POST /services/{serviceName}.{qualifier}/functions/{functionName}/invocations
The following sample request is used:
POST /services/{service}.{qualifier}/functions/{function}/invocations
The following API operations support similar usage:

What to do next

t1881013.html#multiTask1269