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

Prerequisites

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

Create a version

Command syntax:
s cli fc-api publishVersion --region <regionid> --access <accessname> --props <props> --serviceName <serviceName> --description <description>
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.
  • --description string: the description of the service.
Example:
s cli fc-api publishVersion --serviceName mytest --description 'mytest'

For information about the API operation for creating a version, see PublishServiceVersion.

Delete a version

Command syntax:
s cli fc-api deleteVersion --region <regionid> --access <accessname> --props <props> --serviceName <serviceName> --versionId <version>
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.
  • --versionId string: the version of the service.
Example:
s cli fc-api deleteVersion --region cn-hangzhou --serviceName mytest --versionId 1

For information about the API operation for deleting a version, see DeleteServiceVersion.

Query versions

Command syntax:
s cli fc-api listVersions --region <regionid> --props <props> --access <accessname>  --limit <limit number> --serviceName <serviceName> --prefix <return prefix> --nextToken <nextresult> --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 listVersions --access default --serviceName mytest --prefix test

For information about the API operation for querying versions, see ListServiceVersions.