This topic describes alias-related commands in the FC-API component.

Prerequisites

Before you begin, make sure that the following operations are complete:

Create an alias

Command syntax:
s cli fc-api createAlias --region <regionid> --access <accessname> --props <props> --serviceName <serviceName> --versionId <versionid> --aliasName <aliasname> --description <description> --additionalVersionWeight <additionalVersionWeight>
Parameters:
  • --region string: the ID of the region where the resource is deployed.
  • --access string: the alias of the key used.
  • --props string: the properties of the component. For more information about the props parameter, see YAML syntax.
  • --serviceName string: the name of the service.
  • --aliasName string: the alias of the service.
  • --versionId string: the version to which the alias points.
  • --additionalVersionWeight string: the canary release version to which the alias points and the weight of the canary release version.
  • --description string: the description of the alias.
Example:
  • macOS or Linux operating system
    s cli fc-api createAlias --serviceName mytest --versionId 1 --aliasName release --additionalVersionWeight '{"2": 0.2}'
  • Windows operating system
    s cli fc-api createAlias --serviceName mytest --versionId 1 --aliasName release --additionalVersionWeight "{\"1\": 0.2}"

For information about the API operation for creating an alias, see CreateAlias.

Delete an alias

Command syntax:
s cli fc-api deleteAlias --region <regionid> --access <accessname> --props <props> --serviceName <serviceName> --aliasName <ailasName>
Parameters:
  • --region string: the ID of the region where the resource is deployed.
  • --access string: the alias of the key used.
  • --props string: the properties of the component. For more information about the props parameter, see YAML syntax.
  • --serviceName string: the name of the service.
  • --aliasName string: the alias of the service.
Example:
s cli fc-api deleteAlias --region cn-hangzhou --serviceName mytest --aliasName release

For information about the API operation for deleting an alias, see DeleteAlias.

Modify an alias

Command syntax:
s cli fc-api updateAlias --region <regionid> --access <accessname> --props <props> --serviceName <serviceName> --aliasName <aliasName> --description <description> --versionId <versionid> --additionalVersionWeight <additionalVersionWeight>
Parameters:
  • --region string: the ID of the region where the resource is deployed.
  • --access string: the alias of the key used.
  • --props string: the properties of the component. For more information about the props parameter, see YAML syntax.
  • --serviceName string: the name of the service.
  • --aliasName string: the alias of the service.
  • --versionId string: the version to which the alias points.
  • --additionalVersionWeight string: the canary release version to which the alias points and the weight of the canary release version.
  • --description string: the description of the alias.
Example:
  • macOS or Linux operating system
    s cli fc-api updateAlias --aliasName release --description tttt --versionId '1' --additionalVersionWeight '{"2": 0.1}' --serviceName mytest
  • Windows operating system
    s cli fc-api updateAlias --aliasName release --description tttt --versionId "1" --additionalVersionWeight "{\"1\": 0.1}" --serviceName mytest

For information about the API operation for modifying an alias, see UpdateAlias.

Query the information about an alias

Command syntax:
s cli fc-api getAlias --region <regionid> --access <accessname> --props <props> --aliasName <aliasName> --serviceName <serviceName>
Parameters:
  • --region string: the ID of the region where the resource is deployed.
  • --access string: the alias of the key used.
  • --props string: the properties of the component. For more information about the props parameter, see YAML syntax.
  • --serviceName string: the name of the service.
  • --aliasName string: the alias of the service.
Example:
s cli fc-api getAlias --aliasName release --serviceName mytest

For information about the API operation for querying the information about an alias, see GetAlias.

Query aliases

Command syntax:
s cli fc-api listAliases --region <regionid> --access <accessname> --props <props> --serviceName <serviceName> --limit <limit number> --nextToken <nextresult> --prefix <return prefix> --startkey <startkey>
Parameters:
  • --region string: the ID of the region where the resource is deployed.
  • --access string: the alias of the key used.
  • --props string: the properties of the component. For more information about the props parameter, see YAML syntax.
  • --limit string: the maximum number of resources to be returned.
  • --nextToken string: the token used to return more results. If the number of resources exceeds the limit, the nextToken parameter is returned. Include this parameter in subsequent calls to obtain more results. You do not need to provide this parameter in the first call.
  • --prefix string: the prefix that the names of returned resources must contain.
  • --startKey string: the start position of the result list. Results are in alphabetical order, and the results that follow startKey (inclusive) are listed.
  • --serviceName string: the name of the service.
Example:
s cli fc-api listAliases --region cn-hangzhou --limit 3 --serviceName mytest

For information about the API operation for querying aliases, see ListAliases.