By using versioning, you can publish different service versions and work with them in your development workflow, to better manage your service in Function Compute.
- The newly created service has only one LATEST version. Before publishing any version, the LATEST version is the only version you have, and the LATEST version cannot be deleted.
- Each version has a unique ID, version cannot be changed after publish.
When you publish a version, Function Compute takes a snapshot copy of all service configurations, functions, and function configurations (excluding triggers) in the LATEST version and assign a unique version number. You must explicitly publish the version using the console or command line tools. A new version can only be publish after a function or service configuration has changed since last version.
Please input description when publishing new version, it can not be edit after publish：
- Description（Optional）：version description。
Select LATEST in “Version” dropdown button, then choose “Publish new version” from “Operations” dropdown button：
fcli service_version publish -s my-service -d 'description'
You can view and select the version you want from “Versioning” dropdown button
Specify -q(—qualifier) parameter when get service：
fcli service get -s my-service -q '1'
Deleting a version removes the associated functions and configurations permanently, triggers or aliases pointing to this version will not be removed. Functions under this version cannot be invoked after deletion.
Select version from “Version” dropdown button, choose “Delete version” from “Operations” dropdown:
fcli service_version delete -s my-service -v 1
Function Compute provides following APIs for version operations：
Following APIs also support version: