alias
alias commands are used to view, publish, modify, and delete a function alias.
Command Parsing
You can run alias -h or alias --help to view the documentation.
This command includes four subcommands:
alias get
alias get is used to obtain details about a specified alias of a service.
You can run alias get -h or alias get --help to view the documentation.
This command also supports some global parameters, such as -a/--access and --debug. For details, see Global Parameters of Serverless Devs.
|
Parameter Name |
Abbreviation |
Required in YAML |
Required in CLI |
Description |
|---|---|---|---|---|
|
region |
- |
No |
Yes |
Region |
|
function-name |
- |
No |
Yes |
Function name |
|
alias-name |
- |
Yes |
Yes |
Alias |
Example
- If you have a resource description file (YAML), run s alias get --alias-name aliasName to obtain the details about a specified alias.
- If you use CLI (without a YAML resource description file), specify the region and name of the service. For example, s cli fgs alias get --region cn-north-4 --function-name fg-test --alias-name pre.
When using CLI, if the key is not default, add the access parameter. For example, s cli fgs alias get --region cn-north-4 --function-name fg-test --alias-name pre --access xxxx.
fg-test: aliasName: pre versionId: 1 description: test publish version additionalVersionWeight: createdTime: 2021-11-08T06:51:36Z lastModifiedTime: 2021-11-08T06:54:02Z
alias list
alias list is used to list the aliases.
You can run alias list -h or alias list --help to view the documentation.
This command also supports some global parameters, such as -a/--access and --debug. For details, see Global Parameters of Serverless Devs.
|
Parameter Name |
Abbreviation |
Required in YAML |
Required in CLI |
Description |
|---|---|---|---|---|
|
region |
- |
No |
Yes |
Region |
|
function-name |
- |
No |
Yes |
Function name |
|
table |
- |
No |
No |
Output in table |
Example
- If you have a resource description file (YAML), run s alias list to list the aliases.
- If you use CLI (without a YAML resource description file), specify the region and name of the service. For example, s cli fgs alias list --region cn-north-4 --function-name fg-test.
When using CLI, if the key is not default, add the access parameter. For example, s cli fgs alias list --region cn-north-4 --function-name fg-test --access xxxx.
fg-test:
-
aliasName: pre
versionId: 1
description: test publish version
lastModifiedTime: 2021-11-08T06:54:02Z
additionalVersionWeight:
alias publish
alias publish is used to publish and update an alias.
You can run alias publish -h or alias publish --help to view the documentation.
This command also supports some global parameters, such as -a/--access and --debug. For details, see Global Parameters of Serverless Devs.
|
Parameter Name |
Abbreviation |
Required in YAML |
Required in CLI |
Description |
|---|---|---|---|---|
|
region |
- |
No |
Yes |
Region |
|
function-name |
- |
No |
Yes |
Function name |
|
alias-name |
- |
Yes |
Yes |
Alias |
|
version-name |
- |
No |
Yes |
Version corresponding to the alias |
|
description |
- |
No |
No |
Alias description |
|
gversion |
- |
No |
No |
ID of an additional version for dark launch. This is required only when a weight is specified. |
|
weight |
- |
No |
No |
Weight of the dark launch version. This parameter is required when the dark launch version ID is specified. |
Example
- If you have a resource description file (YAML), run s alias publish to publish or update an alias.
- If you use CLI (without a YAML resource description file), specify the region and name of the service. For example, s cli fgs alias publish --region cn-north-4 --function-name fg-test --alias-name pre --version-name 1.
When using CLI, if the key is not default, add the access parameter. For example, s cli fgs alias publish --region cn-north-4 --function-name fg-test --alias-name pre --version-name 1 --access xxxx.
fg-test: aliasName: pre versionId: 1 description: additionalVersionWeight: createdTime: 2021-11-08T06:51:36Z lastModifiedTime: 2021-11-08T06:51:36Z
fc-deploy-test: aliasName: pre versionId: 1 description: test publish version additionalVersionWeight: createdTime: 2021-11-08T06:51:36Z lastModifiedTime: 2021-11-08T06:54:02Z
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
